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
Simple function to see if the windshield wipers are on
public function check_wipers() { echo PHP_EOL; $this->action("checking wipers"); $this->action($this->wipers_on ? "windshield wipers are on" : "windshield wipers are off"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function wipers_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers on\");\r\n $this->wipers_on = TRUE;\r\n $this->action(\"windshield wipers are on\");\r\n }", "public function isWormhole() : bool {\n return ($this->scope === 'wh');\n }", "function eis_device_poweron() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status,$eis_mysqli;\n\t// do nothing\n\treturn true;\n}", "public function hasW()\n {\n return isset($this->w);\n }", "public function hasW()\n {\n return isset($this->w);\n }", "public function hasDw()\n {\n return isset($this->dw);\n }", "public function hasDw()\n {\n return isset($this->dw);\n }", "public function canpoweroff()\n\t{\n\t\treturn $this->Players->canpoweroff($this->SqueezePlyrID);\n\t}", "function is_wg_enabled() {\n\tglobal $config;\n\n\twg_globals();\n\n\tforeach ($wgg['tunnels'] as $tunnel) {\n\n\t\tif (empty($tunnel['enabled'])) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\treturn false;\n}", "public function wipers_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers off\");\r\n $this->wipers_on = FALSE;\r\n $this->action(\"windshield wipers are off\");\r\n }", "public function isWaterfrontOnly();", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "private static function calcIsEnabled(): bool\n {\n if (!TestOsUtil::isWindows() || (PHP_VERSION_ID < 70400)) {\n return false;\n }\n\n if (!isset(self::$ffi)) {\n try {\n /**\n * @noinspection RedundantSuppression, PhpFullyQualifiedNameUsageInspection, PhpUndefinedClassInspection\n * @phpstan-ignore-next-line\n */\n self::$ffi = \\FFI::cdef('void OutputDebugStringA( const char* test );', 'Kernel32.dll');\n } catch (Throwable $throwable) {\n return false;\n }\n }\n\n return true;\n }", "public function hasTowerinfo(){\n return $this->_has(1);\n }", "public function isWip() {\n return preg_match('/^WIP\\s*\\:/', $this->title);\n }", "function isWap($value){\r\n\r\n \tif ($value == 0){\r\n\t\treturn '电脑';\r\n\t}elseif($value == 1){\r\n\t\treturn '手机';\r\n\t}else{\r\n\t\treturn '机器人';\r\n\t}\r\n }", "function is_wpcli() {\n\treturn defined('WP_CLI') && WP_CLI;\n}", "function is_smartphone()\n {\n return dev::isSmartphone();\n }", "public function isWormhole() : bool {\n return ($this->typeId->id === 1);\n }", "public function areLedsOn()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_ARE_LEDS_ON, $payload);\n\n $payload = unpack('C1leds', $data);\n\n return (bool)$payload['leds'];\n }", "public function isWired() {\n\t\treturn $this->_wire ? true : false;\n\t}", "private function _get_windmeters() {\n\t\tif (!$this->_get_data('wilist')) { \n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Set all the windmeter values\n\t\tunset($this->windmeters);\n\t\tforeach ($this->raw->response as $key=>$value) {\n\t\t\t$this->windmeters->{$key} = $value;\t\t\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function isWired(): bool\n {\n if ($this->loadDefaultWire) {\n $this->loadDefaultWire = false;\n\n $defaultWire = config('form-components.default_wire');\n\n if ($defaultWire !== false) {\n $this->wire = $defaultWire;\n }\n }\n\n return $this->wire !== false;\n }", "public function isWarehouseEnabled() {\n return Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse');\n }", "function adminChk(){\r\n\treturn $_SERVER[\"REMOTE_ADDR\"] == \"118.36.189.171\" || $_SERVER[\"REMOTE_ADDR\"] == \"39.115.229.173\" || $_SERVER[\"REMOTE_ADDR\"] == \"127.0.0.1\";\r\n}", "public function isMatriculationFNIWW(): bool\n {\n $pattern = '^(?!0)[0-9]{1,4}(?:\\s|-)?WW[A-HJ-NP-TV-Z]?(?:\\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 }", "public function isNotWired(): bool\n {\n return !$this->isWired();\n }", "function ms_is_switched()\n {\n }", "function getIsAvailable() ;", "abstract public function isWindows() : bool;" ]
[ "0.7370961", "0.6523211", "0.6485527", "0.6466761", "0.6466761", "0.62400895", "0.62400895", "0.61735916", "0.6141623", "0.6127233", "0.60532963", "0.5980827", "0.5944772", "0.5936714", "0.5892675", "0.58765763", "0.5866674", "0.58519655", "0.5833319", "0.58201665", "0.5808182", "0.5784268", "0.5775291", "0.57200503", "0.5715507", "0.5696106", "0.56732464", "0.56692034", "0.5665766", "0.5630085" ]
0.83180064
0
Turn the vehicle's headlights off
public function headlights_off() { echo PHP_EOL; $this->action("turning headlights off"); $this->lights_on = FALSE; $this->action("headlights are off"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function wipers_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers off\");\r\n $this->wipers_on = FALSE;\r\n $this->action(\"windshield wipers are off\");\r\n }", "public function ledsOff()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_LEDS_OFF, $payload);\n }", "public function turnOff() //Einschalten geht nur über WOL! \n { \n $this->lg_handshake();\n $command = '{\"id\":\"turnOff\",\"type\":\"request\",\"uri\":\"ssap://system/turnOff\"}'; \n $this->send_command($command); \n }", "private function ledOff()\n {\n $this->ledPin->setValue(PinInterface::VALUE_LOW);\n }", "public function off()\n {\n echo 'The tv is off now.' . PHP_EOL;\n }", "public function powerDown()\n {\n if ($this->motor_power)\n $this->motor_power->setValue(0);\n }", "public function turnOff($light)\r\n {\r\n $lightname = $light;\r\n $light = $this->bulbNameToID($light);\r\n $isgroup = 'NO';\r\n $data = '<?xml version=\"1.0\"?>\r\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <s:Body>\r\n <u:SetDeviceStatus xmlns:u=\"urn:Belkin:service:bridge:1\">\r\n <DeviceStatusList>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;DeviceStatus&gt;&lt;DeviceID&gt;'.$light.'&lt;/DeviceID&gt;&lt;CapabilityID&gt;10008&lt;/CapabilityID&gt;&lt;CapabilityValue&gt;0:0&lt;/CapabilityValue&gt;&lt;IsGroupAction&gt;'.$isgroup.'&lt;/IsGroupAction&gt;&lt;/DeviceStatus&gt;</DeviceStatusList>\r\n </u:SetDeviceStatus>\r\n </s:Body>\r\n </s:Envelope>';\r\n $headers_array = array(\r\n 'Content-type: text/xml; charset=\"utf-8\"',\r\n 'SOAPACTION: \"urn:Belkin:service:bridge:1#SetDeviceStatus\"',\r\n 'Accept: ',\r\n );\r\n $url = \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/upnp/control/bridge1\";\r\n $response = $this->sendCurl($url,$data,$headers_array);\r\n $this->getStatus($lightname);\r\n }", "public function Stop()\r\n {\r\n echo \"<b><u>Command Received: Stop Vehicle</b></u><br />\";\r\n echo $this->carName . \"'s current speed is \" . $this->speed . \".<br />\";\r\n echo \"Stopping...<br />\";\r\n $this->speed = 0;\r\n echo $this->carName . \" is now travelling at \" . $this->speed . \" mph. <br />\";\r\n }", "public function deactivate(): void;", "public function headlights_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights on\");\r\n $this->lights_on = TRUE;\r\n $this->action(\"headlights are on\");\r\n }", "public function deactivate();", "public function forceSourceOff()\n {\n $this->sendCommand(static::RCMD_SRC_FORCE_OFF);\n }", "public static function deactivate(){\n // Do nothing\n }", "public static function deactivate()\n {\n // Do nothing\n }", "abstract public function deactivate();", "public function unsetWaterSupplyThroughPipes() : void\n {\n $this->waterSuppliedThroughPipes = false;\n }", "public static function deactivate() {\n\t\t\t// Do nothing\n\t\t}", "function tideways_disable()\n{\n}", "public function shutDoor()\n {\n return false;\n }", "public function ShutdownCar()\r\n {\r\n echo \"<b><u>Command Received: Shutdown Engine</b></u><br />\";\r\n if($this->speed > 0)\r\n {\r\n echo \"Stopping prior to shutting down the engine... <br />\";\r\n $this->speed = 0;\r\n }\r\n $this->carEngine->stopEngine();\r\n echo $this->carName . \"'s engine has been shut down <br />\";\r\n }", "public static function deactivate() {\n\n }", "public static function deactivate()\n {\n }", "public function switch_scene_off($id) {\n\t\t//Returns true or false. No values are set! (Execute get_status to get the new status)\t\t\n\t\treturn $this->_switch_scene_off ($id);\n\t}", "public static function deactivate() {\n\t}", "public static function deactivate() {\n\t\t// Do nothing.\n\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function deactivate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public function deactivateService() {}", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "public static function deactivate(){\n }" ]
[ "0.6708087", "0.6573409", "0.6436332", "0.64168584", "0.6293718", "0.58018315", "0.5776745", "0.57458085", "0.56274515", "0.56260884", "0.5607017", "0.55696243", "0.55295616", "0.5511122", "0.5467074", "0.5454244", "0.5415769", "0.5407163", "0.53947544", "0.5388518", "0.5384781", "0.53664887", "0.53603923", "0.53481275", "0.534334", "0.53432506", "0.53432506", "0.53083396", "0.5291165", "0.52722824" ]
0.858816
0
Turn the vehicle's headlights on
public function headlights_on() { echo PHP_EOL; $this->action("turning headlights on"); $this->lights_on = TRUE; $this->action("headlights are on"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check_headlights() {\r\n echo PHP_EOL;\r\n $this->action(\"checking headlights\");\r\n $this->action($this->lights_on ? \"headlights are on\" : \"headlights are off\");\r\n }", "public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }", "public function switchOn();", "public function ledsOn()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_LEDS_ON, $payload);\n }", "public function wipers_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning windshield wipers on\");\r\n $this->wipers_on = TRUE;\r\n $this->action(\"windshield wipers are on\");\r\n }", "public function test() {\r\n //echo LandVehicle::$land_count;\r\n\r\n //test starting the Vehicle and setting the key\r\n $this->start('abc');\r\n $key = '1234ac';\r\n $this->set_password($key);\r\n $this->start(\"abc\");\r\n $this->start($key);\r\n $this->engine_state();\r\n\r\n //get bearings and turn on wipers/headlights\r\n $this->get_direction();\r\n $this->check_headlights();\r\n $this->headlights_on();\r\n $this->wipers_on();\r\n $this->check_wipers();\r\n\r\n //start driving\r\n $this->accelerate(25, 4);\r\n $this->get_speed();\r\n $this->change_speed(1000);\r\n $this->get_speed();\r\n $this->turn_left(180);\r\n $this->get_direction();\r\n $this->turn_right(360);\r\n $this->get_direction();\r\n $this->turn_left(90.4);\r\n $this->get_direction();\r\n $this->turn_right(270.4);\r\n $this->get_direction();\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n //come to a stop after many turns\r\n $this->change_speed(0);\r\n $this->get_speed();\r\n\r\n //ensure we can't get negative speeds\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n $this->engine_state();\r\n //ensure we will stop with current_speed at 0 when stop() is called.\r\n $this->accelerate(50, 2);\r\n $this->stop();\r\n $this->engine_state();\r\n\r\n //one last headlight test\r\n $this->check_headlights();\r\n $this->headlights_off();\r\n }", "public function turn_on()\n {\n $this->testing = TRUE;\n }", "private function ledOn()\n {\n $this->ledPin->setValue(PinInterface::VALUE_HIGH);\n }", "public function turn()\n {\n }", "public function vehicle();", "public function turnOn($light,$brightness=255)\r\n {\r\n $lightname = $light;\r\n $light = $this->bulbNameToID($light);\r\n $isgroup = 'NO';\r\n $data = '<?xml version=\"1.0\"?>\r\n <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <s:Body>\r\n <u:SetDeviceStatus xmlns:u=\"urn:Belkin:service:bridge:1\">\r\n <DeviceStatusList>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;DeviceStatus&gt;&lt;DeviceID&gt;'.$light.'&lt;/DeviceID&gt;&lt;CapabilityID&gt;10008&lt;/CapabilityID&gt;&lt;CapabilityValue&gt;'.$brightness.':0&lt;/CapabilityValue&gt;&lt;IsGroupAction&gt;'.$isgroup.'&lt;/IsGroupAction&gt;&lt;/DeviceStatus&gt;</DeviceStatusList>\r\n </u:SetDeviceStatus>\r\n </s:Body>\r\n </s:Envelope>';\r\n $headers_array = array(\r\n 'Content-type: text/xml; charset=\"utf-8\"',\r\n 'SOAPACTION: \"urn:Belkin:service:bridge:1#SetDeviceStatus\"',\r\n 'Accept: ',\r\n );\r\n $url = \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/upnp/control/bridge1\";\r\n $response = $this->sendCurl($url,$data,$headers_array);\r\n $this->getStatus($lightname);\r\n }", "public function on()\n {\n echo 'The tv is on now.' . PHP_EOL;\n }", "public function makeATrip()\n {\n $this->travelStrategy->move();\n echo \"This place is kewl\";\n $this->travelStrategy->move();\n }", "public function activate()\n\t{\n\t\techo \"fight...\\n\";\n\t}", "public function SwitchLight($id)\n {\n if ( !array_key_exists($id, $this->rooms)){\n throw new Exception(\"Nie ma takiego pomieszczenia\", 1);\n }\n $pin = $this->rooms[$id];\n if ($this->RelayStat($pin)) {\n $this->RelayOff($pin);\n }\n else {\n $this->RelayOn($pin);\n }\n }", "public function enable()\r\n {\r\n $this->enabled = true;\r\n\r\n if (!$this->booted) {\r\n $this->boot();\r\n }\r\n }", "public function setOn($value)\n {\n $this->on = $value;\n }", "function startRelaying() { }", "public function activate()\n\t{\n\t\techo \"shot...\\n\";\n\t}", "public function turnOn(){\n\t\treturn \"Turn On executed\";\n\t}", "public function setupHardware(): void\n {\n echo 'Setup laptop hardware...<br/>';\n }", "function setDebugSwitch($switch, $onoff = true)\n {\n if ($onoff == true) {\n $this->_debugSwitches[\"$switch\"] = true;\n }else {\n unset($this->_debugSwitches[\"$switch\"]);\n }\n }", "public function start() {\n $this->setup();\n $this->fight();\n }", "public function enable()\n {\n $this->enabled = true;\n }", "public function activate();", "public function activate();", "public function testSetHeaterState()\n {\n }", "public function switch_scene_on($id) {\n\t\t//Returns true or false. No values are set! (Execute get_status to get the new status)\n\t\treturn $this->_switch_scene_on ($id);\n\t}", "public function turnWheel() {\n\n $this->setGumballs($this->getGumballs() - 1);\n }", "public function enableTrades()\n\t{\n\t\t$this->shouldTrade = true;\n\t}" ]
[ "0.7363306", "0.68911713", "0.6512324", "0.61402506", "0.59804076", "0.5937115", "0.5923228", "0.567806", "0.53265893", "0.53150856", "0.53087217", "0.53035927", "0.52730983", "0.5183143", "0.5041496", "0.49756184", "0.4904635", "0.48932427", "0.4883198", "0.48204786", "0.48107043", "0.4802749", "0.48027053", "0.47833556", "0.47709814", "0.47709814", "0.4754527", "0.47366259", "0.47299534", "0.4715341" ]
0.85471225
0
Simple function to see if the vehicle's headlights are on
public function check_headlights() { echo PHP_EOL; $this->action("checking headlights"); $this->action($this->lights_on ? "headlights are on" : "headlights are off"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function headlights_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights on\");\r\n $this->lights_on = TRUE;\r\n $this->action(\"headlights are on\");\r\n }", "public function areLedsOn()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_ARE_LEDS_ON, $payload);\n\n $payload = unpack('C1leds', $data);\n\n return (bool)$payload['leds'];\n }", "public function test() {\r\n //echo LandVehicle::$land_count;\r\n\r\n //test starting the Vehicle and setting the key\r\n $this->start('abc');\r\n $key = '1234ac';\r\n $this->set_password($key);\r\n $this->start(\"abc\");\r\n $this->start($key);\r\n $this->engine_state();\r\n\r\n //get bearings and turn on wipers/headlights\r\n $this->get_direction();\r\n $this->check_headlights();\r\n $this->headlights_on();\r\n $this->wipers_on();\r\n $this->check_wipers();\r\n\r\n //start driving\r\n $this->accelerate(25, 4);\r\n $this->get_speed();\r\n $this->change_speed(1000);\r\n $this->get_speed();\r\n $this->turn_left(180);\r\n $this->get_direction();\r\n $this->turn_right(360);\r\n $this->get_direction();\r\n $this->turn_left(90.4);\r\n $this->get_direction();\r\n $this->turn_right(270.4);\r\n $this->get_direction();\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n //come to a stop after many turns\r\n $this->change_speed(0);\r\n $this->get_speed();\r\n\r\n //ensure we can't get negative speeds\r\n $this->decelerate(25, 4);\r\n $this->get_speed();\r\n\r\n $this->engine_state();\r\n //ensure we will stop with current_speed at 0 when stop() is called.\r\n $this->accelerate(50, 2);\r\n $this->stop();\r\n $this->engine_state();\r\n\r\n //one last headlight test\r\n $this->check_headlights();\r\n $this->headlights_off();\r\n }", "function isTrendingNow($heading)\n{\n\t$isTrendingNow = false;\n\t\n\tif ((strcmp($heading, \"Trending Now\") == 0) || (strcmp($heading, \"Spotlight\") == 0))\n\t{\n\t\t$isTrendingNow = true;\n\t}\n\t\n\treturn $isTrendingNow;\n}", "public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }", "public function isHead(): bool {}", "function hasHonors()\n {\n return ($this->gpa > 3) ? \"true\" : \"false\";\n }", "public function isHead(): bool;", "function is_robots()\n {\n }", "public function hasStationary()\n {\n return $this->stationary !== null;\n }", "public function carHasAlreadyCharged()\n {\n $chargingPower = $this -> getChargingPower();\n $kiloWattHourLine = $this -> kiloWattHourLine;\n\n return $chargingPower < $kiloWattHourLine;\n }", "public function isLeveled()\n {\n return $this->is_leveled;\n }", "function getStatus(){\n\t$db = getDatabase();\n $car = getCarData($db);\n \n\t//TRUE\n\tif($car['connected'])\n\t\t$response = createResponse($db);\n\t//FALSE\n else{\n $response = \" Vehicle: Not connected <br>\";\n }\n return $response;\n}", "public function hasRoute(): bool;", "public static function isHead(): bool {\r\n return static :: isMethod('head');\r\n }", "public function hasFlights($did) {\n db_set_active('stage');\n $route = db_select('air_directions_time', 'adt')\n ->fields('adt', array('time'))\n ->condition('adt.did', $did)->execute()->fetchField(0);\n db_set_active('default');\n return $route;\n }", "public function isStartable()\n {\n $driver = $this->driver;\n if($driver){\n // Check if car is not disponible\n $hasActiveRide = $driver->ridesDrived()\n ->where('rides.id', '!=', $this->getKey())\n ->where('rides.status', self::STATUS_STARTED)\n ->exists();\n if($hasActiveRide){\n return false;\n }\n }\n \n return !in_array($this->status, [self::STATUS_COMPLETED, self::STATUS_CANCELED]);\n }", "public function isHead()\n\t{\n\t\treturn $this->httpMethod() == self::MethodHead;\n\t}", "function is_robot()\n {\n return dev::isRobot();\n }", "public function preFlightCheck($direction = null);", "function get_carp_status() {\n\t/* grab the current status of carp */\n\t$status = get_single_sysctl('net.inet.carp.allow');\n\treturn (intval($status) > 0);\n}", "public function vehicle();", "public function deviceConditionMatchesRobot() {}", "public function deviceConditionMatchesRobot() {}", "private static function isHeader(array $airportLine): bool\n {\n return $airportLine[1] === 'latitude_deg' && $airportLine[2] === 'longitude_deg';\n }", "public function hasHandstatus(){\n return $this->_has(7);\n }", "public function startCheck($flight);", "public function hasTowerinfo(){\n return $this->_has(1);\n }", "public function is_robots()\n {\n }", "public static function isFeatureActive()\n {\n }" ]
[ "0.7082882", "0.57546675", "0.56388485", "0.5610307", "0.54752856", "0.5443048", "0.5322987", "0.5313153", "0.5273697", "0.52671635", "0.52427834", "0.522431", "0.52237964", "0.5217415", "0.52028227", "0.5186477", "0.51632744", "0.5160209", "0.51535326", "0.51340723", "0.5105327", "0.50936425", "0.5077991", "0.5077635", "0.5041541", "0.50375944", "0.50348544", "0.50191987", "0.5012977", "0.50040907" ]
0.80851513
0
Tell us the state of the engine, ie is it on or not (note vehicle turns it off automatically).
public function engine_state() { echo PHP_EOL; $this->action("checking engine"); if ($this->engine_on) { $this->action("engine is on! Don't forget to turn it off"); } else { $this->action("engine is off"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function turn_on()\n {\n $this->testing = TRUE;\n }", "public function switchOn();", "public function headlights_on() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights on\");\r\n $this->lights_on = TRUE;\r\n $this->action(\"headlights are on\");\r\n }", "public function getOn()\n {\n if (isset($this->a_State['on']))\n {\n return($this->a_State['on']);\n } /* if */\n else\n {\n return(null);\n } /* else */\n }", "public function state();", "public function getIsState()\n {\n return $this->isState;\n }", "function setIsOn($isOn){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE bot_on_off SET isOn = :isOn');\n\t\t$statement->bindValue(':isOn', $isOn, PDO::PARAM_INT);\n\t\t$statement->execute();\n\t}", "public function is_active();", "public function testIsStarted()\n\t{\n\t\t$this->assertFalse($this->object->isStarted());\n\n\t\t$started = new PNEngineStateStarted($this->object);\n\t\tTestReflection::setValue($this->object, 'state', $started);\n\n\t\t$this->assertTrue($this->object->isStarted());\n\t}", "public function getActiveState();", "protected function usesState(): bool\n {\n return !$this->stateless;\n }", "static private function ServerState() {\n $status = exec('illarionctl status');\n if (strpos($status, 'ONLINE') === FALSE) {\n\t\t\tself::$serverstatus = 1;\n\t\t} else {\n\t\t\tself::$serverstatus = 0;\n\t\t}\n\n $status = exec('testctl status');\n\t\tif (strpos($status, 'ONLINE') === FALSE) {\n\t\t\tself::$testserverstatus = 1;\n\t\t} else {\n\t\t\tself::$testserverstatus = 0;\n\t\t}\n\n\t\tself::$debugger = 0;\n\t}", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }" ]
[ "0.62084776", "0.60974586", "0.5892616", "0.58890015", "0.58708686", "0.58308244", "0.58149576", "0.581077", "0.57627356", "0.5755748", "0.5746295", "0.5743609", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302", "0.5727302" ]
0.869116
0
One of our massive test functions. This is generic Vehicle though. There are no traits that define turn_left and turn_right, but all Vehicles will need to implement that through some trait. Putting the trait in here causes access issues and doesn't make as much sense as adding it to a higher level class (like the Motorcycle's HandleBars).
public function test() { //echo LandVehicle::$land_count; //test starting the Vehicle and setting the key $this->start('abc'); $key = '1234ac'; $this->set_password($key); $this->start("abc"); $this->start($key); $this->engine_state(); //get bearings and turn on wipers/headlights $this->get_direction(); $this->check_headlights(); $this->headlights_on(); $this->wipers_on(); $this->check_wipers(); //start driving $this->accelerate(25, 4); $this->get_speed(); $this->change_speed(1000); $this->get_speed(); $this->turn_left(180); $this->get_direction(); $this->turn_right(360); $this->get_direction(); $this->turn_left(90.4); $this->get_direction(); $this->turn_right(270.4); $this->get_direction(); $this->decelerate(25, 4); $this->get_speed(); //come to a stop after many turns $this->change_speed(0); $this->get_speed(); //ensure we can't get negative speeds $this->decelerate(25, 4); $this->get_speed(); $this->engine_state(); //ensure we will stop with current_speed at 0 when stop() is called. $this->accelerate(50, 2); $this->stop(); $this->engine_state(); //one last headlight test $this->check_headlights(); $this->headlights_off(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test6(){\n echo \"test2 method in trait<br>\";\n }", "public function traits(){\n $this->clapHands();\n }", "public function testFight()\n {\n }", "public function test2(){\n echo \"test2 method in trait<br>\";\n }", "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }", "public function vehicle();", "abstract public function getNumTestedTraits();", "public function turnRight();", "abstract public function getTraits();", "abstract protected function define_my_steps();", "protected function setUpTraits()\n {\n parent::setUpTraits();\n\n $uses = array_flip(class_uses_recursive(get_class($this)));\n\n if (isset($uses[ForeignKeys::class])) {\n /** @var \\Tests\\Traits\\ForeignKeys $this */\n $this->enableForeignKeys();\n }\n\n if (isset($uses[DatabaseSeeding::class])) {\n /** @var \\Tests\\Traits\\DatabaseSeeding $this */\n $this->seedDatabase();\n }\n }", "protected abstract function test();", "protected abstract function test();", "public function getTypeOfVehicles()\n {\n //creating twoWheelerVehicle object\n $twoWheelVehicle = new twoWheelerVehicle(); \n //returning twoWheelVehicle object\n return $twoWheelVehicle; \n }", "protected function setUpTraits()\n {\n return $this->setUpTheTestEnvironmentTraits(array());\n }", "public function testSpecial(): void {\n\t}", "abstract public function winner();", "public function testGetType0()\n{\n\n $actual = $this->traitUse->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function getTypeOfVehicles()\n {\n //creating fourWheelerVehicle object\n $fourWheelVehicle = new fourWheelerVehicle(); \n //returning fourWheelVehicle object\n return $fourWheelVehicle; \n }", "public function testGetHeaterState()\n {\n }", "public function testTrick()\n {\n $trick =new Trick();\n\n $trick->setCreationDate(new \\DateTime());\n $this->assertNotEmpty($trick->getCreationDate());\n\n $trick->addChat(new Chat());\n $this->assertNotEmpty($trick->getChats());\n\n $trick->addVideo(new Video());\n $this->assertNotEmpty($trick->getVideos());\n\n $trick->addPicture(new Picture());\n $this->assertNotEmpty($trick->getPictures());\n }", "abstract public function test();", "abstract public function test();", "public function testCanFly()\n {\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $this->assertFalse($aircraft->canFly(99999999));\n $this->assertFalse($aircraft->canFly($aircraft->range + 1));\n $this->assertTrue($aircraft->canFly(1));\n $this->assertTrue($aircraft->canFly($aircraft->range));\n }", "public function testCannotMoveWhenMove()\r\n {\r\n $this->myTestcar = new Car(new moveCarState());\r\n $this->myTestcar->move();\r\n }", "public function testMachineWorks()\n\t{\n\t\t$this -> GachaMachineInstance -> setGachas(100) ;\n\t\t// play one time\n\t\t$this -> GachaMachineInstance -> turnWheel() ;\n\t\t// it should -1 Gacha\n\t\t$this -> assertEquals( 99 , $this -> GachaMachineInstance -> getGachas() ); // Success\n\n\t}", "public function testGetChallengeActivity()\n {\n }", "public function turn()\n {\n }", "public function setUp() {\n\t $this->stub = $this->getMockForAbstractClass('\\Src\\Vehicle');\n }", "protected function setUpTraits()\n {\n $uses = array_flip(class_uses_recursive(static::class));\n\n return $this->setUpTheTestEnvironmentTraits($uses);\n }" ]
[ "0.52522206", "0.5204665", "0.5195539", "0.51819", "0.5171289", "0.51408106", "0.5040128", "0.5015327", "0.49682316", "0.49161613", "0.4890226", "0.48586184", "0.48586184", "0.47617283", "0.47598037", "0.47567838", "0.47550642", "0.47518802", "0.4745668", "0.47437254", "0.47295392", "0.47190946", "0.47190946", "0.46960536", "0.46838927", "0.46695337", "0.46629667", "0.46572584", "0.46436974", "0.4642018" ]
0.5569143
0
Insert a new review, if possible, for the given ad
public function createReview($adID) { //First let's see if the ad is complete $ad = \Objects\Ad::getInstance($adID); $nbrScreens = $ad->getNbrScreens(); $nbrCreatives = $ad->getNbrCreatives(); if($nbrCreatives != $nbrScreens) return; //Ads are missing, no review for now //The Ad is complete //Define the review status $reviewStatus = ReviewController::AD_PENDING; $reviewerID = NULL; $reviewedDate = 0; if(\Library\User::isAdmin()) { $reviewStatus = ReviewController::AD_APPROVED; $reviewerID = \Library\User::id(); $reviewedDate = time(); } else if(\Library\User::restricted("TRUSTED_CLIENT", true)) { $reviewStatus = ReviewController::AD_AUTO_APPROVED; $reviewerID = \Library\User::id(); $reviewedDate = time(); } $reviewModel = new \Models\ReviewModel(); $reviewModel->create($adID, $reviewStatus, $reviewerID, $reviewedDate); if($reviewerID == NULL) { $emailController = new EmailController(); $emailController->create(EmailController::EMAIL_REVIEW_AD, $adID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addReview($param, $sqlConnection)\r\n{\r\n $uid = intval($param['userID']);\r\n $aid = intval($param['albumID']);\r\n $sqlSuccess = get_sql_results($result, $sqlConnection,\r\n \"INSERT INTO Reviews (userID, albumID, review) \".\r\n \"VALUES ($uid,$aid,'{$param['review']}')\");\r\n return $sqlSuccess;\r\n}", "public function addReview($title, $ID, $review, $rating){\n \t$stmt = $this->conn->prepare (\n\t\t\t\t\"INSERT INTO reviews(title, reviewerID, review, rating)\n\t\t\t\tVALUES(:title, :reviewerID, :review, :rating); \");\n\t\t$stmt->bindParam ( 'title', $title );\n\t\t$stmt->bindParam ( 'reviewerID', $ID );\n\t\t$stmt->bindParam ( 'review', $review );\n\t\t$stmt->bindParam ( 'rating', $rating );\n\t\t$stmt->execute ();\n }", "function addReview($db_connection)\n\t\t\t{\n\t\t\t\t$userid = getUserID($db_connection);\n\t\t\t\t$currentDate = date(\"Y-m-d\");\n\t\t\t\tif(userHasScored($db_connection,$_POST['movieid']))\n\t\t\t\t{\n\t\t\t\t\t$query = \"UPDATE score_and_reviews SET score_data = {$_POST['rating']}, review = '{$_POST['review']}', review_date = '$currentDate' WHERE userid = $userid\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$query = \"INSERT INTO score_and_reviews(userid, movieid, score_data, review_date, review) VALUES ($userid,{$_POST['movieid']},{$_POST['rating']},'$currentDate','{$_POST['review']}')\";\n\n\t\t\t\t}\n\t\t\t\t$result = mysqli_query($db_connection,$query);\n\t\t\t}", "public function add() {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO reviews (persons_id, lessons_id, title, review, date_submitted, rating)\n VALUES (?,?,?,?,?,?)\");\n \n $stmt->bind_param('iisssi', $this->personsID, $this->lessonsID, $this->title, \n $this->review, $this->dateSubmitted, $this->rating);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "public function insertreview($txtProductId,$txtTitle,$txtComment,$txtRate){\n\t\t$object=array(\n\t\t\t'UserId' => $this->session->userdata('userid'),\n\t\t\t'ProductId' => $txtProductId,\n\t\t\t'Title' => $txtTitle,\n\t\t\t'ReviewComment' => $txtComment,\n\t\t\t'Rate' => $txtRate,\n\t\t\t'ReviewDate' => date('Y/m/d'),\n\t\t\t'ReviewTime' => date('H:i:s')\n\t\t);\n\t\t$this->db->insert('tbl_review', $object);\n\t\treturn true;\n\t}", "function submitReview()\n\t{\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\n\t\t$comment = urldecode($_POST['comment']); \n\t\t$rating = intval(urldecode($_POST['rating'])); \n\t\t$book_id = intval(urldecode($_POST['book_id'])); \n\t\t$user_id = intval(urldecode($_POST['user_id'])); \n\t\t$anon = urldecode($_POST['anon']); \n\t\t\n\t\tif (empty($comment)){\n\t\t\t$comment = NULL;\n\t\t}\n\t\tif ($anon == 'true'){\n\t\t\t$anon = 1;\n\t\t}\n\t\telse if ($anon == 'false'){\n\t\t\t$anon = 0;\n\t\t}\n\t\telse {\n\t\t\techo \"anon not read\";\n\t\t}\n\n\t\t$sql = \"INSERT INTO `reviews` (`comment`, `rating`, `book_id`, `user_id`,`anon`)\n\t\t\t\t\tVALUES \n\t\t\t\t\t('$comment','$rating','$book_id','$user_id','$anon')\";\n\n\n\t\t//Executes query string\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\techo \"New record created successfully\";\n\t\t} else {\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\t\t\n\t\t$conn->close();\n\n\t}", "function insert($comment, $score, $id_review, $id_user) {\n $query = $this->db->prepare('INSERT INTO comments (comment, score, id_review, id_user) VALUES (?,?,?,?)');\n $query->execute([$comment, $score, $id_review, $id_user]);\n return $this->db->lastInsertId();\n }", "function insertReview($reviewText, $reviewDate, $invId, $clientId) {\n $db = acmeConnect();\n $sql = 'INSERT INTO reviews (reviewText, reviewDate, invId, clientId) VALUES (:reviewText, :reviewDate, :invId, :clientId)';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':reviewText', $reviewText, PDO::PARAM_STR);\n $stmt->bindValue(':reviewDate', $reviewDate, PDO::PARAM_INT); \n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n $stmt->execute();\n $rowsChanged = $stmt->rowCount();\n $stmt->closeCursor();\n return $rowsChanged;\n}", "function insertReview($user_id, $business_id, $quality, $cost, $comment, $ip_address){\n \t$reviews \t\t\t= new Reviews();\n \t$reviews->review_user_id\t \t\t= $user_id;\n \t$reviews->coffee_supplier_id \t= $business_id;\n \t$reviews->review_quality\t\t\t\t\t= $quality;\n \t$reviews->review_cost\t\t\t\t\t\t= $cost;\n \t$reviews->review_comment\t\t\t\t\t= $comment;\n \t$reviews->ip_address\t\t\t\t\t\t= $ip_address;\n \t$rawData \t\t= $reviews->submitCoffeeSupplierReview();\n \treturn $rawData;\n }", "function submitReview ($rating, $text, $productID) {\r\n //checks if the user is logged in\r\n if (checkLogin()) {\r\n if (userHasPurchashedProduct($productID) && ! userHasReviewedProduct($productID)) {\r\n $id = getUserID();\r\n //check if the ID didnt get an error\r\n if (isset($id)) {\r\n //create query\r\n $sql = \"INSERT INTO reviews\r\n (Rating, Comment, ProductID, PersonID)\r\n VALUES\r\n ($rating,'$text',$productID,$id)\r\n \";\r\n //execute query\r\n runQuery($sql);\r\n\r\n //verify if placing review was succesful\r\n }\r\n }\r\n }\r\n}", "public function store() {\n $film = $_POST['film_id'];\n $user = $_POST['user_id'];\n $review = $_POST['review_text'];\n $vote = $_POST['review_vote'];\n\n if (!$review == \"\") {\n\n DB::table('reviews')->insert(\n array(\n 'film_id' => $film,\n 'user_id' => $user,\n 'review_text' => $review,\n 'review_vote' => $vote\n )\n );\n }\n }", "function db_add_review($art_id, $user_id, $stars, $message)\n{\n $mysqli = db_connect();\n $sql = \"INSERT INTO review (fk_article_id, fk_user_id, stars, message) VALUES (?,?,?,?)\";\n $con = $mysqli->prepare($sql);\n $con->bind_param(\"iiis\", $art_id, $user_id, $stars, $message);\n if ($con->execute() == TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "function addNewReview($reviewText, $invId, $clientId) {\n // Create a connection object using the phpmotors connection function\n $db = phpmotorsConnect();\n // The SQL statement\n $sql = 'INSERT INTO reviews (reviewText, invId, clientId)\n VALUES (:reviewText, :invId, :clientId)';\n // Create the prepared statement using the phpmotors connection\n $stmt = $db->prepare($sql);\n // The next nine lines replace the placeholders in the SQL\n // statement with the actual values in the variables\n // and tells the database the type of data it is\n $stmt->bindValue(':reviewText', $reviewText, PDO::PARAM_STR);\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n // Insert the data\n $stmt->execute();\n // Ask how many rows changed as a result of our insert\n $rowsChanged = $stmt->rowCount();\n // Close the database interaction\n $stmt->closeCursor();\n // Return the indication of success (rows changed)\n return $rowsChanged;\n }", "function add_vote_review($review_id, $agree, $member_id){\r\n // Prepare data\r\n $vote_review_data = array();\r\n $vote_review_data['vote_review_review_id'] = $review_id;\r\n $vote_review_data['vote_review_agree'] = $agree;\r\n $vote_review_data['vote_review_member_id'] = $member_id;\r\n \r\n // Add\r\n $add_result = $this->add($vote_review_data);\r\n return $add_result;\r\n }", "public function add_review($user_id, $book_id, $rating, $date, $reviewText) {\r\n\r\n\r\n //add user_id and book_id when figure out how to get from username and title\r\n $sql = \"INSERT INTO reviews VALUES( NULL, $user_id, $book_id, $rating, CURRENT_DATE , '$reviewText')\";\r\n\r\n\r\n try {\r\n //run the query and add them to the review table in the usersystem database\r\n $query = $this->dbConnection->query($sql);\r\n\r\n if (!$query) {\r\n throw new DatabaseException();\r\n }\r\n\r\n return true;\r\n \r\n } catch (DatabaseException $e) {\r\n return $e->getDetails();\r\n } catch (Exception $e) {\r\n return $e->getMessage();\r\n }\r\n\r\n }", "public function put_review($data)\n\t{\n\t\t$review_count = $this->count_reviews([\n\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t'author_id'\t\t=>\t$data['author_id']\n\t\t]);\n\t\tif ($review_count < 1)\n\t\t{\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->insert('reviews', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filter_results([\n\t\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t\t'author_id'\t=>\t$data['author_id']\n\t\t\t]);\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->update('reviews', $data);\n\t\t}\n\t}", "function postReview() {\n global $dbLink;\n $courseid = mysqli_real_escape_string($dbLink, $_POST['courseid']);\n $username = $_SESSION['username'];\n\t$reviewText = mysqli_real_escape_string($dbLink, $_POST['textReview']);\n\t$userid = $_SESSION['userid'];\n\t$postrate = 0;\n\t$date = date(\"d/m/Y\");\n\tif(isset($_POST['semester'])){\n\t\t$semester = $_POST['semester'] . ' ' . $_POST['year'];\n\t}\n $sqlString = \"INSERT INTO reviews(course_id, user_name, review_text, user_id, review_date, course_rating, course_semester)\n VALUES ('\" . $courseid .\"',\n\t\t\t\t '\" . $username .\"',\n\t\t\t\t '\" . $reviewText .\"',\n\t\t\t\t '\" . $userid .\"',\n\t\t\t\t '\" . $date .\"',\n\t\t\t\t '\" . $postrate .\"',\n\t\t\t\t '\" . $semester .\"')\";\n\n mysqli_query($dbLink, $sqlString) or die(\"Could not register new post..\" . mysqli_error($dbLink));\n\techo '<h3>Success!</h3>';\n\n\tif(isset($courseid )){\n\theader('Location: course.php?cid=' . $courseid .'');\n\t}else {\n\t\theader('Location: reviews.php');\n\t}\n}", "public function run(Review $review): void\n {\n $review->insert($this->getDataReview());\n }", "static function addReview($bookingId, $hotelId, $rating, $comment)\n {\n $db = DB::getConnection();\n try {\n $st = $db->prepare('INSERT INTO projekt_reviews(id_booking, id_user, name_user, id_hotel, name_hotel, rating, comment) VALUES (:id_booking, :id_user, :name_user, :id_hotel, :name_hotel, :rating, :comment)');\n $st->execute(array('id_booking' => $bookingId, 'id_user' => $_SESSION['user']->getId(), 'name_user' => $_SESSION['user']->getName(), 'id_hotel' => $hotelId, 'name_hotel' => Hotel::find($hotelId)->getName(), 'rating' => $rating, 'comment' => $comment));\n } catch (PDOException $e) {\n exit(\"PDO error [insert projekt_users]: \" . $e->getMessage());\n }\n try {\n echo $rating;\n $st = $db->prepare('UPDATE projekt_hotels SET rating = (rating * number_of_comments + :rating)/(number_of_comments + 1), number_of_comments = number_of_comments + 1 WHERE id = :id_hotel');\n $st->execute(array('id_hotel' => $hotelId, 'rating' => $rating));\n } catch (PDOException $e) {\n exit(\"PDO error [UPDATE projekt_hotels]: \" . $e->getMessage());\n }\n }", "public function giveDishReview($dish_id,$customer_id,$rating,$review){\n $query=$this->db->query(\"INSERT INTO dish_review(dish_id,customer_id,rating,review,date_added) VALUES(\".$dish_id.\",\".$customer_id.\",\".$rating.\",'\".$review.\"',CURDATE())\");\n if($query){\n return array(\"status\"=>\"success\");\n }\n else{\n return array(\"status\"=>\"fail\",\"error\"=>\"Unable to Give Review.\");\n }\n }", "public function addReview($review)\n {\n $this->reviews()->create($review);\n }", "public function addReviewByInstructure()\n {\n /* code goes here */\n }", "public function insert_review(Request $request){\n //validate data\n $this->validate($request, [\n 'review_date' => 'required',\n 'reviewed_by' => 'required',\n 'attachment' => 'required'\n ]);\n\n $form_data = array(\n 'comment' => $request->comment,\n 'reviewed_by' => $request->reviewed_by,\n 'revision' => $request->revision,\n 'file_id' => $request->file_id,\n 'initial_approval_id' => $request->initial_approval_id,\n 'phase_id' => $request->phase_id,\n 'review_date' => $request->review_date,\n 'attachment' => $request->attachment,\n 'user_id' => Auth::user()->id\n //'doc_number' => $this->getNextDocRevNumber()\n );\n\n //Store data in document_control_reviews\n Review::create($form_data);\n\n //Select all date from files and store them in document_control_reviews\n //DB::statement('INSERT document_record_archives SELECT * FROM files');\n\n\n\n //Truncate files\n //DB::table('files')->truncate();\n\n //store status message\n Session::flash('success_msg', 'Revision is successfully done!');\n\n //redirect back to the main page\n return back();\n }", "function insertReview($connection, $itemID, $userID, $userRating, $userReview) {\n $stmt = mysqli_prepare($connection, \"INSERT INTO review (StockItemID, AccountID, Rating, Review) VALUES (?, ?, ?, ?)\");\n mysqli_stmt_bind_param($stmt, \"iiis\", $itemID, $userID, $userRating, $userReview);\n mysqli_stmt_execute($stmt);\n mysqli_stmt_close($stmt);\n}", "public function insertComment()\n\t{\n\t\t$reviewid = $this->session->userdata('reviewid');\n\n\t\t$commentData = $this->input->post();\n\n\t\t$comment = $commentData['comment'];\n\t\t// var_dump($comment);\n\t\t$this->Review_Model->insertComment($reviewid, $comment);\n\n\t\tredirect(base_url() . 'index.php/reviewPage/' . $reviewid);\n\t}", "function insertObject(&$reviewAssignment) {\n\t\t$this->update(\n\t\t\tsprintf('INSERT INTO review_assignments (\n\t\t\t\tsubmission_id,\n\t\t\t\treviewer_id,\n\t\t\t\tstage_id,\n\t\t\t\treview_method,\n\t\t\t\tregret_message,\n\t\t\t\tround,\n\t\t\t\tcompeting_interests,\n\t\t\t\trecommendation,\n\t\t\t\tdeclined, replaced, cancelled,\n\t\t\t\tdate_assigned, date_notified, date_confirmed,\n\t\t\t\tdate_completed, date_acknowledged, date_due, date_response_due,\n\t\t\t\treviewer_file_id,\n\t\t\t\tquality, date_rated,\n\t\t\t\tlast_modified,\n\t\t\t\tdate_reminded, reminder_was_automatic,\n\t\t\t\treview_form_id,\n\t\t\t\treview_round_id,\n\t\t\t\tunconsidered\n\t\t\t\t) VALUES (\n\t\t\t\t?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, %s, %s, %s, %s, %s, %s, %s, ?, ?, %s, %s, %s, ?, ?, ?, ?\n\t\t\t\t)',\n\t\t\t\t$this->datetimeToDB($reviewAssignment->getDateAssigned()), $this->datetimeToDB($reviewAssignment->getDateNotified()), $this->datetimeToDB($reviewAssignment->getDateConfirmed()), $this->datetimeToDB($reviewAssignment->getDateCompleted()), $this->datetimeToDB($reviewAssignment->getDateAcknowledged()), $this->datetimeToDB($reviewAssignment->getDateDue()), $this->datetimeToDB($reviewAssignment->getDateResponseDue()), $this->datetimeToDB($reviewAssignment->getDateRated()), $this->datetimeToDB($reviewAssignment->getLastModified()), $this->datetimeToDB($reviewAssignment->getDateReminded())),\n\t\t\tarray(\n\t\t\t\t(int) $reviewAssignment->getSubmissionId(),\n\t\t\t\t(int) $reviewAssignment->getReviewerId(),\n\t\t\t\t(int) $reviewAssignment->getStageId(),\n\t\t\t\t(int) $reviewAssignment->getReviewMethod(),\n\t\t\t\t$reviewAssignment->getRegretMessage(),\n\t\t\t\tmax((int) $reviewAssignment->getRound(), 1),\n\t\t\t\t$reviewAssignment->getCompetingInterests(),\n\t\t\t\t$reviewAssignment->getRecommendation(),\n\t\t\t\t(int) $reviewAssignment->getDeclined(),\n\t\t\t\t(int) $reviewAssignment->getReplaced(),\n\t\t\t\t(int) $reviewAssignment->getCancelled(),\n\t\t\t\t$reviewAssignment->getReviewerFileId(),\n\t\t\t\t$reviewAssignment->getQuality(),\n\t\t\t\t$reviewAssignment->getReminderWasAutomatic(),\n\t\t\t\t$reviewAssignment->getReviewFormId(),\n\t\t\t\t(int) $reviewAssignment->getReviewRoundId(),\n\t\t\t\t(int) $reviewAssignment->getUnconsidered(),\n\t\t\t)\n\t\t);\n\n\t\t$reviewAssignment->setId($this->getInsertReviewId());\n\t\treturn $reviewAssignment->getId();\n\t}", "public function reviewBook($bookid, $email, $review)\n\t{\n\t\t$sql = \"\n\t\t\tINSERT INTO bookreviews (bookid, emailaddress, review) VALUES (?, ?, ?)\n\t\t\";\n\n\t\t$review = DB::insert($sql, [$bookid, $email, $review]);\n\n\t\tCache::forget('reviews_' . $bookid);\n\n\t\treturn $review;\n\t}", "public function createReview($int_id,$int_toyid,$int_userid, $str_username, $str_review, $int_rating) {\n $obj_store = $this->getStore();\n $obj_store->upsert($obj_store->createEntity([\n 'id' => $int_id,\n 'toyId' => $int_toyid,\n 'userid' => $int_userid,\n 'username' => $str_username,\n 'reviewText' => $str_review,\n 'rating' => $int_rating\n ]));\n\n \n }", "public function addReview($review) {\n $this->reviews[] = $review;\n }", "function db_add_response($art_id, $user_id, $message, $id)\n{\n $mysqli = db_connect();\n $sql = \"INSERT INTO review (fk_article_id, fk_user_id, message, response_id) VALUES (?,?,?,?)\";\n $con = $mysqli->prepare($sql);\n $con->bind_param(\"iisi\", $art_id, $user_id, $message, $id);\n if ($con->execute() == TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n}" ]
[ "0.6375171", "0.6314303", "0.62884146", "0.6278936", "0.61770463", "0.617559", "0.6132213", "0.6104332", "0.609863", "0.6098424", "0.60673404", "0.60672885", "0.60088784", "0.5966014", "0.5942886", "0.5935227", "0.5920225", "0.5877077", "0.5867908", "0.5847452", "0.58309925", "0.5745186", "0.57418716", "0.57199377", "0.568086", "0.5623411", "0.5615526", "0.56133145", "0.5603869", "0.5545446" ]
0.66614515
0
Initialize plugin loader for models
public function __construct() { $this->_loader = new Zend_Loader_PluginLoader(array( 'Bugapp' => APPLICATION_PATH . '/models', )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initLoader() {\n $this->_loader = new Loader();\n\t}", "public function initialize()\n {\n parent::initialize();\n $this->loadModel('Projects');\n $this->loadModel('ProjectsInjections');\n $this->loadModel('Colonies');\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'sys.models.*',\n 'product.models.*',\n 'sys.components.*',\n 'hr.models.*',\n ));\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}", "public function __construct()\n\t{\n\t\tforeach(Config::item('core.preload') as $type => $load)\n\t\t{\n\t\t\tif ($load == FALSE) continue;\n\n\t\t\tforeach(explode(',', $load) as $name)\n\t\t\t{\n\t\t\t\tif (($name = trim($name)) == FALSE) continue;\n\n\t\t\t\tswitch($type)\n\t\t\t\t{\n\t\t\t\t\tcase 'libraries':\n\t\t\t\t\t\tif ($name == 'database')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->database();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->library($name);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'models':\n\t\t\t\t\t\t$this->model($name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "protected function _initLoadPlugin() {\n\t\t$front = Zend_Controller_Front::getInstance();\n\t\t$front->registerPlugin(new Plugins_Myplugin() );\t\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}", "public function init()\n {\n $this->config = Yii::app()->params['CaseSearch'];\n $dependencies = array(\n 'OECaseSearch.models.*',\n 'OECaseSearch.components.*',\n );\n foreach ($this->config['parameters'] as $module => $paramList)\n {\n if ($module !== 'core')\n {\n $dependencies = array_merge($dependencies, array(\n \"$module.models.*\",\n ));\n }\n }\n $this->setImport($dependencies);\n\n // Initialise the search provider/s.\n foreach ($this->config['providers'] as $providerID => $searchProvider)\n {\n $this->searchProviders[$providerID] = new $searchProvider($providerID);\n }\n }", "public function __construct() {\n\t\t\n\t\t$this->pluginLoader = new Zend_Loader_PluginLoader ();\n\t}", "public function initSinglePlugins()\n {\n $this->collSinglePlugins = new ObjectCollection();\n $this->collSinglePluginsPartial = true;\n\n $this->collSinglePlugins->setModel('\\Plugins');\n }", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "public function init()\n {\n // TODO: initialize by config ordering\n foreach ($this->plugins as $name => $plugin) {\n $plugin->init();\n }\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\t}", "public function initNarrationPlugins()\n {\n $this->collNarrationPlugins = new ObjectCollection();\n $this->collNarrationPluginsPartial = true;\n\n $this->collNarrationPlugins->setModel('\\Plugins');\n }", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'music.models.*',\n\t\t\t'music.components.*',\n\t\t));\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t\t'admin.models.*',\n\t\t\t\t'admin.components.*',\n\t\t));\n\n\t}", "public function initialize()\n {\n $autoloader = $this->registerAutoloader();\n $this->registerPlugins($autoloader);\n }", "public function initialize()\n {\n $this->loadModel('Users');\n }", "public function __construct() {\n $this->loader();\n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function init() {\n parent::init();\n if (!is_object($this->api)) {\n $class = $this->api;\n $this->api = new $class;\n }\n $this->loadPlugins();\n }", "public function init()\n {\n $this->loadMeta();\n }", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n parent::init();\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'info.models.*',\n\t\t\t'info.components.*',\n\t\t));\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'common.components.*',\n\t\t));\n\t}", "protected function initLoader()\n {\n $config = $this->di->getShared('config');\n $loader = new Loader;\n $loader->registerNamespaces(\n [\n 'Phosphorum\\Models' => $config->get('application')->modelsDir,\n 'Phosphorum\\Controllers' => $config->get('application')->controllersDir,\n 'Phosphorum\\Forms' => $config->get('application')->formsDir,\n 'Phosphorum' => $config->get('application')->libraryDir\n ]\n );\n\n $loader->register();\n $this->di->setShared('loader', $loader);\n\n return $loader;\n }" ]
[ "0.70560014", "0.7022525", "0.7003943", "0.69552284", "0.68227637", "0.6815323", "0.6725727", "0.66877496", "0.66794556", "0.66536695", "0.66503805", "0.66343635", "0.6623057", "0.6615094", "0.65887064", "0.6578339", "0.65425426", "0.65246105", "0.6512719", "0.6504253", "0.6499572", "0.64984465", "0.6495008", "0.64881724", "0.6478104", "0.64779747", "0.64644396", "0.6459216", "0.64592105", "0.6437095" ]
0.70711553
0
get a free id.
private function getFreeId() { $ids = self::queues(); for ($i = 1; $i < pow(2, 16); $i++) { if ($ids[$i] ?? false) { } else { return $i; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function obtenerID();", "public function obtenerId() {}", "function getFreeDrugId()\n {\n $request = \"SELECT id FROM DRUG WHERE id = (SELECT MAX(id) FROM DRUG ORDER BY id ASC)\";\n\n DBConnexion::getInstance()->prepareAndExecuterQuerySelect($request, null);\n $response = DBConnexion::getInstance()->getResult();\n\n return intval($response[0][0]+1);\n }", "public static function getHolderID();", "function getID();", "public function get_id();", "public function get_id();", "public function getID();", "public function getID();", "public function getID();", "public function fetch_the_id() {}", "public function getBuyableIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "public function getAvailableId()\r\n {\r\n while($this->_contains($id = 'winzou_autocomplete_'.sha1(uniqid())));\r\n\r\n return $id;\r\n }", "function system_get_next_free_gid($mingid)\n{\n\treturn(\"\");\n}", "function getNewId();", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "abstract public function get_id();", "public static function getID() {\r\n return 1;\r\n }", "public function getRequestedId() {}", "public function getInternalId()\n {\n return $this->_id;\n }", "public function getPurchasableId();", "public static function get()\n {\n return self::$id;\n }", "public function getId()\n {\n return substr($this->_id, 0, 12);\n }", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}" ]
[ "0.67724544", "0.65510756", "0.65360796", "0.6516126", "0.6466356", "0.6439093", "0.6439093", "0.64252317", "0.64252317", "0.64252317", "0.63448864", "0.6304572", "0.63036263", "0.62964505", "0.62689054", "0.62636757", "0.6225233", "0.6169001", "0.6119997", "0.61110425", "0.60969126", "0.609486", "0.6087847", "0.60863674", "0.6085711", "0.6085711", "0.6085711", "0.6085711", "0.6085711", "0.6084976" ]
0.71075106
0
Display a listing of RequestToTechnical.
public function index() { if (! Gate::allows('request_to_technical_access')) { return abort(401); } if (request('show_deleted') == 1) { if (! Gate::allows('request_to_technical_delete')) { return abort(401); } $request_to_technicals = RequestToTechnical::onlyTrashed()->get(); } else { $request_to_technicals = RequestToTechnical::all(); } return view('admin.request_to_technicals.index', compact('request_to_technicals')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $select_req_ids = DB::select(\"SELECT DISTINCT req_id FROM maint_request_info\");\n\n return view('frontend.request.index')->with('select_req_ids',$select_req_ids);\n }", "public function create()\n {\n if (! Gate::allows('request_to_technical_create')) {\n return abort(401);\n }\n $projects = \\App\\TimeProject::get()->pluck('name', 'id')->prepend('Please select', '');$work_types = \\App\\TimeWorkType::get()->pluck('name', 'id')->prepend('Please select', '');$assigned_people = \\App\\User::get()->pluck('name', 'id');$names = \\App\\Status::get()->pluck('name', 'id')->prepend('Please select', '');\n $enum_priority = RequestToTechnical::$enum_priority;\n \n return view('admin.request_to_technicals.create', compact('enum_priority', 'projects', 'work_types', 'assigned_people', 'names'));\n }", "public function index()\n {\n $p_req= ProductRequest::orderBy('created_at', 'desc')->paginate(10);\n return view('backend.pages.product_request', compact('p_req'));\n }", "public function viewmymaintenancerequestsAction(){\n\t\t$maint = new Maintenance_Model_MaintenanceRequest();\n\t\t$records = $maint->fetchMyRequests();\n\n\t\tif( $records ) {\n\t\t $this->view->paginator = $this->paginate($records);\n\t\t}\n\t}", "public function itemList() {\n $entityId = $this->request->data['entity_id'];\n $instituteId = $this->request->data['institute_id'];\n $courseId = $this->request->data['course_id'];\n $batchId = $this->request->data['batch_id'];\n\n $this->TraineeInfo->recursive = 0;\n $conditions = array('TraineeInfo.entity_id' => $entityId,\n 'TraineeInfo.training_institute_id' => $instituteId,\n 'TraineeInfo.course_info_id' => $courseId,\n 'TraineeInfo.batch_info_id' => $batchId,\n 'TraineeInfo.enrollment_status' => 0);\n $this->set('traineeRegistereds', $this->Paginator->paginate(null, $conditions));\n }", "public function index()\n {\n $pendingRequests = \\DB::table('tblPrescription')\n ->join('tblPatient', 'tblPatient.intPatientId', '=', 'tblPrescription.intPatientIdFK')\n ->join('tblEmployee', 'tblEmployee.intEmployeeId', '=', 'tblPrescription.intEmployeeIdFK')\n ->select('tblPrescription.intPrescriptionId', 'tblPatient.strFirstName', 'tblPatient.strMiddleName', 'tblPatient.strLastName', 'tblEmployee.strFirstName as strEmployeeFirstName', 'tblEmployee.strMiddleName as strEmployeeMiddleName', 'tblEmployee.strLastName as strEmployeeLastName')\n ->get();\n\n $lastRequestId = PrescriptionModel::where('intStatus', '>', 0)\n ->orderBy('intPrescriptionId', 'desc')\n ->select('intPrescriptionId')\n ->first();\n\n return view('transaction-laboratory')\n ->with('pendingRequests', $pendingRequests)\n ->with('recentId', $lastRequestId->intPrescriptionId);\n }", "public function getList()\n {\n $requests = Request::orderBy('id', 'desc')->paginate(15);\n return view('dj.requests', ['requests' => $requests]);\n }", "public function actionTCIs()\n\t{\n\t\tif (ctype_digit(@$_GET['page'])) $this->page = $_GET['page'];\n\t\t$this->renderPartial('_list',array('operations'=>$this->getTransportList($_GET)));\n\t}", "public function index(Request $request)\n {\n \n $order = $request->query('order');\n $customer = $request->query('customer');\n\n $query = Feedback::query();\n\n $query = $query->when(!is_null($order), function($query) use ($order) {\n\n return $query->where('order_id', $order);\n\n });\n\n $query = $query->when(!is_null($customer), function($query) use ($customer) {\n\n return $query->where('customer_id', $customer);\n\n });\n\n $per_page = (int) $request->query('per_page', 15);\n\n $collection = new FeedbackCollection($query->paginate($per_page));\n\n return $collection->additional([\n 'status' => 1\n ]);\n\n }", "public function ticketlistAction(){\n\n\t $this->view->session_data = $this->ModelObj->Useconfig;\n\n\t $this->view->ticketdetails = $this->ModelObj->ticketinformation();\n\n\t $this->view->countries = $this->ModelObj->getCountryList();\n\n\t $this->view->helpdeskstatus = $this->ModelObj->getstatuslist(); \n\n\t $this->view->allcustomers = $this->ModelObj->getCustomerList();\n\n\t $this->view->forwarders = $this->ModelObj->getForwarderList();\n\n }", "public function typeRequest()\n {\n $select = [ 'ams_type_request.id',\n 'ams_type_request.name',\n 'ams_type_request.created_at'];\n\n $prepare = ModelFactory::getInstance('TypeRequest');\n\n $prepare = $prepare->with([\n 'forms' => function($query){\n $query->select('*');\n }\n ]);\n\n $prepare->orderBy('order_number','asc')->get();\n\n // add search filter\n $searchFilter = FilterFactory::getInstance('Text','Search');\n $prepare = $searchFilter->addFilter($prepare,'search','search');\n $this->view->searchFilter = $searchFilter;\n\n $this->view->typerequests = $this->paginate($prepare);\n\n $this->view->title = 'Type of Request List';\n return $this->view('settings.request');\n }", "private function showTicketList()\n {\n $settings = Utils::getPersonalizedSettings($this->db);\n\n /*$user_id = $settings->enable_issues_created_by_me ? \n $settings->enable_issues_created_by_me :\n null;*/\n\n $param = array(\n 'user_id' => null,\n 'source_id' => null,\n 'start' => 0,\n 'size' => 1\n );\n\n $TicketListRenderer = new TicketListRenderer($this->db, $this->template);\n $sql = $this->getTicketListSQL($param);\n//echo $sql;\n $total_ticket = $TicketListRenderer->countTicketList($sql);\n\n $data = array();\n $data['pagger_action_url'] = 'Ticket/ajax_list';\n $data['total_ticket'] = $total_ticket;\n \n $html = $TicketListRenderer->getTicketListView($data);\n \n return $html;\n }", "public function index(Request $request)\n {\n $receivingrequest = ReceivingRequest::with(\"warehouselist\")->with(\"businessunit\")->get();\n\n\t\treturn view('.transactions.ReceivingRequest.index', compact('receivingrequest'));\n\t}", "public function viewallmaintenancerequestsAction(){\n\t\t$maint = new Maintenance_Model_MaintenanceRequest();\n\t\t$records = $maint->fetchAllRequests();\n\n\t\tif( $records ){\n\t\t $this->view->paginator = $this->paginate($records);\n\t\t}\n\t}", "public function getList(Request $request)\n {\n $data = Toy::with(['booking'])->orderby('id')->paginate(15);\n return view('admin.toys.list', compact('data'));\n }", "public function index(Request $request)\n {\n $threads = Thread::threadInfo()\n ->inChannel($request->channels)\n ->isPublic()//复杂的筛选\n ->with('author', 'tags', 'last_component', 'last_post')\n ->withType($request->withType)\n ->withBianyuan($request->withBianyuan)\n ->withTag($request->tags)\n ->excludeTag($request->excludeTags)\n ->ordered($request->ordered)\n ->paginate(config('constants.threads_per_page'));\n return response()->success([\n 'threads' => ThreadInfoResource::collection($threads),\n 'paginate' => new PaginateResource($threads),\n ]);\n //return view('test',compact('threads'));\n }", "public function edit($id)\n {\n if (! Gate::allows('request_to_technical_edit')) {\n return abort(401);\n }\n $projects = \\App\\TimeProject::get()->pluck('name', 'id')->prepend('Please select', '');$work_types = \\App\\TimeWorkType::get()->pluck('name', 'id')->prepend('Please select', '');$assigned_people = \\App\\User::get()->pluck('name', 'id');$names = \\App\\Status::get()->pluck('name', 'id')->prepend('Please select', '');\n $enum_priority = RequestToTechnical::$enum_priority;\n \n $request_to_technical = RequestToTechnical::findOrFail($id);\n\n return view('admin.request_to_technicals.edit', compact('request_to_technical', 'enum_priority', 'projects', 'work_types', 'assigned_people', 'names'));\n }", "public function index()\n {\n $arr['purchaserequest'] = Purchaserequest::All();\n return view('purchase.purchaserequest.index')->with($arr);\n }", "function list(Request $request) {\n $query = Subscription::query();\n\n if ($search = $request->search) {\n $this->searchTerm($query, $search, ['title', 'description']);\n }\n return SubscriptionListResource::collection($query->paginate($request->get('perPage')));\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_tech_req';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function index($pro_id, Request $request)\n {\n $this->client_posted_request_application_entity = ClientPostedRequestApplicationEntity::ownedBy($pro_id, 'professional_id')\n ->with(['postedRequest', 'postedRequest.client', 'professional']);\n $per_page = config('settings.pagination.per_page');\n if(isset($request->recent_only)){\n $this->client_posted_request_application_entity = $this->client_posted_request_application_entity->limit(5);\n $per_page = 5;\n }\n return $this\n ->client_posted_request_application_entity\n ->orderBy('created_at', 'DESC')\n ->paginate(\n $per_page\n );\n }", "public function recipients(Request $request)\n {\n $mainGroups = Customer::where('mainGroup.id', (string) 0)->get();\n $recipients = RecipientDetails::where('status', (int) 1)->get();\n $agents = User::where('isActive', 1)->where('role', 'AG')->orderby('name')->get();\n $customerLevels = CustomerLevel::get();\n $filter_data = $request->input();\n return view('dispatch.recipients.recipients_list')->with(compact(\n 'recipients',\n 'mainGroups',\n 'agents',\n 'customerLevels',\n 'filter_data'\n ));\n }", "public function show(Technology $technology)\n {\n /*\n $mainUser = User::join('checkins', 'users.id', 'checkins.user_id')\n ->where('checkins.technology_id', $technology->id)\n ->select(\n 'users.id',\n DB::raw('count(checkins.id) as total'\n ))\n ->groupBy('users.id')\n ->orderBy('total', 'desc')\n ->first();\n $topUser = User::find($mainUser->id);\n $topUser->totalCheckins = $mainUser->total;\n */\n //$users = $technology->users()->distinct()->get()->except($topUser->id);\n $users = $technology->users()->distinct()->whereHas('subscriptions', function (Builder $query) {\n $query->whereIn('stripe_status', ['active', 'trialing']);\n })->get()->sortByDesc(function($user) use ($technology)\n {\n return $user->checkins()->where('technology_id', $technology->id)->count();\n });\n\n $topUser = $users->first();\n\n return view('technologies.show', compact('technology', 'topUser', 'users'));\n }", "public function allIndex()\n {\n $users = DB::table('users')->select('id','name')->orderBy('name')->get();\n $projects = DB::table('projects')->select('id','description')->orderBy('description')->get();\n $suppliers = Supplier::orderBy('name')->get();\n $tasks = Task::all()->sortBy('number');\n $uoms = Uom::orderBy('name')->orderBy('sort_order')->get();\n $purchase_requests = PurchaseRequest::orderBy('id')->get();\n return view('purchase-request-lines-all',[\n 'users' => $users,\n 'projects' => $projects,\n 'suppliers' => $suppliers,\n 'tasks' => $tasks,\n 'uoms' => $uoms,\n 'purchase_requests' => $purchase_requests,\n 'prStatuses' => PurchaseRequest::PR_STATUSES,\n 'prlStatuses' => PurchaseRequestLine::PRL_STATUSES\n ]);\n }", "public function index()\n {\n $companies=Company::orderBy('name')->get();\n $ticket_types=DB::table('ticket_type')->orderBy('name')->get();\n $devices=DB::table('devices')->orderBy('name')->get();\n $tsac=DB::table('support_technicians')->orderBy('name')->get();\n return view('tickets.add')\n ->with('ticket_types',$ticket_types)\n ->with('devices',$devices)\n ->with('tsac',$tsac)\n ->with('companies',$companies);\n }", "public function actionAdditionalListing()\n \t {\n \t \tob_start();\n \t \tYii::app()->theme='back';\n \n $rec=AdditionalServices::model()->findAll();\n \t \t$this->render('additionallisting',array('list'=>$rec));\n \t }", "public function prescriptionlist(Request $req)\n {\n $prescrip = Prescription::all();\n\t return view('nurse.PrescriptionList', ['prescrip' => $prescrip]);\n }", "public function getfonctionnaire(Request $request)\n {\n $params = $request->getQueryParams();\n $items = $this->agentTable->findPaginatedFonctionnaire(10, $params['p']??1);\n return $this->renderer->render('@platform/listingFonctionnaire', compact('items'));\n }", "public function showAllRequest()\n\t{\n\t\t// get all his/her job\n\t\t$logged_user_id = Auth::user()->id;\n\t\t$user_info = UserInfo::find($logged_user_id);\n\t\t$freelancer_info = FreelancerInfo::find($user_info->user_id);\n\n $jobs = Job::where('freelancer_info_id', $freelancer_info->user_info_id)->get();\n\n $query = \"SELECT jr.job_id, jr.seeker_id, j.deskripsi \";\n $query = $query.\"FROM job_request jr, job j \";\n $query = $query.\"WHERE j.freelancer_info_id = \". $freelancer_info->user_info_id .\" and j.id = jr.job_id\";\n\t\t$job_requests = DB::select(DB::raw($query));\n\n\t\t$job_requests_data = [];\n\t\tforeach ($job_requests as $a_job_req => $value) {\n\t\t\t# code...\n\t\t\t$job_id = $value->job_id;\n\t\t\t$job_deskripsi = $value->deskripsi;\n\t\t\t$seeker_id = $value->seeker_id;\n\t\t\t$seeker_email = User::find($seeker_id)->email;\n\n\t\t\t$a_job_req_data = array(\n\t\t\t\t'job_id' => $job_id,\n\t\t\t\t'job_deskripsi' => $job_deskripsi,\n\t\t\t\t'seeker_id' => $seeker_id,\n\t\t\t\t'seeker_email' => $seeker_email\n\t\t\t);\n\t\t\tarray_push($job_requests_data, $a_job_req_data);\n\t\t}\n\n\t\treturn View::make('job.requests')\n ->with('job_requests_data', $job_requests_data);\n\t}" ]
[ "0.5734516", "0.5666756", "0.56363255", "0.55433273", "0.5496883", "0.548846", "0.54874605", "0.5443414", "0.5426527", "0.541173", "0.5396381", "0.5390489", "0.53643143", "0.53580296", "0.5317709", "0.5301016", "0.5273133", "0.525637", "0.52514434", "0.52238053", "0.52167815", "0.5213407", "0.5197586", "0.5194434", "0.518686", "0.518373", "0.5170349", "0.5170021", "0.5164279", "0.5160822" ]
0.6915019
0
Show the form for creating new RequestToTechnical.
public function create() { if (! Gate::allows('request_to_technical_create')) { return abort(401); } $projects = \App\TimeProject::get()->pluck('name', 'id')->prepend('Please select', '');$work_types = \App\TimeWorkType::get()->pluck('name', 'id')->prepend('Please select', '');$assigned_people = \App\User::get()->pluck('name', 'id');$names = \App\Status::get()->pluck('name', 'id')->prepend('Please select', ''); $enum_priority = RequestToTechnical::$enum_priority; return view('admin.request_to_technicals.create', compact('enum_priority', 'projects', 'work_types', 'assigned_people', 'names')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n return view('medicalRequest.create');\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function new()\n {\n return view('pages.form12.new_requests');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n\t{\n\t $warehouselist = WarehouseList::pluck(\"name\", \"id\");\n\t\t$businessunit = BusinessUnit::pluck(\"name\", \"id\");\n\n\t \n\t return view('.transactions.ReceivingRequest.create', compact(\"warehouselist\", \"businessunit\"));\n\t}", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n // Show the create requirement form.\n return View::make('requirements/create');\n }", "public function create()\n {\n //加载模板\n return view('Admin.Req.add');\n }", "public function create()\n {\n return view('product-characteristics.create');\n }", "public function create()\n {\n $data = Customer::createOrEdit();\n $data['createSupplier'] = 1;\n return view('customer.form', $data);\n }", "public function create() {\n\n\t\treturn view('/mailer/createform');\n\n\t}", "public function create()\n {\n return view('panel.payment-management.payment.form-create');\n }", "public function create()\n {\n return view('industry.form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n \n $category = 'apcs';\n $link = '';\n $master = (new MasterLayoutController)->getSec($category);\n return view('eiaapplicant.create', compact('master','category','link'));\n \n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function create()\n {\n //\n return view('admin.incoterm.create');\n }", "public function create()\n {\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \"Create Product Item\";\n $this->data['mode'] = \"create\";\n return view('product.form', $this->data);\n }", "public function create()\n {\n return view('forming');\n }", "public function get_new(){\n\n\t\t$customer_types = array('' => 'Select One','Buyer'=>'Buyer','Vendor'=>'Vendor');\n\n\t\t$countries = array('' => 'Select One') + \n\t\t\tCountry::lists('country_name', 'country_id');\n\n\t\t$titles = array('' => 'Select One','Mr.'=>'Mr.','Mrs.'=>'Mrs.','Ms.'=>'Ms.','Miss'=>'Miss','Master'=>'Master',\n\t\t\t'Rev.'=>'Rev. (Reverend)','Fr.'=>'Fr. (Father)','Dr.'=>'Dr. (Doctor)','Atty.'=>'Atty. (Attorney)',\n\t\t\t'Prof.'=>'Prof. (Professor)','Hon.'=>'Hon. (Honorable)','Pres.'=>'Pres. (President)',\n\t\t\t'Gov.'=>'Gov. (Governor)','Coach'=>'Coach','Ofc.'=>'Ofc. (Officer)');\n\n\t\t$this->layout->content = View::make('frontend.customers.new')\n\t\t\t->with('title', 'Register Customer')\n\t\t\t->with('customer_type',$customer_types)\n\t\t\t->with('customer_countryId', $countries)\n\t\t\t->with('customer_title', $titles);\n\t}", "public function create()\n {\n return view('web::ticket.create');\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n return view('request.type.create');\n }", "public function create()\n {\n \n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'ajouterPersonne',\n 'employe' => null\n ]\n );\n }", "public function create()\n {\n return view('admin.enquiry.source.form');\n }", "public function create()\n {\n $this->page_title = trans('customer.new');\n\n return view('customer.new', $this->vdata);\n }", "public function actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}" ]
[ "0.71944946", "0.67354745", "0.6582597", "0.6563672", "0.65582204", "0.65582204", "0.65255874", "0.6521825", "0.647198", "0.6321018", "0.6297322", "0.6287054", "0.628262", "0.62734175", "0.62688255", "0.62688005", "0.62649804", "0.6255589", "0.6237941", "0.6228395", "0.622531", "0.6218215", "0.6217808", "0.62112594", "0.6203895", "0.6203561", "0.61924857", "0.6190378", "0.61768734", "0.61689603" ]
0.7381584
0
Store a newly created RequestToTechnical in storage.
public function store(StoreRequestToTechnicalsRequest $request) { if (! Gate::allows('request_to_technical_create')) { return abort(401); } $request = $this->saveFiles($request); $request_to_technical = RequestToTechnical::create($request->all()); $request_to_technical->assigned_person()->sync(array_filter((array)$request->input('assigned_person'))); foreach ($request->input('upload_customer_sign_off_files_id', []) as $index => $id) { $model = config('laravel-medialibrary.media_model'); $file = $model::find($id); $file->model_id = $request_to_technical->id; $file->save(); } return redirect()->route('admin.request_to_technicals.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(TechnicianRequest $request)\n {\n\n //echo $request->pendinginvoiced_at;\n // store the data in database\n $technician = new Technician;\n $technician->pendinginvoiced_at = $request->pendinginvoiced_at;\n $technician->technician_name = $request->technician_name;\n $technician->tech_details = $request->tech_details;\n $technician->flushing_hours = $request->flushing_hours;\n $technician->camera_hours = $request->camera_hours;\n $technician->main_line_auger_hours = $request->main_line_auger_hours;\n $technician->other_hours = $request->other_hours;\n $technician->notes = $request->notes;\n $technician->equipment_left_on_site = $request->equipment_left_on_site;\n $technician->equipment_name = $request->equipment_name;\n $technician->job_id = $request->job_id;\n $technician->user_id = \\Auth::user()->id;\n\n $technician->save();\n\n // check if there is materials\n if(isset($request->material_name_add)){\n //print_r($request->material_name);\n for($i = 0; $i < count($request->material_name_add); ++$i) {\n //echo $request->material_name[$i];\n //echo $request->material_quantity[$i];\n //echo '<br>';\n $material = new Material;\n\n $material->material_name = $request->material_name_add[$i];\n $material->material_quantity = $request->material_quantity_add[$i];\n $material->technician_id = $technician->id;\n\n $material->save();\n }\n }\n\n // change JOB back to pending status\n $job = Job::find($request->job_id);\n $job->status = 0;\n $job->invoiced_at = null;\n $job->save();\n\n Session::flash('success','The Technician Details was successfully created');\n\n // redirect to another page\n return redirect()->route('technicians.show',$technician->id);\n }", "public function store( Request $request ) {\n\t\t//\n\t}", "public function store( Request $request ) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t\t//\n\t\t}", "public function store( Request $request ) {\n\n\t}", "public function store(TechnologyRequest $request) {\n $message = $this->technologyRepository->store($request->all());\n if ($message) {\n\n return $this->errorWrongArgs($message);\n }\n\n return $this->noContent();\n }", "public function store(Request $request)\n {\n $count = RequestForQoutation::get()->count() + 1;\n $length = strlen($count);\n\n for ($i=$length; $i < 7; $i++) { \n $count = \"0\".$count;\n }\n\n $case_id = \"RFQ/\".date(\"ymdhis\").\"/\".date('DM').\"/\".$count;\n\n $RequestForQoutation = new RequestForQoutation;\n $RequestForQoutation->case_id = $case_id;\n $RequestForQoutation->purchase_type = $request->purchase_type;\n $RequestForQoutation->document_title = $request->document_title;\n $RequestForQoutation->solicitation_type = $request->solicitation_type;\n $RequestForQoutation->currency = $request->currency;\n $RequestForQoutation->delivery_date = $request->delivery_date;\n $RequestForQoutation->expired_date = $request->expiration_date;\n $RequestForQoutation->detail_delivery_address = $request->detail_delivery_addres;\n $RequestForQoutation->effective_date = $request->effective_date;\n\n $RequestForQoutation->save();\n\n foreach ($request->content as $key => $value) {\n $RequestForQuotationProduct = new RequestForQuotationProduct;\n $RequestForQuotationProduct->request_for_quotation_id = $RequestForQoutation->id;\n $RequestForQuotationProduct->kodami_product_id = $value['product'];\n $RequestForQuotationProduct->qty = $value['qty'];\n\n $RequestForQuotationProduct->save();\n }\n\n return redirect('/requestForQuotation');\n }", "public function store(Request $request)\n {\n //\n $experience = new Experience;\n $experience->user_id = auth()->user()->id;\n $experience->workplace = request('work');\n $experience->from = request('from');\n $experience->to = request('to');\n $experience->desc_1 = request('desc_1');\n $experience->desc_2 = request('desc_2');\n $experience->desc_3 = request('desc_3');\n $experience->save();\n }", "public function store(CreateReceivingRequestRequest $request)\n\t{\n\t\t$input = $request->all();\n\t \n\t\t$input['requested_date'] = Carbon::createFromFormat('M d, Y', $input['requested_date'])->format('Y-m-d');\n\t\t$input['status'] = ReceivingRequest::statusButton($input['status']);\n\t\t$receivingrequest = ReceivingRequest::create($input);\n\n\t\t$receivingrequest->transaction_number = createTransactionNumber('RR', $receivingrequest->id);\n\t\t$receivingrequest->save();\n\n\t\tif( isset($input['product']) && count($input['product']['name']) > 0 ){\n\t\n\t\t\tfor($ctr = 0; $ctr < count($input['product']['name']); $ctr++){\n\t\t\t\t$objReceivingRequestDetails = new ReceivingRequestDetails();\n\n\t\t\t\t$objReceivingRequestDetails->receivingrequest_id = $receivingrequest->id;\n\t\t\t\t$objReceivingRequestDetails->product_id = $input['product']['name'][$ctr];\n\t\t\t\t$objReceivingRequestDetails->requested_qty = $input['product']['request_qty'][$ctr];\n\n\t\t\t\t$objReceivingRequestDetails->save();\n\t\t\t}\n\n\t\t}\n\n\t\treturn redirect()->route(config('quickroute').'.receivingrequest.index')->withMessage('Receiving request successfully created.');\n\t}", "public function store( Request $request )\n {\n //\n }", "public function store( Request $request )\n {\n //\n }", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request) {\n\t\t//\n\t}", "public function store(Request $request)\n\t\t{\n\t\t\t//\n\t\t}", "public function store(Request $request)\n {\n //\n\n \n $tiquete = new tiquete($request->all());\n \n $tiquete->save();\n \n \n dd($tiquete);\n }", "public function store(Request $request)\n {\n // dd($request->all());\n $input = $this->validate($request, [\n 'office' => '',\n 'code' => '',\n 'responsibilities' => '',\n 'division_id' => 'required',\n 'source_id' => 'required',\n 'location_id' => 'required',\n 'supplies' => 'required|array|min:1',\n ]);\n $requisition = Requisition::updateOrCreate(\n ['id' => $request->id ? $request->id : ''],\n $input\n );\n $supplies = $request->supplies;\n $location = \\App\\Location::whereId($request->location_id)->first();\n\n $supplies_id = [];\n for ($i = 0; $i < count($supplies); ++$i) {\n $supply = \\App\\Supply::whereId($supplies[$i]['id'])->first();\n $receive = $location->receives()->save(new \\App\\Receive(['quantity' => $supplies[$i]['out_quantity']]));\n $supply->tracks()->save(new \\App\\Track(['requisition_id' => $requisition->id, 'supplier_id' => $supply->supplier_id, 'receive_id' => $receive->id, 'check' => $supplies[$i]['out_quantity'], 'type' => 0, 'form_type' => 1])); //type = 1 = requistion\n $supply->orders()->create([\n 'user_id' => auth()->id(),\n 'type' => 'created_purchase_order',\n 'source_id' => $input['source_id'],\n 'po_number' => $input['po_number'],\n 'pr_number' => $input['pr_number'],\n 'date_delivered' => $input['date_delivered']\n ]);\n $supplies_id[] = $supply->id;\n }\n $requisition->supplies()->attach($supplies_id);\n return response()->json($requisition);\n }", "public function store(Request $request)\n {\n echo \"in store function\";\n// echo $user;\n $capitalOne = \\Illuminate\\Http\\Request::create('http://api.reimaginebanking.com/accounts/56c66be6a73e492741507c8f/transfers?key=fab8d98dc85bc29afbe6b9915f27a0e7', 'POST', ['medium' => 'balance', 'payee_id' => 'zxc', 'amount' => 50, 'transaction_date' => '2016-02-21', 'status' => 'pending', 'description' => 'Payment for personal training services']);\n\n $todayDate = '2016-02-21';\n\n $instance = new Transaction;\n\n $instance->payee_id = '56c66be6a73e492741507c90';\n $instance->amount = 50;\n $instance->type = 'p2p';\n $instance->transaction_date = $todayDate;\n $instance->medium = 'balance';\n $instance->save();\n }", "public function store(Request $request)\n {\n $request->merge(['franchise_id' => auth()->user()->franchise->id]);\n $request->merge(['incoming_history' => json_encode([['date' => Carbon::now()->toDateString(), 'stock' => $request->amount]])]);\n $validated = $request->validate([\n 'name' => 'required',\n 'supplier_id' => 'required',\n 'amount' => 'required',\n 'expired' => 'required',\n 'unit' => 'required',\n 'information' => 'required',\n 'franchise_id' => 'required',\n 'incoming_history' => 'required',\n 'deductions_per_transaction' => 'required'\n ]);\n\n $material = new RawMaterial();\n $material->create($validated);\n Flashdata::success_alert(\"Success to add Material\");\n return redirect(route('franchise.material.index'));\n }", "public function store(Request $request)\n {\n //! this action is used to expres the intention to pay. \n\n $intentionToPay = new IntentionToPay();\n $intentionToPay->uuid = $request->uuid;\n $intentionToPay->MerchantRequestID = $request->MerchantRequestID;\n $intentionToPay->CheckoutRequestID = $request->CheckoutRequestID;\n $intentionToPay->amountPayable =$request->amountPayable;\n $intentionToPay->visitorId =$request->visitorId;\n $intentionToPay->InsuranceCoverId = $request->insuranceCoverID;\n\n $intentionToPay->save(); \n\n return response(\"Successfully Added Intention To Pay.\",200);\n\n }", "public function store(Request $request) {\n\t\t\n\t\n\t}", "public function store(Request $request)\n {\n \n // DB::transaction(function () {\n \n // });\n\n $product = $this->product->create($request->except('features'));\n $product->syncFeatures($request->input('features'));\n\n return redirect(route('product.edit', ['id' => $product->id]));\n }", "public function store(Request $request)\n {\n\n Exp_asigna_tutor::create([\n \"id_jefe_periodo\"=>Session::get('id_jefe_periodo'),\n \"id_personal\"=>$request->get(\"id_personal\"),\n \"id_asigna_generacion\"=>$request->get(\"id_asigna_generacion\"),\n ]);\n }", "public function store(Request $request)\n {\n $request[\"Responsable\"] = $request->responsable;\n $request[\"Usuario\"] = $request->usuario;\n\n if($request->Utilizado == \"on\"){\n $request[\"Utilizado\"] = 1;\n }else{\n $request[\"Utilizado\"] = 0;\n }\n $subTipos = Equipo::select('SubTipo.Nombre','Equipo.CodPatrimonial')\n ->join('Modelo','Equipo.IdModelo','=','Modelo.IdModelo')\n ->join('SubTipo','SubTipo.IdSubTipo','=','Modelo.IdSubTipo')\n ->where('IdEquipo', '=', $request->IdEquipo)\n ->first();\n\n $attr = $request->all();\n\n $subtipo = $subTipos->Nombre;\n $response_data = Asignacion::create($attr);\n return redirect()->route('inventario.equipo.subtipo',['subtipo' => $subtipo])\n ->with('success',$subtipo.' con codigo Patrimonial: '.$subTipos->CodPatrimonial . ' asignado correctamente ');\n }", "public function store(Request $request)\n\t{\n\t\t//\n\t}", "public function store(Request $request)\n\t{\n\t\t//\n\t}" ]
[ "0.63589287", "0.61763245", "0.61763245", "0.614117", "0.60970384", "0.60969806", "0.6092926", "0.60915536", "0.60894495", "0.6085461", "0.6085461", "0.60569155", "0.60569155", "0.60569155", "0.60569155", "0.60569155", "0.60569155", "0.60569155", "0.6050527", "0.6041553", "0.598065", "0.59704804", "0.5965352", "0.5965319", "0.5952757", "0.59379536", "0.5922574", "0.5918236", "0.59127975", "0.59127975" ]
0.7451615
0
Show the form for editing RequestToTechnical.
public function edit($id) { if (! Gate::allows('request_to_technical_edit')) { return abort(401); } $projects = \App\TimeProject::get()->pluck('name', 'id')->prepend('Please select', '');$work_types = \App\TimeWorkType::get()->pluck('name', 'id')->prepend('Please select', '');$assigned_people = \App\User::get()->pluck('name', 'id');$names = \App\Status::get()->pluck('name', 'id')->prepend('Please select', ''); $enum_priority = RequestToTechnical::$enum_priority; $request_to_technical = RequestToTechnical::findOrFail($id); return view('admin.request_to_technicals.edit', compact('request_to_technical', 'enum_priority', 'projects', 'work_types', 'assigned_people', 'names')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function editAction()\n {\n $traineecertId = $this->getRequest()->getParam('id');\n $traineecert = $this->_initTraineecert();\n if ($traineecertId && !$traineecert->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_traineecert')->__('This trainee certificate no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getTraineecertData(true);\n if (!empty($data)) {\n $traineecert->setData($data);\n }\n Mage::register('traineecert_data', $traineecert);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_traineecert')->__('Trainee Certificate'))\n ->_title(Mage::helper('bs_traineecert')->__('Trainee Certificates'));\n if ($traineecert->getId()) {\n $this->_title($traineecert->getCertNo());\n } else {\n $this->_title(Mage::helper('bs_traineecert')->__('Add trainee certificate'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function edit($id)\n\t{\n\t\t$receivingrequest = ReceivingRequest::find($id);\n\t $warehouselist = WarehouseList::pluck(\"name\", \"id\")->prepend('Please select', 0);\n\t\t$businessunit = BusinessUnit::pluck(\"name\", \"id\")->prepend('Please select', 0);\n\n\t \n\t\treturn view('.transactions.ReceivingRequest.edit', compact('receivingrequest', \"warehouselist\", \"businessunit\"));\n\t}", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit(Request $request) {\n\n $tenures = auth()->user()->entity->tenures;\n $branches = Branch::where('user_union_id', auth()->user()->entity->id);\n\n $forml = FormL::findOrFail($request->id);\n\n $error_list = $this->getErrors($forml);\n\n return view('change-officer.l.index', compact('tenures','branches','forml','error_list'));\n }", "function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}", "public function editAction()\n {\n \n $id = $this->_request->getParam(\"id\");\n \n // Get object from form Request\n $request_info=array();\n // Get value from Request POST\n $body = $this->_request->getParam(\"desc\");\n // to send Id to database\n $request_info['id']=$id;\n $request_info['desc']=$body;\n // Get object from model Requests\n $request_model=new Application_Model_Requests();\n // Calling edit request function to edit data\n $request_model->editRequest($request_info);\n // redirect to list Request\n // $this->redirect(\"Requests/list\");\n\n\t \n \n \n \n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->get()){\n\t\t\t$ticket = $this->TicketModel->Get($this->input->get('t_id'));\n\t\t\t$this->loadView('edit/ticket', array('ticket'=> $ticket), true);\n\t\t}else if($this->input->post()){\n\t\t\t$this->TicketModel->Edit($this->input->post());\n\t\t\tredirect('index.php/ticket/lists');\n\t\t}\n\t}", "public function editAction()\n {\n $curriculumdocId = $this->getRequest()->getParam('id');\n $curriculumdoc = $this->_initCurriculumdoc();\n if ($curriculumdocId && !$curriculumdoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_curriculumdoc')->__('This curriculum doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCurriculumdocData(true);\n if (!empty($data)) {\n $curriculumdoc->setData($data);\n }\n Mage::register('curriculumdoc_data', $curriculumdoc);\n $this->loadLayout();\n\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Training List'))\n ->_title(Mage::helper('bs_curriculumdoc')->__('Curriculum Documents'));\n if ($curriculumdoc->getId()) {\n $this->_title($curriculumdoc->getCdocName());\n } else {\n $this->_title(Mage::helper('bs_curriculumdoc')->__('Add curriculum doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function get_edit(){\n\t\tif (Auth::check()){\n\t\t\t$customer_id = Auth::user()->customer_id;\n\n\t\t\t$customer_types = array('' => 'Select One','Buyer'=>'Buyer','Vendor'=>'Vendor');\n\n\t\t\t$countries = array('' => 'Select One') + \n\t\t\t\tCountry::lists('country_name', 'country_id');\n\n\t\t\t$titles = array('' => 'Select One','Mr.'=>'Mr.','Mrs.'=>'Mrs.','Ms.'=>'Ms.','Miss'=>'Miss','Master'=>'Master',\n\t\t\t\t'Rev.'=>'Rev. (Reverend)','Fr.'=>'Fr. (Father)','Dr.'=>'Dr. (Doctor)','Atty.'=>'Atty. (Attorney)',\n\t\t\t\t'Prof.'=>'Prof. (Professor)','Hon.'=>'Hon. (Honorable)','Pres.'=>'Pres. (President)',\n\t\t\t\t'Gov.'=>'Gov. (Governor)','Coach'=>'Coach','Ofc.'=>'Ofc. (Officer)');\n\n\t\t\t$this->layout->content = View::make('frontend.customers.edit')\n\t\t\t\t->with('title', 'Edit Customer')\n\t\t\t\t->with('customer', Customer::find($customer_id))\n\t\t\t\t->with('customer_type',$customer_types)\n\t\t\t\t->with('customer_countryId', $countries)\n\t\t\t\t->with('customer_title', $titles);\n\t\t}\n\t}", "public function edit()\n {\n return view('billing::edit');\n }", "public function edit()\n {\n return view('billing::edit');\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function editAction()\n {\n $traineedocId = $this->getRequest()->getParam('id');\n $traineedoc = $this->_initTraineedoc();\n if ($traineedocId && !$traineedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_traineedoc')->__('This trainee document no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getTraineedocData(true);\n if (!empty($data)) {\n $traineedoc->setData($data);\n }\n Mage::register('traineedoc_data', $traineedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_traineedoc')->__('Trainee Document'))\n ->_title(Mage::helper('bs_traineedoc')->__('Trainee Document'));\n if ($traineedoc->getId()) {\n $this->_title($traineedoc->getTraineeDocName());\n } else {\n $this->_title(Mage::helper('bs_traineedoc')->__('Add trainee document'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n $contactUsInfo = $this->contactUsInfoService->getContactInfoDetail();\n\n return view('admin.modules.contactUsInfo.edit', compact('contactUsInfo'));\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('amuco_details_request_office_update');\n\n\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->find($id);\n\n\t\t$this->template->title('Amuco Details Request Office Update');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_update', $this->data);\n\t}", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }", "public function editAction()\n {\n $this->_title($this->__('Request price'))\n ->_title($this->__('Manage request price'));\n\n // 1. Instance RP model\n// /* @var $model Test_Requestprice_Model_Requestprice */\n $model = Mage::getModel('test_requestprice/requestprice');\n\n //2. Id ID exists check it and load data\n $reqpriceId = $this->getRequest()->getParam('id');\n if ($reqpriceId) {\n $model->load($reqpriceId);\n\n if (!$model->getId()) {\n $this->_getSession()->addError(\n Mage::helper('test_requestprice')->__('Request price item does not exist.')\n );\n return $this->_redirect('*/*/');\n }\n // prepare title\n $this->_title($model->getTitle());\n $breadCrumb = Mage::helper('test_requestprice')->__('Edit Item');\n } else {\n $this->_title(Mage::helper('test_requestprice')->__('New Item'));\n $breadCrumb = Mage::helper('test_requestprice')->__('New Item');\n }\n // init breadcrumbs\n $this->_initAction()->_addBreadcrumb($breadCrumb, $breadCrumb);\n\n // 3. Set entered data if there was an error during save\n $data = Mage::getSingleton('adminhtml/session')->getFormData(true);\n if (!empty($data)) {\n $model->addData($data);\n }\n\n // 4. Register model to use later in blocks\n Mage::register('requestprice_item', $model);\n\n // 5. Render layout\n $this->renderLayout();\n }", "public function edit($id_requisito,Request $request)\n {\n \n }" ]
[ "0.6753198", "0.65546346", "0.6549745", "0.6524874", "0.64573175", "0.636553", "0.63427705", "0.63347274", "0.6315249", "0.62827134", "0.62673265", "0.6239687", "0.62371385", "0.6234597", "0.6234597", "0.6224215", "0.61977535", "0.6161846", "0.6161846", "0.61428106", "0.6136383", "0.61240447", "0.6105538", "0.6101213", "0.60990405", "0.60939956", "0.6091671", "0.60692686", "0.60663897", "0.6064084" ]
0.71146655
0
Delete all selected RequestToTechnical at once.
public function massDestroy(Request $request) { if (! Gate::allows('request_to_technical_delete')) { return abort(401); } if ($request->input('ids')) { $entries = RequestToTechnical::whereIn('id', $request->input('ids'))->get(); foreach ($entries as $entry) { $entry->delete(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('courses_details.index');\n }\n }", "public function deleteSelected(Request $request)\n {\n foreach ($request['id'] as $id) {\n $pengeluaran = PengeluaranInshaModel::find($id);\n $pengeluaran->delete();\n }\n }", "public function mutipleDelete(Request $request)\n {\n foreach($request->all() as $product){\n Product::find($product['id'])->delete();\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('classes.index');\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('posts.index');\n }\n }", "public function delete_all(Request $r)\n\t{\n\t\t$input = $r->all();\n\t\tforeach($input['datachecked'] as $tag)\n\t\t{\n\t\t\t$tag_status = \\App\\Tag::where('id',$tag)->first();\n\t\t\t$tag_status->delete();\n }\n session()->flash('success', 'Tag(s) deleted successfully.');\n\t\techo 'success';\n\t}", "public function destroy(Request $request)\n {\n Genero::find($request->all()['id'])->delete();\n $genero = Exsicata::where('genero_id', '=', $request->all()['id'])->get();\n foreach ($genero as $data) {\n $data->delete();\n }\n return response()->json('ok');\n }", "public function destroyMultiple(Request $request)\n { \n $post = $request->all();\n \n // $CommonController = new CommonController;\n // $access = $CommonController->checkFunctionPermission($this->permision,$this->className,$this->methodName);\n // if(empty($access)){ \n // Session::flash('error', 'You do not have permission to access this page!.'); \n // return Redirect::to('cms/dashboard');\n // }\n \n if(empty($post)){ \n Session::flash('error', trans('common.invalidToken')); \n return Redirect::to('cms/family');\n \n }\n \n \n \n \n $deleted_at = date(\"Y-m-d H:i:s\");\n $data = array('stat-nw' => 'unPublish');\n \n DB::table('familiestatuut')->whereIn('id', $post['ids'])->delete(); \n Session::flash('success', trans('common.deletedSuccesfully'));\n \n return 1;\n \n Session::flash('error', trans('common.invalidToken')); \n return 0; \n \n \n }", "public function delete(Request $request) {\n $estadillos = Estadillo::all();\n foreach ($estadillos as $estadillo) {\n if ($estadillo->registreProduccio->id_registre_entrada == $request[\"id\"]){\n ActorEstadillo::where('id_produccio', $estadillo->id_estadillo)->delete();\n $estadillo->delete();\n }\n }\n \n //Elimina tots els costos relacionats amb el registre d'Entrada que s'eliminara\n $costos = Costos::all();\n foreach ($costos as $cost) {\n if ($cost->registreProduccio->id_registre_entrada == $request[\"id\"]){\n EmpleatCost::where('id_costos', $cost->id_costos)->delete();\n $cost->delete();\n }\n }\n \n $calendars = Calendar::all();\n foreach ($calendars as $calendar) {\n if ($calendar->id_registre_entrada == $request[\"id\"]){\n $calendar->delete();\n }\n }\n \n RegistreEntrada::where('id_registre_entrada', $request[\"id\"])->delete();\n //Elimina tots els missatges relacionats amb el registre d'Entrada que s'eliminara\n $registres = RegistreProduccio::where('id_registre_entrada', $request[\"id\"])->get();\n foreach ($registres as $registre) {\n Missatge::where('id_referencia', $registre->id)->where('referencia', 'registreProduccio')->delete();\n }\n //Elimina tots els registres de producció relacionats amb el registre d'Entrada que s'eliminara\n $registres = RegistreProduccio::where('id_registre_entrada', $request[\"id\"])->delete();\n Missatge::where('id_referencia', $request[\"id\"])->whereReferencia('registreEntrada')->delete();\n \n return redirect()->route('indexRegistreEntrada');\n }", "public function multidestroy(request $request){\n $input=$request->all();\n var_dump($input[\"ArticleBorrar\"]);\n\n if(isset($input[\"ArticleBorrar\"])) {\n foreach($input[\"ArticleBorrar\"] as $idArticle) {\n $article = $this->articleRepository->findWithoutFail($idArticle);\n foreach($article->imatges as $imatge) {\n $imatge->delete();\n }\n $this->articleRepository->delete($idArticle);\n }\n }\n\n Flash::success('Articles eliminats correctament.');\n\n return redirect(route('articles.index'));\n }", "public function destroySelected(Request $request)\n {\n foreach ($request->ids as $id) {\n // find that record\n $event = EventBackend::find($id);\n\n // delete english images or files\n\n // delete arabic images or files\n\n if (count($event->media) > 0) {\n $event->media()->delete(); // delete english & arabic youtube links\n }\n\n if (count($event->hashtags) > 0) {\n $event->hashtags()->detach(); // delete hashtags\n }\n\n if (count($event->categories) > 0) {\n $event->categories()->detach(); // delete categories\n }\n\n $event->delete(); // delete events\n }\n\n if (\\Lang::getLocale() == 'en') {\n Session::flash('success', 'Event deleted successfully!');\n } else {\n Session::flash('success', ' تم مسح الحدث بنجاح');\n }\n\n return response()->json(['success', 'event deleted!']);\n }", "public function destroy(Request $request)\n {\n foreach ($request->selected as $id) {\n //$getProduct = json_decode($product);\n //$the_product = Inventory::find($id);\n Inventory::Destroy($id);\n }\n return 'ok';\n \n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll(Request $request)\n {\n if($request->ajax()){\n\n $data = $request->json()->all();\n \n if(is_array($data)){\n \n foreach($data as $key){\n $record = Appointment::find($key);\n if(!is_null($record)){\n $record->delete();\n }\n }\n $msg = 'Delete ' . count($data) . ' success!';\n \n return $this->respondWithMessage($msg);\n }\n else{\n return $this->respondWithError(ApiCode::ERROR_REQUEST, 402);\n }\n }\n }", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "abstract public function deleteAll();", "public function deleteMultiple(Request $request)\n {\n $ids = explode(\",\", $request->ids);\n\n foreach ($ids as $key => $id) {\n $product = Product::with('categories', 'tags', 'attributes')->find($id);\n if (!empty($product)) {\n if (count($product->categories) > 0) {\n foreach ($product->categories as $category) {\n if ($category->total_products > 0) {\n $category->decrement('total_products');\n }\n }\n }\n if (count($product->tags) > 0) {\n foreach ($product->tags as $tag) {\n if ($tag->total_products > 0) {\n $tag->decrement('total_products');\n }\n }\n }\n\n $product->attributes()->detach();\n $product->categories()->detach();\n $this->removeThisCache($product->slug, $product->id);\n\n if ($product->delete() > 0) {\n// return response(1);\n }\n }\n// return response(0);\n }\n return response()->json(['success' => \"Products Multi Deleted successfully.\"]);\n\n }", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function removeBulk(Request $request)\n {\n $reviews_id_array = $request['id'];\n foreach ($reviews_id_array as $review_id)\n {\n $review = Review::find($review_id);\n $review->delete();\n }\n return response()->json('Data deleted successfully.');\n }", "public function destroy(Request $request)\n {\n $auth_id=Auth::id();\n if ($request->method=='delete') {\n foreach ($request->ids as $key => $id) {\n $post = Category::where('user_id',$auth_id)->findorFail($id);\n $post->delete();\n }\n }\n\n// return response()->json(['Coupon Deleted']);\n return response()->json([trans('success')]);\n }", "public function delete_all()\n {\n }", "public function multiple_delete(Request $request)\n {\n Category::destroy($request->ids);\n $response = ['model_type' => 'Category', 'ids' => $request->ids, 'action_type' => 'delete'];\n return json_encode($response);\n }", "public function destroyall(Request $request)\n {\n if(@$request->delete) {\n foreach ($request->delete as $key => $id) {\n\n $news = Newc::with(['comments'])->where('id', $id)->first();\n dd($news);\n if(@$news->media) {\n $media = $news->media;\n $media = str_replace('/storage/app/', '', $media);\n // Storage::delete($media);\n if(@$news->type == 0) {\n Storage::delete($media);\n }\n }\n if(@$news->comments) {\n foreach (@$news->comments as $key_cm => $value_cm) {\n DB::table('like_comments')->where('comment_id',$value_cm->id)->delete();\n }\n }\n CommentNew::where('new_id',$news->id)->delete();\n UserNew::where('new_id',$news->id)->delete();\n DB::table('like_news')->where('new_id',$news->id)->delete();\n Newc::destroy($id);\n viewNew::where('new_id',$id)->delete();\n }\n }\n \n return redirect(route('news.index').'?category_id='.@$request->category_id);\n }", "public function massDestroy(Request $request)\r\n {\r\n if (!Gate::allows('questions_option_delete')) {\r\n return abort(401);\r\n }\r\n if ($request->input('ids')) {\r\n $entries = QuestionsOption::whereIn('id', $request->input('ids'))->get();\r\n\r\n foreach ($entries as $entry) {\r\n $entry->delete();\r\n }\r\n }\r\n }", "public function destroyall(Request $request)\n {\n if(count(collect($request->checkbox)) > 1){\n $post = Post::whereIn('id',$request->get('checkbox'));\n $post->delete();\n }else{\n $post = post::find($request->get('checkbox'))->first();\n $post->delete();\n }\n return back();\n }", "public function deleteAll(): void;", "public function delete_selected_wop(Request $request)\n {\n $cart_ids = $request->input('cart_ids');\n\n $cart_ids = explode(',', $cart_ids);\n\n foreach ($cart_ids as $cid) {\n $cart = WechatCart::find($cid);\n if ($cart) {\n $wop = $cart->order_item;\n $cart->delete();\n $wop->delete();\n }\n }\n\n return response()->json(['status' => 'success']);\n }", "public function destroyMultiple(Request $request)\n { \n $post = $request->all();\n \n // $CommonController = new CommonController;\n // $access = $CommonController->checkFunctionPermission($this->permision,$this->className,$this->methodName);\n // if(empty($access)){ \n // Session::flash('error', 'You do not have permission to access this page!.'); \n // return Redirect::to('cms/dashboard');\n // }\n \n if(empty($post)){ \n Session::flash('error', trans('common.invalidToken')); \n return Redirect::to('cms/client_fm');\n \n }\n \n \n \n \n $deleted_at = date(\"Y-m-d H:i:s\");\n $data = array('status' => 'unPublish');\n \n DB::table('klant_fm')->whereIn('id_kl', $post['ids'])->update($data); \n Session::flash('success', trans('common.deletedSuccesfully'));\n \n return 1;\n\n }" ]
[ "0.64668536", "0.64318085", "0.63371104", "0.6322491", "0.6175007", "0.6056412", "0.6051604", "0.5943179", "0.59217644", "0.5913324", "0.588308", "0.58525723", "0.58445483", "0.58445483", "0.58445483", "0.5816122", "0.58077615", "0.58061975", "0.58027226", "0.5755917", "0.57257605", "0.57025135", "0.5689325", "0.5682183", "0.56731033", "0.56717604", "0.5666698", "0.5650779", "0.5650273", "0.5649205" ]
0.6976723
0
Available socials for social picker
function pearl_available_socials() { $socials = array( '' => esc_html__('Select Option...', 'pearl'), 'facebook' => esc_html__('Facebook', 'pearl'), 'twitter' => esc_html__('Twitter', 'pearl'), 'vk' => esc_html__('VK', 'pearl'), 'instagram' => esc_html__('Instagram', 'pearl'), 'behance' => esc_html__('Behance', 'pearl'), 'dribbble' => esc_html__('Dribbble', 'pearl'), 'flickr' => esc_html__('Flickr', 'pearl'), 'git' => esc_html__('Git', 'pearl'), 'linkedin' => esc_html__('Linkedin', 'pearl'), 'pinterest' => esc_html__('Pinterest', 'pearl'), 'medium' => esc_html__('Medium', 'pearl'), 'yahoo' => esc_html__('Yahoo', 'pearl'), 'delicious' => esc_html__('Delicious', 'pearl'), 'dropbox' => esc_html__('Dropbox', 'pearl'), 'odnoklassniki' => esc_html__('Odnoklassniki', 'pearl'), 'odnoklassniki_square' => esc_html__('Odnoklassniki square', 'pearl'), 'reddit' => esc_html__('Reddit', 'pearl'), 'soundcloud' => esc_html__('Soundcloud', 'pearl'), 'google' => esc_html__('Google', 'pearl'), 'google-plus' => esc_html__('Google +', 'pearl'), 'skype' => esc_html__('Skype', 'pearl'), 'youtube' => esc_html__('Youtube', 'pearl'), 'youtube-play' => esc_html__('Youtube Play', 'pearl'), 'tumblr' => esc_html__('Tumblr', 'pearl'), 'whatsapp' => esc_html__('Whatsapp', 'pearl') ); return apply_filters('pearl_available_socials', $socials); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ds_get_social_profiles() {\n\n // Return a filterable social profile.\n return apply_filters(\n 'ds_social_profiles',\n array()\n );\n \n}", "function wpsight_options_social() {\n\t\n\t\tif( ! current_theme_supports( 'options-social' ) )\n\t\t\treturn;\n\t\t\n\t\t/** Create options array */\n\t\t\t\n\t\t$options_social = array();\n\t\t\t\n\t\t$options_social['heading_social'] = array(\n\t\t\t'name' => __( 'Social', 'wpsight' ),\n\t\t\t'id' => 'heading_social',\n\t\t\t'type' => 'heading'\n\t\t);\n\t\t\n\t\t/** Loop through social icons for info */\n\t\t\n\t\t$social_icons = array();\n\t\tforeach( wpsight_social_icons() as $k => $v ) {\n\t\t\t$social_icons[$k] = '<img src=\"' . $v['icon'] . '\" alt=\"\" />';\n\t\t}\n\t\t\n\t\t$social_icons = implode( '&nbsp;&nbsp;', $social_icons );\n\t\t\n\t\t$options_social['icon_info'] = array( \n\t\t 'name' => __( 'Available Icons', 'wpsight' ),\n\t\t 'desc' => $social_icons,\n\t\t 'type' => 'info'\n\t\t);\n\t\t\n\t\t/** Loop through social icons for icons and links */\n\t\t\n\t\t$social_icons = array();\n\t\tforeach( wpsight_social_icons() as $k => $v ) {\n\t\t\t$social_icons[$k] = $v['name'];\n\t\t}\n\t\t\n\t\tarray_unshift( $social_icons, '' );\n\t\t\n\t\t$nr = apply_filters( 'wpsight_social_icons_nr', 5 );\n\t\t\n\t\tfor( $i = 1; $i <= $nr; $i++ ) {\n\t\t\n\t\t\t$std_icon = '';\n\t\t\t$std_link = '';\n\t\t\n\t\t\t/** Set first default to RSS */\t\n\t\t\t\n\t\t\tif( $i == 1 ) {\n\t\t\t\t$std_icon = 'rss';\n\t\t\t\t$std_link = get_bloginfo_rss( 'rss2_url' );\n\t\t\t}\n\t\t\n\t\t\t$options_social['icon_' . $i] = array( \n\t\t\t\t'name' \t => __( 'Social', 'wpsight' ) . ' #' . $i . ' ' . __( 'Icon', 'wpsight' ),\n\t\t\t\t'desc' \t => __( 'Please select an icon.', 'wpsight' ),\n\t\t\t\t'std' \t => $std_icon,\n\t\t\t\t'id' \t => 'icon_' . $i,\n\t\t\t\t'type' \t => 'select',\n\t\t\t\t'options' => $social_icons\n\t\t\t);\n\t\t\t\n\t\t\t$options_social['icon_' . $i . '_link'] = array( \n\t\t\t\t'name' => __( 'Social', 'wpsight' ) . ' #' . $i . ' ' . __( 'Link', 'wpsight' ),\n\t\t\t\t'desc' => __( 'Please enter the URL to your social account.', 'wpsight' ),\n\t\t\t\t'std' => $std_link,\n\t\t\t\t'id' => 'icon_' . $i . '_link',\n\t\t\t\t'type' => 'text'\n\t\t\t);\t\n\t\t\n\t\t}\n\t\t\t\t\n\t\treturn apply_filters( 'wpsight_options_social', $options_social );\n\t\t\n\t}", "private function fetch_social_profiles() {\n\t\t$profiles = [];\n\t\t$social_profiles = [\n\t\t\t'facebook_site',\n\t\t\t'instagram_url',\n\t\t\t'linkedin_url',\n\t\t\t'myspace_url',\n\t\t\t'youtube_url',\n\t\t\t'pinterest_url',\n\t\t\t'wikipedia_url',\n\t\t];\n\t\tforeach ( $social_profiles as $profile ) {\n\t\t\t$social_profile = $this->helpers->options->get( $profile, '' );\n\t\t\tif ( $social_profile !== '' ) {\n\t\t\t\t$profiles[] = \\urldecode( $social_profile );\n\t\t\t}\n\t\t}\n\n\t\t$twitter = $this->helpers->options->get( 'twitter_site', '' );\n\t\tif ( $twitter !== '' ) {\n\t\t\t$profiles[] = 'https://twitter.com/' . $twitter;\n\t\t}\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_organization_social_profiles' - Allows filtering social profiles for the\n\t\t * represented organization.\n\t\t *\n\t\t * @api string[] $profiles\n\t\t */\n\t\t$profiles = \\apply_filters( 'wpseo_schema_organization_social_profiles', $profiles );\n\n\t\treturn $profiles;\n\t}", "function tc_generates_socials() {\r\n $socials = apply_filters( 'tc_default_socials' , TC_init::$instance -> socials );\r\n\r\n //declares some loop's vars and the settings array\r\n $priority = 50;//start priority\r\n $incr = 0;\r\n $socials_setting_control = array();\r\n\r\n foreach ( $socials as $key => $data ) {\r\n $priority += $incr;\r\n $socials_setting_control['tc_theme_options[' . $key . ']'] = array(\r\n 'default' => ( isset($data['default']) && !is_null($data['default']) ) ? $data['default'] : null ,\r\n 'sanitize_callback' => array( $this , 'tc_sanitize_url' ),\r\n 'control' => 'TC_controls' ,\r\n 'label' => ( isset($data['option_label']) ) ? call_user_func( '__' , $data['option_label'] , 'customizr' ) : $key,\r\n 'section' => 'tc_social_settings' ,\r\n 'type' => 'url',\r\n 'priority' => $priority\r\n );\r\n $incr += 5;\r\n }\r\n\r\n return $socials_setting_control;\r\n }", "public function get_social_sites() {\n \treturn $this->social_sites;\n }", "public function choose_social_handler()\r\n {\r\n check_ajax_referer('cht_nonce_ajax', 'nonce_code');\r\n $slug = filter_input(INPUT_POST, 'social', FILTER_SANITIZE_STRING);\r\n\r\n if (!is_null($slug) && !empty($slug)) {\r\n foreach ($this->socials as $social) {\r\n if ($social['slug'] == $slug) {\r\n break;\r\n }\r\n }\r\n if (!$social) {\r\n return; // return if social media setting not found\r\n }\r\n\r\n $widget_index = filter_input(INPUT_POST, 'widget_index', FILTER_SANITIZE_STRING);\r\n\r\n $value = get_option('cht_social'.$widget_index.'_' . $slug); // get setting for media if already saved\r\n\r\n if (empty($value)) { // Initialize default values if not found\r\n $value = [\r\n 'value' => '',\r\n 'is_mobile' => 'checked',\r\n 'is_desktop' => 'checked',\r\n 'image_id' => '',\r\n 'title' => $social['title'],\r\n 'bg_color' => \"\",\r\n ];\r\n }\r\n if(!isset($value['bg_color']) || empty($value['bg_color'])) {\r\n $value['bg_color'] = $social['color']; // Initialize background color value if not exists. 2.1.0 change\r\n }\r\n if(!isset($value['image_id'])) {\r\n $value['image_id'] = ''; // Initialize custom image id if not exists. 2.1.0 change\r\n }\r\n if(!isset($value['title'])) {\r\n $value['title'] = $social['title']; // Initialize title if not exists. 2.1.0 change\r\n }\r\n if(!isset($value['fa_icon'])) {\r\n $value['fa_icon'] = \"\"; // Initialize title if not exists. 2.1.0 change\r\n }\r\n if(!isset($value['value'])) {\r\n $value['value'] = \"\"; // Initialize title if not exists. 2.1.0 change\r\n }\r\n $imageId = $value['image_id'];\r\n $imageUrl = \"\";\r\n $status = 0;\r\n if(!empty($imageId)) {\r\n $imageUrl = wp_get_attachment_image_src($imageId, \"full\")[0]; // get custom image URL if exists\r\n $status = 1;\r\n }\r\n if($imageUrl == \"\") {\r\n $imageUrl = plugin_dir_url(\"\").\"chaty/admin/assets/images/chaty-default.png\"; // Initialize with default image if custom image is not exists\r\n $status = 0;\r\n $imageId = \"\";\r\n }\r\n $color = \"\";\r\n if(!empty($value['bg_color'])) {\r\n $color = \"background-color: \".$value['bg_color']; // set background color of icon it it is exists\r\n }\r\n if($social['slug'] == \"Whatsapp\"){\r\n $val = $value['value'];\r\n $val = str_replace(\"+\",\"\", $val);\r\n $value['value'] = $val;\r\n } else if($social['slug'] == \"Facebook_Messenger\"){\r\n $val = $value['value'];\r\n $val = str_replace(\"facebook.com\",\"m.me\", $val); // Replace facebook.com with m.me version 2.0.1 change\r\n $val = str_replace(\"www.\",\"\", $val); // Replace www. with blank version 2.0.1 change\r\n $value['value'] = $val;\r\n\r\n $val = trim($val, \"/\");\r\n $val_array = explode(\"/\", $val);\r\n $total = count($val_array)-1;\r\n $last_value = $val_array[$total];\r\n $last_value = explode(\"-\", $last_value);\r\n $total_text = count($last_value)-1;\r\n $total_text = $last_value[$total_text];\r\n\r\n if(is_numeric($total_text)) {\r\n $val_array[$total] = $total_text;\r\n $value['value'] = implode(\"/\", $val_array);\r\n }\r\n }\r\n $value['value'] = esc_attr__(wp_unslash($value['value']));\r\n $value['title'] = esc_attr__(wp_unslash($value['title']));\r\n\r\n $svg_icon = $social['svg'];\r\n\r\n $help_title = \"\";\r\n $help_text = \"\";\r\n $help_link = \"\";\r\n\r\n if((isset($social['help']) && !empty($social['help'])) || isset($social['help_link'])) {\r\n $help_title = isset($social['help_title'])?$social['help_title']:\"Doesn't work?\";\r\n $help_text = isset($social['help'])?$social['help']:\"\";\r\n if(isset($social['help_link']) && !empty($social['help_link'])) {\r\n $help_link = $social['help_link'];\r\n }\r\n }\r\n\r\n $channel_type = \"\";\r\n $placeholder = $social['example'];\r\n if($social['slug'] == \"Link\" || $social['slug'] == \"Custom_Link\" || $social['slug'] == \"Custom_Link_3\" || $social['slug'] == \"Custom_Link_4\" || $social['slug'] == \"Custom_Link_5\") {\r\n if (isset($value['channel_type'])) {\r\n $channel_type = esc_attr__(wp_unslash($value['channel_type']));\r\n }\r\n\r\n if(!empty($channel_type)) {\r\n foreach($this->socials as $icon) {\r\n if($icon['slug'] == $channel_type) {\r\n $svg_icon = $icon['svg'];\r\n\r\n $placeholder = $icon['example'];\r\n\r\n if((isset($icon['help']) && !empty($icon['help'])) || isset($icon['help_link'])) {\r\n $help_title = isset($icon['help_title'])?$icon['help_title']:\"Doesn't work?\";\r\n $help_text = isset($icon['help'])?$icon['help']:\"\";\r\n if(isset($icon['help_link']) && !empty($icon['help_link'])) {\r\n $help_link = $icon['help_link'];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if(empty($channel_type)) {\r\n $channel_type = $social['slug'];\r\n }\r\n\t if($channel_type == \"Telegram\") {\r\n\t\t $value['value'] = trim($value['value'], \"@\");\r\n\t }\r\n ob_start();\r\n ?>\r\n <!-- Social media setting box: start -->\r\n <li data-id=\"<?php echo esc_attr($social['slug']) ?>\" class=\"chaty-channel\" data-channel=\"<?php echo esc_attr($channel_type) ?>\" id=\"chaty-social-<?php echo esc_attr($social['slug']) ?>\">\r\n <div class=\"channels-selected__item <?php esc_attr_e(($status)?\"img-active\":\"\") ?> <?php esc_attr_e(($this->is_pro()) ? 'pro' : 'free'); ?> 1 available\">\r\n <div class=\"chaty-default-settings\">\r\n <div class=\"move-icon\">\r\n <img src=\"<?php echo esc_url(plugin_dir_url(\"\").\"/chaty/admin/assets/images/move-icon.png\") ?>\">\r\n </div>\r\n <div class=\"icon icon-md active\" data-label=\"<?php esc_attr_e($social['title']); ?>\">\r\n <span style=\"\" class=\"custom-chaty-image custom-image-<?php echo esc_attr($social['slug']) ?>\" id=\"image_data_<?php echo esc_attr($social['slug']) ?>\">\r\n <img src=\"<?php echo esc_url($imageUrl) ?>\" />\r\n <span onclick=\"remove_chaty_image('<?php echo esc_attr($social['slug']) ?>')\" class=\"remove-icon-img\"></span>\r\n </span>\r\n <span class=\"default-chaty-icon <?php echo (isset($value['fa_icon'])&&!empty($value['fa_icon']))?\"has-fa-icon\":\"\" ?> custom-icon-<?php echo esc_attr($social['slug']) ?> default_image_<?php echo esc_attr($social['slug']) ?>\" >\r\n <svg width=\"39\" height=\"39\" viewBox=\"0 0 39 39\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <?php echo $svg_icon; ?>\r\n </svg>\r\n <span class=\"facustom-icon\" style=\"background-color: <?php echo esc_attr($value['bg_color']) ?>\"><i class=\"<?php echo esc_attr($value['fa_icon']) ?>\"></i></span>\r\n </span>\r\n </div>\r\n\r\n <?php if($social['slug'] != 'Contact_Us') { ?>\r\n <!-- Social Media input -->\r\n\t <?php if(($social['slug'] == \"Whatsapp\" || $channel_type == \"Whatsapp\") && !empty($value['value'])) {\r\n\t\t $value['value'] = trim($value['value'], \"+\");\r\n\t\t $value['value'] = \"+\".$value['value'];\r\n\t } ?>\r\n <div class=\"channels__input-box\">\r\n <input data-label=\"<?php echo esc_attr($social['title']) ?>\" placeholder=\"<?php esc_attr_e($placeholder); ?>\" type=\"text\" class=\"channels__input custom-channel-<?php echo esc_attr__($channel_type) ?> <?php echo isset($social['attr'])?$social['attr']:\"\" ?>\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[value]\" value=\"<?php esc_attr_e(wp_unslash($value['value'])); ?>\" data-gramm_editor=\"false\" id=\"channel_input_<?php echo esc_attr($social['slug']); ?>\" />\r\n </div>\r\n <?php } ?>\r\n <div class=\"channels__device-box\">\r\n <?php\r\n $slug = esc_attr__($this->del_space($social['slug']));\r\n $slug = str_replace(' ', '_', $slug);\r\n $is_desktop = isset($value['is_desktop']) && $value['is_desktop'] == \"checked\" ? \"checked\" : '';\r\n $is_mobile = isset($value['is_mobile']) && $value['is_mobile'] == \"checked\" ? \"checked\" : '';\r\n ?>\r\n <!-- setting for desktop -->\r\n <label class=\"channels__view\" for=\"<?php echo esc_attr($slug); ?>Desktop\">\r\n <input type=\"checkbox\" id=\"<?php echo esc_attr($slug); ?>Desktop\" class=\"channels__view-check js-chanel-icon js-chanel-desktop\" data-type=\"<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[is_desktop]\" value=\"checked\" data-gramm_editor=\"false\" <?php esc_attr_e($is_desktop) ?> />\r\n <span class=\"channels__view-txt\">Desktop</label>\r\n </label>\r\n\r\n <!-- setting for mobile -->\r\n <label class=\"channels__view\" for=\"<?php echo esc_attr($slug); ?>Mobile\">\r\n <input type=\"checkbox\" id=\"<?php echo esc_attr($slug); ?>Mobile\" class=\"channels__view-check js-chanel-icon js-chanel-mobile\" data-type=\"<?php echo str_replace(' ', '_', strtolower(esc_attr__($this->del_space($social['slug'])))); ?>\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[is_mobile]\" value=\"checked\" data-gramm_editor=\"false\" <?php esc_attr_e($is_mobile) ?> >\r\n <span class=\"channels__view-txt\">Mobile</span>\r\n </label>\r\n </div>\r\n\r\n <?php if($social['slug'] == 'Contact_Us') { ?>\r\n <div class=\"channels__input transparent\"></div>\r\n <?php } ?>\r\n\r\n <?php\r\n $close_class = \"active\";\r\n if($social['slug'] == 'Contact_Us') {\r\n $setting_status = get_option(\"chaty_contact_us_setting\");\r\n if($setting_status === false) {\r\n $close_class = \"\";\r\n }\r\n }\r\n ?>\r\n\r\n <!-- button for advance setting -->\r\n <div class=\"chaty-settings <?php echo esc_attr($close_class) ?>\" data-nonce=\"<?php echo wp_create_nonce($social['slug'].\"-settings\") ?>\" id=\"<?php echo esc_attr($social['slug']); ?>-close-btn\" onclick=\"toggle_chaty_setting('<?php echo esc_attr($social['slug']); ?>')\">\r\n <a href=\"javascript:;\"><span class=\"dashicons dashicons-admin-generic\"></span> Settings</a>\r\n </div>\r\n\r\n <?php if($social['slug'] != 'Contact_Us') { ?>\r\n\r\n <!-- example for social media -->\r\n <div class=\"input-example\">\r\n <?php esc_attr_e('For example', CHT_OPT); ?>:\r\n <span class=\"inline-box channel-example\">\r\n <?php if($social['slug'] == \"Poptin\") { ?>\r\n <br/>\r\n <?php } ?>\r\n <?php esc_attr_e($placeholder); ?>\r\n </span>\r\n </div>\r\n\r\n <!-- checking for extra help message for social media -->\r\n <div class=\"help-section\">\r\n <?php if((isset($social['help']) && !empty($social['help'])) || isset($social['help_link'])) { ?>\r\n <div class=\"viber-help\">\r\n <?php if(isset($help_link) && !empty($help_link)) { ?>\r\n <a class=\"help-link\" href=\"<?php echo esc_url($help_link) ?>\" target=\"_blank\"><?php esc_attr_e($help_title); ?></a>\r\n <?php } else if(isset($help_text) && !empty($help_text)) { ?>\r\n <span class=\"help-text\"><?php echo $help_text; ?></span>\r\n <span class=\"help-title\"><?php esc_attr_e($help_title); ?></span>\r\n <?php } ?>\r\n </div>\r\n <?php } ?>\r\n </div>\r\n <?php } ?>\r\n </div>\r\n\r\n <?php if($social['slug'] == \"Whatsapp\" || $social['slug'] == \"Link\" || $social['slug'] == \"Custom_Link\" || $social['slug'] == \"Custom_Link_3\" || $social['slug'] == \"Custom_Link_4\" || $social['slug'] == \"Custom_Link_5\") { ?>\r\n <div class=\"Whatsapp-settings advanced-settings extra-chaty-settings\">\r\n <?php $embedded_window = isset($value['embedded_window'])?$value['embedded_window']:\"no\"; ?>\r\n <div class=\"chaty-setting-col\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[embedded_window]\" value=\"no\" >\r\n <label class=\"chaty-switch chaty-embedded-window\" for=\"whatsapp_embedded_window_<?php echo esc_attr($social['slug']); ?>\">\r\n <input type=\"checkbox\" class=\"embedded_window-checkbox\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[embedded_window]\" id=\"whatsapp_embedded_window_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" <?php checked($embedded_window, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n WhatsApp Chat Popup &#128172;\r\n <div class=\"html-tooltip top\">\r\n <span class=\"dashicons dashicons-editor-help\"></span>\r\n <span class=\"tooltip-text top\">\r\n Show an embedded WhatsApp window to your visitors with a welcome message. Your users can start typing their own message and start a conversation with you right away once they are forwarded to the WhatsApp app.\r\n <img src=\"<?php echo esc_url(CHT_PLUGIN_URL) ?>/admin/assets/images/whatsapp-popup.gif\" />\r\n </span>\r\n </div>\r\n </label>\r\n </div>\r\n <!-- advance setting for Whatsapp -->\r\n <div class=\"whatsapp-welcome-message <?php echo ($embedded_window==\"yes\")?\"active\":\"\" ?>\">\r\n <div class=\"chaty-setting-col\">\r\n <label style=\"display: block; width: 100%\" for=\"cht_social_embedded_message_<?php echo esc_attr($social['slug']); ?>\">Welcome message</label>\r\n <div class=\"full-width\">\r\n <div class=\"full-width\">\r\n <?php $unique_id = uniqid(); ?>\r\n <?php $embedded_message = isset($value['embedded_message'])?$value['embedded_message']:esc_html__(\"How can I help you? :)\", \"chaty\"); ?>\r\n <textarea class=\"chaty-setting-textarea chaty-whatsapp-setting-textarea\" data-id=\"<?php echo esc_attr($unique_id) ?>\" id=\"cht_social_embedded_message_<?php echo esc_attr($unique_id) ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[embedded_message]\" ><?php echo $embedded_message ?></textarea>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"chaty-setting-col\">\r\n <?php $is_default_open = isset($value['is_default_open'])?$value['is_default_open']:\"\"; ?>\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[is_default_open]\" value=\"no\" >\r\n <label class=\"chaty-switch\" for=\"whatsapp_default_open_embedded_window_<?php echo esc_attr($social['slug']); ?>\">\r\n <input type=\"checkbox\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[is_default_open]\" id=\"whatsapp_default_open_embedded_window_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" <?php checked($is_default_open, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n Open the window on load\r\n <span class=\"icon label-tooltip\" data-label=\"Open the WhatsApp chat popup on page load, after the user sends a message or closes the window, the window will stay closed to avoid disruption\"><span class=\"dashicons dashicons-editor-help\"></span></span>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <?php } ?>\r\n\r\n <!-- advance setting fields: start -->\r\n <?php $class_name = !$this->is_pro()?\"not-is-pro\":\"\"; ?>\r\n <div class=\"chaty-advance-settings <?php esc_attr_e($class_name); ?>\" style=\"<?php echo (empty($close_class) && $social['slug'] == 'Contact_Us')?\"display:block\":\"\"; ?>\">\r\n <!-- Settings for custom icon and color -->\r\n <div class=\"chaty-setting-col\">\r\n <label>Icon Appearance</label>\r\n <div>\r\n <!-- input for custom color -->\r\n <input type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[bg_color]\" class=\"chaty-color-field\" value=\"<?php esc_attr_e($value['bg_color']) ?>\" />\r\n\r\n <!-- button to upload custom image -->\r\n <?php if($this->is_pro()) { ?>\r\n <a onclick=\"upload_chaty_image('<?php echo esc_attr($social['slug']); ?>')\" href=\"javascript:;\" class=\"upload-chaty-icon\"><span class=\"dashicons dashicons-upload\"></span> Custom Image</a>\r\n\r\n <!-- hidden input value for image -->\r\n <input id=\"cht_social_image_<?php echo esc_attr($social['slug']); ?>\" type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[image_id]\" value=\"<?php esc_attr_e($imageId) ?>\" />\r\n <?php } else { ?>\r\n <div class=\"pro-features upload-image\">\r\n <div class=\"pro-item\">\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\" class=\"upload-chaty-icon\"><span class=\"dashicons dashicons-upload\"></span> Custom Image</a>\r\n </div>\r\n <div class=\"pro-button\">\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\"><?php esc_attr_e('Upgrade to Pro', CHT_OPT);?></a>\r\n </div>\r\n </div>\r\n <?php } ?>\r\n </div>\r\n </div>\r\n <div class=\"clear clearfix\"></div>\r\n\r\n <?php if($social['slug'] == \"Link\" || $social['slug'] == \"Custom_Link\" || $social['slug'] == \"Custom_Link_3\" || $social['slug'] == \"Custom_Link_4\" || $social['slug'] == \"Custom_Link_5\") {\r\n $channel_type = \"\";\r\n if(isset($value['channel_type'])) {\r\n $channel_type = esc_attr__(wp_unslash($value['channel_type']));\r\n }\r\n $socials = $this->socials;\r\n ?>\r\n <div class=\"chaty-setting-col\">\r\n <label>Channel type</label>\r\n <div>\r\n <!-- input for custom title -->\r\n <select class=\"channel-select-input\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[channel_type]\" value=\"<?php esc_attr_e($value['channel_type']) ?>\">\r\n <option value=\"<?php echo esc_attr($social['slug']) ?>\">Custom channel</option>\r\n <?php foreach ($socials as $social_icon) {\r\n $selected = ($social_icon['slug'] == $channel_type)?\"selected\":\"\";\r\n if ($social_icon['slug'] != 'Custom_Link' && $social_icon['slug'] != 'Custom_Link_3' && $social_icon['slug'] != 'Custom_Link_4' && $social_icon['slug'] != 'Custom_Link_5' && $social_icon['slug'] != 'Contact_Us' && $social_icon['slug'] != 'Link') { ?>\r\n <option <?php echo esc_attr($selected) ?> value=\"<?php echo esc_attr($social_icon['slug']) ?>\"><?php echo esc_attr($social_icon['title']) ?></option>\r\n <?php }\r\n }?>\r\n </select>\r\n </div>\r\n </div>\r\n <div class=\"clear clearfix\"></div>\r\n <?php } ?>\r\n\r\n <div class=\"chaty-setting-col\">\r\n <label>On Hover Text</label>\r\n <div>\r\n <input type=\"text\" class=\"chaty-title\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[title]\" value=\"<?php esc_attr_e($value['title']) ?>\">\r\n </div>\r\n </div>\r\n <div class=\"clear clearfix\"></div>\r\n\r\n <div class=\"Contact_Us-settings advanced-settings\">\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Contact Form Title</label>\r\n <div>\r\n <?php $contact_form_title = isset($value['contact_form_title'])?$value['contact_form_title']:esc_html__(\"Contact Us\", \"chaty\"); ?>\r\n <input id=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[contact_form_title]\" value=\"<?php esc_attr_e($contact_form_title) ?>\" >\r\n </div>\r\n </div>\r\n <?php\r\n $fields = array(\r\n 'name' => array(\r\n 'title' => \"Name\",\r\n 'placeholder' => \"Enter your name\",\r\n 'is_required' => 1,\r\n 'type' => 'input',\r\n 'is_enabled' => 1\r\n ),\r\n 'email' => array(\r\n 'title' => \"Email\",\r\n 'placeholder' => \"Enter your email address\",\r\n 'is_required' => 1,\r\n 'type' => 'email',\r\n 'is_enabled' => 1\r\n ),\r\n 'phone' => array(\r\n\t 'title' => \"Phone\",\r\n\t 'placeholder' => \"Enter your phone number\",\r\n\t 'is_required' => 1,\r\n\t 'type' => 'input',\r\n\t 'is_enabled' => 1\r\n ),\r\n 'message' => array(\r\n 'title' => \"Message\",\r\n 'placeholder' => \"Enter your message\",\r\n 'is_required' => 1,\r\n 'type' => 'textarea',\r\n 'is_enabled' => 1\r\n )\r\n );\r\n echo '<div class=\"form-field-setting-col\">';\r\n foreach ($fields as $label => $field) {\r\n $saved_value = isset($value[$label])?$value[$label]:array();\r\n $field_value = array(\r\n 'is_active' => (isset($saved_value['is_active']))?$saved_value['is_active']:'yes',\r\n 'is_required' => (isset($saved_value['is_required']))?$saved_value['is_required']:'yes',\r\n 'placeholder' => (isset($saved_value['placeholder']))?$saved_value['placeholder']:$field['placeholder'],\r\n );\r\n ?>\r\n <div class=\"field-setting-col\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[<?php echo $label ?>][is_active]\" value=\"no\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[<?php echo $label ?>][is_required]\" value=\"no\">\r\n\r\n <div class=\"left-section\">\r\n <label class=\"chaty-switch chaty-switch-toggle\" for=\"field_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\">\r\n <input type=\"checkbox\" class=\"chaty-field-setting\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[<?php echo $label ?>][is_active]\" id=\"field_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\" value=\"yes\" <?php checked($field_value['is_active'], \"yes\") ?>>\r\n <div class=\"chaty-slider round\"></div>\r\n\r\n <?php echo $field['title'] ?>\r\n </label>\r\n </div>\r\n <div class=\"right-section\">\r\n <div class=\"field-settings <?php echo ($field_value['is_active']==\"yes\")?\"active\":\"\" ?>\">\r\n <div class=\"inline-block\">\r\n <label class=\"inline-block\" for=\"field_required_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\">Required?</label>\r\n <div class=\"inline-block\">\r\n <label class=\"chaty-switch\" for=\"field_required_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\">\r\n <input type=\"checkbox\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[<?php echo $label ?>][is_required]\" id=\"field_required_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\" value=\"yes\" <?php checked($field_value['is_required'], \"yes\") ?>>\r\n <div class=\"chaty-slider round\"></div>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"field-settings <?php echo ($field_value['is_active']==\"yes\")?\"active\":\"\" ?>\">\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"placeholder_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\">Placeholder text</label>\r\n <div>\r\n <input id=\"placeholder_for_<?php echo esc_attr($social['slug']); ?>_<?php echo $label ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[<?php echo $label ?>][placeholder]\" value=\"<?php esc_attr_e($field_value['placeholder']) ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <?php if($label != 'message') { ?>\r\n <div class=\"chaty-separator\"></div>\r\n <?php } ?>\r\n <?php }\r\n echo '</div>'; ?>\r\n <div class=\"form-field-setting-col\">\r\n <div class=\"form-field-title\">Submit Button</div>\r\n <div class=\"color-box\">\r\n <div class=\"clr-setting\">\r\n <?php $field_value = isset($value['button_text_color'])?$value['button_text_color']:\"#ffffff\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"button_text_color_for_<?php echo esc_attr($social['slug']); ?>\">Text color</label>\r\n <div>\r\n <input id=\"button_text_color_for_<?php echo esc_attr($social['slug']); ?>\" class=\"chaty-color-field button-color\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[button_text_color]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n <?php $field_value = isset($value['button_bg_color'])?$value['button_bg_color']:\"#A886CD\" ?>\r\n <div class=\"clr-setting\">\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"button_bg_color_for_<?php echo esc_attr($social['slug']); ?>\">Background color</label>\r\n <div>\r\n <input id=\"button_bg_color_for_<?php echo esc_attr($social['slug']); ?>\" class=\"chaty-color-field button-color\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[button_bg_color]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <?php $field_value = isset($value['button_text'])?$value['button_text']:\"Chat\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"button_text_for_<?php echo esc_attr($social['slug']); ?>\">Button text</label>\r\n <div>\r\n <input id=\"button_text_for_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[button_text]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n <?php $field_value = isset($value['thanks_message'])?$value['thanks_message']:\"Your message was sent successfully\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"thanks_message_for_<?php echo esc_attr($social['slug']); ?>\">Thank you message</label>\r\n <div>\r\n <input id=\"thanks_message_for_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[thanks_message]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n <div class=\"chaty-separator\"></div>\r\n <?php $field_value = isset($value['redirect_action'])?$value['redirect_action']:\"no\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]\" value=\"no\" >\r\n <label class=\"chaty-switch\" for=\"redirect_action_<?php echo esc_attr($social['slug']); ?>\">\r\n <input type=\"checkbox\" class=\"chaty-redirect-setting\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_action]\" id=\"redirect_action_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" <?php checked($field_value, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n Redirect visitors after submission\r\n </label>\r\n </div>\r\n <div class=\"redirect_action-settings <?php echo ($field_value == \"yes\")?\"active\":\"\" ?>\">\r\n <?php $field_value = isset($value['redirect_link'])?$value['redirect_link']:\"\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"redirect_link_for_<?php echo esc_attr($social['slug']); ?>\">Redirect link</label>\r\n <div>\r\n <input id=\"redirect_link_for_<?php echo esc_attr($social['slug']); ?>\" placeholder=\"<?php echo site_url(\"/\") ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[redirect_link]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n <?php $field_value = isset($value['link_in_new_tab'])?$value['link_in_new_tab']:\"no\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_in_new_tab]\" value=\"no\" >\r\n <label class=\"chaty-switch\" for=\"link_in_new_tab_<?php echo esc_attr($social['slug']); ?>\">\r\n <input type=\"checkbox\" class=\"chaty-field-setting\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_in_new_tab]\" id=\"link_in_new_tab_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" <?php checked($field_value, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n Open in a new tab\r\n </label>\r\n </div>\r\n </div>\r\n <div class=\"chaty-separator\"></div>\r\n <?php $field_value = isset($value['close_form_after'])?$value['close_form_after']:\"no\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after]\" value=\"no\" >\r\n <label class=\"chaty-switch\" for=\"close_form_after_<?php echo esc_attr($social['slug']); ?>\">\r\n <input type=\"checkbox\" class=\"chaty-close_form_after-setting\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after]\" id=\"close_form_after_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" <?php checked($field_value, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n Close form automatically after submission\r\n <span class=\"icon label-tooltip inline-message\" data-label=\"Close the form automatically after a few seconds based on your choice\"><span class=\"dashicons dashicons-editor-help\"></span></span>\r\n </label>\r\n </div>\r\n <div class=\"close_form_after-settings <?php echo ($field_value == \"yes\")?\"active\":\"\" ?>\">\r\n <?php $field_value = isset($value['close_form_after_seconds'])?$value['close_form_after_seconds']:\"3\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>\">Close after (Seconds)</label>\r\n <div>\r\n <input id=\"close_form_after_seconds_<?php echo esc_attr($social['slug']); ?>\" type=\"number\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[close_form_after_seconds]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-field-setting-col no-margin\">\r\n <input type=\"hidden\" value=\"no\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[send_leads_in_email]\" >\r\n <input type=\"hidden\" value=\"yes\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]\" >\r\n <?php $field_value = isset($val['save_leads_locally'])?$val['save_leads_locally']:\"yes\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"save_leads_locally_<?php echo esc_attr($social['slug']); ?>\" class=\"full-width chaty-switch\">\r\n <input type=\"checkbox\" disabled id=\"save_leads_locally_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[save_leads_locally]\" <?php checked($field_value, \"yes\") ?> >\r\n <div class=\"chaty-slider round\"></div>\r\n Save leads to the local database\r\n <div class=\"html-tooltip top no-position\">\r\n <span class=\"dashicons dashicons-editor-help\"></span>\r\n <span class=\"tooltip-text top\">Your leads will be saved in your local database, you'll be able to find them <a target=\"_blank\" href=\"<?php echo admin_url(\"admin.php?page=chaty-contact-form-feed\") ?>\">here</a></span>\r\n </div>\r\n </label>\r\n </div>\r\n <?php $field_value = isset($value['send_leads_in_email'])?$value['send_leads_in_email']:\"no\" ?>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"save_leads_to_email_<?php echo esc_attr($social['slug']); ?>\" class=\"email-setting full-width chaty-switch\">\r\n <input class=\"email-setting-field\" disabled type=\"checkbox\" id=\"save_leads_to_email_<?php echo esc_attr($social['slug']); ?>\" value=\"yes\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[send_leads_in_email]\" >\r\n <div class=\"chaty-slider round\"></div>\r\n Send leads to your email\r\n <span class=\"icon label-tooltip\" data-label=\"Get your leads by email, whenever you get a new email you'll get an email notification\"><span class=\"dashicons dashicons-editor-help\"></span></span>\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\">(<?php esc_attr_e('Upgrade to Pro', CHT_OPT);?>)</a>\r\n </label>\r\n </div>\r\n <div class=\"email-settings <?php echo ($field_value == \"yes\")?\"active\":\"\" ?>\">\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"email_for_<?php echo esc_attr($social['slug']); ?>\">Email address</label>\r\n <div>\r\n <?php $field_value = isset($value['email_address'])?$value['email_address']:\"\" ?>\r\n <input id=\"email_for_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[email_address]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"sender_name_for_<?php echo esc_attr($social['slug']); ?>\">Sender's name</label>\r\n <div>\r\n <?php $field_value = isset($value['sender_name'])?$value['sender_name']:\"\" ?>\r\n <input id=\"sender_name_for_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[sender_name]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n </div>\r\n </div>\r\n <div class=\"chaty-setting-col\">\r\n <label for=\"email_subject_for_<?php echo esc_attr($social['slug']); ?>\">Email subject</label>\r\n <div>\r\n <?php $field_value = isset($value['email_subject'])?$value['email_subject']:\"New lead from Chaty - {name} - {date} {hour}\" ?>\r\n <input id=\"email_subject_for_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[email_subject]\" value=\"<?php esc_attr_e($field_value); ?>\" >\r\n <div class=\"mail-merge-tags\"><span>{name}</span><span>{phone}</span><span>{email}</span><span>{date}</span><span>{hour}</span></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <?php if($this->is_pro()) { ?>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"Whatsapp-settings advanced-settings\">\r\n <!-- advance setting for Whatsapp -->\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Pre Set Message</label>\r\n <div>\r\n <?php $pre_set_message = isset($value['pre_set_message'])?$value['pre_set_message']:\"\"; ?>\r\n <input id=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[pre_set_message]\" value=\"<?php esc_attr_e($pre_set_message) ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Email-settings advanced-settings\">\r\n <!-- advance setting for Email -->\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Mail Subject <span class=\"icon label-tooltip inline-tooltip\" data-label=\"Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you\"><span class=\"dashicons dashicons-editor-help\"></span></span></label>\r\n <div>\r\n <?php $mail_subject = isset($value['mail_subject'])?$value['mail_subject']:\"\"; ?>\r\n <input id=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[mail_subject]\" value=\"<?php esc_attr_e($mail_subject) ?>\" >\r\n <span class=\"supported-tags\"><span class=\"icon label-tooltip support-tooltip\" data-label=\"{title} tag grabs the page title of the webpage\">{title}</span> and <span class=\"icon label-tooltip support-tooltip\" data-label=\"{url} tag grabs the URL of the page\">{url}</span> tags are supported</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"WeChat-settings advanced-settings\">\r\n <!-- advance setting for WeChat -->\r\n <?php\r\n $qr_code = isset($value['qr_code'])?$value['qr_code']:\"\"; // Initialize QR code value if not exists. 2.1.0 change\r\n $imageUrl = \"\";\r\n $status = 0;\r\n if($qr_code != \"\") {\r\n $imageUrl = wp_get_attachment_image_src($qr_code, \"full\")[0]; // get custom Image URL if exists\r\n }\r\n if($imageUrl == \"\") {\r\n $imageUrl = plugin_dir_url(\"\").\"chaty/admin/assets/images/chaty-default.png\"; // Initialize with default image URL if URL is not exists\r\n } else {\r\n $status = 1;\r\n }\r\n ?>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Upload QR Code</label>\r\n <div>\r\n <!-- Button to upload QR Code image -->\r\n <a class=\"cht-upload-image <?php esc_attr_e(($status)?\"active\":\"\") ?>\" id=\"upload_qr_code\" href=\"javascript:;\" onclick=\"upload_qr_code('<?php echo esc_attr($social['slug']); ?>')\">\r\n <img id=\"cht_social_image_src_<?php echo esc_attr($social['slug']); ?>\" src=\"<?php echo esc_url($imageUrl) ?>\" alt=\"<?php esc_attr_e($value['title']) ?>\">\r\n <span class=\"dashicons dashicons-upload\"></span>\r\n </a>\r\n\r\n <!-- Button to remove QR Code image -->\r\n <a href=\"javascript:;\" class=\"remove-qr-code remove-qr-code-<?php echo esc_attr($social['slug']); ?> <?php esc_attr_e(($status)?\"active\":\"\") ?>\" onclick=\"remove_qr_code('<?php echo esc_attr($social['slug']); ?>')\"><span class=\"dashicons dashicons-no-alt\"></span></a>\r\n\r\n <!-- input hidden field for QR Code -->\r\n <input id=\"upload_qr_code_val-<?php echo esc_attr($social['slug']); ?>\" type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[qr_code]\" value=\"<?php esc_attr_e($qr_code) ?>\" >\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Link-settings Custom_Link-settings Custom_Link_3-settings Custom_Link_4-settings Custom_Link_5-settings advanced-settings\">\r\n <?php $is_checked = (!isset($value['new_window']) || $value['new_window'] == 1)?1:0; ?>\r\n <!-- Advance setting for Custom Link -->\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label >Open In a New Tab</label>\r\n <div>\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]\" value=\"0\" >\r\n <label class=\"channels__view\" for=\"cht_social_window_<?php echo esc_attr($social['slug']); ?>\">\r\n <input id=\"cht_social_window_<?php echo esc_attr($social['slug']); ?>\" type=\"checkbox\" class=\"channels__view-check\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]\" value=\"1\" <?php checked($is_checked, 1) ?> >\r\n <span class=\"channels__view-txt\">&nbsp;</span>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Linkedin-settings advanced-settings\">\r\n <?php $is_checked = isset($value['link_type'])?$value['link_type']:\"personal\"; ?>\r\n <!-- Advance setting for Custom Link -->\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label >LinkedIn</label>\r\n <div>\r\n <label>\r\n <input type=\"radio\" <?php checked($is_checked, \"personal\") ?> name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]\" value=\"personal\">\r\n Personal\r\n </label>\r\n <label>\r\n <input type=\"radio\" <?php checked($is_checked, \"company\") ?> name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]\" value=\"company\">\r\n Company\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <?php } else { ?>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"Whatsapp-settings advanced-settings\">\r\n <?php $pre_set_message = isset($value['pre_set_message'])?$value['pre_set_message']:\"\"; ?>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Pre Set Message</label>\r\n <div>\r\n <div class=\"pro-features\">\r\n <div class=\"pro-item\">\r\n <div class=\"pre-message-whatsapp\">\r\n <input disabled id=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"\" value=\"<?php esc_attr_e($pre_set_message) ?>\" >\r\n <span class=\"supported-tags\"><span class=\"icon label-tooltip support-tooltip\" data-label=\"{title} tag grabs the page title of the webpage\">{title}</span> and <span class=\"icon label-tooltip support-tooltip\" data-label=\"{url} tag grabs the URL of the page\">{url}</span> tags are supported</span>\r\n <button data-button=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"button\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\"><path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\"></path><path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\"></path></svg></button>\r\n </div>\r\n </div>\r\n <div class=\"pro-button\">\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\"><?php esc_attr_e('Upgrade to Pro', CHT_OPT);?></a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Email-settings advanced-settings\">\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Mail Subject <span class=\"icon label-tooltip inline-tooltip\" data-label=\"Add your own pre-set message that's automatically added to the user's message. You can also use merge tags and add the URL or the title of the current visitor's page. E.g. you can add the current URL of a product to the message so you know which product the visitor is talking about when the visitor messages you\"><span class=\"dashicons dashicons-editor-help\"></span></span></label>\r\n <div>\r\n <div class=\"pro-features\">\r\n <div class=\"pro-item\">\r\n <input disabled id=\"cht_social_message_<?php echo esc_attr($social['slug']); ?>\" type=\"text\" name=\"\" value=\"\" >\r\n <span class=\"supported-tags\"><span class=\"icon label-tooltip support-tooltip\" data-label=\"{title} tag grabs the page title of the webpage\">{title}</span> and <span class=\"icon label-tooltip support-tooltip\" data-label=\"{url} tag grabs the URL of the page\">{url}</span> tags are supported</span>\r\n </div>\r\n <div class=\"pro-button\">\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\"><?php esc_attr_e('Upgrade to Pro', CHT_OPT);?></a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"WeChat-settings advanced-settings\">\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Upload QR Code</label>\r\n <div>\r\n <a target=\"_blank\" class=\"cht-upload-image-pro\" id=\"upload_qr_code\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\" >\r\n <span class=\"dashicons dashicons-upload\"></span>\r\n </a>\r\n <a target=\"_blank\" href=\"<?php echo esc_url($this->getUpgradeMenuItemUrl());?>\"><?php esc_attr_e('Upgrade to Pro', CHT_OPT);?></a>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Link-settings Custom_Link-settings Custom_Link_3-settings Custom_Link_4-settings Custom_Link_5-settings advanced-settings\">\r\n <?php $is_checked = 1; ?>\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label >Open In a New Tab</label>\r\n <div>\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]\" value=\"0\" >\r\n <label class=\"channels__view\" for=\"cht_social_window_<?php echo esc_attr($social['slug']); ?>\">\r\n <input id=\"cht_social_window_<?php echo esc_attr($social['slug']); ?>\" type=\"checkbox\" class=\"channels__view-check\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[new_window]\" value=\"1\" checked >\r\n <span class=\"channels__view-txt\">&nbsp;</span>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"Linkedin-settings advanced-settings\">\r\n <?php $is_checked = \"personal\"; ?>\r\n <!-- Advance setting for Custom Link -->\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label >LinkedIn</label>\r\n <div>\r\n <label>\r\n <input type=\"radio\" <?php checked($is_checked, \"personal\") ?> name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]\" value=\"personal\">\r\n Personal\r\n </label>\r\n <label>\r\n <input type=\"radio\" <?php checked($is_checked, \"company\") ?> name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[link_type]\" value=\"company\">\r\n Company\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n <?php } ?>\r\n\r\n\t <?php $use_whatsapp_web = isset($value['use_whatsapp_web'])?$value['use_whatsapp_web']:\"yes\"; ?>\r\n <div class=\"Whatsapp-settings advanced-settings\">\r\n <div class=\"clear clearfix\"></div>\r\n <div class=\"chaty-setting-col\">\r\n <label>Whatsapp Web</label>\r\n <input type=\"hidden\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]\" value=\"no\" />\r\n <div>\r\n <div class=\"checkbox\">\r\n <label for=\"cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web\" class=\"chaty-checkbox\">\r\n <input class=\"sr-only\" type=\"checkbox\" id=\"cht_social_<?php echo esc_attr($social['slug']); ?>_use_whatsapp_web\" name=\"cht_social_<?php echo esc_attr($social['slug']); ?>[use_whatsapp_web]\" value=\"yes\" <?php echo checked($use_whatsapp_web, \"yes\") ?> />\r\n <span></span>\r\n Use Whatsapp Web directly on desktop\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- advance setting fields: end -->\r\n\r\n\r\n <!-- remove social media setting button: start -->\r\n <button type=\"button\" class=\"btn-cancel\" data-social=\"<?php echo esc_attr($social['slug']); ?>\">\r\n <svg width=\"14\" height=\"13\" viewBox=\"0 0 14 13\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect width=\"15.6301\" height=\"2.24494\" rx=\"1.12247\" transform=\"translate(2.26764 0.0615997) rotate(45)\" fill=\"white\"/>\r\n <rect width=\"15.6301\" height=\"2.24494\" rx=\"1.12247\" transform=\"translate(13.3198 1.649) rotate(135)\" fill=\"white\"/>\r\n </svg>\r\n </button>\r\n <!-- remove social media setting button: end -->\r\n </div>\r\n </li>\r\n <!-- Social media setting box: end -->\r\n <?php\r\n $html = ob_get_clean();\r\n echo json_encode($html);\r\n }\r\n wp_die();\r\n }", "function tc_get_social_networks() {\r\n $__options = tc__f( '__options' );\r\n\r\n //gets the social network array\r\n $socials = apply_filters( 'tc_default_socials' , TC_init::$instance -> socials );\r\n\r\n //declares some vars\r\n $html = '';\r\n\r\n foreach ( $socials as $key => $data ) {\r\n if ( $__options[$key] != '' ) {\r\n //gets height and width from image, we check if getimagesize can be used first with the error control operator\r\n $width = $height = '';\r\n if ( isset($data['custom_icon_url']) && @getimagesize($data['custom_icon_url']) ) { list( $width, $height ) = getimagesize($data['custom_icon_url']); }\r\n\r\n //there is one exception : rss feed has no target _blank and special icon title\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\" %4$s %5$s>%6$s</a>',\r\n apply_filters( 'tc_social_link_class',\r\n sprintf('social-icon icon-%1$s' ,\r\n ( $key == 'tc_rss' ) ? 'feed' : str_replace('tc_', '', $key)\r\n ),\r\n $key\r\n ),\r\n esc_url( $__options[$key]),\r\n isset($data['link_title']) ? call_user_func( '__' , $data['link_title'] , 'customizr' ) : '' ,\r\n ( $key == 'tc_rss' ) ? '' : apply_filters( 'tc_socials_target', 'target=_blank', $key ),\r\n apply_filters( 'tc_additional_social_attributes', '' , $key),\r\n ( isset($data['custom_icon_url']) && !empty($data['custom_icon_url']) ) ? sprintf('<img src=\"%1$s\" width=\"%2$s\" height=\"%3$s\" alt=\"%4$s\"/>',\r\n $data['custom_icon_url'],\r\n $width,\r\n $height,\r\n isset($data['link_title']) ? call_user_func( '__' , $data['link_title'] , 'customizr' ) : ''\r\n ) : ''\r\n );\r\n }\r\n }\r\n return $html;\r\n }", "function fusion_element_social_links() {\n\t$social_options = array(\n\t\t'name' => esc_attr__( 'Social Links', 'fusion-builder' ),\n\t\t'shortcode' => 'fusion_social_links',\n\t\t'icon' => 'fusiona-link',\n\t\t'params' => array(\n\t\t\tarray(\n\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t'heading' => esc_attr__( 'Boxed Social Icons', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Choose to get a boxed icons. Choose default for theme option selection.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'icons_boxed',\n\t\t\t\t'value' => array(\n\t\t\t\t\tesc_attr__( 'Default', 'fusion-builder' ) => '',\n\t\t\t\t\tesc_attr__( 'Yes', 'fusion-builder' ) => 'yes',\n\t\t\t\t\tesc_attr__( 'No', 'fusion-builder' ) => 'no',\n\t\t\t\t),\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Social Icon Box Radius', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Choose the radius of the boxed icons. In pixels (px), ex: 1px, or \"round\". ', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'icons_boxed_radius',\n\t\t\t\t'value' => '',\n\t\t\t\t'dependency' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'element' => 'icons_boxed',\n\t\t\t\t\t\t'value' => 'no',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t'heading' => esc_attr__( 'Social Icons Color Type', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Choose to get a boxed icons. Choose default for theme option selection.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'color_type',\n\t\t\t\t'value' => array(\n\t\t\t\t\tesc_attr__( 'Default', 'fusion-builder' ) => '',\n\t\t\t\t\tesc_attr__( 'Custom Colors', 'fusion-builder' ) => 'custom',\n\t\t\t\t\tesc_attr__( 'Brand Colors', 'fusion-builder' ) => 'brand',\n\t\t\t\t),\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'heading' => esc_attr__( 'Social Icon Custom Colors', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Specify the color of social icons. ', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'icon_colors',\n\t\t\t\t'value' => '',\n\t\t\t\t'dependency' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'element' => 'color_type',\n\t\t\t\t\t\t'value' => 'brand',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'heading' => esc_attr__( 'Social Icon Custom Box Colors', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Specify the box color of social icons. ', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'box_colors',\n\t\t\t\t'value' => '',\n\t\t\t\t'dependency' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'element' => 'icons_boxed',\n\t\t\t\t\t\t'value' => 'no',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'element' => 'color_type',\n\t\t\t\t\t\t'value' => 'brand',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t'heading' => esc_attr__( 'Social Icon Tooltip Position', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Choose the display position for tooltips. Choose default for theme option selection.' ),\n\t\t\t\t'param_name' => 'tooltip_placement',\n\t\t\t\t'value' => array(\n\t\t\t\t\tesc_attr__( 'Default', 'fusion-builder' ) => '',\n\t\t\t\t\tesc_attr__( 'Top', 'fusion-builder' ) => 'top',\n\t\t\t\t\tesc_attr__( 'Bottom', 'fusion-builder' ) => 'bottom',\n\t\t\t\t\tesc_attr__( 'Left', 'fusion-builder' ) => 'left',\n\t\t\t\t\tesc_attr__( 'Right', 'fusion-builder' ) => 'Right',\n\t\t\t\t),\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Blogger Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Blogger link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'blogger',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Deviantart Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Deviantart link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'deviantart',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Digg Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Digg link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'digg',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Dribbble Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Dribbble link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'dribbble',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Dropbox Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Dropbox link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'dropbox',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Facebook Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Facebook link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'facebook',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Flickr Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Flickr link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'flickr',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Forrst Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Forrst link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'forrst',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Google+ Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Google+ link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'googleplus',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Instagram Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Instagram link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'instagram',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'LinkedIn Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom LinkedIn link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'linkedin',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Myspace Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Myspace link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'myspace',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'PayPal Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom PayPal link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'paypal',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Pinterest Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Pinterest link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'pinterest',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Reddit Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Reddit link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'reddit',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'RSS Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom RSS link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'rss',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Skype Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Skype link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'skype',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'SoundCloud Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom SoundCloud link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'soundcloud',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Spotify Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Spotify link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'spotify',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Tumblr Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Tumblr link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'tumblr',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Twitter Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Twitter link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'twitter',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Vimeo Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Vimeo link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'vimeo',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'VK Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom VK link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'vk',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Xing Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Xing link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'xing',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Yahoo Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Yahoo link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'yahoo',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Yelp Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Yelp link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'yelp',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Youtube Link', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom Youtube link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'youtube',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => esc_attr__( 'Email Address', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Insert an email address to display the email icon.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'email',\n\t\t\t\t'value' => '',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t'heading' => esc_attr__( 'Show Custom Social Icon', 'fusion-builder' ),\n\t\t\t\t'description' => esc_attr__( 'Show the custom social icon specified in Theme Options.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'show_custom',\n\t\t\t\t'value' => array(\n\t\t\t\t\tesc_attr__( 'Yes', 'fusion-builder' ) => 'yes',\n\t\t\t\t\tesc_attr__( 'No', 'fusion-builder' ) => 'no',\n\t\t\t\t),\n\t\t\t\t'default' => 'no',\n\t\t\t),\n\t\t),\n\t);\n\t$custom_social_networks = fusion_builder_get_custom_social_networks();\n\tif ( is_array( $custom_social_networks ) ) {\n\t\t$custom_networks = array();\n\t\tforeach ( $custom_social_networks as $key => $custom_network ) {\n\t\t\t$social_options['params'][] = array(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => sprintf( esc_attr__( 'Custom %s Link', 'fusion-builder' ), $key + 1 ),\n\t\t\t\t'description' => esc_attr__( 'Insert your custom social link.', 'fusion-builder' ),\n\t\t\t\t'param_name' => 'custom_' . $key,\n\t\t\t\t'value' => '',\n\t\t\t\t'dependency' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'element' => 'show_custom',\n\t\t\t\t\t\t'value' => 'yes',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\t$social_options['params'][] = array(\n\t\t'type' => 'radio_button_set',\n\t\t'heading' => esc_attr__( 'Alignment', 'fusion-builder' ),\n\t\t'description' => esc_attr__( \"Select the icon's alignment.\", 'fusion-builder' ),\n\t\t'param_name' => 'alignment',\n\t\t'value' => array(\n\t\t\tesc_attr__( 'Text Flow', 'fusion-builder' ) => '',\n\t\t\tesc_attr__( 'Left', 'fusion-builder' ) => 'left',\n\t\t\tesc_attr__( 'Center', 'fusion-builder' ) => 'center',\n\t\t\tesc_attr__( 'Right', 'fusion-builder' ) => 'right',\n\t\t),\n\t\t'default' => '',\n\t);\n\t$social_options['params'][] = array(\n\t\t'type' => 'checkbox_button_set',\n\t\t'heading' => esc_attr__( 'Element Visibility', 'fusion-builder' ),\n\t\t'param_name' => 'hide_on_mobile',\n\t\t'value' => fusion_builder_visibility_options( 'full' ),\n\t\t'default' => fusion_builder_default_visibility( 'array' ),\n\t\t'description' => esc_attr__( 'Choose to show or hide the element on small, medium or large screens. You can choose more than one at a time.', 'fusion-builder' ),\n\t);\n\t$social_options['params'][] = array(\n\t\t'type' => 'textfield',\n\t\t'heading' => esc_attr__( 'CSS Class', 'fusion-builder' ),\n\t\t'param_name' => 'class',\n\t\t'value' => '',\n\t\t'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ),\n\t);\n\t$social_options['params'][] = array(\n\t\t'type' => 'textfield',\n\t\t'heading' => esc_attr__( 'CSS ID', 'fusion-builder' ),\n\t\t'param_name' => 'id',\n\t\t'value' => '',\n\t\t'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ),\n\t);\n\tfusion_builder_map( $social_options );\n}", "public function getSocialUrls()\n {\n return $this->social_urls;\n }", "public function get_social_icon_list()\r\n {\r\n $social = get_option('cht_numb_slug'.$this->widget_number); // get saved social media list\r\n $social = explode(\",\", $social);\r\n\r\n $arr = array();\r\n foreach ($social as $key_soc):\r\n foreach ($this->socials as $key => $social) : // compare with Default Social media list\r\n if ($social['slug'] != $key_soc) {\r\n continue; // return if slug is not equal\r\n }\r\n $value = get_option('cht_social'.$this->widget_number.'_' . $social['slug']); // get saved settings for button\r\n if ($value) {\r\n $slug = strtolower($social['slug']);\r\n $channel_id = \"cht-channel-0\";\r\n $channel_id = trim($channel_id, \"_\");\r\n if (!empty($value['value']) || $slug == \"contact_us\") {\r\n $slug = strtolower($social['slug']);\r\n $url = \"\";\r\n $mobile_url = \"\";\r\n $desktop_target = \"\";\r\n $mobile_target = \"\";\r\n $qr_code_image = \"\";\r\n\r\n $channel_type = $slug;\r\n\r\n if(!isset($value['value'])) {\r\n $value['value'] = \"\";\r\n }\r\n\r\n $svg_icon = $social['svg'];\r\n if($slug == \"link\" || $slug == \"custom_link\" || $slug == \"custom_link_3\" || $slug == \"custom_link_4\" || $slug == \"custom_link_5\") {\r\n if(isset($value['channel_type']) && !empty($value['channel_type'])) {\r\n $channel_type = $value['channel_type'];\r\n\r\n foreach($this->socials as $icon) {\r\n if($icon['slug'] == $channel_type) {\r\n $svg_icon = $icon['svg'];\r\n }\r\n }\r\n }\r\n }\r\n\r\n $channel_type = strtolower($channel_type);\r\n\r\n if($channel_type == \"viber\") {\r\n /* Viber change to exclude + from number for desktop */\r\n $val = $value['value'];\r\n if(is_numeric($val)) {\r\n $fc = substr($val, 0, 1);\r\n if($fc == \"+\") {\r\n $length = -1*(strlen($val)-1);\r\n $val = substr($val, $length);\r\n }\r\n if(!wp_is_mobile()) {\r\n /* Viber change to include + from number for mobile */\r\n $val = \"+\".$val;\r\n }\r\n }\r\n } else if($channel_type == \"whatsapp\") {\r\n /* Whatspp change to exclude + from phone number */\r\n $val = $value['value'];\r\n $val = str_replace(\"+\",\"\", $val);\r\n $val = str_replace(\"-\",\"\", $val);\r\n $val = str_replace(\" \",\"\", $val);\r\n } else if($channel_type == \"facebook_messenger\") {\r\n /* Facebook change to change URL from facebook.com to m.me version 2.1.0 change */\r\n $val = $value['value'];\r\n $val = str_replace(\"facebook.com\",\"m.me\", $val); // Replace facebook.com with m.me version 2.0.1 change\r\n $val = str_replace(\"www.\",\"\", $val); // Replace www. with blank version 2.0.1 change\r\n $value['value'] = $val;\r\n\r\n $val = trim($val, \"/\");\r\n $val_array = explode(\"/\", $val);\r\n $total = count($val_array)-1;\r\n $last_value = $val_array[$total];\r\n $last_value = explode(\"-\", $last_value);\r\n $total_text = count($last_value)-1;\r\n $total_text = $last_value[$total_text];\r\n\r\n if(is_numeric($total_text)) {\r\n $val_array[$total] = $total_text;\r\n $val = implode(\"/\", $val_array);\r\n }\r\n } else {\r\n $val = $value['value'];\r\n }\r\n if(!isset($value['title'])) {\r\n $value['title'] = $social['title']; // Initialize title with default title if not exists. version 2.1.0 change\r\n }\r\n $image_url = \"\";\r\n\r\n /* get custom image URL if uploaded. version 2.1.0 change */\r\n if(isset($value['image_id']) && !empty($value['image_id'])) {\r\n $image_id = $value['image_id'];\r\n if(!empty($image_id)) {\r\n $image_data = wp_get_attachment_image_src($image_id, \"full\");\r\n if(!empty($image_data) && is_array($image_data)) {\r\n $image_url = $image_data[0];\r\n }\r\n }\r\n }\r\n\r\n $on_click_fn = \"\";\r\n $popup_html = \"\";\r\n $has_custom_popup = 0;\r\n $is_default_open = 0;\r\n /* get custom icon background color if exists. version 2.1.0 change */\r\n if(!isset($value['bg_color']) || empty($value['bg_color'])) {\r\n $value['bg_color'] = '';\r\n }\r\n if($channel_type == \"whatsapp\") {\r\n /* setting for Whatsapp URL */\r\n $val = str_replace(\"+\",\"\",$val);\r\n\t if(isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == \"no\") {\r\n\t\t $url = \"https://wa.me/\".$val;\r\n\t } else {\r\n\t\t $url = \"https://web.whatsapp.com/send?phone=\" . $val;\r\n\t }\r\n $mobile_url = \"https://wa.me/\".$val;\r\n // https://wa.me/$number?text=$test\r\n if(isset($value['pre_set_message']) && !empty($value['pre_set_message'])) {\r\n\t if(isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == \"no\") {\r\n\t\t $url .= \"?text=\".rawurlencode($value['pre_set_message']);\r\n\t } else {\r\n\t\t $url .= \"&text=\".rawurlencode($value['pre_set_message']);\r\n\t }\r\n $mobile_url .= \"?text=\".rawurlencode($value['pre_set_message']);\r\n }\r\n if(wp_is_mobile()) {\r\n $mobile_target = \"\";\r\n } else {\r\n $desktop_target = \"_blank\";\r\n }\r\n if(isset($value['embedded_window']) && $value['embedded_window'] == \"yes\") {\r\n $embedded_message = isset($value['embedded_message'])?$value['embedded_message']:\"\";\r\n $pre_set_message = isset($value['pre_set_message'])?$value['pre_set_message']:\"\";\r\n $is_default_open = (isset($value['is_default_open'])&&$value['is_default_open']==\"yes\")?1:0;\r\n $has_custom_popup = 1;\r\n $mobile_url = \"javascript:;\";\r\n $url = \"javascript:;\";\r\n $url = \"javascript:;\";\r\n $close_button = \"<div role='button' class='close-chaty-popup is-whatsapp-btn'><div class='chaty-close-button'></div></div>\";\r\n $popup_html = \"<div class='chaty-whatsapp-popup'>\";\r\n $popup_html .= \"<span class='default-value' style='display:none'>\".esc_attr($pre_set_message).\"</span>\";\r\n $popup_html .= \"<span class='default-msg-value' style='display:none'>\".esc_attr($embedded_message).\"</span>\";\r\n $popup_html .= \"<span class='default-msg-phone' style='display:none'>\".esc_attr($val).\"</span>\";\r\n $popup_html .= \"<div class='chaty-whatsapp-body'>\".$close_button.\"<div class='chaty-whatsapp-message'></div></div>\";\r\n $popup_html .= \"<div class='chaty-whatsapp-footer'>\";\r\n\t if(isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == \"no\") {\r\n\t\t $popup_html .= \"<form class='whatsapp-chaty-form' autocomplete='off' target='_blank' action='https://wa.me/\".$val.\"' method='get'>\";\r\n\t } else {\r\n\t\t $popup_html .= \"<form class='whatsapp-chaty-form' autocomplete='off' target='_blank' action='https://web.whatsapp.com/send' method='get'>\";\r\n\t }\r\n $popup_html .= \"<div class='chaty-whatsapp-field'><input autocomplete='off' class='chaty-whatsapp-msg' name='text' value='' /></div>\";\r\n $popup_html .= \"<input type='hidden' name='phone' class='chaty-whatsapp-phone' value='' />\";\r\n $popup_html .= \"<input type='hidden' class='is-default-open' value='\".esc_attr($is_default_open).\"' />\";\r\n $popup_html .= \"<input type='hidden' class='channel-id' value='\".esc_attr($channel_id).\"' />\";\r\n $popup_html .= \"<button type='submit' class='chaty-whatsapp-submit-btn'><svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'><path fill='#ffffff' d='M1.101 21.757L23.8 12.028 1.101 2.3l.011 7.912 13.623 1.816-13.623 1.817-.011 7.912z'></path></svg></button><div style='clear:both'></div>\";\r\n $popup_html .= \"</form>\";\r\n $popup_html .= \"</div>\";\r\n $popup_html .= \"</div>\";\r\n }\r\n } else if($channel_type == \"phone\") {\r\n /* setting for Phone */\r\n $url = \"tel:\".$val;\r\n } else if($channel_type == \"sms\") {\r\n /* setting for SMS */\r\n $url = \"sms:\".$val;\r\n } else if($channel_type == \"telegram\") {\r\n /* setting for Telegram */\r\n\t $val = ltrim($val, \"@\");\r\n $url = \"https://telegram.me/\".$val;\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"line\" || $channel_type == \"google_maps\" || $channel_type == \"poptin\" || $channel_type == \"waze\" ) {\r\n /* setting for Line, Google Map, Link, Poptin, Waze, Custom Link */\r\n $url = esc_url($val);\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"link\" || $channel_type == \"custom_link\" || $channel_type == \"custom_link_3\" || $channel_type == \"custom_link_4\" || $channel_type == \"custom_link_5\") {\r\n $is_exist = strpos($val, \"javascript\");\r\n $is_viber = strpos($val, \"viber\");\r\n if($is_viber !== false) {\r\n $url = $val;\r\n } else if($is_exist === false) {\r\n $url = esc_url($val);\r\n if($channel_type == \"custom_link\" || $channel_type == \"link\" || $channel_type == \"custom_link_3\" || $channel_type == \"custom_link_4\" || $channel_type == \"custom_link_5\") {\r\n $desktop_target = (isset($value['new_window']) && $value['new_window'] == 0)?\"\":\"_blank\";\r\n $mobile_target = (isset($value['new_window']) && $value['new_window'] == 0)?\"\":\"_blank\";\r\n }\r\n } else {\r\n $url = \"javascript:;\";\r\n $on_click_fn = str_replace('\"',\"'\",$val);\r\n }\r\n }else if($channel_type == \"wechat\") {\r\n /* setting for WeChat */\r\n $url = \"javascript:;\";\r\n if(!empty($value['title'])) {\r\n\t $value['title'] .= \": \".$val;\r\n } else {\r\n\t $value['title'] = $val;\r\n }\r\n $qr_code = isset($value['qr_code'])?$value['qr_code']:\"\";\r\n if(!empty($qr_code)) {\r\n $image_data = wp_get_attachment_image_src($qr_code, \"full\");\r\n if(!empty($image_data) && is_array($image_data)) {\r\n $qr_code_image = $image_data[0];\r\n }\r\n }\r\n } else if($channel_type == \"viber\") {\r\n /* setting for Viber */\r\n $url = $val;\r\n } else if($channel_type == \"snapchat\") {\r\n /* setting for SnapChat */\r\n $url = \"https://www.snapchat.com/add/\".$val;\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"waze\") {\r\n /* setting for Waze */\r\n $url = \"javascript:;\";\r\n $value['title'] .= \": \".$val;\r\n } else if($channel_type == \"vkontakte\") {\r\n /* setting for vkontakte */\r\n $url = \"https://vk.me/\".$val;\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"skype\") {\r\n /* setting for Skype */\r\n $url = \"skype:\".$val.\"?chat\";\r\n } else if($channel_type == \"email\") {\r\n /* setting for Email */\r\n $url = \"mailto:\".$val;\r\n $mail_subject = (isset($value['mail_subject']) && !empty($value['mail_subject']))?$value['mail_subject']:\"\";\r\n if($mail_subject != \"\") {\r\n $url .= \"?subject=\".urlencode($mail_subject);\r\n }\r\n } else if($channel_type == \"facebook_messenger\") {\r\n /* setting for facebook URL */\r\n $url = esc_url($val);\r\n $url = str_replace(\"http:\", \"https:\", $url);\r\n if(wp_is_mobile()) {\r\n $mobile_target = \"\";\r\n } else {\r\n $desktop_target = \"_blank\";\r\n }\r\n } else if($channel_type == \"twitter\") {\r\n /* setting for Twitter */\r\n $url = \"https://twitter.com/\".$val;\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"instagram\") {\r\n /* setting for Instagram */\r\n $url = \"https://www.instagram.com/\".$val;\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"linkedin\") {\r\n /* setting for Linkedin */\r\n $link_type = !isset($value['link_type']) || $value['link_type'] == \"company\"?\"company\":\"personal\";\r\n if($link_type == \"personal\") {\r\n $url = \"https://www.linkedin.com/in/\".$val;\r\n } else {\r\n $url = \"https://www.linkedin.com/company/\".$val;\r\n }\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"slack\") {\r\n /* setting for slack */\r\n $url = esc_url($val);\r\n $desktop_target = \"_blank\";\r\n $mobile_target = \"_blank\";\r\n } else if($channel_type == \"contact_us\") {\r\n $url = \"javascript:;\";\r\n $desktop_target = \"\";\r\n $mobile_target = \"\";\r\n $input_fields = \"\";\r\n if(isset($value['name']) || isset($value['email']) || isset($value['message'])) {\r\n $field_setting = $value['name'];\r\n if(isset($field_setting['is_active']) && $field_setting['is_active'] == \"yes\") {\r\n $is_required = (isset($field_setting['is_required']) && $field_setting['is_required'] == \"yes\")?\"is-required\":\"\";\r\n $placeholder = isset($field_setting['placeholder'])?$field_setting['placeholder']:\"Enter your name\";\r\n $input_fields .= \"<div class='chaty-input-area'>\";\r\n $input_fields .= \"<input autocomplete='off' class='chaty-input-field chaty-field-name {$is_required}' name='name' type='text' id='chaty-name' placeholder='{$placeholder}' />\";\r\n $input_fields .= \"</div>\";\r\n }\r\n $field_setting = $value['email'];\r\n if(isset($field_setting['is_active']) && $field_setting['is_active'] == \"yes\") {\r\n $is_required = (isset($field_setting['is_required']) && $field_setting['is_required'] == \"yes\")?\"is-required\":\"\";\r\n $placeholder = isset($field_setting['placeholder'])?$field_setting['placeholder']:\"Enter your email address\";\r\n $input_fields .= \"<div class='chaty-input-area'>\";\r\n $input_fields .= \"<input autocomplete='off' class='chaty-input-field chaty-field-email {$is_required}' name='email' type='email' id='chaty-name' placeholder='{$placeholder}' />\";\r\n $input_fields .= \"</div>\";\r\n }\r\n\t $field_setting = $value['phone'];\r\n\t if(isset($field_setting['is_active']) && $field_setting['is_active'] == \"yes\") {\r\n\t\t $is_required = (isset($field_setting['is_required']) && $field_setting['is_required'] == \"yes\")?\"is-required\":\"\";\r\n\t\t $placeholder = isset($field_setting['placeholder'])?$field_setting['placeholder']:\"Enter your phone number\";\r\n\t\t $input_fields .= \"<div class='chaty-input-area'>\";\r\n\t\t $input_fields .= \"<input autocomplete='off' class='chaty-input-field chaty-field-phone {$is_required}' name='name' type='text' id='chaty-phone' placeholder='{$placeholder}' />\";\r\n\t\t $input_fields .= \"</div>\";\r\n\t }\r\n $field_setting = $value['message'];\r\n if(isset($field_setting['is_active']) && $field_setting['is_active'] == \"yes\") {\r\n $is_required = (isset($field_setting['is_required']) && $field_setting['is_required'] == \"yes\")?\"is-required\":\"\";\r\n $placeholder = isset($field_setting['placeholder'])?$field_setting['placeholder']:\"Enter your message\";\r\n $input_fields .= \"<div class='chaty-input-area'>\";\r\n $input_fields .= \"<textarea autocomplete='off' class='chaty-input-field chaty-field-message {$is_required}' name='name' id='chaty-name' placeholder='{$placeholder}' ></textarea>\";\r\n $input_fields .= \"</div>\";\r\n }\r\n }\r\n if(!empty($input_fields)) {\r\n $has_custom_popup = 1;\r\n $button_text = isset($value['button_text']) && !empty($value['button_text'])?$value['button_text']:\"Submit\";\r\n $button_bg_color = isset($value['button_bg_color']) && !empty($value['button_bg_color'])?$value['button_bg_color']:\"#A886CD\";\r\n $button_text_color = isset($value['button_text_color']) && !empty($value['button_text_color'])?$value['button_text_color']:\"#ffffff\";\r\n $contact_form_title = isset($value['contact_form_title'])?$value['contact_form_title']:\"\";\r\n $popup_html = \"<div class='chaty-contact-form'>\";\r\n $popup_html .= \"<form action='#' method='post' class='chaty-contact-form-data' autocomplete='off'>\";\r\n $popup_html .= \"<div class='chaty-contact-header'>\".esc_attr($contact_form_title).\" <div role='button' class='close-chaty-popup'><div class='chaty-close-button'></div></div><div style='clear:both'></div></div>\";\r\n $popup_html .= \"<div class='chaty-contact-body'>\";\r\n $popup_html .= $input_fields;\r\n $popup_html .= \"<input type='hidden' class='chaty-field-widget' name='widget_id' value='' />\";\r\n $popup_html .= \"<input type='hidden' class='chaty-field-channel' name='channel' value='{$social['slug']}' />\";\r\n $nonce = wp_create_nonce(\"chaty-front-form\");\r\n $popup_html .= \"<input type='hidden' class='chaty-field-nonce' name='nonce' value='{$nonce}' />\";\r\n $popup_html .= \"</div>\";\r\n $popup_html .= \"<div class='chaty-contact-footer'>\";\r\n $popup_html .= \"<button style='color: {$button_text_color}; background: {$button_bg_color}' type='submit' class='chaty-contact-submit-btn' data-text='{$button_text}'>{$button_text}</div>\";\r\n $popup_html .= \"</div>\";\r\n $popup_html .= \"</form>\";\r\n $popup_html .= \"</div>\";\r\n }\r\n } else if($channel_type == \"tiktok\") {\r\n\t $val = $value['value'];\r\n\t $firstCharacter = substr($val, 0, 1);\r\n\t if($firstCharacter != \"@\") {\r\n\t\t $val = \"@\".$val;\r\n\t }\r\n\t $url = esc_url(\"https://www.tiktok.com/\".$val);\r\n\t $desktop_target = $mobile_target = \"_blank\";\r\n }\r\n\r\n /* Instagram checking for custom color */\r\n if($channel_type == \"instagram\" && $value['bg_color'] == \"#ffffff\") {\r\n $value['bg_color'] = \"\";\r\n }\r\n\r\n $svg = trim(preg_replace('/\\s\\s+/', '', $svg_icon));\r\n\r\n $is_mobile = isset($value['is_mobile']) ? 1 : 0;\r\n $is_desktop = isset($value['is_desktop']) ? 1 : 0;\r\n\r\n if(empty($mobile_url)) {\r\n $mobile_url = $url;\r\n }\r\n\r\n $svg_class = ($channel_type == \"contact_us\")?\"color-element\":\"\";\r\n\r\n $svg = '<svg class=\"ico_d '.$svg_class.'\" width=\"39\" height=\"39\" viewBox=\"0 0 39 39\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" style=\"transform: rotate(0deg);\">'.$svg.'</svg>';\r\n\r\n\t $rgb_color = $this->getRGBColor($value['bg_color']);\r\n $data = array(\r\n 'val' => esc_attr__(wp_unslash($val)),\r\n 'default_icon' => $svg,\r\n 'bg_color' => $value['bg_color'],\r\n 'rbg_color' => $rgb_color,\r\n 'title' => esc_attr__(wp_unslash($value['title'])),\r\n 'img_url' => esc_url($image_url),\r\n 'social_channel' => $slug,\r\n 'channel_type' => $channel_type,\r\n 'href_url' => $url,\r\n 'desktop_target' => $desktop_target,\r\n 'mobile_target' => $mobile_target,\r\n 'qr_code_image' => esc_url($qr_code_image),\r\n 'channel' => $social['slug'],\r\n 'is_mobile' => $is_mobile,\r\n 'is_desktop' => $is_desktop,\r\n 'mobile_url' => $mobile_url,\r\n 'on_click' => $on_click_fn,\r\n \"has_font\" => 0,\r\n \"popup_html\" => $popup_html,\r\n \"has_custom_popup\" => $has_custom_popup,\r\n \"is_default_open\" => $is_default_open\r\n );\r\n $arr[] = $data;\r\n }\r\n }\r\n endforeach;\r\n endforeach;\r\n return $arr;\r\n }", "public function SelectSocial(){\n\n $all_redes = ($this->ConfigModelo->select('select', 'red_social', '', '', '', ''));\n return $all_redes;\n\n\n }", "public function socials()\n {\n return $this->morphMany(config('hej.models.social'), 'model');\n }", "function publisher_social_share_option_list() {\n\n\t\t$sites = array(\n\t\t\t'facebook' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-facebook\"></i> ' . __( 'Facebook', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'facebook-messenger' => array(\n\t\t\t\t'label' => '<i class=\"fa bsfi-fb-messenger\"></i> ' . __( 'Facebook Messenger', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'twitter' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-twitter\"></i> ' . __( 'Twitter', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'google_plus' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-google-plus\"></i> ' . __( 'Google+', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'pinterest' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-pinterest\"></i> ' . __( 'Pinterest', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'reddit' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-reddit-alien\"></i> ' . __( 'ReddIt', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'linkedin' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-linkedin\"></i> ' . __( 'Linkedin', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'tumblr' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-tumblr\"></i> ' . __( 'Tumblr', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'telegram' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-send\"></i> ' . __( 'Telegram', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'whatsapp' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-whatsapp\"></i> ' . __( 'Whatsapp (Only Mobiles)', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'email' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-envelope\"></i> ' . publisher_translation_get( 'email' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'stumbleupon' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-stumbleupon\"></i> ' . __( 'StumbleUpon', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'vk' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-vk\"></i> ' . __( 'VK', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'digg' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-digg\"></i> ' . __( 'Digg', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'line' => array(\n\t\t\t\t'label' => '<i class=\"fa bsfi-line\"></i> ' . __( 'LINE (Only Mobiles)', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'bbm' => array(\n\t\t\t\t'label' => '<i class=\"fa bsfi-bbm\"></i> ' . __( 'BlackBerry (Only Mobiles)', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'viber' => array(\n\t\t\t\t'label' => '<i class=\"fa bsfi-viber\"></i> ' . __( 'Viber (Only Mobiles)', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'print' => array(\n\t\t\t\t'label' => '<i class=\"fa fa-print\"></i> ' . publisher_translation_get( 'print' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\t\t\t'ok-ru' => array(\n\t\t\t\t'label' => '<i class=\"fa bsfi-ok-ru\"></i> ' . __( 'OK.ru', 'publisher' ),\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t),\n\n\t\t);\n\n\t\tforeach ( publisher_get_option( 'social_share_custom_links' ) as $link ) {\n\n\t\t\tif ( empty( $link['title'] ) || empty( $link['link'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sites[ $link['title'] ] = array(\n\t\t\t\t'label' => bf_get_icon_tag( $link['icon'] ) . ' ' . $link['title'],\n\t\t\t\t'css-class' => 'active-item'\n\t\t\t);\n\t\t}\n\n\t\treturn $sites;\n\t}", "public function socials()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select(['prefix AS social', 'value AS url', 'is_primary'])\n ->where('type', 'social');\n }", "public static function get_sharing_providers($themeType, $loginRadiusSettings)\r\n {\r\n $searchOption = $themeType . 'SharingProvidersHidden';\r\n if (!empty($loginRadiusSettings[$searchOption])) {\r\n return str_replace(',', '\",\"', $loginRadiusSettings[$searchOption]);\r\n } else {\r\n return 'Facebook\",\"Twitter\",\"Pinterest\",\"Print\",\"Email';\r\n }\r\n }", "function nsh_social() {\n\n\t$social = nsh_get_social();\n\n\tif ( $social ) {\n\t\techo $social;\n\t}\n\n}", "function nsh_get_social() {\n\n\t$output = false;\n\n\t\t// Possible contact methods\n\t\t$methods = array(\n\n\t\t\t'twitter' => array(\n\t\t\t\t'field' => 'twitter',\n\t\t\t\t'name' => 'Twitter',\n\t\t\t\t'url_base' => 'https://www.twitter.com/'\n\t\t\t),\n\n\t\t\t'github' => array(\n\t\t\t\t'field' => 'github',\n\t\t\t\t'name' => 'GitHub'\n\t\t\t),\n\n\t\t\t'dribbble' => array(\n\t\t\t\t'field' => 'dribbble',\n\t\t\t\t'name' => 'Dribbble'\n\t\t\t),\n\n\t\t\t'soundcloud' => array(\n\t\t\t\t'field' => 'soundcloud',\n\t\t\t\t'name' => 'SoundCloud'\n\t\t\t),\n\n\t\t\t'email' => array(\n\t\t\t\t'field' => 'email',\n\t\t\t\t'name' => 'Email',\n\t\t\t\t'url_base' => 'mailto:'\n\t\t\t)\n\n\t\t);\n\n\t\t// Loop through 'em!\n\t\t// Track items so we only open a <ul> when we have field values\n\t\t$items = 0;\n\n\t\tforeach ( $methods as $method => $details ) {\n\n\t\t\t$value = get_field($details['field'], 'option');\n\n\t\t\tif ( $value ) {\n\n\t\t\t\t// If it's the first match, open a <ul>\n\t\t\t\tif ( $items === 0 ) {\n\t\t\t\t\t$output .= '<ul class=\"social\">';\n\t\t\t\t}\n\n\t\t\t\t// Set url from field, with base if it's set\n\t\t\t\t$url = isset($details['url_base']) ? $details['url_base'] . $value : $value;\n\n\t\t\t\t// Markup!\n\t\t\t\t$output .= '<li><a href=\"' . $url . '\" class=\"social__item social__item--' . $method . '\">' . $details['name'] . '</a></li>';\n\n\t\t\t\t$items++;\n\n\t\t\t} // if $value\n\n\t\t} // foreach\n\n\t\t// Close the <ul> if htere are items\n\t\tif ( $items ) {\n\t\t\t$output .= '</ul>';\n\t\t}\n\n\treturn $output;\n\n}", "public function social()\n {\n $id = 1; // make $id to always be one\n //Find social_setting by id in social_settings table and store it in \"$social_setting\" variable\n $social_setting = socialSetting::find($id);\n return view('admin/settings/social', [\n 'social_setting' => $social_setting,\n ]);\n }", "public function updateSocial ()\n {\n foreach ($this->user->social as $social_key => $social)\n {\n if($social->url !== $social->full_link)\n {\n if(strpos($social->full_link, $social->contain) === false) {\n $count = count(explode('://', $social->full_link));\n\n if($count > 1) {\n $social->full_link = $social->url;\n }else {\n $social->full_link = strtolower($social->url.$social->full_link);\n }\n }\n }\n }\n\n u()->update([\n 'social' => $this->user->social\n ]);\n\n return $this->message('Settings updated!', 'Social settings successfully updated.', true, $this->user);\n }", "function cosmetics_get_social_url() {\n\n global $cosmetics_options;\n $cosmetics_social_networks = cosmetics_get_social_network();\n\n foreach( $cosmetics_social_networks as $cosmetics_social ) :\n $cosmetics_social_url = $cosmetics_options['cosmetics_social_network_' . $cosmetics_social['id']];\n\n if( $cosmetics_social_url ) :\n?>\n\n <div class=\"social-network-item item-<?php echo esc_attr( $cosmetics_social['id'] ); ?>\">\n <a href=\"<?php echo esc_url( $cosmetics_social_url ); ?>\">\n <i class=\"fa fa-<?php echo esc_attr( $cosmetics_social['id'] ); ?>\" aria-hidden=\"true\"></i>\n </a>\n </div>\n\n\n<?php\n endif;\n\n endforeach;\n}", "public function show(Social $social)\n {\n //\n }", "public function show(Social $social)\n {\n //\n }", "function my_customizer_social_media_array() {\n\t$social_sites = array('twitter', 'facebook', 'google-plus', 'flickr', 'pinterest', 'youtube', 'tumblr', 'dribbble', 'rss', 'linkedin', 'instagram', 'email');\n\treturn $social_sites;\n}", "function fielding_acf_populate_social_icon( $field ) {\n\t$field['choices'] = array(\n\t\t'facebook' => 'Facebook',\n\t\t'twitter' => 'Twitter',\n\t\t'youtube' => 'YouTube',\n\t\t'googleplus' => 'Google+',\n\t\t'pinterest' => 'Pinterest',\n\t\t'flickr' => 'Flickr',\n\t\t'linkedin' => 'LinkedIn',\n\t\t'blog' => 'Blogs',\n\t);\n\n\treturn $field;\n}", "public function social()\n {\n $record = Social::first();\n return view('admin.pages.social', compact('record'));\n }", "public function get_social_registrations() {\n\t\tglobal $wpdb;\n\n\t\t$social_registration = array();\n\n\t\tforeach ( wc_social_login()->get_providers() as $provider ) {\n\n\t\t\t$linked_accounts = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM {$wpdb->usermeta} WHERE meta_key = %s\", '_wc_social_login_' . $provider->get_id() . '_identifier' ) );\n\n\t\t\tif ( $linked_accounts ) {\n\n\t\t\t\t$social_registration[ $provider->get_id() ] = array(\n\t\t\t\t\t'provider_title' => $provider->get_title(),\n\t\t\t\t\t'chart_color' => $provider->get_color(),\n\t\t\t\t\t'linked_accounts' => $linked_accounts,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $social_registration;\n\t}", "private function initializeSocialMedia()\n {\n $this->ch->addSection($this->slug . '_social_media', 'Social Media', 130);\n foreach ($this->social as $media => $label) {\n $this->ch->addControl(\"social_{$media}\", $this->slug . '_social_media', $label);\n }\n }", "function grve_portfolio_social_visibility() {\n\n\t$social_options = grve_option('portfolio_social');\n\tif ( !empty( $social_options ) ) {\n\t\tforeach ( $social_options as $key => $value ) {\n\t\t\tif ( $value ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n\n\n}", "function ds_register_default_social_profiles( $profiles ) {\n\n\t// add the facebook profile.\n\t$profiles['facebook'] = array(\n\t\t'id' => 'ds_facebook_url',\n\t\t'label' => __( 'Facebook URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'class' => 'facebook',\n\t\t'description' => __( 'Enter your Facebook profile URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'priority' => 10,\n\t\t'type' => 'text',\n\t\t'default' => '',\n\t\t'sanitize_callback' => 'sanitize_text_field',\n\t);\n\n\t// add the linkedin profile.\n\t$profiles['linkedin'] = array(\n\t\t'id' => 'ds_linkedin_url',\n\t\t'label' => __( 'LinkedIn URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'class' => 'linkedin',\n\t\t'description' => __( 'Enter your LinkedIn profile URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'priority' => 20,\n\t\t'type' => 'text',\n\t\t'default' => '',\n\t\t'sanitize_callback' => 'sanitize_text_field',\n\t);\n\n\t// add the twitter profile.\n\t$profiles['twitter'] = array(\n\t\t'id' => 'ds_twitter_url',\n\t\t'label' => __( 'Twitter URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'class' => 'twitter',\n\t\t'description' => __( 'Enter your Twitter profile URL', 'hd-extensible-social-profiles-widget' ),\n\t\t'priority' => 40,\n\t\t'type' => 'text',\n\t\t'default' => '',\n\t\t'sanitize_callback' => 'sanitize_text_field',\n\t);\n\n\t// return the modified profiles.\n\treturn $profiles;\n\n}", "function graphql_user_social_links_input( $fields ) {\n\t\n\t\t$fields['socialLinks'] = [\n\t\t\t'type' => new \\WPGraphQL\\Type\\WPInputObjectType([\n\t\t\t\t'name' => 'UserProfileSocialLinksInput',\n\t\t\t\t'fields' => [\n\t\t\t\t\t'twitter' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Twitter url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t\t'facebook' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Facebook url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t\t'instagram' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Instagram url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]),\n\t\t\t'description' => __( 'Social links for the user', 'your-textdomain' ),\n\t\t];\n\t\n\t\treturn $fields;\n\t\n\t}" ]
[ "0.6605316", "0.659257", "0.65631825", "0.65587336", "0.6498543", "0.6491676", "0.6476584", "0.64217055", "0.6402", "0.6362196", "0.6361725", "0.6333179", "0.63264555", "0.6314458", "0.6310492", "0.62749374", "0.6205243", "0.61970353", "0.6189213", "0.618046", "0.6143683", "0.6143683", "0.6104152", "0.60377204", "0.60258883", "0.6025355", "0.60203874", "0.5992974", "0.59664583", "0.595575" ]
0.7134292
0
/ ===================================================================================== adds general message to general_messages and all_messages
public function add_message($msg){ $this->general_messages[] = $msg; $msg_array = array( 'type' => 'general', 'class' => $this::GEN_MSG_CLASS, 'text' => $msg ); $this->all_messages[] = $msg_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "private function initMessage()\n {\n $this->_message['MSG_ERROR'] = Utils::getMessageError();\n $this->_message['MSG_ALERT'] = Utils::getMessageALert();\n }", "function addMessage( $message )\n {\n if ( isset($message['errorMessage']) )\n {\n $this->messages[] = array_merge($this->empty_message,$message);\n } else if ( isset($message[0]) && isset($message[0]['errorMessage']) ) {\n foreach ( $message as $m )\n {\n $this->messages[] = array_merge($this->empty_message,$m);\n }\n }\n }", "public function commonMessages() {\n return [];\n }", "function load_global_messages() {\n global $global_messages, $session, $webDir, $language_codes;\n // these may seem unused, but they are needed when including messages.inc.php\n global $siteName, $InstitutionUrl, $Institution;\n\n foreach ($session->native_language_names as $code => $name) {\n // include_messages\n include \"$webDir/lang/$code/common.inc.php\";\n $extra_messages = \"config/{$language_codes[$code]}.inc.php\";\n if (file_exists($extra_messages)) {\n include $extra_messages;\n } else {\n $extra_messages = false;\n }\n include \"$webDir/lang/$code/messages.inc.php\";\n if ($extra_messages) {\n include $extra_messages;\n }\n $global_messages['langCourseDescription'][$code] = $langCourseDescription;\n $global_messages['langCourseUnits'][$code] = $langCourseUnits;\n $global_messages['langGlossary'][$code] = $langGlossary;\n $global_messages['langEBook'][$code] = $langEBook;\n $global_messages['langVideo'][$code] = $langVideo;\n $global_messages['langDropBox'][$code] = $langDropBox;\n }\n}", "static function message($message)\n {\n global $template_vars;\n $template_vars['messages'][] = $message;\n }", "public function addMessage($message='',$type=self::MSG_SUCCESS,$field=''){\n $type = strtolower($type);\n if(is_object($message)){\n if(is_subclass_of($message, 'CModel')){\n if($message->hasErrors()){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n foreach($message->getErrors() as $key=>$error){\n $this->messages[$type][] = array('message'=>$error[0],'field'=>$key);\n }\n }\n }else if(is_subclass_of($message, 'Exception')){\n $type = self::MSG_ERROR;\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message->getMessage(),'field'=>$key);\n }\n }else if($message != ''){\n if(!is_array($this->messages[$type])){\n $this->messages[$type] = array();\n }\n $this->messages[$type][] = array('message'=>$message,'field'=>$field);\n }\n }", "private function _updateInternalMessage()\n {\n $from = trim($this->_generalSettings->getFrom());\n $from_name = trim($this->_generalSettings->getFromName());\n $reply_to = trim($this->_generalSettings->getReplyTo());\n $categories = explode(',', $this->_generalSettings->getCategories());\n $template = trim($this->_generalSettings->getTemplateID());\n $asm_group_id = trim($this->_generalSettings->getAsmGroupId());\n\n $xsmtpapi_header['category'] = [ 'magento2_sendgrid_plugin' ];\n foreach ($categories as $category) {\n $xsmtpapi_header['category'][] = trim($category);\n }\n\n if (! empty($template)) {\n $xsmtpapi_header['filters']['templates']['settings']['enable'] = 1;\n $xsmtpapi_header['filters']['templates']['settings']['template_id'] = $template;\n }\n\n // asm group id\n if ($asm_group_id != false and $asm_group_id != 0) {\n $xsmtpapi_header['asm_group_id'] = intval($asm_group_id);\n }\n\n if (! empty($from)) {\n $this->_message->setFrom($from);\n }\n\n if (! empty($from_name) and ! empty($from)) {\n $this->_message->setFrom($from, $from_name);\n }\n\n if (! empty($from_name) and empty($from)) {\n $initial_from = $this->_message->getFrom();\n $this->_message->setFrom($initial_from, $from_name);\n }\n\n if (! empty($reply_to)) {\n $this->_message->setReplyTo($reply_to);\n }\n }", "public function MyMessages(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/myMessage';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Messages',\n\t\t\t'londontec' => $this->setting_model->Get_All('londontec_users'),\n\t\t\t'student' => $this->setting_model->Get_All('students'),\n\t\t\t'message' => $this->setting_model->Get_All_DESCENDING('message','message_id'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function message()\n\t{\n\t\t$this->add('message', 'required', true, 'Message is required.');\n\t\t$this->add('message', 'regexp', '#^[a-zA-Z0-9\\s_\\- ,\\.!]*$#', 'Bad message format.');\n\t\t$this->add('message', 'max', 250, 'Bad message length, no more than 250 characters.');\n\n\t\t$this->setInformation('message', 'Message desciption, no specials characters, no accent, no more than 250 characters...');\n\t}", "public function display_admin_messages() {\n $key = isset($_REQUEST['cs_message']) ? stripslashes($_REQUEST['cs_message']) : false;\n\n if ( $key !== false ) {\n $msg = $this->get_message( $key );\n\n global $CSCore;\n $CSCore->admin_message( $msg['type'], $key, $msg['text'], $this->options_page_slug );\n }\n }", "function tn_add_static_message( $type, $message ) {\n\tTN_Messages::add_static_message( array( $type => $message ) );\n}", "protected function loadDefaultMessages()\n {\n $this->_messages = array(\n Viabill_Payment_Model_Gateway::COMMAND_CAPTURE => array(\n 400 => Mage::helper('viabill')\n ->__('Error when trying to capture the order - please contact ViaBill for more information.'),\n 403 => Mage::helper('viabill')\n ->__('Capture is not longer possible for this transaction - please contact ViaBill for more information.'), // @codingStandardsIgnoreLine\n 409 => Mage::helper('viabill')\n ->__('You are not allowed to make several capture attempts in a very short time - please try again in 15 minutes or contact ViaBill for more info.'), // @codingStandardsIgnoreLine\n 500 => Mage::helper('viabill')\n ->__('Error when trying to capture the transaction - please try again in 15 minutes.')\n ),\n Viabill_Payment_Model_Gateway::COMMAND_REFUND => array(\n 400 => Mage::helper('viabill')\n ->__('Error when trying to refund the transaction - please contact ViaBill for more information.'),\n 403 => Mage::helper('viabill')\n ->__('Refund is not possible at the moment - please contact ViaBill for more information.'),\n 500 => Mage::helper('viabill')\n ->__('Error when trying to refund the transaction - please try again in 15 minutes.')\n ),\n Viabill_Payment_Model_Gateway::COMMAND_CANCEL => array(\n 400 => Mage::helper('viabill')\n ->__('Error when trying to cancel the transaction - please contact ViaBill for more information.'),\n 500 => Mage::helper('viabill')\n ->__('It\\'s not possible to cancel the transaction - please try again in 15 minutes.')\n ),\n Viabill_Payment_Model_Gateway::COMMAND_RENEW => array(\n 400 => Mage::helper('viabill')\n ->__('It\\'s not possible to renew the order at the moment - please contact ViaBill for more information.'), // @codingStandardsIgnoreLine\n 403 => Mage::helper('viabill')\n ->__('Renew is no longer possible for this transaction.'),\n 500 => Mage::helper('viabill')\n ->__('Error when trying to renew the order - please try again in 15 minutes.')\n )\n );\n }", "public function add_message( $string, $error = false ) {\n\t\tif ( $error ) {\n\t\t\t$this->admin_error[] = (string) $string;\n\t\t} else {\n\t\t\t$this->admin_message[] = (string) $string;\n\t\t}\n\t}", "protected function defineMessages()\n {\n return [];\n }", "public static function register(): void\n {\n GlobalMessage::setMessages(self::$messages);\n }", "public function addMessage($message);", "public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }", "function tn_prepare_messages() {\n\n\t$_messages = TN_Messages::get_instance();\n\n\t$messages = $_messages->get_messages();\n\n\tif( $messages ) :\n\n\t\tadd_action( 'tn_messages', function() use ( $messages ) { \n\n\t\t\tforeach( $messages as $key => $message ) {\n\t\t\t\t// we add data-message - useful if element is eg cloned to pull it downscreen\n\t\t\t\tif( isset( $message['success'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message success\"><?php echo $message['success']; ?></div>\n\t\t\t\t<?php elseif ( isset( $message['error'] ) ) : ?>\n\t\t\t\t\t<div data-message=\"<?php echo ++$key; ?>\" class=\"tn_message error\"><?php echo $message['error']; ?></div>\t\n\t\t\t\t<?php endif; \n\t\t\t}\n\n\t\t});\n\n\tendif;\n}", "protected function initializeMessages()\n {\n $this->messages = array(\n \n );\n }", "public function add_message($field, $message) {\n\t\tif(isset($this->_field_data[$field]) AND (!isset($this->_field_data[$field]['error']) OR !$this->_field_data[$field]['error']) )\n\t\t\t\n\t\t\t$this->_field_data[$field]['error'] = $message;\n\t}", "function tn_add_message( $type, $message ) {\n\t$m = TN_Messages::get_instance();\n\t$m->add_message( array( $type => $message ) );\n}", "function pms_display_errors_form_general() {\r\n\r\n $form_error = pms_errors()->get_error_message( 'form_general' );\r\n\r\n if( empty( $form_error ) )\r\n return;\r\n\r\n echo '<div class=\"pms-form-errors-wrapper\">';\r\n echo '<p>' . $form_error . '</p>';\r\n echo '</div>';\r\n\r\n }", "public function add_message($message){\n $this->messages[] = $message;\n }", "public function add_message()\n {\n $result = $this->message->verify_message();\n if($result != NULL)\n {\n $this->session->set_flashdata('errors', $result);\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n else\n {\n $this->message->add_message($this->input->post(NULL, TRUE));\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n }", "function add_message($messages){\n global $messages;\n $messages[] = $messages;\n}", "function add($message) { return; }", "function add_message($message = 'Empty message') // here the 'Foo' from line 52 became $message variable inside function\n{\n\tglobal $messages;\n\t\n\t$messages[] = $message;\n}", "public function initMessages()\n {\n $this->messages = [\n 'alpha' => '{{name}} must only contain alphabetic characters.',\n 'alnum' => '{{name}} must only contain alpha numeric characters and dashes.',\n 'noWhitespace' => '{{name}} must not contain white spaces.',\n 'length' => '{{name}} must length between {{minValue}} and {{maxValue}}.',\n 'email' => 'Please make sure you typed a correct email address.'\n ];\n }", "function add_message($vMessage, $index = 0) {\n\t\tif ($this->get_multiple_values()) {\n\t\t\tif (!isset($this->messages[$index])) {\n\t\t\t\t$this->messages[$index] = Array();\n\t\t\t}\t\n\t\t\tarray_push($this->messages[$index], $vMessage);\n\t\t} else {\n\t\t\tarray_push($this->messages, $vMessage);\n\t\t}\n\t}" ]
[ "0.6433189", "0.6396209", "0.62156105", "0.61841345", "0.6155886", "0.6118709", "0.60685414", "0.6052367", "0.6034809", "0.60262454", "0.5998521", "0.5991226", "0.5979096", "0.5966284", "0.5903183", "0.58987707", "0.58952767", "0.5892049", "0.5888982", "0.58828545", "0.5872288", "0.58473414", "0.58299035", "0.58166003", "0.58122474", "0.5810053", "0.5795452", "0.57872355", "0.57818013", "0.5779358" ]
0.67283547
0
Returns a path for the thumbnail source
abstract public function get_thumbnail_source_path();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function thumbnailPath() {\n return $this->baseDir() . '/tn-' . $this->fileName();\n }", "public function getRootThumbnailPath()\n {\n return \"{$this->thumbnail}\";\n }", "public function getThumbnail() {\n\n if (file_exists($this->getUploadDir() . '/min_' . $this->path)){\n return $this->getUploadDir() . '/min_' . $this->path;\n }else{\n return $this->getWebPath();\n }\n }", "public function getThumbnailPath()\n {\n return $this->getThumbnailsFolder() . '/' . $this->getRootThumbnailPath();\n }", "public function getThumbnailUrl();", "function ThumbSRC()\n\t{\treturn $this->imagelocation . \"thumbs/\" . (int)$this->id . \".jpg\";\n\t}", "public function getThumbnail() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('thumbnail'));\n }", "public function getThumbnail()\n {\n if ($this->getThumbnailUrl() !== false) {\n $url = $this->getThumbnailUrl();\n } else {\n $url = Path::child('/img/no-thumb.jpg');\n }\n\n return $url;\n }", "public function get_thumb_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_thumb_name();\n\t}", "public function getThumbnailLocation() {\n\t\treturn Images::BLIZZARD_PATH . $this->thumbnail;\n\t}", "private function thumb()\n {\n $preview = array('png', 'jpg', 'gif', 'bmp');\n\n $publicBaseUrl = 'packages/spescina/mediabrowser/src/img/icons/';\n\n if ($this->folder)\n {\n if ($this->back)\n {\n $icon = 'back';\n }\n else\n {\n $icon = 'folder';\n }\n\n $url = $publicBaseUrl . $icon . '.png';\n }\n else\n {\n if (in_array($this->extension, $preview))\n {\n $url = $this->path;\n }\n else\n {\n $url = $publicBaseUrl . $this->extension . '.png';\n }\n }\n\n return $url;\n }", "public function resolveThumbnailUrl();", "private function getImageSourcePath()\r\n {\r\n // check if relative\r\n if(substr($this->_imagesource, 0, 2) == \"..\" || $this->_imagesource{0} == \".\")\r\n {\r\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $this->_imagesource;\r\n }\r\n else\r\n {\r\n return $this->_imagesource;\r\n }\r\n }", "function getThumbUrl () {\n return link::thumb($this->dir, $this->file);\n }", "public function getThumbPath()\n {\n $blockThumbsFolder = $this->theme->getFolder() . '/public/block-thumbs/';\n return $blockThumbsFolder . md5($this->blockSlug) . '/' . md5(file_get_contents($this->getViewFile())) . '.jpg';\n }", "public function thumb(){\n\treturn '/images/products/thumbs/'.$this->path;\n}", "public function GetThumbPath() {\n\t\t\t// calculate the web/docroot-relative path\n\t\t\t$strThumbPath = $this->GetThumbFolder() . '/thumb-' . $this->intId . '.' . ImageFileType::$ExtensionArray[$this->intImageFileTypeId];\n\n\t\t\t// See if the thumbnail image, itself exists\n\t\t\tif (file_exists(__DOCROOT__ . $strThumbPath))\n\t\t\t\treturn $strThumbPath;\n\n\t\t\t// It does NOT exist -- we need to create it first\n\t\t\tQApplication::MakeDirectory(__DOCROOT__ . $this->GetThumbFolder(), 0777);\n\n\t\t\t$objImageControl = new QImageControl(null);\n\t\t\t$objImageControl->ImagePath = $this->GetImagePath();\n\t\t\t$objImageControl->Width = 100;\n\t\t\t$objImageControl->Height = 100;\n\t\t\t$objImageControl->ScaleCanvasDown = false;\n\t\t\t$objImageControl->ScaleImageUp = true;\n\t\t\t$objImageControl->RenderImage(__DOCROOT__ . $strThumbPath);\n\n\t\t\treturn $strThumbPath;\n\t\t}", "private function getThumbFilepath() {\n\t\t$filename = $this->getThumbFilename();\n\t\t$filepath = $this->pathCache . $filename;\n\t\treturn($filepath);\n\t}", "public function getThumbnailUrlPath($path = \"\")\n {\n if ($path) {\n return url(env(\"ASSET_URL\", \"\") . \"/storage/$this->const_ModelName/thumbails/$path\");\n }\n return url(env(\"ASSET_URL\", \"\") . \"/storage/$this->const_ModelName/thumbails/$this->path\");\n }", "public function getThumbnailUrlPath($path = \"\")\n {\n if ($path) {\n return url(env(\"ASSET_URL\", \"\") . \"/storage/$this->const_ModelName/thumbails/$path\");\n }\n return url(env(\"ASSET_URL\", \"\") . \"/storage/$this->const_ModelName/thumbails/$this->path\");\n }", "public function APIGetThumbnailSrc($size='') {\n if(!empty($this->thumbnail)) {\n return URL::to('/').base64_decode($this->thumbnail);\n }\n }", "public function getThumbnailUrlAttribute()\n {\n return Storage::url($this->getThumbnailPath());\n }", "public function getThumbSrcAttribute()\n {\n return $this->present()->thumbSrc(null, 22, [], 'name');\n }", "public function getThumbUrlAttribute()\n {\n if (!$this->thumb_extension) return null;\n return asset($this->imageDirectory . '/' . $this->thumbFileName);\n }", "public function getSrcPath()\n {\n return $this->getSettingArray()[\"src_path\"];\n }", "public function getThumbnailAttribute()\n {\n /** @var Photo $thumbPhoto */\n try {\n $thumbPhoto = ($this->cover_id != null) ? Photo::find($this->cover_id) : $this->first_related_destination->avatar;\n\n return $thumbPhoto->src;\n } catch (\\Exception $e) {\n return Photo::samplePhotoUrl();\n }\n }", "public function get_thumbnail()\n {\n }", "public function getThumbnailResource() {\n\t\treturn $this->thumbnailResource;\n\t}", "public function getThumbnailUrl()\n\t{\n if ($about = $this->getAbout()) {\n \t$ci =& get_instance();\n $ci->load->config('dir');\n $upload_path = $ci->config->item('upload_dir');\n\n\t\t\t$path = $upload_path . 'media/thumbnails/' . $about->photo; \n\n if (!file_exists($path) || $about->photo == '') {\n $url = base_url().BASE_IMG . 'user-photo.jpg';\n } else {\n $url = site_url($path);\n }\n }\t\n\n return $url;\n\t}", "protected function get_thumbnail_path($path) {\n $relative_path = $this->getRelativePath($path);\n $thumbnail_path = $this->path_to_files . '/' . $this->config['images']['thumbnail']['dir'] . '/';\n\n if (is_dir($path)) {\n $thumbnail_fullpath = $thumbnail_path . $relative_path . '/';\n } else {\n $thumbnail_fullpath = $thumbnail_path . dirname($relative_path) . '/' . basename($path);\n }\n\n return $this->cleanPath($thumbnail_fullpath);\n }" ]
[ "0.80168724", "0.7964641", "0.7810865", "0.7748612", "0.7651174", "0.75961137", "0.75083584", "0.7369335", "0.7357117", "0.734409", "0.7317583", "0.7314274", "0.70809317", "0.7043076", "0.69830585", "0.6982412", "0.69629514", "0.6953417", "0.6908599", "0.6908599", "0.688267", "0.68826425", "0.6866813", "0.682436", "0.6760025", "0.67113316", "0.6690687", "0.66902506", "0.6678762", "0.6628427" ]
0.9238036
0
Return a file source's subfolder setting
public function source_subfolder() { $settings = $this->source()->settings(); return !empty($settings->subfolder) ? rtrim($settings->subfolder, '/').'/' : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getSubsetFile() {}", "public function getSrcPath()\n {\n return $this->getSettingArray()[\"src_path\"];\n }", "abstract public function subfolder($manipulation_name = '');", "function getRootLevelFolder() ;", "function greyhead_configuration_get_path_to_sites_directory($subpath = 'sites/') {\n return GREYHEAD_DRUPAL_ROOT . '/' . $subpath;\n }", "private static function GetPath(){\r\n\t return System:::IO:::Path::Combine(\r\n\t self::GetFolder(),\"settings.xml\");\r\n\t }", "public function getDirectoryVar();", "function getSubfolders() ;", "public function getConfigPath($sub = null)\n {\n return $this->getSubPath('config', $sub);\n }", "function get_parent_theme_file_path($file = '')\n {\n }", "public function getSubDir()\n\t{\n\t\treturn $this->sub_dir;\n\t}", "function getResourcePath (string $file, string $subfolder = ''): string {\n\tif ($subfolder === ''){\n\t\t$path = _ROOT_PATH.'resources/'.$file;\n\t}else {\n\t\t$path = _ROOT_PATH.'resources/'.$subfolder.'/'.$file;\n\t}\n\n\t$originalInfo = pathinfo($path);\n\tif(getConfig(\"IMAGES_USE_WEBP\") === \"true\" and in_array($originalInfo['extension'], ['jpg', 'jpeg', 'png'])){\n\t\t$webpFile = md5($path).'.webp';\n\t\t$webpPath = _ROOT_PATH.'resources/webp-convert/'.$webpFile;\n\t\tif(!is_file($webpPath)){\n\t\t\t$methodName = \"imagecreatefrom\".($originalInfo['extension'] === 'jpg' ? 'jpeg' : $originalInfo['extension']);\n\t\t\tif(function_exists($methodName)){\n\t\t\t\t$img = $methodName($path);\n\t\t\t\timagewebp($img, $webpPath, 100);\n\t\t\t}\n\t\t}\n\t\treturn $webpPath;\n\t}\n\treturn $path;\n}", "protected function getSubdirectory(): string\n {\n return empty($this->subdirectory) ?\n strtolower(array_reverse(explode('\\\\', \\get_class($this)))[1]) :\n $this->subdirectory;\n }", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "public function getFolder();", "public function getAssetFolder()\n {\n return $this->config()->asset_folder;\n }", "public function getAssetFolder()\n {\n return $this->config()->asset_folder;\n }", "public function getRootFolder() : string;", "public function getFolderPath(){}", "function getDefaultFolder() ;", "public function getFolder()\n {\n return $this->config['folder'] . '/' . basename($this->themeSlug);\n }", "function folder_covers(): string\n{\n $default = \\wp_upload_dir()['basedir'] . '/covers/';\n return getOption('folder_covers', $default);\n}", "function get_parent_theme_file_uri($file = '')\n {\n }", "protected function getSkinFolder() {\r\n\t\tif (isset($this->config['skins'][$this->templateSkin]['folder'])) {\r\n\t\t\treturn $this->config['skins'][$this->templateSkin]['folder'];\r\n\t\t} else {\r\n\t\t\tthrow new Exceptions\\Custom(\"no template folder in config: \" . $this->templateSkin);\t\r\n\t\t}\r\n\t}", "public function get_folder() {\n return $this->folder;\n }", "protected function _getSettingsFilename( )\n {\n return (sfConfig::get('sf_app_dir') . '/config/settings.yml');\n }", "function Event_Config_File()\n {\n return join(\"/\",array($this->Event_Config_Path,$this->Event_Config_File));\n }", "public function getProjectConfigurationFilePath() {\n // filesystem between the working directory and the working copy root.\n\n // We allow this because Subversion repositories are hierarchical and\n // may have a \"projects/xyz/\" directory which is meaningfully an entirely\n // different project from \"projects/abc/\".\n\n // You can checkout \"projects/\" and have the \".svn/\" directory appear\n // there, then change into \"abc/\" and expect \"arc\" to operate within the\n // context of the \"abc/\" project.\n\n $paths = Filesystem::walkToRoot($this->getWorkingDirectory());\n $root = $this->getPath();\n foreach ($paths as $path) {\n if (!Filesystem::isDescendant($path, $root)) {\n break;\n }\n\n $candidate = $path.'/.arcconfig';\n if (Filesystem::pathExists($candidate)) {\n return $candidate;\n }\n }\n\n return parent::getProjectConfigurationFilePath();\n }", "public static function folderPath(){\n\t\treturn DATA.static::$folderPrefix.'files/';\n\t}", "function getResourceURL (string $file, string $subfolder = ''): string {\n\tif ($subfolder === ''){\n\t\t$path = _ROOT_PATH.'resources/'.$file;\n\t\t$url = _URL.'resources/'.$file;\n\t}else {\n\t\t$path = _ROOT_PATH.'resources/'.$subfolder.'/'.$file;\n\t\t$url = _URL.'resources/'.$subfolder.'/'.$file;\n\t}\n\n\t$originalInfo = pathinfo($path);\n\tif(getConfig(\"IMAGES_USE_WEBP\") === \"true\" and in_array($originalInfo['extension'], ['jpg', 'jpeg', 'png'])){\n\t\t$webpFile = md5($path).'.webp';\n\t\t$webpPath = _ROOT_PATH.'resources/webp-convert/'.$webpFile;\n\t\t$webpUrl = _URL.'resources/webp-convert/'.$webpFile;\n\t\tif(!is_file($webpPath)){\n\t\t\t$methodName = \"imagecreatefrom\".($originalInfo['extension'] === 'jpg' ? 'jpeg' : $originalInfo['extension']);\n\t\t\tif(function_exists($methodName)){\n\t\t\t\t$img = $methodName($path);\n\t\t\t\timagewebp($img, $webpPath, 100);\n\t\t\t}\n\t\t}\n\t\treturn $webpUrl;\n\t}\n\n\treturn $url;\n}" ]
[ "0.6053696", "0.6021111", "0.5783398", "0.5782519", "0.5781409", "0.57484907", "0.57477015", "0.57281977", "0.5703876", "0.56885844", "0.5668091", "0.56541646", "0.55827457", "0.55719143", "0.556048", "0.55308264", "0.55308264", "0.5515675", "0.55105853", "0.55055624", "0.54414004", "0.54126525", "0.5407448", "0.54070646", "0.54016435", "0.5374792", "0.53747094", "0.53576297", "0.5353866", "0.53388953" ]
0.78863657
0
Check if the given offset points on a channel on the list.
public function offsetExists($offset) { return isset($this->channels[$offset]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetExists($offset)\r\n {\r\n return $offset < count($this->stack);\r\n }", "function offsetExists(/*. mixed .*/ $offset){}", "public function existsOffset($offset, $container = 'default');", "public function offsetExists($offset)\n {\n // init\n $length = $this->length();\n $offset = (int) $offset;\n\n if ($offset >= 0) {\n return ($length > $offset);\n }\n\n return ($length >= abs($offset));\n }", "public abstract function is_valid_offset($offset);", "public function offsetExists($offset)\n {\n return isset($this->bricks[$offset]);\n }", "public function offsetExists($offset)\n\t{\n\t\treturn ($offset>=0 && $offset<$this->getCount());\n\t}", "public function offsetExists($offset): bool;", "public function hasOffset(){\n return $this->_has(1);\n }", "public function offsetExists($offset) {\n\t\treturn isset($this->pile[$offset]);\n\t}", "public function offsetExists(mixed $offset): bool {\n return array_key_exists($offset, $this->items);\n }", "public function offsetExists($offset)\n\t{\n\t\treturn isset($this->list[$offset]);\n\t}", "public function offsetExists($offset)\n {\n return array_key_exists(call_user_func($this->mapFunction,$offset),$this->container);\n }", "public function offsetExists($offset);", "public function offsetExists($offset);", "public function offsetExists($offset): bool\n\t{\n\t\treturn $offset < count($this->items);\n\t}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists($offset) {}", "public function offsetExists(mixed $offset): bool\n {\n return Arr::accessible($this->value) && Arr::exists($this->value, $offset);\n }", "public function offsetExists($offset)\n {\n return array_key_exists($offset, $this->_items);\n }", "public function offsetExists($offset): bool\n {\n return \\array_key_exists($offset, $this->items);\n }", "public function offsetExists($offset)\n {\n }", "public function offsetExists($offset)\n {\n return array_key_exists($offset, $this->info);\n }", "public function offsetExists($offset) {\n\t\treturn array_key_exists($offset, $this->access_test_results);\n\t}", "function offsetExists($offset)\n {\n return isset($this->items[$offset]);\n }", "public function offsetExists($offset)\r\n {\r\n return array_key_exists($offset, $this->data);\r\n }" ]
[ "0.585918", "0.5857861", "0.58514875", "0.58511525", "0.58492327", "0.5768492", "0.5745769", "0.5740244", "0.5696496", "0.5682665", "0.5681669", "0.563551", "0.5624604", "0.5599344", "0.5599344", "0.55674565", "0.5557006", "0.5557006", "0.5557006", "0.5557006", "0.5557006", "0.5557006", "0.55560076", "0.5548645", "0.5547173", "0.55398", "0.5535931", "0.5531683", "0.55289054", "0.55200005" ]
0.7002666
0
Return a channel which is pointed by the given offset.
public function offsetGet($offset) { return $this->channels[$offset]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCardAt($offset)\n {\n return $this->get(self::CARD, $offset);\n }", "public function getCompAt($offset)\n {\n return $this->get(self::_COMP, $offset);\n }", "public function offsetSet($offset, $value)\n {\n $this->channels[$offset] = $value;\n }", "public function offset(?int $offset): self;", "public function getCardgroupAt($offset)\n {\n return $this->get(self::CARDGROUP, $offset);\n }", "public function offsetGet($offset)\n {\n return $this->bricks[$offset];\n }", "public static function offset($offset);", "public function offsetUnset($offset)\n {\n unset($this->channels[$offset]);\n }", "public function offsetExists($offset)\n {\n return isset($this->channels[$offset]);\n }", "public function getChannel();", "public function offset($offset);", "public function offsetGet($offset)\r\n {\r\n return $this->get($offset);\r\n }", "public function offsetGet($offset);", "public function offsetGet($offset);", "public function offsetGet($offset)\n {\n if (!parent::offsetExists($offset)) {\n $this[$offset] = new static(array(), $this->getFlags(), $this->getIteratorClass());\n }\n\n return parent::offsetGet($offset);\n }", "public function offsetGet($offset)\n {\n return $this->part($offset);\n }", "public function get($offset);", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function offsetGet($offset)\n {\n return $this->get($offset);\n }", "public function getAtOffset(Array $offset = []);", "public function offsetGet($offset){\n\t\treturn $this->get($offset);\n\t}", "public function offsetGet($offset) {}", "public function offsetGet($offset) {}" ]
[ "0.60765564", "0.59392464", "0.5581068", "0.54837036", "0.5440446", "0.5434856", "0.5373593", "0.5354716", "0.5350612", "0.53098166", "0.527101", "0.5256933", "0.52534866", "0.52534866", "0.5238843", "0.52118057", "0.5211611", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.5198176", "0.51956487", "0.51934123", "0.51559645", "0.51559645" ]
0.7559827
0
Set the given channel on a place which is pointed by the given offset.
public function offsetSet($offset, $value) { $this->channels[$offset] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function offsetSet($offset, $value);", "public function offsetSet($offset, $value);", "public function set($offset, $value);", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset, $value) {}", "public function offsetSet($offset,$item)\n\t{\n\t\t$this->$offset=$item;\n\t}", "public function offsetSet( $offset, $value ) {\n\t\t// ...\n\t}", "public function offsetSet($offset, $value) { }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value){\n\t\t$this->set($offset, $value);\n\t}", "public function offsetSet($offset, $value) \n {\n }", "public function offsetSet($offset, $value)\n {\n }", "public function offsetSet($offset, $part)\n {\n if ($offset === null) {\n $this->append($part);\n }\n\n $this->replace($offset, $part);\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }", "public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }" ]
[ "0.6253893", "0.6253893", "0.6130315", "0.61113524", "0.61110735", "0.61110735", "0.61110735", "0.6104435", "0.6098266", "0.60702926", "0.6010596", "0.5994113", "0.5990749", "0.596533", "0.5953963", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494", "0.59427494" ]
0.74692345
0
Remove a channel which is located in a place pointed by the given offset.
public function offsetUnset($offset) { unset($this->channels[$offset]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($offset = null);", "public function offsetUnset($offset) {\n $this->remove(array($offset));\n }", "public function offsetUnset($offset) {\n\t\tunset($this->pile[$offset]);\n\t}", "public function offsetUnset($offset);", "public function offsetUnset($offset);", "public function offsetUnset($offset)\r\n {\r\n return $this->remove($offset);\r\n }", "public function offsetUnset( $offset ) {\n\t\t// ...\n\t}", "public function offsetUnset($offset)\n {\n return $this->remove($offset);\n }", "public function offsetUnset($offset)\n {\n return $this->remove($offset);\n }", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset) {}", "public function offsetUnset($offset)\n {\n $this->remove($offset);\n }", "public function offsetUnset($offset)\n\t{\n\t\t$this->remove($offset);\n\t}", "public function offsetUnset($offset)\n\t{\n\t\t$this->remove($offset);\n\t}", "public function offsetUnset($offset)\n {\n }", "public function offsetUnset($offset)\n\t\t{\n\t\t\tunset($this->source[$offset]);\n\t\t}", "public function offsetUnset($offset)\n {\n unset($this->container[$offset]);\n }", "public function offsetUnset($offset) {\n\t\treturn $this->removeValueForKey($offset);\n\t}", "public function offsetUnset($offset)\n {\n $this->clear($offset);\n }", "public function offsetUnset($offset)\n {\n unset($this->bricks[$offset]);\n $this->bricks = array_values($this->bricks);\n }", "public function offsetUnset($offset): void;", "public function offsetUnset($offset)\n {\n unset($this->item[$offset]);\n }", "public function offsetUnset($offset) {\n return;\n }", "public function offsetUnset ($offset)\n {\n unset($this->elements[$offset]);\n }", "public function offsetUnset($offset)\n {\n $this->delete($offset);\n }", "public function offsetUnset($offset)\n {\n $this->delete($offset);\n }", "function offsetUnset(/*. mixed .*/ $offset)\n\t\t/*. throws BadMethodCallException .*/ {}" ]
[ "0.66976106", "0.6495227", "0.6467733", "0.644756", "0.644756", "0.6369198", "0.6325927", "0.6310538", "0.6310538", "0.6305948", "0.6305948", "0.6305948", "0.6305564", "0.6305564", "0.62679297", "0.6231092", "0.6231092", "0.61906564", "0.6171805", "0.6106003", "0.61041474", "0.61018723", "0.6084988", "0.6056625", "0.60262746", "0.6007976", "0.6001856", "0.6000277", "0.6000277", "0.5989762" ]
0.77622086
0
Return a number of all channels which are on the list.
public function count() { return count($this->channels); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsedChannels(): int\n {\n }", "public function count(): int\n {\n return count($this->channels);\n }", "public function getChannels()\n {\n $size = $this->getImageSize();\n\n return $size['channels'];\n }", "public function getMaxChannels(): int\n {\n }", "public function getCount ()\n {\n return count ( $this->_list ) ;\n }", "public function getAudioChannels() {}", "public function getNumberOfAudioChannels()\n {\n return $this->numberOfAudioChannels;\n }", "public function count()\n {\n $counts = array();\n foreach($this->lists as $list) {\n $counts[] = count($list);\n }\n return array_reduce($counts, function($a, $b) { return $a * $b; }, 1);\n }", "public function count() {\n return count($this->list);\n }", "public function getCachedChannelsCountAttribute(): int\n {\n return Cache::remember($this->cacheKey().':channels_count', 10, function () {\n return $this->channels->count();\n });\n }", "public function count()\n\t{\n\t\treturn count($this->list);\n\t}", "public function count()\n {\n return count($this->list);\n }", "public function count() {\n return count( $this->list );\n }", "public function get_channels()\n {\n }", "public function count() {\n return count($this->scale);\n }", "public function getNumberOfColors()\n\t{\n\t\treturn count($this->colors);\n\t}", "public function count()\n {\n $count = 0;\n foreach ($this->lists as $list) {\n $count += $list->count();\n }\n return $count;\n }", "public function getChannels();", "public function getGuildsCount()\n {\n return $this->count(self::_GUILDS);\n }", "public function getDpsListCount()\n {\n return $this->count(self::_DPS_LIST);\n }", "public function all(): array\n {\n return $this->channels;\n }", "public function count()\n {\n $this->setIteratorFilter(self::FLIST_NOCONTAINER | self::FLIST_UNSUB);\n return count(iterator_to_array($this));\n }", "public function getNumberOfComponents() {}", "public function getCountsList(){\n return $this->_get(6);\n }", "public function getChannels()\n {\n return $this->channels;\n }", "public function length()\n {\n return count($this->list);\n }", "public function channels()\n {\n return $this->send('channels');\n }", "public function getChannels(){\n\t\t//TODO: Change query\n\t\t$query = sprintf(\"SELECT idChannel FROM Channels limit 1\");\n\n\t\t$this->dbObj->Query($query);\n\n\t\tif ($this->dbObj->numErr) {\n\t\t\t$this->parent->SetError(5);\n\t\t}\n\n\t\t$out = NULL;\n\t\twhile (!$this->dbObj->EOF) {\n\t \t\t$out[] = $this->dbObj->GetValue(\"idChannel\");\n\t\t\t$this->dbObj->Next();\n\t\t}\n\n\t \treturn $out;\n\t}", "public function getRankListCount()\n {\n return $this->count(self::_RANK_LIST);\n }", "public final function getNumberOfColors(): int\n\t{\n\t\treturn $this->numberOfColors;\n\t}" ]
[ "0.75981665", "0.7465623", "0.7113431", "0.6555332", "0.6452089", "0.6349365", "0.6347884", "0.6333027", "0.6282302", "0.6238018", "0.6218401", "0.6185132", "0.6154089", "0.6092683", "0.6086054", "0.6020538", "0.60061646", "0.5983918", "0.59553427", "0.5950792", "0.59294116", "0.5919422", "0.591574", "0.5906965", "0.5903654", "0.5884899", "0.58801764", "0.5868239", "0.5849866", "0.5820519" ]
0.7719563
0
Set the pointer on a next channel on the list which is enabled.
public function next() { do { ++$this->pointer; } while ($this->valid() && !$this->current()->isEnabled()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function channelling(): void\n {\n self::$isChannel = true;\n }", "function setFirstNext($next){\r\n\t\t$this->first->next=$next;\r\n\t}", "public function setNext($next) {}", "public function next(): void\n {\n ++$this->pointer;\n }", "public function next()\n {\n $this->pointer++;\n }", "public function offsetSet($offset, $value)\n {\n $this->channels[$offset] = $value;\n }", "public function setNextBlock($nextBlock);", "public function next(): void\n {\n ++$this->position;\n }", "public function next(): void\n {\n ++$this->position;\n }", "public function next(): void\n {\n ++$this->position;\n }", "public function next(){\n $this->index ++;\n }", "public function next(): void\n {\n $this->_index++;\n }", "function enableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = true;\r\n }", "function next() {\n $this->position++;\n }", "public function next() {\n\t\t$this->position ++;\n\t}", "public function setChannel($value)\n {\n return $this->set(self::channel, $value);\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "private function next()\n {\n $this->m++;\n $this->init();\n }", "function switchChannel($ch)\n {\n exec( $this->arfilelocation['iwpriv'] . ' '\n . escapeshellarg($this->interface) . ' set Channel='.$ch);\n }", "public function next() {\n ++ $this->_position;\n }", "public function setNext($next)\n {\n $this->next = $next;\n\n return $this;\n }", "public function setNext($next)\n {\n $this->next = $next;\n\n return $this;\n }" ]
[ "0.5823512", "0.55107903", "0.5406688", "0.53351206", "0.5233461", "0.5130884", "0.5119582", "0.49412268", "0.49412268", "0.49412268", "0.49223244", "0.49136794", "0.48817408", "0.48640803", "0.48542747", "0.4819594", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48170766", "0.48099527", "0.48020682", "0.48012686", "0.4792896", "0.4792896" ]
0.56956714
1
Return an array of ids of channels which are on the list.
public function getChannelIds() { $ids = []; foreach ($this as $channel) { $channelId = $channel->getChannelId(); if (!empty($channelId)) { $ids[] = $channelId; } } return $ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChannels(){\n\t\t//TODO: Change query\n\t\t$query = sprintf(\"SELECT idChannel FROM Channels limit 1\");\n\n\t\t$this->dbObj->Query($query);\n\n\t\tif ($this->dbObj->numErr) {\n\t\t\t$this->parent->SetError(5);\n\t\t}\n\n\t\t$out = NULL;\n\t\twhile (!$this->dbObj->EOF) {\n\t \t\t$out[] = $this->dbObj->GetValue(\"idChannel\");\n\t\t\t$this->dbObj->Next();\n\t\t}\n\n\t \treturn $out;\n\t}", "public function channels(){\n return $this->channelCollection->map(function ($item, $key) {\n return ['channel' => $item['channel']];\n });\n }", "public function getTopChannelIds()\n {\n return Channel::whereNull('parent_channel')->active()->lists('id');\n }", "public function all(): array\n {\n return $this->channels;\n }", "public function getChannels();", "public function get_channel_ids($use_cache = TRUE)\r\n\t{\r\n\t\t//cache?\r\n\t\tif ($use_cache AND isset($this->cache['channel_ids']['full']))\r\n\t\t{\r\n\t\t\treturn $this->cache['channel_ids']['full'];\r\n\t\t}\r\n\r\n\t\t$query = $this->EE->db\r\n\t\t\t\t\t\t->select('preference_value')\r\n\t\t\t\t\t\t->where('preference_name', 'channel_ids')\r\n\t\t\t\t\t\t->get('user_preferences');\r\n\r\n\t\tif ($query->num_rows() == 0)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t$this->cache['channel_ids']['full'] = unserialize(\r\n\t\t\t$query->row('preference_value')\r\n\t\t);\r\n\r\n\t\treturn $this->cache['channel_ids']['full'];\r\n\t}", "public function getChannels()\n {\n return $this->channels;\n }", "public function getChannelNames()\n {\n $array = [];\n\n foreach ($this->channels as $channel) {\n $array[$channel->name] = $channel->name;\n }\n\n return $array;\n }", "public function getChannels()\n\t{\n\t\t$channels = App::make('ChannelRepository')->getChannels();\n\t\t\n\t\treturn App::make('Apiv1\\Transformers\\ChannelTransformer')->transformCollection($channels, $this->user);\n\t}", "private function listChannels()\n {\n $channels = Auth::guard()->user()->channels->load('users');\n foreach($channels as $channel){\n foreach($channel->users as $key => $user){\n if ($user->id == Auth::guard()->user()->id){\n unset($channel->users[$key]);\n }\n }\n }\n return $channels;\n }", "public function getIdsList() {\n return $this->_get(1);\n }", "public function getChannels()\n {\n return $this->Channels;\n }", "public function get_cat_ids()\n {\n $categories = $this->categories\n ->where('is_active', '=', 1)\n ->find_all();\n\n $ids = [];\n\n foreach ($categories as $category) {\n if ($category->loaded()) {\n $ids[] = $category->id;\n }\n }\n\n return $ids;\n }", "public function channels()\n {\n return $this->send('channels');\n }", "public function get_channels()\n {\n }", "public function getBubbleIds()\n {\n $organisations = $this->organisations->pluck('id')->toArray();\n $ids = [];\n\n /**\n * Get screen channels\n */\n $channels = ScreenChannel::where('screen_id', $this->id)\n ->with('channel')\n ->get();\n\n if (!$channels || !sizeof($channels)) {\n return $ids;\n }\n\n $channelWithoutFilters = $channels\n ->filter(function ($channel) {\n return !isset($channel->settings->filters) ||\n !is_array($channel->settings->filters) ||\n !sizeof($channel->settings->filters);\n })\n ->unique()\n ->values();\n $channelWithFilters = $channels\n ->filter(function ($channel) use ($channelWithoutFilters) {\n return !$channelWithoutFilters->contains($channel);\n })\n ->unique()\n ->values();\n\n /**\n * Get ids from channels without filters\n */\n if (sizeof($channelWithoutFilters)) {\n $byOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return $channel->bubblesAreByOrganisation();\n });\n $anyOrganisation = $channelWithoutFilters->filter(function ($channel) {\n return !$channel->bubblesAreByOrganisation();\n });\n $bubbleIds = new Collection();\n if (sizeof($byOrganisation)) {\n $byOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $byOrganisation->pluck('id')->toArray(),\n 'organisation_id' => $organisations,\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($byOrganisationBubblesIds);\n }\n if (sizeof($anyOrganisation)) {\n $anyOrganisationBubblesIds = Panneau::resource('bubbles')\n ->query([\n 'channel_id' => $anyOrganisation->pluck('id')->toArray(),\n ])\n ->lists('bubbles.id');\n $bubbleIds = $bubbleIds->merge($anyOrganisationBubblesIds);\n }\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n\n /**\n * Get ids from channels with filters\n */\n if (sizeof($channelWithFilters)) {\n foreach ($channelWithFilters as $channel) {\n $params = [\n 'channel_id' => $channel->channel_id,\n ];\n $filters = $channel->settings->filters;\n\n foreach ($filters as $filter) {\n if (isset($filter->value) && isset($filter->name) && !empty($filter->name)) {\n if (!isset($params['filter_' . $filter->name])) {\n $params['filter_' . $filter->name] = [];\n }\n if (is_array($filter->value)) {\n $notEmptyValues = array_where($filter->value, function ($key, $value) {\n return !empty($value);\n });\n if (sizeof($notEmptyValues)) {\n $params['filter_' . $filter->name] = array_unique(\n array_merge($params['filter_' . $filter->name], $notEmptyValues)\n );\n }\n } elseif (!empty($filter->value)) {\n $params['filter_' . $filter->name][] = $filter->value;\n }\n }\n }\n\n $notEmptyParams = array_where($params, function ($key, $value) {\n return !empty($value);\n });\n\n if ($channel->bubblesAreByOrganisation() && sizeof($organisations)) {\n $notEmptyParams['organisation_id'] = $organisations;\n }\n\n $bubbleIds = Panneau::resource('bubbles')\n ->query($notEmptyParams)\n ->lists('bubbles.id');\n foreach ($bubbleIds as $id) {\n $ids[] = $id;\n }\n }\n }\n\n /**\n * Get ids from playlists\n */\n $screenId = $this->id;\n $playlists = Playlist::whereHas('screens', function ($query) use ($screenId) {\n $query->where('screens.id', $screenId);\n })\n /*->join(\n 'screens_playlists_pivot',\n 'screens_playlists_pivot.playlist_id',\n '=',\n 'playlists.id'\n )\n ->where('screens_playlists_pivot.screen_id', $this->id)*/\n ->get();\n foreach ($playlists as $playlist) {\n $timeline = $playlist->getTimeline();\n foreach ($timeline->bubbleIds as $bubbleId) {\n $ids[] = $bubbleId;\n }\n }\n\n $ids = array_unique($ids);\n sort($ids);\n\n return $ids;\n }", "public static function getChannels() {\n\t\t$channels = [];\n\t\ttry {\n\t\t\t$mapper = new ObjectMapper();\n\t\t\t$response = self::getResponse();\n\t\t\t$data = json_decode( $response, true );\n\t\t\tif ( count( $data['Channels'] ) > 0 ) {\n\t\t\t\tforeach ( $data['Channels'] as $dataProject ) {\n $channels[] = $mapper->mapJson( json_encode( $dataProject ), Channel::class );\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\treturn $channels;\n\t}", "public function getChannels()\n {\n $size = $this->getImageSize();\n\n return $size['channels'];\n }", "public function getCategoryIds()\n {\n if (! $this->hasData('category_ids')) {\n $wasLocked = false;\n if ($this->isLockedAttribute('category_ids')) {\n $wasLocked = true;\n $this->unlockAttribute('category_ids');\n }\n $ids = $this->_getResource()->getCategoryIds($this);\n $this->setData('category_ids', $ids);\n if ($wasLocked) {\n $this->lockAttribute('category_ids');\n }\n }\n\n return (array) $this->_getData('category_ids');\n }", "public function getAllChannels()\n {\n return Channel::with('subChannel.display')->active()->alive()->get()->toArray();\n }", "public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}", "private function getChannels()\r\n {\r\n static $channels;\r\n\r\n if (empty($channels)) {\r\n // Store the cache forever.\r\n $cache_key = 'categoryFirst';\r\n $channels = \\SCache::sear($cache_key, function () {\r\n $categories = $this->all();\r\n $channels = [];\r\n foreach ($categories as $category) {\r\n if ($category['bclassid'] == 0) {\r\n $channels[] = $category;\r\n }\r\n }\r\n return $channels;\r\n });\r\n }\r\n\r\n return $channels;\r\n }", "public function getIds();", "public function getIds();", "public function getAllChannels()\n {\n return $this->_channel;\n }", "function &getChannels() {\n\t\tif($this->_channels === null) {\n\t\t\tglobal $db,$pun_user;\n\t\t\t\n\t\t\t$this->_channels = array();\n\t\t\t\n\t\t\t// Get valid PunBB forums:\n\t\t\t$sql = 'SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tforum_name\n\t\t\t\t\tFROM\n\t\t\t\t\t\t'.$db->prefix.'forums AS f\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t'.$db->prefix.'forum_perms AS fp\n\t\t\t\t\tON\n\t\t\t\t\t\t(fp.forum_id=f.id AND fp.group_id=\\''.$db->escape($pun_user['g_id']).'\\')\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t(fp.read_forum IS NULL OR fp.read_forum=1);';\n\t\t\t$result = $db->query($sql);\n\n\t\t\t$defaultChannelFound = false;\n\n\t\t\twhile ($row = $db->fetch_assoc($result)) {\n\t\t\t\t// Check if we have to limit the available channels:\n\t\t\t\tif($this->getConfig('limitChannelList') && !in_array($row['id'], $this->getConfig('limitChannelList'))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$forumName = $this->trimChannelName($row['forum_name']);\n\t\t\t\t\n\t\t\t\t$this->_channels[$forumName] = $row['id'];\n\n\t\t\t\tif(!$defaultChannelFound && $row['id'] == $this->getConfig('defaultChannelID')) {\n\t\t\t\t\t$defaultChannelFound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->free_result($result);\n\n\t\t\tif(!$defaultChannelFound) {\n\t\t\t\t// Add the default channel as first array element to the channel list:\n\t\t\t\t$this->_channels = array_merge(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t$this->trimChannelName($this->getConfig('defaultChannelName'))=>$this->getConfig('defaultChannelID')\n\t\t\t\t\t),\n\t\t\t\t\t$this->_channels\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $this->_channels;\n\t}", "public function getAllChannels()\n {\n return Channel::all();\n }", "public function getChannelList()\n {\n return Channel::with('subChannel.display')->get();\n }", "public function getIds(): array\n {\n return $this->ids;\n }", "public function getSupplyChannels();" ]
[ "0.7078454", "0.6962226", "0.6767074", "0.6725589", "0.6609322", "0.6567238", "0.649827", "0.64391017", "0.6383432", "0.6326732", "0.63179535", "0.62899053", "0.6277092", "0.62713474", "0.6242606", "0.62168366", "0.61238873", "0.6117613", "0.6103672", "0.60845137", "0.60519665", "0.60414755", "0.6020734", "0.6020734", "0.60097104", "0.5994559", "0.59911036", "0.59431696", "0.5942836", "0.59410447" ]
0.8179587
0
Return a Script object which contains a script with Dotpay widget configuration.
public function getWidgetScript() { foreach ($this as $channel) { if ($channel instanceof Dotpay) { return $channel->getScript($this->getChannelIds()); } } return new Script(new PlainText()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWidgetScript() {\n //$vIsHasLHCAccount = $vCurrentSession->getValue('isHasLHCAccount');\n //if (!$vIsHasLHCAccount) {\n $script = $this->fillChatWidget();\n // }\n return isset($script) === true ? $script: false ;\n }", "public function setScript()\n {\n $container = strtoupper($this->getCurrentWidget()->getPlugin());\n $NameAction = strtolower($this->getCurrentWidget()->getAction()); \n // If the widget is a \"gedmo snippet\"\n if ( ($container == 'CONTENT') && ($NameAction == 'snippet') ) {\n // if the configXml field of the widget is configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($this->getCurrentWidget()->getConfigXml());\n if ($xmlConfig->widgets->get('content')){\n $snippet_widget = $this->getWidgetById($xmlConfig->widgets->content->id);\n $container = strtoupper($snippet_widget->getPlugin());\n $NameAction = strtolower($snippet_widget->getAction());\n }\n } catch (\\Exception $e) {\n } \n }\n // If the widget is a \"gedmo snippet\"\n elseif ( ($container == 'GEDMO') && ($NameAction == 'snippet') ) {\n // if the configXml field of the widget is configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($this->getCurrentWidget()->getConfigXml());\n if ($xmlConfig->widgets->get('gedmo')){\n $snippet_widget = $this->getWidgetById($xmlConfig->widgets->gedmo->id);\n $container = strtoupper($snippet_widget->getPlugin());\n $NameAction = strtolower($snippet_widget->getAction());\n }\n } catch (\\Exception $e) {\n }\n } \n $this->script['js'][$container.$NameAction] = $this->extensionWidget->ScriptJsFunction($container, $NameAction);\n $this->script['css'][$container.$NameAction] = $this->extensionWidget->ScriptCssFunction($container, $NameAction);\n }", "static public function getScript()\n {\n return self::getTransport()->getScript();\n }", "public function getSettings()\n {\n $typoScript = $this->configurationManager->getConfiguration(\n \\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,\n 'SfBanners',\n 'Pi1'\n );\n return $typoScript;\n }", "public function getScript()\n {\n if ($this->script == null) {\n $this->script = new Script();\n }\n\n return $this->script;\n }", "static public function loadIngoScript()\n {\n return Ingo_Script::factory(\n $GLOBALS['session']->get('ingo', 'backend/script'),\n $GLOBALS['session']->get('ingo', 'backend/scriptparams', Horde_Session::TYPE_ARRAY)\n );\n }", "public function getScript()\n {\n if ($this->script == null) {\n $this->script = new Script($this->getScriptBuf());\n }\n\n return $this->script;\n }", "public function forgeScript()\n {\n // check if we have a script creation array\n if ($this->provider && isset($this->provider['render']['script'])) {\n // Start script tag.\n $script = '<script';\n\n foreach ($this->provider['render']['script'] as $attribute => $val) {\n $script .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n\n // Close script tag.\n $script .='></script>';\n\n return $script;\n }\n }", "function getScript()\n {\n $script = \"\n <!-- main scripts -->\n <script src=\\\"/inelcom/js/jquery-3.1.1.min.js\\\"></script>\n <script src=\\\"/inelcom/js/bootstrap.min.js\\\"></script>\n <script src=\\\"/inelcom/js/plugins/metisMenu/jquery.metisMenu.js\\\"></script>\n <script src=\\\"/inelcom/js/plugins/slimscroll/jquery.slimscroll.min.js\\\"></script>\n <!-- Date picker -->\n <script src=\\\"/inelcom/js/plugins/datapicker/bootstrap-datepicker.js\\\"></script> \n <!-- Date range use moment.js same as full calendar plugin -->\n <script src=\\\"/inelcom/js/plugins/fullcalendar/moment.min.js\\\"></script> \n <!-- Date range picker -->\n <script src=\\\"/inelcom/js/plugins/daterangepicker/daterangepicker.js\\\"></script>\n <!-- Datatable -->\n <script src=\\\"/inelcom/js/plugins/dataTables/datatables.min.js\\\"></script> \n <!-- Custom and plugin javascript -->\n <script src=\\\"/inelcom/js/inspinia.js\\\"></script>\n <script src=\\\"/inelcom/js/plugins/pace/pace.min.js\\\"></script>\n \";\n\n return $script;\n }", "public function get_output_script() {\n $output = '<script>';\n $output .= 'var Aw = ' . $this->prepare_json();\n $output .= '</script>';\n \n return $output;\n }", "function script()\n {\n return '<script type=\"text/javascript\" src=\"' . $this->URL . '\"></script>';\n }", "public function generate_script() {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\tob_start();\n\t\t?>\n\t\t(function($){\n\n\t\t\tvar $wcf_ppec = {\n\t\t\t\tinit: function () {\n\t\t\t\t\tvar getButtons = [\n\t\t\t\t\t\t'wcf-upsell-offer',\n\t\t\t\t\t\t'wcf-downsell-offer'\n\t\t\t\t\t];\n\n\t\t\t\t\twindow.paypalCheckoutReady = function () {\n\t\t\t\t\t\tpaypal.checkout.setup(\n\t\t\t\t\t\t\t'<?php echo $this->get_woo_payer_id(); ?>',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tenvironment: '<?php echo $environment; ?>',\n\t\t\t\t\t\t\t\tbuttons: getButtons,\n\t\t\t\t\t\t\t\tlocale: 'en_US',\n\n\t\t\t\t\t\t\t\tclick: function () {\n\n\t\t\t\t\t\t\t\t\tvar postData = {\n\t\t\t\t\t\t\t\t\t\tstep_id: cartflows.current_step,\n\t\t\t\t\t\t\t\t\t\torder_id: <?php echo isset( $_GET['wcf-order'] ) ? intval( $_GET['wcf-order'] ) : 0; ?>,\n\t\t\t\t\t\t\t\t\t\torder_key: '<?php echo isset( $_GET['wcf-key'] ) ? sanitize_text_field( $_GET['wcf-key'] ) : ''; ?>',\n\t\t\t\t\t\t\t\t\t\tsession_key: '<?php echo isset( $_GET['wcf-sk'] ) ? sanitize_text_field( $_GET['wcf-sk'] ) : ''; ?>',\n\t\t\t\t\t\t\t\t\t\taction: 'cartflows_front_create_ppec_paypal_checkout_token'\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tpaypal.checkout.initXO();\n\n\t\t\t\t\t\t\t\t\tvar action = $.post(cartflows.ajax_url, postData);\n\n\t\t\t\t\t\t\t\t\taction.done(function (data) {\n\t\t\t\t\t\t\t\t\t\tpaypal.checkout.startFlow(data.token);\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\taction.fail(function () {\n\t\t\t\t\t\t\t\t\t\tpaypal.checkout.closeFlow();\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t$wcf_ppec.init();\n\t\t})(jQuery);\n\t\t<?php\n\n\t\treturn ob_get_clean();\n\t}", "public static function get_script(){\r\n\t\t\treturn '<script src=\"https://www.google.com/jsapi\"></script>';\r\n\t\t}", "public function get_app_script()\n {\n }", "public function getScript(): string\n {\n return $this->script;\n }", "public function getScript()\n\t{\n\t\treturn $this->root->script;\n\t}", "public function getScriptMarkup(){ return $this->scripts_markup; }", "protected function getJavaScriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}" ]
[ "0.65830034", "0.64373696", "0.6301369", "0.6144808", "0.6102449", "0.60436356", "0.59874696", "0.59589416", "0.5873644", "0.58617055", "0.5819742", "0.5779247", "0.5774962", "0.57125235", "0.56367683", "0.5594633", "0.55920756", "0.5579904", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053", "0.55306053" ]
0.80469626
0
load the wishlist if the user login session is set, if not redirect to login page
public function index() { if ($this->session->has_userdata('loginSession')) { $this->load->view('wishlistview'); } else { redirect('/Login'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function mainpage() \n { \n //$userlogcheck = $_SESSION['loginsession']['currently_logged_in'];\n if ($this->session->userdata('loginsession')) \n { \n $celebs = $this->WishlistModel->getWishlistbyUserId();\t\n $this->load->view('main', array('celebs' => $celebs)); \n } else { \n redirect('WishlistController/invalid'); \n } \n }", "public function login_action() \n { \n $this->load->helper('security'); \n $this->load->library('form_validation'); \n $this->form_validation->set_rules('username', 'Username:', 'required|trim|xss_clean|callback_validation'); \n $this->form_validation->set_rules('password', 'Password:', 'required|trim'); \n\t\t\n\t\t//logical block check if validation form has been checked, and if true, allocates it a session according to the username,\n //redirects to the main admin page\n\t\tif ($this->form_validation->run()) \n { \n $this->session->unset_userdata('registrationsession');\n $id = $_SESSION['userId'];\n\n if($this->WishlistModel->checkList($id))\n {\n $data = array('userId' => $id, 'username' => $this->input->post('username'), 'currently_logged_in' => 1); \t\n $this->session->set_userdata('loginsession', $data);\n $this->session->unset_userdata('userId');\n redirect('WishlistController/mainpage');\n }\n else\n {\n $message['errors'] = \"Let's first add a list Simon:)\";\n $check['listcheck'] = \"true\";\n $this->load->view('view', $message + $check);\n }\n\n\t\t}\n\t\t//if the statement is false the user is redirected to the login page again\n else { \n $data['form1_errors'] = validation_errors();\n $this->load->view('view', $data); \n } \n\t}", "public function checkLogged() {\n if (!PlonkSession::exists('id')) {\n PlonkWebsite::redirect($_SERVER['PHP_SELF'] . '?' . PlonkWebsite::$moduleKey . '=home&' . PlonkWebsite::$viewKey . '=home');\n } \n }", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function requireLogin()\n\t{\n\t\tif (!$this->getFBUID()) {\n\t\t\t$this->redirectToLogin();\n\t\t}\n\t}", "public function redirect_if_logged_in()\n {\n Session::_start();\n if(isset($_SESSION['user']))\n {\n header('location: ' . URL_WITH_INDEX_FILE . 'results/index');\n exit();\n }\n }", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "public function must_be_logged_in()\n {\n Session::_start();\n if(!isset($_SESSION['user']))\n {\n Session::_destroy();\n header('location: ' . URL_WITH_INDEX_FILE . 'login/index');\n exit();\n }\n }", "public function checsession() {\n // using the default layout 'protected/views/layouts/main.php'\n $session = Yii::app()->session['isLoggedIn'];\n if(empty($session)){\n $this->redirect(Yii::app()->baseUrl.'/index.php');\n }\n }", "public static function fetchForUser()\r\n {\r\n $wishlist = new static();\r\n \r\n $identity = \\Dsc\\System::instance()->get( 'auth' )->getIdentity();\r\n $session_id = \\Dsc\\System::instance()->get( 'session' )->id();\r\n \r\n if (! empty( $identity->id ))\r\n {\r\n $wishlist->load( array(\r\n 'user_id' => new \\MongoId( (string) $identity->id ) \r\n ) );\r\n $wishlist->user_id = $identity->id;\r\n \r\n $session_wishlist = static::fetchForSession();\r\n \r\n // if there was no user wishlist but there IS a session wishlist, just add the user_id to the session wishlist and save it\r\n if (empty( $wishlist->id ) && ! empty( $session_wishlist->id ))\r\n {\r\n $wishlist = $session_wishlist;\r\n $wishlist->user_id = $identity->id;\r\n $wishlist->save();\r\n }\r\n \r\n // if there was a user wishlist and there is a session wishlist, merge them and delete the session wishlist\r\n // if we already did the merge, skip this\r\n $session_wishlist_merged = \\Dsc\\System::instance()->get( 'session' )->get( 'shop.session_wishlist_merged' );\r\n if (! empty( $session_wishlist->id ) && $session_wishlist->id != $wishlist->id && empty( $session_wishlist_merged ))\r\n {\r\n $wishlist->session_id = $session_id;\r\n $wishlist->merge( $session_wishlist->cast() );\r\n $session_wishlist->remove();\r\n \\Dsc\\System::instance()->get( 'session' )->set( 'shop.session_wishlist_merged', true );\r\n }\r\n \r\n if (empty( $wishlist->id ))\r\n {\r\n $wishlist->save();\r\n }\r\n }\r\n \r\n return $wishlist;\r\n }", "protected function loginIfRequested() {}", "public function index()\n {\n return Redirect( url('member/wishlist') );\n }", "public function session_check(){\n\n\tif(!isset($_SESSION[\"user-type\"]) && $_SESSION[\"user-type\"] != \"user\"){\n\t\tredirect(\"Login\");\n\t} \n}", "function action_userLogged() {\n if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {\n $_SESSION['logged'] = false;\n header('Location: /');\n } else {\n $_SESSION['logged'] = true;\n header('Location: /home/track');\n // Include view for this page.\n @include_once APP_PATH . 'view/track_page.tpl.php';\n }\n }", "public function onMenuInitialize_SitepageGutterWishlist($row) {\n\t\t\n\t\t//GET VIEWER DETAIL\n $viewer = Engine_Api::_()->user()->getViewer();\n\t\t$viewer_id = $viewer->getIdentity();\n\n\t\tif(empty($viewer_id)) {\n\t\t\treturn false;\n\t\t}\n\n $canView = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitepagewishlist_wishlist', 'view');\n\t\tif(empty($canView)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//RETURN FALSE IF SUBJECT IS NOT SET\n $subject = Engine_Api::_()->core()->getSubject();\n if ($subject->getType() !== 'sitepage_page') {\n return false;\n }\n\n\t\t//SHOW ADD TO WISHLIST LINK IF SITEPAGWISHLIST MODULES IS ENABLED\n\t\t$sitepageWishlistEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitepagewishlist');\n if (!$viewer->getIdentity() || empty($sitepageWishlistEnabled)) {\n return false;\n }\n\n return array(\n 'class' => 'icon_sitepagewishlist_add buttonlink',\n 'route' => 'default',\n 'params' => array(\n 'module' => 'sitepagewishlist',\n 'controller' => 'index',\n 'action' => 'add',\n 'page_id' => $subject->getIdentity(),\n ),\n );\n }", "public function index()\n\t{\n\t\t$requestUrl = $this->input->get(\"redirect\");\n\t\t\n\t\tif ($this->login_util->isUserLoggedIn()){\n\t\t\t// session exists\n\t\t\tredirect($requestUrl, 'refresh');\n\t\t}\n\t\t\n\t\t$this->display_login($requestUrl);\n\t}", "public function restrict() {\n\t\tif (!$this->is_logged_in()) {\n\t\t\tredirect('login', 'refresh');\n\t\t}\n\t}", "public function index()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url() . 'login', 'refresh');\n if ($this->session->userdata('admin_login') == 1)\n redirect(base_url() . 'admin/question_list', 'refresh');\n \n \n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "function check_pre_login() {\n\tif ($_SESSION['id']) {\n\t\theader(\"Location: home.php\");\n\t\texit;\t\n\t}\n}", "public function logged_in_redirect(){\n\n\t\tif (isset($_SESSION['user_id'])) {\n\t\t \t# code...\n\t\t \theader('Location: index.php');\n\t\t } \n\t}", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public function profileAction() {\r\n\r\n //GET WISHLIST ID AND OBJECT\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n //SET SITESTOREPRODUCT SUBJECT\r\n Engine_Api::_()->core()->setSubject($wishlist);\r\n\r\n //GET PAGE OBJECT\r\n $pageTable = Engine_Api::_()->getDbtable('pages', 'core');\r\n $pageSelect = $pageTable->select()->where('name = ?', \"sitestoreproduct_wishlist_profile\");\r\n $pageObject = $pageTable->fetchRow($pageSelect);\r\n\r\n $params['wishlist'] = 'Wishlists';\r\n Engine_Api::_()->sitestoreproduct()->setMetaTitles($params);\r\n\r\n $params['wishlist_creator_name'] = $wishlist->getOwner()->getTitle();\r\n Engine_Api::_()->sitestoreproduct()->setMetaKeywords($params);\r\n\r\n //CHECK AUTHENTICATION\r\n if (!Engine_Api::_()->authorization()->isAllowed($wishlist, null, \"view\")) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //INCREASE VIEW COUNT IF VIEWER IS NOT OWNER\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if (!$wishlist->getOwner()->isSelf($viewer)) {\r\n $wishlist->view_count++;\r\n $wishlist->save();\r\n }\r\n\r\n if(Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\r\n $this->_helper->content\r\n ->setContentName($pageObject->page_id)\r\n ->setNoRender()\r\n ->setEnabled();\r\n }else{\r\n $this->_helper->content\r\n ->setNoRender()\r\n ->setEnabled();\r\n } \r\n }", "public static function check() {\n session_start();\n if (!isset($_SESSION['user'])) {\n header('Location: /');\n exit;\n }\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "private function check_is_user_login()\n\t{\n\t\tif($this->session->userdata('logged_in') != FALSE)\n\t\t{\n\t\t\tredirect('home');\n\t\t}\n\t}", "public static function session_check(){\n if(!isset($_SESSION)){\n session_start();\n }\n if( !isset( $_SESSION[\"loggedIn\"])){\n\n header(\"Location: login.php\");\n }\n }", "function ifLoggedIn(){\n\t\n\tif(isset($_SESSION[\"userinfo\"])){\n\t\t\n\t\t\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==1){\n\t\t\tredirect(\"admin.php\");\n\t\t}\n\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==2){\n\t\t\tredirect(\"member.php\");\n\t\t}\n\t\t\n\t}\n}", "public function wishlist($offset = 0) {\n\t\t$this->page_data['page_name'] = \"wishlist\";\n\t\t$this->page_data['page_title'] = 'Wishlist';\n\t\t$this->page_data['page_view'] = 'user/course_list';\n\t\t$this->page_data['sub_page_name'] = \"course_list_wishlist\";\n\n// Filter by category related code\n\t\t$filter = $this->getFilterArray();\n\n\t\t$this->pagination_config['per_page'] = 10;\n\t\t$this->pagination_config['total_rows'] = $this->course_model->get_wishlist_courses_by_user_id(\"COUNT\", $this->session->userdata('user_id'), array('id'), null, $filter);\n\t\t$this->page_data['course_list'] = $this->course_model->get_wishlist_courses_by_user_id(\"OBJECT\", $this->session->userdata('user_id'), array('id', 'slug', 'title', 'price'), array('limit' => $this->pagination_config['per_page'], 'offset' => $offset), $filter);\n\n\t\t// Load the default course view. we are here loadin a default view because\n\t\t// there are few common functionality that works for both user/my_courses and user/wishlist\n\n\t\t$this->my_board_course_default_view();\n\t}" ]
[ "0.6678639", "0.6191641", "0.5999231", "0.59899163", "0.59750646", "0.5904623", "0.59020865", "0.5872175", "0.58550894", "0.5828345", "0.5766807", "0.5762125", "0.5759489", "0.5732283", "0.57174623", "0.5717009", "0.57031214", "0.57021505", "0.5701329", "0.56928223", "0.56841975", "0.5661855", "0.5657963", "0.56370693", "0.5636222", "0.56142896", "0.56131005", "0.56120706", "0.56108254", "0.559689" ]
0.676549
0
method to load the wishlist view to shared user (setting the session)
public function username($username){ $this->session->set_userdata('sharedToUser',$username); $this->load->view('wishlistshareview'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fetchForUser()\r\n {\r\n $wishlist = new static();\r\n \r\n $identity = \\Dsc\\System::instance()->get( 'auth' )->getIdentity();\r\n $session_id = \\Dsc\\System::instance()->get( 'session' )->id();\r\n \r\n if (! empty( $identity->id ))\r\n {\r\n $wishlist->load( array(\r\n 'user_id' => new \\MongoId( (string) $identity->id ) \r\n ) );\r\n $wishlist->user_id = $identity->id;\r\n \r\n $session_wishlist = static::fetchForSession();\r\n \r\n // if there was no user wishlist but there IS a session wishlist, just add the user_id to the session wishlist and save it\r\n if (empty( $wishlist->id ) && ! empty( $session_wishlist->id ))\r\n {\r\n $wishlist = $session_wishlist;\r\n $wishlist->user_id = $identity->id;\r\n $wishlist->save();\r\n }\r\n \r\n // if there was a user wishlist and there is a session wishlist, merge them and delete the session wishlist\r\n // if we already did the merge, skip this\r\n $session_wishlist_merged = \\Dsc\\System::instance()->get( 'session' )->get( 'shop.session_wishlist_merged' );\r\n if (! empty( $session_wishlist->id ) && $session_wishlist->id != $wishlist->id && empty( $session_wishlist_merged ))\r\n {\r\n $wishlist->session_id = $session_id;\r\n $wishlist->merge( $session_wishlist->cast() );\r\n $session_wishlist->remove();\r\n \\Dsc\\System::instance()->get( 'session' )->set( 'shop.session_wishlist_merged', true );\r\n }\r\n \r\n if (empty( $wishlist->id ))\r\n {\r\n $wishlist->save();\r\n }\r\n }\r\n \r\n return $wishlist;\r\n }", "function init_content_item_shared($client) {\n\t$CI = &get_instance();\n\t$CI->load->model('team_password/team_password_model');\n\tif ($client) {\n\t\techo '<div role=\"tabpanel\" class=\"tab-pane\" id=\"item_shared\">';\n\t\trequire \"modules/team_password/views/item_shared.php\";\n\t\techo '</div>';\n\t}\n}", "public function index()\n {\n\n if ($this->session->has_userdata('loginSession')) {\n $this->load->view('wishlistview');\n\n } else {\n redirect('/Login');\n }\n }", "public function getWishlist(){\n\t\t$wishlists = \\App\\Wishlist::where('user_id', '=', \\Auth::id())->orderBy('id', 'DESC')->get();\n\t\t$circles = \\App\\Circle::where('circle_email', '=', \\Auth::user()->email)->orderBy('id', 'DESC')->get();\n\t\treturn view('wishlist.home')\n\t\t\t->with('circles', $circles)\n\t\t\t->with('wishlists', $wishlists);\n\t}", "public function mainpage() \n { \n //$userlogcheck = $_SESSION['loginsession']['currently_logged_in'];\n if ($this->session->userdata('loginsession')) \n { \n $celebs = $this->WishlistModel->getWishlistbyUserId();\t\n $this->load->view('main', array('celebs' => $celebs)); \n } else { \n redirect('WishlistController/invalid'); \n } \n }", "public function wishlist()\n {\n $favoriteProducts = auth()->user()->favorites()->latest()->paginate();\n\n return view('users.wishlist', get_defined_vars());\n }", "public function profileAction() {\r\n\r\n //GET WISHLIST ID AND OBJECT\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n //SET SITESTOREPRODUCT SUBJECT\r\n Engine_Api::_()->core()->setSubject($wishlist);\r\n\r\n //GET PAGE OBJECT\r\n $pageTable = Engine_Api::_()->getDbtable('pages', 'core');\r\n $pageSelect = $pageTable->select()->where('name = ?', \"sitestoreproduct_wishlist_profile\");\r\n $pageObject = $pageTable->fetchRow($pageSelect);\r\n\r\n $params['wishlist'] = 'Wishlists';\r\n Engine_Api::_()->sitestoreproduct()->setMetaTitles($params);\r\n\r\n $params['wishlist_creator_name'] = $wishlist->getOwner()->getTitle();\r\n Engine_Api::_()->sitestoreproduct()->setMetaKeywords($params);\r\n\r\n //CHECK AUTHENTICATION\r\n if (!Engine_Api::_()->authorization()->isAllowed($wishlist, null, \"view\")) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //INCREASE VIEW COUNT IF VIEWER IS NOT OWNER\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if (!$wishlist->getOwner()->isSelf($viewer)) {\r\n $wishlist->view_count++;\r\n $wishlist->save();\r\n }\r\n\r\n if(Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\r\n $this->_helper->content\r\n ->setContentName($pageObject->page_id)\r\n ->setNoRender()\r\n ->setEnabled();\r\n }else{\r\n $this->_helper->content\r\n ->setNoRender()\r\n ->setEnabled();\r\n } \r\n }", "public function index()\n {\n /** @var User $user */\n $user = \\Sentinel::check();\n $wishlists = $user->wishlists;\n\n return view('wishlist.index', compact(\"wishlists\"));\n }", "public function index()\n {\n $wishlists = Wishlist::with('item')->where('user_id', Auth::id())->get();\n return view('front/wishlist', compact('wishlists'));\n }", "function DangNhap() {\n if(Auth::check())\n {\n /* Truyen 1 view share cho tat ca cac view de lay thong tin nguoi dung, Auth::user() lay thong tin nguoi dung dang nhap*/\n view()->share(Auth::user());\n }\n }", "public function preference() {\n $this->_data['api_key'] = $_SESSION['api_key'];\n $this->_data['shop'] = $_SESSION['shop'];\n\n $this->load->view('layout/preference', $this->_data);\n }", "public function profileAction() {\n // Validate request methods\n $this->validateRequestMethod();\n\n // Set the translations for zend library.\n if (!Zend_Registry::isRegistered('Zend_Translate'))\n Engine_Api::_()->getApi('Core', 'siteapi')->setTranslate();\n\n //GET DIARY ID AND SUBJECT\n if (Engine_Api::_()->core()->hasSubject())\n $subject = $wishlist = Engine_Api::_()->core()->getSubject('sitereview_wishlist');\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n if (isset($wishlist) && !empty($wishlist))\n Engine_Api::_()->core()->setSubject($wishlist);\n else\n $this->respondWithError('no_record');\n } else {\n $this->respondWithError('no_record');\n }\n\n if (empty($wishlist)) {\n $this->respondWithError('no_record');\n }\n\n $wishlist_id = $this->_getParam('wishlist_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //INCREASE VIEW COUNT IF VIEWER IS NOT OWNER\n if (!$wishlist->getOwner()->isSelf($viewer)) {\n $wishlist->view_count++;\n $wishlist->save();\n }\n\n // PREPARE RESPONSE ARRAY\n $bodyParams['response'] = $subject->toArray();\n $bodyParams['response'][\"owner_title\"] = $subject->getOwner()->getTitle();\n if (isset($bodyParams['response']['body']) && !empty($bodyParams['response']['body']))\n $bodyParams['response']['body'] = strip_tags($bodyParams['response']['body']);\n\n $bodyParams['response'] = array_merge($bodyParams['response'], Engine_Api::_()->getApi('Core', 'siteapi')->getContentUrl($subject));\n\n $viewer_id = $viewer->getIdentity();\n if (!empty($viewer_id)) {\n $level_id = $viewer->level_id;\n } else {\n $level_id = Engine_Api::_()->getDbtable('levels', 'authorization')->fetchRow(array('type = ?' => \"public\"))->level_id;\n }\n\n $showMessageOwner = 0;\n $showMessageOwner = Engine_Api::_()->authorization()->getPermission($level_id, 'messages', 'auth');\n if ($showMessageOwner != 'none') {\n $showMessageOwner = 1;\n }\n\n $messageOwner = 1;\n if ($wishlist->owner_id == $viewer_id || empty($viewer_id) || empty($showMessageOwner)) {\n $messageOwner = 0;\n }\n //GET LEVEL SETTING\n $can_create = Engine_Api::_()->authorization()->getPermission($level_id, 'sitereview_wishlist', \"create\");\n $bodyParams['response']['wishlist_creator_name'] = $wishlist->getOwner()->getTitle();\n\n $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($subject, true);\n $bodyParams['response'] = array_merge($bodyParams['response'], $getContentImages);\n $perms = array();\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $perms = array();\n foreach ($roles as $roleString) {\n $role = $roleString;\n if ($auth->isAllowed($su, $role, 'view')) {\n $perms['auth_view'] = $roleString;\n }\n }\n $bodyParams['response'] = array_merge($bodyParams['response'], $perms);\n\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n try {\n //FETCH RESULTS\n $paginator = Engine_Api::_()->getDbTable('wishlistmaps', 'sitereview')->wishlistListings($wishlist->wishlist_id);\n $paginator->setItemCountPerPage($itemCount);\n $paginator->setCurrentPageNumber($this->_getParam('currentpage', 1));\n $total_item = $paginator->getTotalItemCount();\n $bodyParams['response']['totallistings'] = $total_item;\n\n foreach ($paginator as $sitereviewObj) {\n\n $sitereview = $sitereviewObj->toArray();\n\n if (isset($sitereviewObj->owner_id) && !empty($sitereviewObj->owner_id)) {\n // Add owner images\n $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($sitereviewObj, true);\n $sitereview = array_merge($sitereview, $getContentImages);\n\n $sitereview[\"owner_title\"] = $sitereviewObj->getOwner()->getTitle();\n }\n\n if (empty($sitereview['price']))\n unset($sitereview['price']);\n\n // Set the price & currency \n if (isset($sitereview['price']) && $sitereview['price'] > 0)\n $sitereview['currency'] = Engine_Api::_()->getApi('settings', 'core')->getSetting('payment.currency', 'USD');\n\n // Add images \n $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($sitereviewObj);\n $sitereview = array_merge($sitereview, $getContentImages);\n\n if (isset($wishlist->listing_id) && !empty($wishlist->listing_id) && $wishlist->listing_id == $sitereviewObj->listing_id) {\n if (!isset($bodyParams['response']['image']) && empty($bodyParams['response']['image']))\n $bodyParams['response'] = array_merge($bodyParams['response'], $getContentImages);\n }\n\n\n $isAllowedView = $sitereviewObj->authorization()->isAllowed($viewer, 'view');\n $sitereview[\"allow_to_view\"] = empty($isAllowedView) ? 0 : 1;\n\n $isAllowedEdit = $sitereviewObj->authorization()->isAllowed($viewer, 'edit');\n $sitereview[\"edit\"] = empty($isAllowedEdit) ? 0 : 1;\n\n $isAllowedDelete = $sitereviewObj->authorization()->isAllowed($viewer, 'delete');\n $sitereview[\"delete\"] = empty($isAllowedDelete) ? 0 : 1;\n $ListingMenu = array();\n $ListingMenu[] = array(\n 'name' => 'remove',\n 'label' => $this->translate('Remove'),\n 'url' => 'listings/wishlist/remove',\n 'urlParams' => array(\n \"listing_id\" => $sitereviewObj->getIdentity(),\n 'wishlist_id' => $wishlist->getIdentity()\n )\n );\n if ($wishlist->owner_id == $viewer_id || $level_id == 1)\n $sitereview['gutter_menu'] = $ListingMenu;\n $tempResponse[] = $sitereview;\n }\n if (!empty($tempResponse)) {\n $bodyParams['response']['listing'] = $tempResponse;\n }\n\n if (!isset($bodyParams['response']['image']) && empty($bodyParams['response']['image'])) {\n $bodyParams['response'] = array_merge($bodyParams['response'], $getContentImages);\n }\n\n if ($viewer_id) {\n $wishlistMenus[] = array(\n 'name' => 'memberWishlist',\n 'label' => $this->translate($wishlist->getOwner()->getTitle() . \"'s\" . \" Wishlists\"),\n 'url' => 'listings/wishlist',\n 'urlParams' => array(\n \"text\" => $wishlist->getOwner()->getTitle())\n );\n if ($can_create) {\n $wishlistMenus[] = array(\n 'name' => 'create',\n 'label' => $this->translate('Create New Wishlist'),\n 'url' => 'listings/wishlist/create',\n );\n }\n if (!empty($messageOwner)) {\n $wishlistMenus[] = array(\n 'name' => 'messageOwner',\n 'label' => $this->translate('Message Owner'),\n 'url' => 'listings/wishlist/message-owner',\n 'urlParams' => array(\n \"wishlist_id\" => $wishlist->getIdentity())\n );\n }\n $wishlistMenus[] = array(\n 'name' => 'report',\n 'label' => $this->translate('Report'),\n 'url' => 'report/create/subject/' . $subject->getGuid(),\n 'urlParams' => array(\n \"type\" => $wishlist->getType(),\n \"id\" => $wishlist->getIdentity()\n )\n );\n\n $wishlistMenus[] = array(\n 'name' => 'share',\n 'label' => $this->translate('Share'),\n 'url' => 'activity/share',\n 'urlParams' => array(\n \"type\" => $wishlist->getType(),\n \"id\" => $wishlist->getIdentity()\n )\n );\n\n if ($wishlist->owner_id == $viewer_id || $level_id == 1) {\n $wishlistMenus[] = array(\n 'name' => 'edit',\n 'label' => $this->translate('Edit Wishlist'),\n 'url' => 'listings/wishlist/edit/' . $wishlist->getIdentity(),\n );\n $wishlistMenus[] = array(\n 'name' => 'delete',\n 'label' => $this->translate('Delete Wishlist'),\n 'url' => 'listings/wishlist/delete/' . $wishlist->getIdentity(),\n );\n }\n }\n\n $wishlistMenus[] = array(\n 'name' => 'tellafriend',\n 'label' => $this->translate('Tell A Friend'),\n 'url' => 'listings/wishlist/tell-a-friend',\n 'urlParams' => array(\n \"wishlist_id\" => $wishlist->getIdentity())\n );\n if (!empty($wishlistMenus)) {\n $bodyParams['gutterMenus'] = $wishlistMenus;\n }\n\n $this->respondWithSuccess($bodyParams);\n } catch (Exception $ex) {\n $this->respondWithValidationError('internal_server_error', $ex->getMessage());\n }\n }", "public static function fetchForSession()\r\n {\r\n $wishlist = new static();\r\n \r\n $session_id = \\Dsc\\System::instance()->get( 'session' )->id();\r\n \r\n $wishlist->load( array(\r\n 'session_id' => $session_id \r\n ) );\r\n $wishlist->session_id = $session_id;\r\n \r\n return $wishlist;\r\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function editAction() {\n\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n Engine_Api::_()->core()->setSubject($wishlist);\n } else {\n $this->respondWithError('no_record');\n }\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $level_id = $viewer->level_id;\n\n\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\n $this->respondWithError('unauthorized');\n }\n //GET USER DIARIES\n $wishlistTable = Engine_Api::_()->getDbtable('wishlists', 'sitereview');\n $wishlistDatas = $wishlistTable->userWishlists($viewer);\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $perms = array();\n foreach ($roles as $roleString) {\n $role = $roleString;\n if ($auth->isAllowed($wishlist, $role, 'view')) {\n $perms['auth_view'] = $roleString;\n }\n }\n //FORM GENERATION\n if ($this->getRequest()->isGet()) {\n $formValues = $wishlist->toArray();\n $formValues = array_merge($formValues, $perms);\n\n if (isset($formValues['body']) && !empty($formValues['body']))\n $formValues['body'] = strip_tags($formValues['body']);\n\n\n $this->respondWithSuccess(array(\n 'form' => Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm(),\n 'formValues' => $formValues\n ));\n }\n\n //FORM VALIDATION\n else if ($this->getRequest()->isPut() || $this->getRequest()->isPost()) {\n\n $db = Engine_Api::_()->getItemTable('sitereview_listing')->getAdapter();\n $db->beginTransaction();\n try {\n $values = array();\n $getForm = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm();\n foreach ($getForm as $element) {\n\n if (isset($_REQUEST[$element['name']]))\n $values[$element['name']] = $_REQUEST[$element['name']];\n }\n if (empty($values['title'])) {\n $validationMessage = \"title is required\";\n $this->respondWithValidationError('validation_fail', $validationMessage);\n }\n\n $wishlist->setFromArray($values)->save();\n $db->commit();\n\n //PRIVACTY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = 'owner';\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\n }\n $db->commit();\n // Change request method POST to GET\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "function _sf_set_list_view_cookie() {\n\t\tif(!isset($_COOKIE['listing_view']))\n\t\t\tsetcookie('listing_view', ddp('lst_view'), 0, '/');\n\t\t\t\n\t\t//// IF OUR VIEW IS SET WE SET THE COOKIE AS WELL\n\t\tif(isset($_GET['view'])) {\n\t\t\t\n\t\t\tif($_GET['view'] == 'grid') {\n\t\t\t\tsetcookie('listing_view', 'Grid', 0, '/');\n\t\t\t} else {\n\t\t\t\tsetcookie('listing_view', 'List', 0, '/');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function index()\n {\n $wishlist_items = Wishlist::where('user_id', Auth::user()->id)->get();\n return view('wishlist', ['wishlist_items' => $wishlist_items]);\n }", "public function get_shared_wishlist($user_id)\n\t{\n\t\t//echo \"Hello\";exit;\n\t\t$ch = curl_init();\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, API_BASE .\"/wishlist/sharedlist\");\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t 'Authorization: Basic ' . $this->session->userdata('auth') ));\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = json_decode( $content );\n\n\t\treturn ( $response );\n\t}", "public function mylist()\n {\n $product = $this->productRepo->findProductImages();\n $wishlists = Wishlist::where([\n 'customer_id' => Auth::user()->id,\n ])->get();\n return view('front.accounts')\n ->with('wishlists', $wishlists, $product);\n }", "public function wishlist(Request $request)\n\t{\n\t\t\n\n\t\t\t$maincategorys = Maincategory::all(); \n\t\t\t$wishlists = Wishlist::where('userid', $request->user()->id)->groupBy('productid')->get();\t\n\t\t\t\n\n\t\t\treturn view('pages.wishlist')\n\t\t\t->with('maincategorys', $maincategorys)\n\t\t\t->with('wishlists', $wishlists);\n\t\n\t}", "public function shareholders() { \n $data['page'] = 'Shareholders List';\n $data['page_title'] = 'Shareholders List';\n $data['page_module'] = 'share'; \n $data['shareholders_list'] = $this->Share_Model->shareHoldersList(); \n $this->load->view('share/shareholders_list', $data);\n }", "public function show(WishList $wishList)\n {\n //\n }", "public function __construct()\n {\n $this->active_tab = 'user';\n View::share ( 'active_tab', $this->active_tab );\n View::share ( 'page', 'user' ); \n }", "private function synchronize()\n {\n $_SESSION['user'] = $this->user;\n }", "protected function initializeView(\\TYPO3\\Flow\\Mvc\\View\\ViewInterface $view) {\n\t\t$view->assign('sessionUser', $this->securityContext->getAccount()->getParty());\n\t}", "public function init() {\n\n $listingtype_id = $this->getRequestParam('listingtype_id');\n if (!empty($listingtype_id)) {\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('sitereview_listing', null, \"view_listtype_$listingtype_id\")->isValid())\n $this->respondWithError('unauthorized');\n }\n\n $listing_id = $this->getRequestParam('listing_id');\n if (!empty($listing_id)) {\n\n //GET LISTING TYPE ID\n $listingType = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n if (!empty($listingType)) {\n $listingtype_id = $listingType->listingtype_id;\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('sitereview_listing', null, \"view_listtype_$listingtype_id\")->isValid())\n $this->respondWithError('unauthorized');\n }\n }\n\n $sitereviewWishlistView = Zend_Registry::isRegistered('sitereviewWishlistView') ? Zend_Registry::get('sitereviewWishlistView') : null;\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('sitereview_wishlist', null, \"view\")->isValid())\n $this->respondWithError('unauthorized');\n }", "public function clickShareWishList()\n {\n $this->waitFormToLoad();\n $this->_rootElement->find($this->shareWishList)->click();\n }", "public function indexAction() {\r\n $request = Zend_Controller_Front::getInstance()->getRequest();\r\n $requestParams = $request->getParams();\r\n $this->view->titleLink = $this->_getParam('titleLink', '');\r\n $this->view->wishlistBlockWidth = $this->_getParam('wishlistBlockWidth', 198);\r\n $this->view->isBottomTitle = $this->_getParam('is_bottom_title', 0);\r\n $this->view->hideFollow = empty($requestParams['hide_follow'])? true: false;\r\n $this->view->viewTypes = $viewTypes = $this->_getParam('viewTypes', array(\"list\", \"grid\"));\r\n $this->view->viewTypeDefault = $this->_getParam('viewTypeDefault', 'grid');\r\n $this->view->wishlistCount = $viewTypes = $this->_getParam('wishlistCount', 1);\r\n $this->view->showPagination = $viewTypes = $this->_getParam('showPagination', 1);\r\n $this->view->followLike = $this->_getParam('followLike', array(\"follow\", \"like\"));\r\n $this->view->statisticsWishlist = $this->_getParam('statisticsWishlist', array(\"productCount\", \"likeCount\", \"viewCount\", \"followCount\"));\r\n $viewTypeDefault = $this->_getParam('viewTypeDefault', 'grid');\r\n if (is_array($viewTypes) && !in_array($viewTypeDefault, $viewTypes)) {\r\n $viewTypeDefault = $viewTypes[0];\r\n }\r\n if (!isset($requestParams['viewType'])) {\r\n $this->view->setAlsoInForm = true;\r\n $requestParams['viewType'] = $viewTypeDefault;\r\n }\r\n //GENERATE SEARCH FORM\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Search();\r\n $form->populate($requestParams);\r\n $this->view->formValues = $form->getValues();\r\n $page = $request->getParam('page', 1);\r\n\r\n //GET PAGINATOR\r\n $params = array();\r\n $params['pagination'] = 1;\r\n $params['displayBy'] = $this->_getParam('displayBy', 'all');\r\n $params['is_only_featured'] = $this->_getParam('is_only_featured', 0);\r\n \r\n $from_my_store_account = $this->_getParam('from_my_store_account', 0);\r\n if(!empty($from_my_store_account)) {\r\n $this->view->from_my_store_account = $params['search_wishlist'] = 'my_wishlists';\r\n }\r\n \r\n $params = array_merge($requestParams, $params);\r\n $itemCount = $this->_getParam('itemCount', 20);\r\n $this->view->isSearched = Count($params);\r\n\r\n $this->view->paginator = Engine_Api::_()->getDbtable('wishlists', 'sitestoreproduct')->getBrowseWishlists($params);\r\n $sitestoreproductBrowseWishlist = Zend_Registry::isRegistered('sitestoreproductBrowseWishlist') ? Zend_Registry::get('sitestoreproductBrowseWishlist') : null;\r\n $this->view->paginator->setItemCountPerPage($itemCount);\r\n $this->view->paginator->setCurrentPageNumber($page);\r\n $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->viewer_id = $viewer_id = $viewer->getIdentity();\r\n $this->view->listThumbsCount = $this->_getParam('listThumbsCount', 4);\r\n $this->view->isAjax = $this->_getParam('isAjax', false);\r\n if ($this->view->isAjax) {\r\n $this->getElement()->removeDecorator('Title');\r\n $this->getElement()->removeDecorator('Container');\r\n }\r\n $this->view->params = $params = $this->_getAllParams();\r\n\r\n if ($viewer_id)\r\n $this->view->allowFollow = 1;\r\n \r\n if(empty($sitestoreproductBrowseWishlist) ) {\r\n return $this->setNoRender();\r\n }\r\n }", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '优惠券列表';\n $this->global['pageName'] = 'coupon';\n $data['searchStatus'] = '0';\n\n $this->loadViews(\"coupon\", $this->global, $data, NULL);\n }\n }" ]
[ "0.613461", "0.60348094", "0.5900353", "0.5856581", "0.58420444", "0.56474006", "0.56312823", "0.5596777", "0.55822206", "0.55801356", "0.5579091", "0.5573114", "0.55345565", "0.54762423", "0.54762423", "0.5473916", "0.5471676", "0.5435409", "0.5433434", "0.54228234", "0.54221666", "0.5395344", "0.53920627", "0.5345656", "0.53225964", "0.5321001", "0.53158873", "0.5313039", "0.52936304", "0.5277664" ]
0.6974684
0
Modifies the response to add LastModified header.
public function onKernelResponse(FilterResponseEvent $event) { if (isset($this->lastModifiedDate)) { $event->getResponse()->setLastModified($this->lastModifiedDate); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add_last_modified_header() {\n\t\tif ( headers_sent() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_single() || is_page() ) {\n\t\t\t$object = get_queried_object();\n\t\t\tif ( property_exists( $object, 'post_date_gmt' ) ) {\n\t\t\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s \\G\\M\\T', strtotime( $object->post_date_gmt . 'UTC' ) ), true );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s \\G\\M\\T' ), true );\n\t}", "function send_modified_header($mdate, $etag=null, $skip_check=false)\n{\n if (headers_sent())\n return;\n \n $iscached = false;\n $etag = $etag ? \"\\\"$etag\\\"\" : null;\n\n if (!$skip_check)\n {\n if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)\n $iscached = true;\n \n if ($etag)\n $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);\n }\n \n if ($iscached)\n header(\"HTTP/1.x 304 Not Modified\");\n else\n header(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $mdate).\" GMT\");\n \n header(\"Cache-Control: private, must-revalidate, max-age=0\");\n header(\"Expires: \");\n header(\"Pragma: \");\n \n if ($etag)\n header(\"Etag: $etag\");\n \n if ($iscached)\n {\n ob_end_clean();\n exit;\n }\n}", "function http_send_last_modified($timestamp = null) {}", "public function setLastModified($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LASTMODIFIED] \n = $value;\n }", "protected function _modified_headers($last_modified)\n {\n $modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))\n ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE'])\n : FALSE;\n\n if ( ! $modified_since OR $modified_since != $last_modified)\n return;\n\n // Nothing has changed since their last request - serve a 304 and exit\n header('HTTP/1.1 304 Not Modified');\n header('Connection: close');\n exit();\n }", "public static function getLastModified() {}", "public function lastModified(string $value)\n {\n $this->header('Last-Modified', $value, true);\n }", "function httpcache_by_lastupdate($modif_time = -1) {\r\n // If the last modified date on web browser equals the server, then return HTTP 304 response without body.\r\n // http://www.web-caching.com/mnot_tutorial/how.html\r\n if ($modif_time == -1) {\r\n global $app;\r\n $modif_time = $app['last-modified'];\r\n }\r\n\r\n if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and gmdate('D, d M Y H:i:s', $modif_time).' GMT' == trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {\r\n header('HTTP/1.0 304 Not Modified');\r\n header('Content-Length: 0');\r\n exit();\r\n }\r\n header('Last-Modified: '.gmdate('D, d M Y H:i:s',$modif_time).' GMT');\r\n}", "public function notModified()\n\t{\n\t\t$protocol = filter_input(INPUT_SERVER, \"SERVER_PROTOCOL\");\n\t\t$this->header($protocol .\" 304 Not Modified\");\n\t\t$this->app->quit();\n\t}", "public static function _lastModified($time) {\n self::response()->header('Last-Modified', date(DATE_RFC1123, $time));\n\n if (strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) === $time) {\n self::halt(304);\n }\n }", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "function stampModified() {\n\t\treturn $this->setLastModified(Core::getCurrentDate());\n\t}", "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 }", "public function getLastModified(){\n return $this->lastModified;\n }", "public function modified($time = null) {\n\t\tif ($time !== null) {\n\t\t\t$date = $this->_getUTCDate($time);\n\t\t\t$this->_headers['Last-Modified'] = $date->format('D, j M Y H:i:s') . ' GMT';\n\t\t}\n\t\tif (isset($this->_headers['Last-Modified'])) {\n\t\t\treturn $this->_headers['Last-Modified'];\n\t\t}\n\t\treturn null;\n\t}", "function set_http_header()\n\t{\n\t\theader( \"Expires: -1\" );\n\t\theader( \"Last-Modified: \" . gmdate( \"D, d M Y H:i:s\" ) . \" GMT\" );\n\t\theader( \"Cache-Control: no-cache, must-revalidate\" );\n\t\theader( \"Pragma: no-cache\" );\n\t\treturn ( 0 );\n\t}", "private static function lastModificationDate($file = null, $content = null)\n\t{\n\t\t$last_modified_time = $file ? filemtime($file) : mktime();\n\t\theader(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\", $last_modified_time).\" GMT\");\n\t\tif( is_null($file) || (Common::getExtention($file) == 'php' && !self::$activateCache) || Client::isOldMSIE() )\n\t\t{\n\t\t\theader(\"Cache-Control: no-cache, must-revalidate\");\n\t\t\theader(\"Pragma: no-cache\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Expires: \" . gmdate(\"D, d M Y H:i:s\", filemtime($file) + 3600) . \" GMT\");\n\t\t\theader(\"Cache-Control: public\");\n\t\t\t\n\t\t\t// Additional stuff: force the cache to be activated !!!!\n\t\t\t$etag = md5($content);\n\t\t\tif( @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag )\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.1 304 Not Modified\"); // File cached !!! No need to re-sent it !\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "public function getLastModifiedAt();", "public function getLastModifiedAt();", "public function lastModified(\\DateTime $dateTime)\n\t{\n\t\t$this->lastModified = $dateTime->getTimestamp();\n\t\t$this->header(\"Last-Modified: \". gmdate(\"D, d M Y H:i:s\", $this->lastModified) .\" GMT\");\n\t}", "public function lastModified($last_modified_time = null)\n {\n return $this->dateHeader('Last-Modified', $last_modified_time, 'lastModified', '$last_modified_time');\n }", "#[Pure]\nfunction http_cache_last_modified($timestamp_or_expires = null) {}", "public function getLastModified($asString = true) {}", "function put_headers() {\n # Padraic Renaghan on [email protected].\n #\n # Note that in HTTP/1.1 the Cache-Control headers override the Expires\n # headers and HTTP/1.0 ignores headers it does not recognize (e.g,\n # Cache-Control). Mulitple Cache-Control directives are split into \n # mulitple headers to better support MSIE 4.x.\n #\n # Added pre- and post-check for MSIE 5.x as suggested by R.C.Winters,\n # see http://msdn.microsoft.com/workshop/author/perf/perftips.asp#Use%20Cache-Control%20Extensions\n # for details\n switch ($this->allowcache) {\n\n case \"passive\":\n $mod_gmt = gmdate(\"D, d M Y H:i:s\", getlastmod()) . \" GMT\"; \n header(\"Last-Modified: \" . $mod_gmt);\n # possibly ie5 needs the pre-check line. This needs testing.\n header(\"Cache-Control: post-check=0, pre-check=0\");\n break;\n\n case \"public\":\n $exp_gmt = gmdate(\"D, d M Y H:i:s\", time() + $this->allowcache_expire * 60) . \" GMT\";\n $mod_gmt = gmdate(\"D, d M Y H:i:s\", getlastmod()) . \" GMT\"; \n header(\"Expires: \" . $exp_gmt);\n header(\"Last-Modified: \" . $mod_gmt);\n header(\"Cache-Control: public\");\n header(\"Cache-Control: max-age=\" . $this->allowcache_expire * 60);\n break;\n \n case \"private\":\n $mod_gmt = gmdate(\"D, d M Y H:i:s\", getlastmod()) . \" GMT\";\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . $mod_gmt);\n header(\"Cache-Control: private\");\n header(\"Cache-Control: max-age=\" . $this->allowcache_expire * 60);\n header(\"Cache-Control: pre-check=\" . $this->allowcache_expire * 60);\n break;\n\n default:\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: no-cache\");\n header(\"Cache-Control: post-check=0, pre-check=0\");\n header(\"Pragma: no-cache\");\n break;\n }\n }", "public function getLastModified()\n {\n return $this->_lastModified;\n }", "static function add_cache_headers($body = null) {\n\t\t// Development sites have frequently changing templates; this can get stuffed up by the code\n\t\t// below.\n\t\tif(Director::isDev()) return;\n\n\t\tif(!headers_sent()) {\n\t\t\tif(function_exists('apache_request_headers')) {\n\t\t\t\t$headers = apache_request_headers();\n\t\t\t\tif(isset($headers['X-Requested-With']) && $headers['X-Requested-With'] == 'XMLHttpRequest') self::$cache_age = 0;\n // bdc: now we must check for DUMB IE6:\n if(isset($headers['x-requested-with']) && $headers['x-requested-with'] == 'XMLHttpRequest') self::$cache_age = 0;\n\t\t\t}\n\n\t\t\tif(self::$cache_age > 0) {\n\t\t\t\theader(\"Cache-Control: max-age=\" . self::$cache_age . \", must-revalidate\");\n\t\t\t\theader(\"Pragma:\");\n\t\t\t} else {\n\t\t\t\theader(\"Cache-Control: no-cache, max-age=0, must-revalidate\");\n\t\t\t}\n\n\t\t\tif(self::$modification_date && self::$cache_age > 0) {\n\t\t\t\theader(\"Last-Modified: \" . self::gmt_date(self::$modification_date));\n\n\t\t\t\t$expires = 2 * time() - self::$modification_date;\n\t\t\t\theader(\"Expires: \" . self::gmt_date($expires));\n\t\t\t}\n\n\t\t\tif(self::$etag) {\n\t\t\t\theader('ETag: ' . self::$etag);\n\t\t\t}\n\t\t}\n\t}", "private function refreshCache()\n {\n\n\t\t// any valid date in the past\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t// always modified right now\n\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t// HTTP/1.1\n\t\theader(\"Cache-Control: private, no-store, max-age=0, no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t// HTTP/1.0\n\t\theader(\"Pragma: no-cache\");\n\t}" ]
[ "0.7983931", "0.72746235", "0.7220157", "0.7012572", "0.67936856", "0.66962034", "0.66639125", "0.65936846", "0.6587019", "0.6574674", "0.65075415", "0.65075415", "0.65075415", "0.65075415", "0.64234424", "0.63427013", "0.62927854", "0.6278667", "0.62383336", "0.62226933", "0.6175296", "0.6175296", "0.614338", "0.6116724", "0.6114911", "0.60871476", "0.60744464", "0.6050312", "0.60443", "0.60442317" ]
0.75007737
1
return a cleaned IPTC value
function clean_iptc_value($value) { // strip leading zeros (weird Kodak Scanner software) while ( isset($value[0]) and $value[0] == chr(0)) { $value = substr($value, 1); } // remove binary nulls $value = str_replace(chr(0x00), ' ', $value); return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "function clean_value( $t )\n\t{\n\t\treturn $this->parse_clean_value( $t );\n\t}", "function pulisciInput($value) {\n\t$value=trim($value);\n\t$value=htmlentities($value);\n\t$value=strip_tags($value);\n\treturn $value;\n}", "public function getCleanValue()\n {\n return null;\n }", "public function cleanValue($value)\n\t\t{\n\t\t\tif ($value !== null)\n\t\t\t{\n\t\t\t\tif (is_string($value))\n\t\t\t\t\t$value = $this->convertToCurrentEncoding($value);\n\t\t\t\tif (get_magic_quotes_gpc())\n\t\t\t\t\t$value = stripslashes($value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}", "private function Clean($value){\r\n\t\t\treturn htmlspecialchars(strip_tags($value));\r\n\t\t}", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "private function clean_value($string)\n {\n \n $string = Functions::import_decode($string);\n $string = str_replace(array(\"\\n\", \"\\t\", \"\\r\", chr(9), chr(10), chr(13)), \" \", $string);\n return Functions::remove_whitespace($string);\n }", "private function cleanValue($value) {\n if (is_array($value)) {\n foreach ($value as $key => $v) {\n $value[$key] = $this->cleanValue($v);\n }\n } else {\n if (strpos($value, ArrayHelper::PHP_CONTENT) === 0) {\n $value = substr($value, strlen(ArrayHelper::PHP_CONTENT));\n }\n }\n \n return $value;\n }", "public function cleanValue($value)\n {\n $value = $this->toPhp($value);\n $this->validate($value);\n return $value;\n }", "private function sanitiseValue($value)\n {\n // Handle poorly encoded documents. We always use UTF8\n $value = utf8_encode($value);\n\n // Remove the = and \" from a CSV value like =\"VALUE\", which can be used to trick\n // Excel into keeping numbers sanely.\n $value = preg_replace('/^=\"(.*)\"$/', '\\1', $value);\n\n // Trim whitespace and quotes from around values.\n $value = trim($value, \" \\t\\n\\r\\0\\x0B\\\"'\");\n\n return $value;\n }", "private static function _processPoValues($value)\n {\n $value = addslashes($value);\n $value = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), '', $value);\n\n return trim($value);\n }", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "public function cleanString($value) {\n $data = trim($value);\n \n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n \n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n \n return $data;\n }", "function smcf_filter($value) {\r\n\t$pattern = array(\"/\\n/\",\"/\\r/\",\"/content-type:/i\",\"/to:/i\", \"/from:/i\", \"/cc:/i\");\r\n\t$value = preg_replace($pattern, \"\", $value);\r\n\treturn $value;\r\n}", "function valid_get($data) {\n\t\t\t$data = trim($data); //trim - функция удаляет пробелы до и после слова но в самом слове пробелы не удаляет\n\t\t\t$data = stripslashes($data); //stripslashes — Удаляет экранирование символов\n\t\t\t$data = strip_tags($data); //strip_tags — Удаляет теги HTML и PHP из строки\n\t\t\t$data = htmlspecialchars($data); //htmlspecialchars — Преобразует специальные символы в HTML-сущности\n\t\t\treturn $data;\n\t }", "private function filterValue($data)\n\t{\n\t\t// Remove double Quotes from the data\n\t\t$finalValue = strip_tags($data);\n\n\t\t// Remove double Quotes from the data\n\t\t// $finalValue = str_replace('\"', '', $finalValue);\n\n\t\t// Remove single Quotes from the data\n\t\t// $finalValue = str_replace(\"'\", '', $finalValue);\n\n\t\t// Remove tabs and newlines from the data\n\t\t$finalValue = preg_replace('/(\\r\\n|\\r|\\n)+/', \" \", $finalValue);\n\n\t\t// Remove extra spaces from the data\n\t\t$finalValue = preg_replace('/\\s+/', \" \", $finalValue);\n\n\t\treturn $finalValue;\n\t}", "function submission_scrub($value) {\n $bad_things = array('to:','cc:','bcc:','content-type:','mime-version:','multipart-mixed:','content-transfer-encoding:');\n\n // if any of the bad things are in the submission, return an empty string\n foreach ($bad_things as $v) { \n if (stripos($value, $v) !==false)\n return '';\n } \n // replace any newline characters with spaces\n $value = str_replace(array( \"\\r\", \"\\n\", \"%0a\", \"%0d\"), ' ', $value);\n\n // return the value\n return trim($value);\n }", "function clean($value = \"\") {\r\n $value = trim($value);\r\n $value = stripslashes($value);\r\n $value = strip_tags($value);\r\n $value = htmlspecialchars($value);\r\n \r\n\t\treturn $value;\t\t\r\n}", "protected static function readIPTC($iptc, $value, $glue=\", \") {\r\n\t\tif (isset($iptc[$value])){\r\n\t\t\treturn implode($glue, $iptc[$value]);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "function clean($value) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n if (!is_numeric($value)) $value = addslashes($value);\n return $value;\n}", "function parseCleanValue($v){\r\n\t\tif($v == \"\"){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$v = str_replace(\"&#032;\", \" \", $v);\r\n\t\t$v = str_replace(\"&\" , \"&amp;\" , $v);\r\n\t\t$v = str_replace(\"<!--\" , \"&#60;&#33;--\" , $v);\r\n\t\t$v = str_replace(\"-->\" , \"--&#62;\" , $v);\r\n\t\t$v = preg_replace(\"/<script/i\" , \"&#60;script\" , $v);\r\n\t\t$v = str_replace(\">\" , \"&gt;\" , $v);\r\n\t\t$v = str_replace(\"<\" , \"&lt;\" , $v);\r\n\t\t$v = str_replace(\"\\\"\" , \"&quot;\" , $v);\r\n\t\t$v = preg_replace(\"/\\n/\" , \"<br />\" , $v); // Convert literal newlines\r\n\t\t$v = preg_replace(\"/\\\\\\$/\" , \"&#036;\" , $v);\r\n\t\t$v = preg_replace(\"/\\r/\" , \"\" , $v); // Remove literal carriage returns\r\n\t\t$v = str_replace(\"!\" , \"&#33;\" , $v);\r\n\t\t$v = str_replace(\"'\" , \"&#39;\" , $v); // IMPORTANT: It helps to increase sql query safety.\r\n\t\t// Ensure unicode chars are OK\r\n\t\t$v = preg_replace(\"/&amp;#([0-9]+);/s\", \"&#\\\\1;\", $v);\r\n\t\t// Strip slashes if not already done so.\r\n\t\tif($this->get_magic_quotes){\r\n\t\t\t$v = stripslashes($v);\r\n\t\t}\r\n\t\t// Swap user entered backslashes\r\n\t\t$v = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $v);\r\n\t\treturn $v;\r\n\t}", "function vcex_vc_value_from_safe( $value, $encode = false ) {\n\tif ( function_exists( 'vc_value_from_safe' ) ) {\n\t\treturn vc_value_from_safe( $value );\n\t}\n\t$value = preg_match( '/^#E\\-8_/', $value ) ? rawurldecode( base64_decode( preg_replace( '/^#E\\-8_/', '', $value ) ) ) : $value;\n\tif ( $encode ) {\n\t\t$value = htmlentities( $value, ENT_COMPAT, 'UTF-8' );\n\t}\n\treturn $value;\n}", "public function clean_string($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_STRING);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "public function sanitize ( $mValue )\n {\n return $mValue;\n }", "function _xss_clean($field, $is_image = FALSE)\r\n\t{\r\n\t\t$this->{$field} = xss_clean($this->{$field}, $is_image);\r\n\t}", "function clean($data){\n\t\t$this->data = $data;\n\t\t$data = trim($data);\n\t\t$data = stripcslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "public function xss_clean($value)\n {\n if(is_array($value)) {\n foreach($value as $k => $v) {\n $value[$k] = htmlentities($v);\n }\n }\n else {\n $value = htmlentities($value);\n }\n return $value;\n }", "function cleanseTheData($data) \n\t\t{\n \t\t\t$data = trim($data);\n\t\t\t$data = stripslashes($data);\n\t\t\t$data = htmlspecialchars($data);\n\t\t\treturn $data;\n\t\t}", "private function _sanitize($pValue)\n\t{\n\t\t$value = trim($pValue);\n\t\t$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n\t\t$value = (string)$value;\n\t\treturn $value;\n\t}" ]
[ "0.6317176", "0.6010486", "0.5952495", "0.5931623", "0.5857504", "0.5796812", "0.5747209", "0.5722128", "0.5715729", "0.57015157", "0.5666901", "0.5662041", "0.56577075", "0.56563574", "0.5653173", "0.56082827", "0.5607068", "0.5607063", "0.55888873", "0.55628186", "0.5550418", "0.5544092", "0.55403507", "0.5535733", "0.55287737", "0.552027", "0.55079836", "0.55031425", "0.5498824", "0.5485925" ]
0.70346045
0
Checks time stats for issue.
public function checkTime($project, $issue) { $response = $this->client->createRequest() ->setMethod('get') ->setUrl($this->prepareUrl($project, $issue)) ->addHeaders(['PRIVATE-TOKEN' => $this->token]) ->send(); if ($response->isOk) { return $response->getData(); } Yii::error(VarDumper::dumpAsString($response)); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function v1_check_db_timeframe($name, $key, $code, $stime, $etime, $owners, &$error) {\n\t\n\tglobal $warnings;\n\t\n\t// Format times\n\tif (empty($stime)) {\n\t\t$stime=\"0000-00-00 00:00:00\";\n\t}\n\tif (empty($etime)) {\n\t\t$etime=\"9999-12-31 23:59:59\";\n\t}\n\t\n\t// If already in database, send a warning\n\t$rows=v1_get_id_times($key, $code, $owners);\n\t\n\tforeach ($rows as $row) {\n\t\t// Check time\n\t\t\n\t\t// Format times\n\t\tif (empty($row[$key.'_stime'])) {\n\t\t\t$cmp_stime=\"0000-00-00 00:00:00\";\n\t\t}\n\t\telse {\n\t\t\t$cmp_stime=$row[$key.'_stime'];\n\t\t}\n\t\tif (empty($row[$key.'_etime'])) {\n\t\t\t$cmp_etime=\"9999-12-31 23:59:59\";\n\t\t}\n\t\telse {\n\t\t\t$cmp_etime=$row[$key.'_etime'];\n\t\t}\n\t\t\n\t\t// If start time is same, warning only\n\t\tif ($stime==$cmp_stime) {\n\t\t\t// Warning: already in database\n\t\t\t$warning_msg=$name.\" code=\\\"\".$code.\"\\\"\";\n\t\t\t// 1st owner\n\t\t\tif (!empty($owners[0])) {\n\t\t\t\t$warning_msg.=\" owner1=\\\"\".$owners[0]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 2nd owner\n\t\t\tif (!empty($owners[1])) {\n\t\t\t\t$warning_msg.=\" owner2=\\\"\".$owners[1]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 3rd owner\n\t\t\tif (!empty($owners[2])) {\n\t\t\t\t$warning_msg.=\" owner3=\\\"\".$owners[2]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t$warning_msg.=\" startTime=\\\"\".$stime.\"\\\"\";\n\t\t\tarray_push($warnings, $warning_msg);\n\t\t}\n\t\telse {\n\t\t\t// No error = only if end time strictly before compared start time OR start time strictly after compared end time\n\t\t\tif (strcmp($stime, $cmp_etime)<=0 && strcmp($etime, $cmp_stime)>=0) {\n\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner1=\\\"\".$owners[0]['code'].\"\\\"&gt;, the timeframe [\".$stime.\", \".$etime.\"] overlaps with existing data in database [\".$cmp_stime.\", \".$cmp_etime.\"]\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "function v1_check_db_timeframe3($name, $key, $code, $stime, $etime, $owners, $guest_table, $guest_code, $gguest_table, $gguest_code, &$error) {\n\tglobal $warnings;\n\t// Format times\n\tif (empty($stime)) {\n\t\t$stime=\"0000-00-00 00:00:00\";\n\t}\n\tif (empty($etime)) {\n\t\t$etime=\"9999-12-31 23:59:59\";\n\t}\n\t\n\t// If already in database, send a warning\n\t$rows=v1_get_id_times3($key, $code, $owners, $guest_table, $guest_code, $gguest_table, $gguest_code);\n\t\n\tforeach ($rows as $row) {\n\t\t// Check time\n\t\t// Format times\n\t\tif (empty($row[$key.'_stime'])) {\n\t\t\t$cmp_stime=\"0000-00-00 00:00:00\";\n\t\t}else {\n\t\t\t$cmp_stime=$row[$key.'_stime'];\n\t\t}\n\t\tif (empty($row[$key.'_etime'])) {\n\t\t\t$cmp_etime=\"9999-12-31 23:59:59\";\n\t\t}else {\n\t\t\t$cmp_etime=$row[$key.'_etime'];\n\t\t}\n\t\t\n\t\t// If start time is same, warning only\n\t\tif ($stime==$cmp_stime) {\n\t\t\t// Warning: already in database\n\t\t\t$warning_msg=$name.\" code=\\\"\".$code.\"\\\"\";\n\t\t\t// 1st owner\n\t\t\tif (!empty($owners[0])) {\n\t\t\t\t$warning_msg.=\" owner1=\\\"\".$owners[0]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 2nd owner\n\t\t\tif (!empty($owners[1])) {\n\t\t\t\t$warning_msg.=\" owner2=\\\"\".$owners[1]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 3rd owner\n\t\t\tif (!empty($owners[2])) {\n\t\t\t\t$warning_msg.=\" owner3=\\\"\".$owners[2]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t$warning_msg.=\" startTime=\\\"\".$stime.\"\\\"\";\n\t\t\tarray_push($warnings, $warning_msg);\n\t\t}\n\t\telse {\n\t\t\t// No error = only if end time strictly before compared start time OR start time strictly after compared end time\n\t\t\tif (strcmp($stime, $cmp_etime)<=0 && strcmp($etime, $cmp_stime)>=0) {\n\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner1=\\\"\".$owners[0]['code'].\"\\\"&gt;, the timeframe [\".$stime.\", \".$etime.\"] overlaps with existing data in database [\".$cmp_stime.\", \".$cmp_etime.\"]\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "function v1_check_db_timeframe2($name, $key, $code, $stime, $etime, $owners, $guest_table, $guest_code, &$error) {\n\tglobal $warnings;\n\t// Format times\n\tif (empty($stime)) {\n\t\t$stime=\"0000-00-00 00:00:00\";\n\t}\n\tif (empty($etime)) {\n\t\t$etime=\"9999-12-31 23:59:59\";\n\t}\n\t\n\t// If already in database, send a warning\n\t$rows=v1_get_id_times2($key, $code, $owners, $guest_table, $guest_code);\n\t\n\tforeach ($rows as $row) {\n\t\t// Check time\n\t\t// Format times\n\t\tif (empty($row[$key.'_stime'])) {\n\t\t\t$cmp_stime=\"0000-00-00 00:00:00\";\n\t\t}else {\n\t\t\t$cmp_stime=$row[$key.'_stime'];\n\t\t}\n\t\tif (empty($row[$key.'_etime'])) {\n\t\t\t$cmp_etime=\"9999-12-31 23:59:59\";\n\t\t}else {\n\t\t\t$cmp_etime=$row[$key.'_etime'];\n\t\t}\n\t\t\n\t\t// If start time is same, warning only\n\t\tif ($stime==$cmp_stime) {\n\t\t\t// Warning: already in database\n\t\t\t$warning_msg=$name.\" code=\\\"\".$code.\"\\\"\";\n\t\t\t// 1st owner\n\t\t\tif (!empty($owners[0])) {\n\t\t\t\t$warning_msg.=\" owner1=\\\"\".$owners[0]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 2nd owner\n\t\t\tif (!empty($owners[1])) {\n\t\t\t\t$warning_msg.=\" owner2=\\\"\".$owners[1]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t// 3rd owner\n\t\t\tif (!empty($owners[2])) {\n\t\t\t\t$warning_msg.=\" owner3=\\\"\".$owners[2]['code'].\"\\\"\";\n\t\t\t}\n\t\t\t$warning_msg.=\" startTime=\\\"\".$stime.\"\\\"\";\n\t\t\tarray_push($warnings, $warning_msg);\n\t\t}\n\t\telse {\n\t\t\t// No error = only if end time strictly before compared start time OR start time strictly after compared end time\n\t\t\tif (strcmp($stime, $cmp_etime)<=0 && strcmp($etime, $cmp_stime)>=0) {\n\t\t\t\t$error=\"&lt;\".$name.\" code=\\\"\".$code.\"\\\" owner1=\\\"\".$owners[0]['code'].\"\\\"&gt;, the timeframe [\".$stime.\", \".$etime.\"] overlaps with existing data in database [\".$cmp_stime.\", \".$cmp_etime.\"]\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn TRUE;\n}", "private function checkTimeValidity()\n {\n $inThirtyMinutes = Carbon::createFromFormat('H:i:s', Carbon::now()->toTimeString())->addMinutes(30);\n $pickup_time = Carbon::createFromFormat('H:i', request('pickup_time'));\n $minTime = Carbon::createFromFormat('H:i', \"11:00\");\n $maxTime = Carbon::createFromFormat('H:i', \"22:00\");\n\n $error = false;\n $error_message = '';\n\n if ($pickup_time < $minTime) {\n $error = true;\n $error_message = 'Sorry, this is too early';\n }\n\n if ($pickup_time < $inThirtyMinutes) {\n $error = true;\n $error_message = 'Sorry but You can\\'t pick up earlier than ' . $inThirtyMinutes->toTimeString();\n }\n\n if ($pickup_time > $maxTime) {\n $error = true;\n $error_message = 'Sorry but You can\\'t pick up later than ' . $maxTime->toTimeString();\n }\n\n return ['error' => $error, 'error_message' => $error_message];\n }", "function checkEverytime()\n {\n // ######### Respond in time and maybe also right ###########\n\n // Schnellfeuer\n if (!$this->achieve_array[5][2]) {\n if (count($this->timestamps) > 0) {\n if ((getdate()[0] - end($this->timestamps) <= 2) and ($this->last_evaluation)) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][2])] = $this->achieve_array[2][2];\n $this->last_achievement = $this->achieve_array[0][2];\n $this->achieve_array[5][2] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Luftschuss\n if (!$this->achieve_array[5][60]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) <= 2) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][60])] = $this->achieve_array[2][60];\n $this->last_achievement = $this->achieve_array[0][60];\n $this->achieve_array[5][60] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Spritner\n if (!$this->achieve_array[5][3]) {\n if (count($this->timestamps) > 4) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 5] <= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][3])] = $this->achieve_array[2][3];\n $this->last_achievement = $this->achieve_array[0][3];\n $this->achieve_array[5][3] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Marathonläufer\n if (!$this->achieve_array[5][61]) {\n if (count($this->timestamps) > 9) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 10] <= 60) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][61])] = $this->achieve_array[2][61];\n $this->last_achievement = $this->achieve_array[0][61];\n $this->achieve_array[5][61] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Lichtgeschwindigkeit\n if (!$this->achieve_array[5][62]) {\n if (count($this->timestamps) > 9) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 10] <= 5) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][62])] = $this->achieve_array[2][62];\n $this->last_achievement = $this->achieve_array[0][63];\n $this->achieve_array[5][62] = true;\n $this->achievementCounter++;\n }\n }\n }\n // ######### Do nothing for some time #########\n\n // Eingeschlafen?\n if (!$this->achieve_array[5][1]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][1])] = $this->achieve_array[2][1];\n $this->last_achievement = $this->achieve_array[0][1];\n $this->achieve_array[5][1] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Stillgestanden\n if (!$this->achieve_array[5][58]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 5) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][58])] = $this->achieve_array[2][58];\n $this->last_achievement = $this->achieve_array[0][58];\n $this->achieve_array[5][58] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Toilettenpause\n if (!$this->achieve_array[5][59]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 600) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][59])] = $this->achieve_array[2][59];\n $this->last_achievement = $this->achieve_array[0][59];\n $this->achieve_array[5][59] = true;\n $this->achievementCounter++;\n }\n }\n }\n\n }", "protected function timeExceeded() {\n if ($this->timeLimit == 0) {\n return FALSE;\n }\n $time_elapsed = time() - REQUEST_TIME;\n $pct_time = $time_elapsed / $this->timeLimit;\n if ($pct_time > $this->timeThreshold) {\n $this->showMessage(\n t('Time limit approaching, starting new batch',\n array('!pct' => round($pct_time*100),\n '!usage' => format_size($time_elapsed),\n '!limit' => format_size($this->timeLimit))),\n 'warning');\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "function VerifyTime() {\r\n $current = time();\r\n // check if the session has expired\r\n $this->err_level = 16;\r\n $this->err = \"Verify expire. LastUsed: \" . (string)$this->sessdata[\"lastused\"] . \" ExpireTime: \" . (string)$this->expire_time . \" Current: \" . (string)$current ;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n if ($this->sessdata[\"lastused\"]+$this->expire_time<$current) {\r\n return 0;\r\n }\r\n return 1;\r\n }", "function check_time($ts){\n\n // 1: Read the hh:mm in seperate variables and convert to int\n\t$ts_unix = strtotime($ts);\n\t$ts_hour = idate('H', $ts_unix);\n\t$ts_minute = idate('i',$ts_unix);\n\n // 2: Convert into decimal \n\t$ts_sum = $ts_hour + ($ts_minute * 1/60);\n\n\t$time_now_hour = idate('H');\n\t$time_now_minute = idate('i');\n\t\n\t$time_now_sum = $time_now_hour + ($time_now_minute * 1/60);\n \n // 3: Calculate the difference between now and the timestamp\n\t$div_minutes = ($time_now_sum - $ts_sum) * 60;\n\n // 4: Generate a tag with red background if difference > 5 min\n\tif(($div_minutes <= 5) && ($div_minutes >= 0) && (date(\"Y-m-d\") == date(\"Y-m-d\",$ts_unix)))\n\t{\n\t\treturn '<td class =\"ok_color\">'.$ts.'</td>';\n\t} else\n\t{\n\t\treturn '<td class =\"fail_color\">'.$ts.'</td>';\n\t}\n }", "function check_time($time)\n\t{\n\t\t$components = explode(' ', $time);\n\t\t$date = explode('-', $components[0]);\n\t\t$clock = explode(':', $components[1]);\n\n\t\t// This is really annoying, but we have to check whether each array has the right number of digits, since the next line converts each number to an int.\n\t\tif ((strlen($date[0]) != 4) || (strlen($date[1]) != 2) || (strlen($date[2]) != 2) ||\n\t\t\t(strlen($clock[0]) != 2) || (strlen($clock[1]) != 2) || (strlen($clock[2]) != 2))\n\t\t\treturn false;\n\t\t\n\t\t// now make sure each part of the datetime is valid.\n\t\telse if (!checkdate((int)$date[1], (int)$date[2],(int)$date[0]))\n\t\t\treturn false;\n\t\telse if ((int)$clock[0] > 24 || (int)$clock[0] < 0)\n\t\t\treturn false;\n\t\telse if ((int)$clock[1] > 60 || (int)$clock[1] < 0)\n\t\t\treturn false;\n\t\telse if ((int)$clock[2] > 60 || (int)$clock[2] < 0)\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}", "function ignoringtime ($problem) {\n $result = mysql_db_query (\"vishnu_prob_\" . $problem,\n \"select task_duration_index, setup_duration_index, \" .\n \"wrapup_duration_index, task_unavail_index \" .\n \"from constraints;\");\n $value = mysql_fetch_row ($result);\n mysql_free_result ($result);\n if ((! $value[0]) && (! $value[1]) && (! $value[2]) && (! $value[3]))\n return true;\n $result = mysql_db_query (\"vishnu_prob_\" . $problem,\n \"select multitasking from constraints;\");\n $value = mysql_fetch_row ($result);\n mysql_free_result ($result);\n return $value[0] == \"ignoring_time\";\n }", "function checkEverytime()\n {\n // Schnellfeuer\n if (!$this->achieve_array[5][2]) {\n if (count($this->timestamps) > 0) {\n if ((getdate()[0] - end($this->timestamps) <= 2) and ($this->last_evaluation)) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][2])] = $this->achieve_array[2][2];\n $this->last_achievement = $this->achieve_array[0][2];\n $this->achieve_array[5][2] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Spritner\n if (!$this->achieve_array[5][3]) {\n if (count($this->timestamps) > 4) {\n if (getdate()[0] - $this->timestamps[count($this->timestamps) - 5] <= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][3])] = $this->achieve_array[2][3];\n $this->last_achievement = $this->achieve_array[0][3];\n $this->achieve_array[5][3] = true;\n $this->achievementCounter++;\n }\n }\n }\n // Eingeschlafen erst einmal stumpf machen, also 30 Sekunden keine Frage beantworten\n if (!$this->achieve_array[5][1]) {\n if (count($this->timestamps) > 0) {\n if (getdate()[0] - end($this->timestamps) >= 30) {\n $this->achievementsToDisplay[$this->generateFilename($this->achieve_array[0][1])] = $this->achieve_array[2][1];\n $this->last_achievement = $this->achieve_array[0][1];\n $this->achieve_array[5][1] = true;\n $this->achievementCounter++;\n }\n }\n }\n }", "function health_check()\n {\n $zombies = $this->scheduled_task_model->get_zombies();\n\n if ( $zombies )\n {\n foreach ( $zombies as $zombie )\n {\n $data = array(\n 'type' => config( 'emergency_types' )->scheduled_task,\n 'info' => \"Task: \". $zombie->name,\n 'message' => \"Scheduled task has been running for too long. Check the server \".\n \"and cron log for any errors. It's been moved to active for now.\" );\n\n log_message(\n 'error',\n \"Health Check Failed: \". print_r( $data, TRUE ) );\n\n $data = array(\n 'state' => 'active' );\n\n $this->scheduled_task_model->save( $data, $zombie->id );\n }\n }\n\n return TRUE;\n }", "public function checkTimeEnd(): bool;", "public function validateTokenTime($token) {\n \t// get token validation\n \tif(Reset::where('token', $token)->count() > 0) {\n\t \t$reset = Reset::where('token', $token)->first();\n\n\t \tdate_default_timezone_set('UTC'); \n\t $date_two = date('Y-m-d H:i:s ', time());\n\n\t $minutes = round((strtotime($date_two) - strtotime($reset->updated_at)) / 60,2);\n\t $hours = round((strtotime($date_two) - strtotime($reset->updated_at))/(60*60));\n\n\t if($hours >= 24) {\n\t return \"expired\";\n\t } else {\n\t return \"working\";\n\t }\n\t } else {\n\t \treturn \"working\";\n\t }\n }", "public function hasTimeLimitReached(): bool;", "private function checkFailure() : void\n {\n $failure = (int) $this->session->get('failure', 0);\n $time = (int) $this->session->get('failure_time', time());\n if ($failure >= static::FAILURE) {\n if ($time >= time()) {\n throw new \\DomainException($this->i18n->t(\n 'setrun/user',\n 'Form is blocked for {min} minutes',\n ['min' => static::FAILURE_TIME / 60])\n );\n }\n $this->removeFailure();\n }\n }", "public function getIssueTime()\n {\n return $this->issueTime;\n }", "public function test_it_can_expose_the_percentage_of_time_taken()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time has been taken\n // Work out percentage (Hat tip @ollieread)\n $onePercent = $this->project->getOriginal('total_seconds') / 100;\n $percentage = min(100, ceil($this->project->time_logged_seconds / $onePercent));\n // The percentage should match the project's percentage\n $this->assertSame($this->project->percentage_taken, $percentage);\n }", "function _Fchecktimestchrgrpcnstr($_Mteacher1,$_Mgroup1,$_Mcourse1,&$_Mpossibletimes)\n{\n\t$_Mdayslots=$GLOBALS['_Mdayslots'];$_Mtotslots=$GLOBALS['_Mtotslots'];\n\t$_Mcourseunits=$_Mcourse1->getcourseunits();\n\t$_Mcoursepartunits=$_Mcourse1->getcoursepartunits();\n\t//if($_Mcourseunits==3) $_Mcourseunits++;//3 units needs 4 free slot\n\t$_Mteachertime=$_Mteacher1->getteachertimes();\n\t$_Mgroupstatus=$_Mgroup1->getgroupstatus();\n\t$_Mfreetimecount=0;\n\tfor($i=0 ; $i<$_Mtotslots ; $i++)\n\t{\n\t\t//checkconstraint4course();\n\t\t$_Mttime=$_Mteachertime[$i];$_Mgtime=$_Mgroupstatus[$i];\n\t\t//will correct ; p is assumed f\n\t\tif($_Mttime=='p') $_Mttime='f';\n\t\t//*********************\n\t\t\n\t\tif(($_Mttime=='f')&($_Mgroupstatus[$i]=='f'))\n\t\t $_Mfreetimecount++;\n\t\tif((($_Mttime=='e')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='f'))||\n\t\t (($_Mttime=='e')&($_Mgtime=='f'))//||\n\t\t //(($_Mttime=='p')&($_Mgtime!='s'))//will check other statuses\n\t\t )\n\t\t\t $_Mfreetimecount+=.5;\n\t \t$_Mpossibletimes[$i]=_Fsmaller($_Mttime,$_Mgtime);\n\t\t\n\t}\n\t$_Mcourseremainedtimes=$_Mcourse1->getcourseremainedunits();\n\tif(($_Mfreetimecount>0)&($_Mfreetimecount<$_Mcourseremainedtimes))//if teacher has free slot but not >= courseunits,act according to a total constraint parameter\n\t{\n\t\tglobal $_Mpartialteacherschedule;\n\t\tif($_Mpartialteacherschedule)\n\t\t{ \n\t\t\tarray_push($GLOBALS['_Mteachershavenocmpletefreeslots'],array($GLOBALS['_Mgroup1']->getgroupid(),$_Mcourse1->getcourseid(),$_Mcourse1->getcoursecaption(),$_Mteacher1->teacherid,$_Mteacher1->teacherfamily));\n\t\t\tif(($_Mfreetimecount>=$_Mcoursepartunits)&(($_Mcourse1->getcoursepart()=='c1')||($_Mcourse1->getcoursepart()=='a1')))return true;\n\t\t\telse if(($_Mfreetimecount>=$_Mcoursepartunits)&($_Mcourse1->getotherparttid()==$_Mteacher1->getteacherid()))return true;\n\t\t\telse return false;\n\t\t}\n\t\telse return false;\n\t}\n\n\telse if (($_Mfreetimecount>=$_Mcourseremainedtimes)&&($_Mfreetimecount>0))\n\t return true;\n\telse return false;\n}", "public function hasTime(){\n return $this->_has(3);\n }", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "public function detectTrackerCrash()\n\t{\n\t\t$rs = $this->db->query('SELECT enqueued < DATE_SUB(NOW(), INTERVAL 60 SECOND) AS last_enqueued_delay FROM tweet_queue ORDER BY id DESC LIMIT 1');\n\t\tif ($rs && ($row = $rs->fetch())) {\n\t\t\tif ($row['last_enqueued_delay']) {\n\t\t\t\treturn self::CRASHED;\n\t\t\t} else {\n\t\t\t\treturn self::OK;\n\t\t\t}\n\t\t} else {\n\t\t\treturn self::TEST_FAILED;\n\t\t}\n\t}", "function timecheck ($time) {\n $min = 0;\n if($time->h >= 1) {\n $min += 60*$time->h;\n }\n $min += $time->i;\n if($min == 0) {\n return \"Passage en cours...\";\n } else {\n return $min.\" min\";\n }\n \n\n}", "public function has_time() {\n return in_array( $this->duration_unit, array( 'hour', 'minute' ) );\n }", "public static function CheckTimers() {\n Context::Log(LOG, 'Checking Timers');\n $timers = OmniModel::getInstance()->getTimers($duration);\n Context::Log(INFO, 'EventManger::Check' . var_export($timers, true));\n foreach ($timers as $timer) {\n // \t\t\tvar_dump($timer);\n $caseId = $timer['caseId'];\n $id = $timer['id'];\n $item = CaseSvc::LoadCaseItem($caseId, $id);\n $case = TaskSvc::TimerDue($item);\n }\n }", "function checkTime($stmt, $i){\n\t\tif(floatval(self::$data[$i]['Time']) < floatval($stmt['sequenceStart']) || floatval(self::$data[$i]['Time']) > floatval($stmt['sequenceStart']) + floatval($stmt['sequenceLength']) ){\n\t\t\t$arr = array('success' => 3, 'error_msg' => 'Wrong values');\n\t\t\techo json_encode($arr);\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function calculate_time(){\n\t\t\n\t\t$time_zone = new DateTimeZone('Asia/Colombo');\n\t\t\n\t\t$current_time = new DateTime(\"now\",$time_zone);\n\t\t$temp = $current_time->format(\"Y/m/28 06:00:00\");\n\n\t\t$end_time = new DateTime($temp,$time_zone);\n\t\n//\t\techo date_format($current_time,\"Y/m/d H:i:s\").\"<br>\";\n//\t\techo date_format($end_time,\"Y/m/d H:i:s\").\"<br>\";\n\n\t\t$file = 'timer.txt';\n\t\t\n\t\tif($end_time<$current_time){\n\n\t\t\tif($this->run_once_check($file)){\n\t\t\t\t//run the program\n\t\t\t}\n\t\t}\n\t\telseif(file_exists($file)){\n\t\t\t$this->delete_file($file);\n\t\t}\n\n\t}", "function checkTimeRange($params) {\n\n if (!isset($params['start_date']) || $params['start_date'] == null) {\n return -1;\n }\n \n if (!isset($params['stop_date']) || $params['stop_date'] == null) {\n return -2;\n }\n \n if (!isset($params['start_time']) || $params['start_time'] == null) {\n return -3;\n }\n \n if (!isset($params['end_time']) || $params['end_time'] == null) {\n return -4;\n }\n \n $startTime = $params['start_date'] . ' ' . $params['start_time'];\n $emdTime = $params['stop_date'] . ' ' . $params['end_time'];\n \n if(strtotime($startTime) > strtotime($emdTime)) {\n return -5;\n }\n return 1;\n }", "private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }", "public function hasTime(){\n return $this->_has(6);\n }" ]
[ "0.61271614", "0.5971811", "0.5935898", "0.5827334", "0.58269256", "0.5686257", "0.5610473", "0.55585796", "0.55465066", "0.5545637", "0.5522683", "0.5517942", "0.54512745", "0.5444874", "0.5392815", "0.53843236", "0.5379461", "0.5361531", "0.5360012", "0.53449416", "0.5331893", "0.53277117", "0.53266776", "0.5301983", "0.52795184", "0.5257596", "0.52463746", "0.52157485", "0.5213673", "0.52107286" ]
0.6273215
0
Handle customer subscription updated.
public function handleCustomerSubscriptionUpdated(array $payload) { $user = $this->getCustomerByStripeId($payload['data']['object']['customer']); if ($user) { $data = $payload['data']['object']; $user->subscriptions->filter(function (Subscription $subscription) use ($data) { return $subscription->stripe_id === $data['id']; })->each(function (Subscription $subscription) use ($data) { // Quantity... if (isset($data['quantity'])) { $subscription->quantity = $data['quantity']; } // Plan... if (isset($data['plan']['id'])) { $subscription->stripe_plan = $data['plan']['id']; } // Trial ending date... if (isset($data['trial_end'])) { $trial_ends = Carbon::createFromTimestamp($data['trial_end']); if ( !$subscription->trial_ends_at || $subscription->trial_ends_at->ne($trial_ends) ) { $subscription->trial_ends_at = $trial_ends; } } // Cancellation date... if (isset($data['cancel_at_period_end']) && $data['cancel_at_period_end']) { $subscription->ends_at = $subscription->onTrial() ? $subscription->trial_ends_at : Carbon::createFromTimestamp($data['current_period_end']); } $subscription->save(); }); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleCustomerSubscriptionUpdated($payload)\n {\n // Handle The Event\n $user = $this->getUserByStripeId($payload['data']['object']['customer']);\n if ( $user ) {\n $subscription = $user->subscriptions->filter(function ($subscription) use ($payload) {\n return $subscription->stripe_id === $payload['data']['object']['id'];\n })->first();\n $subscription->current_period_start = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_start']);\n $subscription->current_period_end = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_end']);\n $subscription->status = $payload['data']['object']['status'];\n $subscription->name = $payload['data']['object']['plan']['name'];\n\n\n try{\n $client = new Client;\n $result = $client->request('POST', 'https://api2.autopilothq.com/v1/contact', [\n 'headers' => [\n 'autopilotapikey' => env('AUTOP'),\n 'Content-Type' => 'application/json'\n ],\n 'json' => [\n 'contact' => [\n 'Email' => $user->email,\n 'custom' => [\n 'string--Subscription--Status' => $payload['data']['object']['status'],\n 'string--Subscription--Plan' => $payload['data']['object']['plan']['name'],\n ],\n '_autopilot_list' => '9ECC7B84-9EB3-43EB-8C08-72A20E2573EA'\n ]\n ]\n ]);\n \n } catch (RequestException $e) {\n \n } catch (ClientException $e) {\n \n }\n\n\n $subscription->save();\n return $subscription;\n }\n\n }", "protected function handleSubscriptionUpdated(array $data): void\n {\n $this->configureStripeClient();\n $stripeSubscription = $data['data']['object'];\n $subscription = Subscription::find()->status(null)->reference($stripeSubscription['id'])->one();\n\n if (!$subscription) {\n Craft::warning('Subscription with the reference “' . $stripeSubscription['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');\n\n return;\n }\n\n // See if we care about this subscription at all\n $subscription->setSubscriptionData($data['data']['object']);\n\n $this->setSubscriptionStatusData($subscription);\n\n if (empty($data['data']['object']['plan'])) {\n Craft::warning($subscription->reference . ' contains multiple plans, which is not supported. (event \"' . $data['id'] . '\")', 'stripe');\n } else {\n $planReference = $data['data']['object']['plan']['id'];\n $plan = Commerce::getInstance()->getPlans()->getPlanByReference($planReference);\n\n if ($plan) {\n $subscription->planId = $plan->id;\n } else {\n Craft::warning($subscription->reference . ' was switched to a plan on Stripe that does not exist on this Site. (event \"' . $data['id'] . '\")', 'stripe');\n }\n }\n\n Commerce::getInstance()->getSubscriptions()->updateSubscription($subscription);\n }", "public function updateSubscription($request);", "public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }", "public function syncSubscriptions($stripe_customer_id)\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n \n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\t$result_json = \\Stripe\\Customer::retrieve($stripe_customer_id);\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Subscription update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\t//print_r($result_json);die;\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n $subs = $result_json->subscriptions->data;\n\t\t\t\n\t\t\tDb::getInstance()->Execute('DELETE from '._DB_PREFIX_.'stripepro_subscription where `id_customer`='.(int)Tools::getValue('id_customer'));\n\t\t\tif(count($subs)>0)\n\t\t\tforeach($subs as $sub){\n\t\t\t\tDb::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_subscription (stripe_subscription_id, stripe_customer_id, id_customer, stripe_plan_id, quantity, current_period_start, current_period_end, status, date_add) VALUES (\\''.$sub->id.'\\', \\''.$stripe_customer_id.'\\', '.(int)Tools::getValue('id_customer').',\\''.$sub->plan->id.'\\', '.(int)$sub->quantity.', \\''.$sub->current_period_start.'\\',\n\t\t\\''.$sub->current_period_end.'\\', \\''.$sub->status.'\\', NOW())');\n\t\t\n\t\t\t }\n\t\t\t}\n\t\n\treturn true;\n\t\n\t}", "function ihc_update_stripe_subscriptions(){\n\tglobal $wpdb;\n\t$data = $wpdb->get_results(\"SELECT id, txn_id, payment_data FROM \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\t\tWHERE txn_id LIKE 'ch_%';\");\n\tif (count($data)){\n\n\t\t//loading stripe libs\n\t\trequire_once IHC_PATH . 'classes/stripe/init.php';\n\t\t$secret_key = get_option('ihc_stripe_secret_key');\n\t\t\\Stripe\\Stripe::setApiKey($secret_key);\n\n\t\tforeach ($data as $obj){\n\t\t\t$payment_data = json_decode($obj->payment_data);\n\t\t\tif (!empty($payment_data->customer)){\n\t\t\t\t$replace_txn_id = $payment_data->customer;\n\t\t\t} else {\n\t\t\t\t$stripe_obj = \\Stripe\\Charge::retrieve($obj->txn_id);\n\t\t\t\tif (!empty($stripe_obj->customer)){\n\t\t\t\t\t$replace_txn_id = $stripe_obj->customer;\n\t\t\t\t}\n\t\t\t\tunset($stripe_obj);\n\t\t\t}\n\t\t\tif (!empty($replace_txn_id)){\n\t\t\t\t$wpdb->query(\"UPDATE \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\tSET txn_id='\" . $replace_txn_id . \"'\n\t\t\t\t\t\t\t\tWHERE id= '\" . $obj->id . \"';\n\t\t\t\t\t\t\");\n\t\t\t\tunset($replace_txn_id);\n\t\t\t}\n\t\t}//end foreach\n\t}\n}", "public function updatesubscription($slug) {\n $paymentData = $this->repository->proccessSubscriptionPayment ( $slug );\n\n if (isset ( $paymentData )) {\n return view ( 'payment::customer.payment.ccavRequestHandler' )->with ( 'encrypted_data', $paymentData );\n } else {\n return false;\n }\n }", "public function handleCustomerSubscriptionCreated($payload)\n {\n // Handle The Event\n $user = $this->getUserByStripeId($payload['data']['object']['customer']);\n if ( $user ) {\n\n $subscription = $user->subscriptions->filter(function ($subscription) use ($payload) {\n return $subscription->stripe_id === $payload['data']['object']['id'];\n })->first();\n\n $subscription->current_period_start = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_start']);\n $subscription->current_period_end = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_end']);\n $subscription->status = $payload['data']['object']['status'];\n $subscription->save();\n\n return $subscription;\n }\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public static function subscriptionDiscountUpdated($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionDiscountUpdated', $callback);\n }", "public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"&#039;\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }", "public function update()\n {\n return $this->putResource(sprintf('/%s', str_replace('{{subscriber_code}}', $this->subscriber_code, self::PATH)));\n }", "public function onUpdateCustomer($event)\n\t{\n\n\t\t$this->init();\n\n\t\t$objCustomer = $event->objCustomer;\n\n\n\t\t$intListId = $this->getListId($this->objModule->getConfig('list'));\n\n\t\tif (!is_null($intListId))\n\t\t{\n\t\t\t$merge_vars = array(\n\t\t\t\t'FNAME'=>$objCustomer->first_name,\n\t\t\t\t'LNAME'=>$objCustomer->last_name\n\t\t\t);\n\t\t\tif($objCustomer->newsletter_subscribe)\n\t\t\t{\n\n\t\t\t\t//Verify this person is really on the mailing list\n\t\t\t\t$arrReturn = $this->api->listMemberInfo($intListId, $objCustomer->email);\n\n\t\t\t\tYii::log(\"listMemberInfo returned \".print_r($arrReturn,true), 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t\tif ($arrReturn['success'])\n\t\t\t\t\t$retval = $this->api->listUpdateMember($intListId, $objCustomer->email,$merge_vars);\n\t\t\t\telse\n\t\t\t\t\treturn $this->onAddCustomer($event); //just send this to the Add routine\n\n\t\t\t\tYii::log(\"listUpdateMember returned \".print_r($retval,true), 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->api->listUnsubscribe($intListId, $objCustomer->email); //goodbye\n\t\t\t\tYii::log(\"listUnsubscribe sent for \".$objCustomer->email, 'info', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t}\n\n\t\t\tif ($this->api->errorCode)\n\t\t\t{\n\t\t\t\tYii::log(\"Unable to load listUpdateMember() Code=\".$this->api->errorCode.\" Msg=\".$this->api->errorMessage, 'error', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\t\treturn false;\n\t\t\t} else\n\t\t\t\treturn true;\n\n\t\t} else {\n\t\t\tYii::log(\"Mailchimp - can't find list \".$this->objModule->getConfig('list'), 'error', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\t\treturn false;\n\t\t}\n\n\n\n\t\treturn true;\n\n\n\t}", "function update_sub_Customer ($cust) {\n $data = array(\n 'cust_sub_id' => $cust['sub_id']\n );\n $this->db->where('cust_rp_id', $cust['cust_rp_id']);\n $this->db->update('customer', $data); \n }", "public function update(Request $request, Subscribe $subscribe)\n {\n //\n }", "public function subscription($customer_id)\n {\n $customer = \\Stripe\\Customer::retrieve([\n 'id' => $customer_id,\n ]);\n $collection = new Collection($customer->subscriptions->data);\n return $collection->sortByDesc(function ($value) {\n return $value->created;\n })->first();\n }", "public function subscribeCustomer($customer)\n {\n //prüfen ob Magento Plugin aktiviert ist.\n if (!$this->helper->isMailingworkEnabled()) {\n return parent::subscribeCustomer($customer);\n }\n $this->loadByCustomer($customer);\n\n if ($customer->getImportMode()) {\n $this->setImportMode(true);\n }\n\n if (!$customer->getIsSubscribed() && !$this->getId()) {\n // If subscription flag not set or customer is not a subscriber\n // and no subscribe below\n return $this;\n }\n\n if(!$this->getId()) {\n $this->setSubscriberConfirmCode($this->randomSequence());\n }\n\n /*\n * Logical mismatch between customer registration confirmation code and customer password confirmation\n */\n $confirmation = null;\n if ($customer->isConfirmationRequired() && ($customer->getConfirmation() != $customer->getPassword())) {\n $confirmation = $customer->getConfirmation();\n }\n\n $sendInformationEmail = false;\n if ($customer->hasIsSubscribed()) {\n $status = $customer->getIsSubscribed()\n ? (!is_null($confirmation) ? self::STATUS_UNCONFIRMED : self::STATUS_SUBSCRIBED)\n : self::STATUS_UNSUBSCRIBED;\n /**\n * If subscription status has been changed then send email to the customer\n */\n if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) {\n $sendInformationEmail = true;\n }\n } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && (is_null($confirmation))) {\n $status = self::STATUS_SUBSCRIBED;\n $sendInformationEmail = true;\n } else {\n $status = ($this->getStatus() == self::STATUS_NOT_ACTIVE ? self::STATUS_UNSUBSCRIBED : $this->getStatus());\n }\n\n if($status != $this->getStatus()) {\n $this->setIsStatusChanged(true);\n }\n\n $this->setStatus($status);\n\n if(!$this->getId()) {\n $storeId = $customer->getStoreId();\n if ($customer->getStoreId() == 0) {\n $storeId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();\n }\n $this->setStoreId($storeId)\n ->setCustomerId($customer->getId())\n ->setEmail($customer->getEmail());\n } else {\n $this->setStoreId($customer->getStoreId())\n ->setEmail($customer->getEmail());\n }\n\n $sendSubscription = $customer->getData('sendSubscription') || $sendInformationEmail;\n if (is_null($sendSubscription) xor $sendSubscription) {\n if ($this->getIsStatusChanged() && $status == self::STATUS_UNSUBSCRIBED) {\n $result = $this->mwOptoutRecipient(true);\n } elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) {\n $result = $this->mwOptinRecipient(true);\n }\n }\n\n $this->save();\n return $this;\n }", "public function updated(CustomerInquiry $customerInquiry)\n {\n\n }", "public function update()\n {\n try {\n $customers = $this->getShopifyCustomers();\n\n foreach($customers as $c) {\n $customer = new Customer();\n $customer->update($c);\n }\n\n return $this->sendResponse(Customer::all(), 'Customers updates successfully.');\n\n } catch (\\Exception $e) {\n return $this->sendError($e->getMessage());\n }\n }", "protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }", "public function Update()\n {\n \t$rs = mysql_query(\"UPDATE subscriptions SET subscription_name_fr='\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', subscription_name_en='\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_fr='\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_en='\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_by_id='\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_date='\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t \t\t\t\t \"' WHERE subscription_id=\" . $this->subscription_id);\n \t\t\n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\n }", "public function subscribeCustomer($customer) {\n if (Mage::helper('contactlab_subscribers')->skipSubscribeCustomer()) {\n return;\n }\n return parent::subscribeCustomer($customer);\n }", "protected function _processTransactionSubscriptionModified($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\t\t\t$subscriptionStatus = $this->fetch('subscriptions', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'id' => $parameters['subscription_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'status'\n\t\t\t\t)\n\t\t\t));\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t!empty($subscriptionStatus['count']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$subscriptionData[0]['status'] = $subscriptionStatus['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' modified',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_modified',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function account_updated(){\n $this->log();\n http_response_code(200);\n ob_end_flush();\n }", "public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }", "public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);", "public function update(Request $request, Customer $customer)\n {\n //\n }", "public function update(Request $request, Customer $customer)\n {\n //\n }", "public function update(Request $request, Customer $customer)\n {\n //\n }" ]
[ "0.7938381", "0.6629907", "0.6474294", "0.6454521", "0.64393604", "0.6368669", "0.6290253", "0.6255986", "0.6196972", "0.6196972", "0.59801406", "0.59479505", "0.5939963", "0.59267765", "0.5903966", "0.589188", "0.58612907", "0.58470136", "0.5829545", "0.58078426", "0.5796042", "0.57716435", "0.57516646", "0.5742614", "0.5740125", "0.57283866", "0.5724053", "0.57127875", "0.57127875", "0.57127875" ]
0.7524786
1
Handle customer source deleted.
public function handleCustomerSourceDeleted(array $payload) { if ($user = $this->getCustomerByStripeId($payload['data']['object']['customer'])) { $user->updateCardFromStripe(); } // TODO: update our payment sources table return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($customerId);", "public function deleted() {\n // TODO Implement this\n }", "public function deleted(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "function deleteCustomer() {\n\n // Delete all notes of customer\n $stmt = $GLOBALS['con']->prepare(\"DELETE FROM customerNotes WHERE customer_id = ?\");\n $stmt->bind_param(\"s\", $uid);\n\n $uid = validateInput('delete', 'post');\n\n $stmt->execute();\n $stmt->close();\n\n\n // Delete customer \n $stmt = $GLOBALS['con']->prepare(\"DELETE FROM customerInfo WHERE id = ?\");\n $stmt->bind_param(\"s\", $uid);\n \n $uid = validateInput('delete', 'post');\n\n $stmt->execute();\n $stmt->close(); \n }", "public function destroy(Request $request, Source $source)\n {\n $source->delete();\n $request->session()->flash('message', 'Successfully deleted the source!');\n return redirect('sources');\n }", "public function delete($customerId)\n {\n $customer = Customer::find(decrypt($customerId));\n $customer->delete();\n return redirect()->route('admin.customer.index');\n }", "public function destroy(Customer $customer)\n {\n //\n }", "public function destroy(Customer $customer)\n {\n //\n }", "public function destroy(Customer $customer)\n {\n //\n }", "public function destroy(Customer $customer)\n {\n //\n }", "public function destroy(Customer $customer)\n {\n //\n }", "public function destroy(Source $source)\n {\n\n $source->delete();\n\n // flash()->success('Source has been deleted.');\n\n return redirect()->route('sources.index');\n }", "public function deleted(Currency $currency)\n {\n //\n }", "protected function _preDelete() {}", "public function destroy(Customer $customer)\n { \n dd($customer);\n if($customer->delete()){\n return 'Record Deleted';\n }\n }", "public function customer_delete($id)\n {\n $sales = $this->MSales_master->get_by_customer_id($id);\n if (count($sales) > 0)\n {\n $this->session->set_flashdata('error', 'Customer can\\'t delete, S/He is in Sales List.');\n }\n else\n {\n $this->MCustomers->delete($id);\n }\n\n redirect('inventory/customer-list', 'refresh');\n }", "public function deleteSource()\n {\n return Yii::$app->storage->fileSystemDeleteFile($this->filter_id . '_' . $this->file->name_new_compound);\n }", "public function deleted(CustomerInquiry $customerInquiry)\n {\n\n }", "public function deleted(Country $country)\n {\n\n }", "function getListDeleteCustomer()\n {\n $model = new CustomerModel();\n $getListCustomer = $model->getListCustomerDel();\n\n //set view and title\n $title = TITLE_LIST_CUSTOMERS;\n $view = \"View/v_list-delete-customer.php\";\n include(DIRECTORY_ADMIN_VIEW);\n }", "public function destroy(Customers $customer)\n {\n // $customer->delete();\n // return redirect()->route('customers.index')->with('success', 'Customer has been deleted');\n }", "public function listsPatientsourcesdelete($patientsources_id)\r\n {\r\n $deleted_source = Sources::destroy($patientsources_id);\r\n if($deleted_source){\r\n return response()->json(['msg' => 'Deleted patient source']);\r\n }\r\n }", "public function deleted(Credit $credit)\n {\n\n }", "public function delete()\n {\n\t\t$res = $this->getDB()->delete('customers',['customer_ID'=>$this->getId()]);\n \n // Check to see if the query ran properly.\n if(!$res)\n {\n throw new Exception('The customer was not deleted from the database, something went wrong in the SQL statement.');\n }\n }", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "function delete()\n {\n global $connection;\n //echo \"Im on the customers ->delete()\";\n\n //else\n //{\n #set_error_handler\n #set_exception_handler\n #call the stored procedure\n //$SQLQuery = \"DELETE FROM customers \" \n // . \" WHERE customer_username = :customer_username;\";\n $SQLQuery = \"CALL customers_delete(\"\n . \":customer_username);\";\n $PDOStatement = $connection->prepare($SQLQuery);\n $PDOStatement->bindParam(\":customer_username\", $this->customer_username); \n $PDOStatement->execute(); \n }", "public static function deleted($event) {\n\n\t\t$account = $event->getSubject();\n\n\t}", "function delete_customer($customer_id)\n {\n return $this->db->delete('customer',array('customer_id'=>$customer_id));\n }", "public function delCustomerById($id){ \n $delquery = \"DELETE FROM tbl_customer WHERE id = '$id'\";\n $delData = $this->db->delete($delquery);\n if ( $delData ) {\n echo \"<script> alert('Customer Deleted successfully.');</script>\";\n echo \"<script> window.location = 'customer-list.php'; </script>\";\n } else {\n echo \"<script> alert('Customer not deleted !');</script>\";\n echo \"<script> window.location = 'customer-list.php'; </script>\";\n }\n }", "public function preDelete() { }" ]
[ "0.6692381", "0.6154661", "0.61180973", "0.61180395", "0.6079464", "0.60732335", "0.6065986", "0.60385084", "0.60385084", "0.60385084", "0.60385084", "0.6021553", "0.5993087", "0.59712505", "0.5969775", "0.5968384", "0.59656453", "0.59332234", "0.5929563", "0.59080976", "0.59065104", "0.59060585", "0.58987415", "0.5891496", "0.58907473", "0.58869743", "0.5853785", "0.58445656", "0.58443826", "0.5836146" ]
0.75575286
0
Function enables caching. Params can be passed as an associative array or a set of param=value strings. phpSmug uses the PEAR MDB2 module to interact with the database. You will need to install PEAR, the MDB2 module and corresponding database driver yourself in order to use database caching.
public function enableCache() { $args = phpSmug::processArgs( func_get_args() ); $this->cacheType = $args['type']; $this->cache_expire = ( array_key_exists( 'cache_expire', $args ) ) ? $args['cache_expire'] : '3600'; $this->cache_table = ( array_key_exists( 'table', $args ) ) ? $args['table'] : 'phpsmug_cache'; if ( $this->cacheType == 'db' ) { require_once 'MDB2.php'; $db =& MDB2::connect( $args['dsn'] ); if ( PEAR::isError( $db ) ) { $this->cacheType = FALSE; return "CACHING DISABLED: {$db->getMessage()} {$db->getUserInfo()} ({$db->getCode()})"; } $this->cache_db = $db; $options = array( 'comment' => 'phpSmug cache', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci' ); $fields = array( 'request' => array( 'type' => 'text', 'length' => '35', 'notnull' => TRUE ), 'response' => array( 'type' => 'clob', 'notnull' => TRUE ), 'expiration' => array( 'type' => 'integer', 'notnull' => TRUE ) ); $db->loadModule('Manager'); $db->createTable( $this->cache_table, $fields, $options ); $db->setOption('idxname_format', '%s'); // Make sure index name doesn't have the prefix $db->createIndex( $this->cache_table, 'request', array( 'fields' => array( 'request' => array() ) ) ); if ( $db->queryOne( "SELECT COUNT(*) FROM $this->cache_table") > $this->max_cache_rows ) { $diff = time() - $this->cache_expire; $db->exec( "DELETE FROM {$this->cache_table} WHERE expiration < {$diff}" ); $db->query( 'OPTIMIZE TABLE ' . $this->cache_table ); } } elseif ( $this->cacheType == 'fs' ) { if ( file_exists( $args['cache_dir'] ) && ( is_dir( $args['cache_dir'] ) ) ) { $this->cache_dir = realpath( $args['cache_dir'] ).'/phpSmug/'; if ( is_writeable( realpath( $args['cache_dir'] ) ) ) { if ( !is_dir( $this->cache_dir ) ) { mkdir( $this->cache_dir, 0755 ); } $dir = opendir( $this->cache_dir ); while ( $file = readdir( $dir ) ) { if ( substr( $file, -6 ) == '.cache' && ( ( filemtime( $this->cache_dir . '/' . $file ) + $this->cache_expire ) < time() ) ) { unlink( $this->cache_dir . '/' . $file ); } } } else { $this->cacheType = FALSE; return 'CACHING DISABLED: Cache Directory "'.$args['cache_dir'].'" is not writeable.'; } } else { $this->cacheType = FALSE; return 'CACHING DISABLED: Cache Directory "'.$args['cache_dir'].'" doesn\'t exist, is a file or is not readable.'; } } return (bool) TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cache();", "function start_cache()\r\n\t{\r\n\t\t$this->db->start_cache();\r\n\t}", "function setcache( $name, $d, $b = NULL )\n{\n\t\treturn FALSE;\n}", "public function setCaching($cache);", "abstract protected function cacheData();", "public static function cacheEnabled($mnt,$command,$params,$path)\n{\nif (!is_null(self::$caching)) return self::$caching;\n\nif (is_null($mnt)) return false;\n\nreturn self::instance($mnt)->cacheEnabled($command,$params,$path);\n}", "function cachePage($params=array()){\n\t\t$PageID = $this->getPageID($params);\n\t\t\n\t\tif ( !isset($params['data']) ) trigger_error('Missing parameter \"data\": '.Dataface_Error::printStackTrace(), E_USER_ERROR);\n\t\t$Data = $params['data'];\n\t\t$Language = ( isset($params['lang']) ? $params['lang'] : $this->app->_conf['lang']);\n\t\tif ( class_exists('Dataface_AuthenticationTool') ){$auth =& Dataface_AuthenticationTool::getInstance();\n\t\t\t$UserID = ( isset($params['user']) ? $params['user'] : $auth->getLoggedInUsername());\n\t\t} else {\n\t\t\t$UserID = null;\n\t\t}\n\t\t\n\t\t$Expires = (isset($params['expires']) ? $params['expires'] : time() + $this->lifeTime);\n\t\t$tables = (isset($params['tables']) ? $params['tables'] : '');\n\t\t$Dependencies = (is_array($tables) ? implode(',',$tables) : $tables);\n\t\t\n\t\tif ( $this->useGzipCompression && extension_loaded('zlib') ){\n\t\t\t// If we are using GZIP compression then we will use zlib library\n\t\t\t// functions (gzcompress) to compress the data also for storage\n\t\t\t// in the database.\n\t\t\t// Apparently we have to play with the headers and footers of the \n\t\t\t// gzip file for it to work properly with the web browsers.\n\t\t\t// see http://ca.php.net/gzcompress user comments.\n\t\t\t\n\t\t\t$size = strlen($Data);\n\t\t\t$crc = crc32($Data);\n\t\t\t/*\n\t\t\t$Data_gz = \"\\x1f\\x8b\\x08\\x00\\x00\\x00\\x00\\x00\".\n\t\t\t\t\t\tsubstr(gzcompress($Data,9),0, $size-4).\n\t\t\t\t\t\t$this->_gzipGetFourChars($crc).\n\t\t\t\t\t\t$this->_gzipGetFourChars($size);\n\t\t\t*/\n\t\t\t/* Fix for IE compatibility .. seems to work for mozilla too. */\n\t\t\t$Data_gz = \"\\x1f\\x8b\\x08\\x00\\x00\\x00\\x00\\x00\".\n\t\t\t\t\t\tsubstr(gzcompress($Data,9),0, $size);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif ( isset($params['randomize']) and $params['randomize'] ){\n\t\t\t// We are keeping multiple versions of this page so that we can \n\t\t\t// show them on a random rotation. This is to simulate dynamicism\n\t\t\t// while still caching pages.\n\t\t\t\n\t\t\t// Basically the following query will delete existing cached versions\n\t\t\t// of this page except for the most recent X versions - where X\n\t\t\t// is the number specified in the $randomize parameter. The \n\t\t\t// $randomize parameter is the number of versions of this page\n\t\t\t// that should be used on random rotation.\n\t\t\t$res = mysql_query(\"\n\t\t\t\tDELETE FROM `\".addslashes($this->tableName).\"`\n\t\t\t\tWHERE \n\t\t\t\t\t`PageID`='\".addslashes($PageID).\"' AND\n\t\t\t\t\t`Language`='\".addslashes($Language).\"' AND\n\t\t\t\t\t`UserID`='\".addslashes($UserID).\"' AND\n\t\t\t\t\t`GenID` NOT IN (\n\t\t\t\t\t\tSELECT `GenID` FROM `\".addslashes($this->tableName).\"`\n\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t`PageID`='\".addslashes($PageID).\"' AND\n\t\t\t\t\t\t\t`Language`='\".addslashes($Language).\"' AND\n\t\t\t\t\t\t\t`UserID`='\".addslashes($UserID).\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t`LastModified` desc\n\t\t\t\t\t\tLIMIT \".(intval($params['randomize']) - 1).\"\n\t\t\t\t)\", $this->app->db() );\n\t\t\t\n\t\t\tif ( !$res ){\n\t\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t\t}\n\t\t} else {\n\t\t\t// We are not randomizing. We delete any existing pages.\n\t\t\t$res = mysql_query(\"\n\t\t\t\tDELETE FROM `\".addslashes($this->tableName).\"`\n\t\t\t\tWHERE\n\t\t\t\t\t`PageID`='\".addslashes($PageID).\"' AND\n\t\t\t\t\t`Language`='\".addslashes($Language).\"' AND\n\t\t\t\t\t`UserID`='\".addslashes($UserID).\"'\", $this->app->db());\n\t\t\tif ( !$res ){\n\t\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get the headers so we can reproduce them properly.\n\t\tif ( function_exists('headers_list') ){\n\t\t\t$headers = serialize(headers_list());\n\t\t} else {\n\t\t\t$headers = array();\n\t\t}\t\n\t\t\n\t\t// Now we can insert the cached page.\n\t\t$sql = \"\n\t\t\tINSERT INTO `\".addslashes($this->tableName).\"`\n\t\t\t(`PageID`,`Language`,`UserID`,`Dependencies`,`Expires`,`Data`,`Data_gz`, `Headers`)\n\t\t\tVALUES\n\t\t\t('\".addslashes($PageID).\"',\n\t\t\t '\".addslashes($Language).\"',\n\t\t\t '\".addslashes($UserID).\"',\n\t\t\t '\".addslashes($Dependencies).\"',\n\t\t\t FROM_UNIXTIME('\".addslashes($Expires).\"'),\n\t\t\t '\".addslashes($Data).\"',\n\t\t\t '\".addslashes($Data_gz).\"',\n\t\t\t '\".addslashes($headers).\"'\n\t\t\t)\";\n\t\t\t//file_put_contents('/tmp/dump.sql',$sql);\n\t\t$res = mysql_query($sql, $this->app->db());\n\t\t\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t}\n\t\n\t\tif ( @$this->app->_conf['_output_cache']['cachedir'] ){\n\t\t\t$filename = DATAFACE_SITE_PATH.'/'.$this->app->_conf['_output_cache']['cachedir'];\n\t\t\t$dir = $PageID{0};\n\t\t\t$filename = $filename.'/'.$dir;\n\t\t\tif ( !file_exists($filename)){\n\t\t\t\tmkdir($filename, 0777);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$filename .= '/'.$PageID.'-'.md5($Language.'-'.$UserID);\n\t\t\tif ( file_exists($filename) ){\n\t\t\t\t@unlink($filename);\n\t\t\t} \n\t\t\t//echo \"Opening $filename\";\n\t\t\t$fh = fopen($filename, 'w');\n\t\t\tif ( $fh ){ \n\t\t\t\tfwrite($fh, $Data);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\t\n\t\t\t$fh = fopen($filename.'.gz', 'w');\n\t\t\tif ( $fh ){\n\t\t\t\tfwrite($fh, $Data_gz);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t}", "public function sqlCache()\n\t{\n\t\t$this->cache = true;\n\t\treturn $this;\n\t}", "public function cache($options = true);", "public function useCache($a_use = true)\n\t{\n\t\t$this->use_cache = $a_use;\n\t}", "public function enableCache()\n\t{\n\t\t$this->_enableCache = true;\n\t}", "function &createCache() {}", "public function onQueryBuilt(&$params, &$oRequest, &$args)\n\t{\n\t\tif (!strstr($args[0]->query['select'], 'SELECT SQL_CACHE ')) {\n\t\t\t$args[0]->query['select'] = str_replace('SELECT', 'SELECT SQL_CACHE ', $args[0]->query['select']);\n\t\t}\n\t}", "public function enableCaching()\n {\n $this->cache = true;\n }", "function cachedSQL($sSQL) {\n if($objResultset = clsMem::getMem()->get(MD5($sSQL))) {\n // return the cached resultset\n return $objResultSet;\t\n }\n else {\n $objResultSet = mysql_query($sSQL);\n // Store the resultset in the cache (30 mins with zlib compression)\n clsMem::getMem()->set(MD5($sSQL), $objResultSet, true, 1800);\n // return it \n return $objResultSet;\n }\n}", "public function enableCache() :void\n {\n Settings::setCache($this->cacheAdapter->buildCache());\n }", "public function setUpCache();", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}", "public function startCache() {}", "public static function setCache($cache) {}", "public function updateCache();", "public static function enableCaching(): void\n {\n static::$caching = true;\n }", "public function Cache($uuid, $method, $params, $forceRebuild = true)\r\n\t{\r\n\t\t// cached path\r\n\t\t$cached = apc_fetch($uuid);\r\n\t\tif( $cached !== false && !$forceRebuild )\r\n\t\t{\r\n\t\t\t$this->logger->write(\"Cache hit: $uuid\");\r\n\t\t\treturn $cached;\r\n\t\t}\r\n\r\n\t\t// uncached path\r\n\t\t$result = call_user_func_array($method, $params);\r\n\r\n\t\tself::Save($uuid, $result);\r\n\r\n\t\treturn $result;\r\n\t}", "function smarty_function_db($params, &$smarty)\n{\n extract($params);\n switch($function) {\n\tcase \"fetch\":\n\t return content::fetch($key);\n\t break;\n\tdefault:\n\t return;\n\t break;\n }\n}", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "private function setDriver($params)\n {\n if (isset($params['driver'])) {\n return Cache::driver($params['driver']);\n } \n return Cache::driver();\n }", "public function cacheQuery( $queryStr, $queryTitle ){\r\n $st = $this->_connections[$this->_activeConnection]->prepare($queryStr);\r\n $this->_queryCache[$queryTitle] = $st;\r\n\t\t$st = NULL;\r\n }", "public function setCacheDriver($cacheDriver);", "protected function initializeCache() {}", "protected function initializeCache() {}" ]
[ "0.6279587", "0.6259032", "0.6239676", "0.6148387", "0.6139618", "0.60149646", "0.6008643", "0.59923345", "0.59058154", "0.5872038", "0.5841732", "0.58288556", "0.5762605", "0.5752095", "0.5749241", "0.57316184", "0.5715388", "0.5714111", "0.57120615", "0.5705842", "0.5688278", "0.56727064", "0.5658323", "0.5614704", "0.55848193", "0.55605155", "0.5547604", "0.5541999", "0.55406535", "0.5534172" ]
0.7683221
0
Set a proxy for all phpSmug calls. Params can be passed as an associative array or a set of param=value strings.
public function setProxy() { $args = phpSmug::processArgs( func_get_args() ); $this->proxy['server'] = $args['server']; $this->proxy['port'] = $args['port']; $this->proxy['username'] = ( isset( $args['username'] ) ) ? $args['username'] : ''; $this->proxy['password'] = ( isset( $args['password'] ) ) ? $args['password'] : ''; $this->proxy['auth_scheme'] = ( isset( $args['auth_scheme'] ) ) ? $args['auth_scheme'] : 'basic'; $this->req->setConfig( array( 'proxy_host' => $this->proxy['server'], 'proxy_port' => $this->proxy['port'], 'proxy_user' => $this->proxy['username'], 'proxy_password' => $this->proxy['password'], 'proxy_auth_scheme' => $this->proxy['auth_scheme'] ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setProxy($proxy);", "public function setServiceProxy($serviceProxy);", "public function setParams($params);", "public function setParams($params);", "public function setProxyHost($host);", "public function set($params) {}", "private function _setParams ()\n {\n $endpoint = $this->_endpoint->getData();\n if (count($endpoint) > 0) {\n \n $method = $this->_endpoint->getUrl();\n $methodname = 'setParameter' . ucfirst($method['method']);\n \n $this->_httpclient->{$methodname}('access_token', \n $this->_accesstoken);\n $this->_httpclient->{$methodname}('api_secret', $this->_apisecret);\n \n foreach ($endpoint as $param => $value) {\n $this->_httpclient->{$methodname}($param, $value);\n }\n }\n }", "public function setParams(array $params);", "public function setParams(array $params);", "public function setParams(array $params);", "private function setProxyPort($pp){\n\t\t$this->proxy_port = $pp;\n\t}", "public function setParams(array $params, $reset = true) {}", "function setProxy($proxy=true){\n $this->platform->setProxy($proxy);\n }", "public function setParameters($params) {\n\t\t$defaultParams = $this->params;\n\t\t$allParams = array_merge($defaultParams, $params);\n\n\t\t$this->validateParameters($allParams);\n\n\t\t// Save parameters as they were\n\t\t$this->params = $allParams;\n\n\t\t// Update request URLs from the new parameters\n\t\t$this->urlRaw = $this->build();\n\t\t$this->url = $this->build(true);\n\t}", "function setProxySettings($proxyHost, $proxyPort, $proxyUserName, $proxyPassword) {\n\t\t$this->m_proxyHost = $proxyHost;\n\t\t$this->m_proxyPort = $proxyPort;\n\t\t$this->m_proxyUserName = $proxyUserName;\n\t\t$this->m_proxyPassword = $proxyPassword;\n\t}", "private function setParams($params)\n\t{\n\t\t$this->params = $params;\n\t}", "public function setParams($params) {\n\t\t$this->params = array();\n\t\t$this->addParams($params);\n\t}", "public function setParams(array $params) :void;", "public function setParams(array $params): void;", "private function set_proxy(array $options) {\r\n $this->proxyhost = $options['host'];\r\n\r\n if (isset($options['port'])) {\r\n $this->proxyport = $options['port'];\r\n }\r\n if (isset($options['user'])) {\r\n $this->proxyuser = $options['user'];\r\n }\r\n if (isset($options['password'])) {\r\n $this->proxypassword = $options['password'];\r\n }\r\n }", "function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}", "function setParams($params) {\n $this->params = $params;\n }", "public function setParams($params)\n {\n $this->_params = $params;\n }", "public function setParams($params)\n {\n $this->_params = $params;\n }", "protected function setParams($params)\n {\n // endpoint\n if (isset($params['Endpoint'])) {\n $this->setEndPoint($params['Endpoint']);\n unset($params['Endpoint']);\n } else {\n $this->setEndPoint();\n }\n\n // service\n if (isset($params['Service'])) {\n $this->setService($params['Service']);\n unset($params['Service']);\n } else {\n $this->setService();\n }\n\n // remaining\n if (is_array($params)) {\n $this->params = array_merge($this->params, $params);\n }\n }", "public function set_proxy($proxy, $auth = '')\n {\n $this->proxy = $proxy;\n $this->proxypwd = $auth;\n }", "public function setParams($params)\n {\n $this->params = $params;\n }", "public function setParams( $params )\r\n\t{\r\n\t\t$this->params = $params;\r\n\t}", "public function setParams($params) {\n $this->params = $params;\n }", "public function setup($params)\n {\n if ($this->env === \"local\") {\n $this->people = new Proxy($params);\n }\n\n // otherwise, get a regular search object\n else {\n $this->people = new Searcher($params, $this->env);\n }\n\n }" ]
[ "0.6654264", "0.61954415", "0.61682546", "0.61682546", "0.6131174", "0.6087372", "0.5995669", "0.5954034", "0.5954034", "0.5954034", "0.59122795", "0.58826774", "0.58574283", "0.58197844", "0.5814522", "0.57948357", "0.5783386", "0.5780164", "0.5777162", "0.5725216", "0.5723951", "0.5719681", "0.56646514", "0.56646514", "0.5616888", "0.56039697", "0.5578514", "0.5574371", "0.55720687", "0.5544203" ]
0.6998684
0
Set Token and Token Secret for use by other methods in phpSmug. Use this method to pull in the token and token secret obtained during the OAuth authorisation process. If OAuth is being used, this method MUST be called so phpSmug knows about the token and token secret. NOTE: It's up to the application developer using phpSmug to store the Access token and token secret in a location convenient for their application. phpSmug can not do this as all storage and caching done by phpSmug is of a temporary nature.
public function setToken() { $args = phpSmug::processArgs( func_get_args() ); $this->oauth_token = $args['id']; $this->oauth_token_secret = $args['Secret']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setToken($token, $token_secret) {}", "protected function _setOauthToken()\n {\n $this->_initHttpClient($this->_endpointUrls['access_token'], CurlHttpClient::POST);\n $this->_httpClient->setPostParam('client_id', $this->_config['client_id']);\n $this->_httpClient->setPostParam('client_secret', $this->_config['client_secret']);\n $this->_httpClient->setPostParam('grant_type', $this->_config['grant_type']);\n $this->_httpClient->setPostParam('redirect_uri', $this->_config['redirect_uri']);\n $this->_httpClient->setPostParam('code', $this->getAccessCode());\n $this->_oauthToken = $this->_getHttpClientResponse();\n }", "public function setOAuthTokenSecret($tokenSecret)\n {\n $this->oauthToken->setTokenSecret($tokenSecret);\n }", "public function set_access_token($token, $secret) {\n $this->access_token = $token;\n $this->access_token_secret = $secret;\n }", "protected function access_token() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token'] = $_SESSION['oauth']['oauth_token'];\r\n\t\t$this->tmhOAuth->config['user_secret'] = $_SESSION['oauth']['oauth_token_secret'];\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/access_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_verifier' => $_REQUEST['oauth_verifier']\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$token = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->conf->TwitterOAuthToken = $token['oauth_token'];\r\n\t\t\t$this->conf->TwitterOAuthSecret = $token['oauth_token_secret'];\r\n\t\t\t$this->conf->TwitterUsername = $token['screen_name'];\r\n\t\t\t$this->conf->write();\r\n\t\t\tunset($_SESSION['oauth']);\r\n\t\t\theader('Location: ' . SocialHelper::php_self());\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "public static function set_token_access() {\n if (SesLibrary::_get('_uuid') || SesLibrary::_get('_uuid') == null) {\n $param = [\n 'uri' => config('app.base_api_uri') . '/generate-token-access?deviceid=' . SesLibrary::_get('_uuid'),\n 'method' => 'GET'\n ];\n $this->__init_request_api($param);\n }\n }", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "public function get_oauth_token_secret() {\n\t\treturn $this->_oauth_token_secret;\n\t}", "public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }", "private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}", "public function loadAccessToken()\n {\n $this->setHeader(self::HEADER_TYPE_BASIC, self::TOKEN_HEADER);\n\n $curl = new Curl;\n\n $opt = [\n 'grant_type' => $this->grant,\n 'username' => $this->username,\n 'password' => $this->password,\n 'scope' => $this->scope\n ];\n\n $token = $curl->post(self::BASE_API_URL.self::TOKEN_END_POINT, $opt, $this->getHeader());\n\n $this->saveAccessToken($token);\n }", "public function setOAuthToken(string $token, string $tokenSecret): void\n {\n $this->authorizer->setToken(new Token($token, $tokenSecret));\n }", "public function setTokenSecret(string $tokenSecret): void\n {\n $this->setParam($this->tokenSecretParamKey, $tokenSecret);\n }", "public function _getAccessToken()\n {\n $this->setAccessToken($this->_getStoreConfig($this->path_access_token));\n }", "public function setToken($token, $token_secret = null) {\n\n\t\tparent::setToken($token, $token_secret);\n\t}", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function init()\n {\n $this->accessToken = 'EAAPgIZBacbTMBAJnVjjmoOW3tjZClqcJDUP3NZB5Dbi72zA2Ix8tE5qviZAE4BF3UqluxlZCLAOnlqe0WYeTXGZBTesuyGPQXb7iPZAC2qOWnX376GvrvZAiO34bcEJ7TYyPqgqV2uLZAkvHD8DkjuPZC7OEpS91ydHnNXbEPpclLSQQZDZD';\n }", "private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }", "private function setCredentials()\n\t{\n\t\t$this->credentials['app_token'] = $this->settings_repo->getSiteSetting('facebook', 'app_token');\n\t\t$this->credentials['page_id'] = $this->settings_repo->getSiteSetting('facebook', 'page_id');\n\t}", "public function getSecret() {\n return $this->accessSecret;\n }", "public function getOAuthTokenSecret()\n {\n return $this->oauthToken->getTokenSecret();\n }", "protected function _getOAuth () {\n\n\t\t$callback = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$encrypter = new \\Dropbox\\OAuth\\Storage\\Encrypter(self::encrypter_secret);\n\t\t$storage = new \\Dropbox\\OAuth\\Storage\\Session($encrypter);\n\n\t\t// spoof storage using token stored with plugin\n\t\tif ($this->is_authorized()) {\n\t\t\t$storage->set($this->_plugin->setting(self::token_setting), 'access_token');\n\t\t}\n\n\t\t$OAuth = new \\Dropbox\\OAuth\\Consumer\\Curl(self::consumer_key, self::consumer_secret, $storage, $callback);\n\n\t\treturn $OAuth;\n\t}", "public function setToken() {\n $base_uri = $this->remoteSite->get('protocol') . '://' . $this->remoteSite->get('host');\n $options = array(\n 'base_uri' => $base_uri,\n 'allow_redirects' => TRUE,\n 'timeout' => 5,\n 'connect_timeout' => 5,\n );\n\n $token = $this->httpClient->request('get', 'rest/session/token', $options)->getBody();\n return $token->__toString();\n }", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "private function getAccessToken() {\n\n // set the request token and secret we have stored\n $this->tmhOAuth->config['user_token'] = $_SESSION['authtoken'];\n $this->tmhOAuth->config['user_secret'] = $_SESSION['authsecret'];\n\n\n // send request for an access token\n $this->tmhOAuth->request('POST', $this->tmhOAuth->url('oauth/access_token', ''), array(\n\n // pass the oauth_verifier received from Twitter\n 'oauth_verifier' => $_GET['oauth_verifier']\n ));\n\n\n\n if($this->tmhOAuth->response['code'] == 200) {\n\n // get the access token and store it in a cookie\n $response = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\n setcookie('access_token', $response['oauth_token'], time()+3600*24*30);\n setcookie('access_token_secret', $response['oauth_token_secret'], time()+3600*24*30);\n\n // state is now 2\n $_SESSION['authstate'] = 2;\n\n // redirect user to clear leftover GET variables\n header('Location: ' . $this->tmhOAuth->php_self());\n\n exit;\n }\n\n return false;\n }", "public function setAccessToken($token);", "public function __construct($oauth_token = NULL, $oauth_token_secret = NULL){\n\t\t$key = Config::get('social.twitter.app_id');\n\n\t\t// Set the Consumer Secret\n\t\t$secret = Config::get('social.twitter.app_secret');\n\n\t\t$oauth_token = Config::get('social.twitter.access_token');\n\t\t$oauth_token_secret = Config::get('social.twitter.access_token_secret');\n\n\t\t// Log::info('app key '.$key);\n\t\t// Log::info('app secret '.$secret);\n\t\t// Log::info('client token '.$oauth_token);\n\t\t// Log::info('client token secret '.$oauth_token_secret);\n\t\t\n\t\tparent::__construct($key, $secret, $oauth_token, $oauth_token_secret);\n\t}", "public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "protected function getAccessToken($oauth_token) {\n\n\t}", "function getAccessToken($token = NULL) {\n\t\t$r = $this->oAuthRequest ( $this->accessTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}" ]
[ "0.699483", "0.69315577", "0.6595747", "0.6577421", "0.6567299", "0.6528033", "0.65255195", "0.6441816", "0.6316078", "0.62788004", "0.6229927", "0.6209302", "0.6206399", "0.61687607", "0.6126485", "0.6120952", "0.61163235", "0.6081622", "0.6048413", "0.6047142", "0.6026594", "0.6011514", "0.6008295", "0.599593", "0.59724927", "0.5968666", "0.59461606", "0.5909355", "0.58779967", "0.5861883" ]
0.73831743
0
Force the use of the secure/HTTPS API endpoint for ALL API calls, not just those entailing authentication. This is only implemented if authenticating using OAuth.
public function setSecureOnly() { if ( isset( $this->OAuthSecret ) ) { $this->secure = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function enableSecureApiUrl()\n\t{\n\t\t$this->api_url = self::API_SECURE_URL;\n\t}", "public function forceSSL();", "public function forceSSL();", "public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}", "public static function secure() {\r\n\t\tif (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])==='on') return;\r\n\t\theader(\"Location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\");\r\n }", "protected function _initForceSSL() {\n\t\tif($_SERVER['SERVER_PORT'] != '443') {\n\t\t\theader('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t\texit();\n\t\t}\n\t}", "final protected function make_secure() {\n\t\t$url = \"https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n\t\tif (!empty($_SERVER['QUERY_STRING']))\n\t\t\t$url .= \"?{$_SERVER['QUERY_STRING']}\";\n\t\t$this->response->redirect($url);\n\t}", "public function getSecureApiUrl()\n {\n $this->urlHelper->setData('secure_is_forced', true);\n $url = $this->urlHelper->getUrl('magemail/jsonApi', array('_nosid' => true, '_secure' => true));\n\n return $url;\n }", "private function _secureBackend()\n\t{\n\t\tif (!$this->_isAuthenticated()) {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t\texit();\n\t\t}\n\t}", "function Secure()\r\n\t{\r\n\t\tarray_walk($_GET, array($this, 'secureGET'));\r\n\t\tarray_walk($_POST, array($this, 'securePOST'));\r\n\t}", "function force_ssl_admin($force = \\null)\n {\n }", "function forceSSL() {\r\tif(empty($_SERVER[\"HTTPS\"]) || $_SERVER[\"HTTPS\"] !== \"on\") {\r\t\theader(\"Location: https://\" . $_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\r\t\texit();\r\t}\r}", "function force_ssl_login($force = \\null)\n {\n }", "private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }", "public function disableSSLChecks() {}", "public function secure()\n\t{\n\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')\n\t\t\t|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO']\n\t\t\t\t&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');\n\t}", "protected function sslRedirection()\n {\n return;\n }", "function ensureHTTPS()\r\n {\r\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' && $_SERVER['HTTPS'] !== 'off')\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n // Get current page url and query string\r\n $host = strlen($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n // Redirect to the secure url \r\n redirectToURL(\"https://${host}${uri}\");\r\n }\r\n }", "public function requireNonSSL(){\n $requireNonSecure = array_map('strtolower', func_get_args());\n if (in_array(strtolower($this->action), $requireNonSecure) || $requireNonSecure == array('*')) {\n if ($this->RequestHandler->isSSL()) {\n $this->redirect('http://' . rtrim(env('SERVER_NAME'), '/') . $this->here);\n return;\n }\n }\n }", "static function Secure(){\n\t\tif(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == \"off\"){\n\t\t $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t header('HTTP/1.1 301 Moved Permanently');\n\t\t header('Location: ' . $redirect);\n\t\t exit();\n\t\t}\n\t}", "public function secure () {\n return ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] === 443)) ? true : false;\n }", "function force_ssl() {\n\t global $psts;\n return (bool)$psts->get_setting('stripe_ssl', false);\n\t}", "public function isSecure()\n {\n return false;\n }", "private function enhanceHttpSecurity() {\n // remove exposure of PHP version (at least where possible)\n \\header_remove('X-Powered-By');\n\n // if the user is signed in\n if ($this->isLoggedIn()) {\n // prevent clickjacking\n \\header('X-Frame-Options: sameorigin');\n // prevent content sniffing (MIME sniffing)\n \\header('X-Content-Type-Options: nosniff');\n\n // disable caching of potentially sensitive data\n \\header('Cache-Control: no-store, no-cache, must-revalidate', true);\n \\header('Expires: Thu, 19 Nov 1981 00:00:00 GMT', true);\n \\header('Pragma: no-cache', true);\n }\n }", "public static function forceAuthentication() {\n\t\tif (!self::authenticated()) {\n\t\t\tself::redirectToLogin();\n\t\t}\n\t}", "public function checkSslBackendAndRedirectIfNeeded() {}", "function force_ssl(){\n\tif(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == \"off\"){\n\t $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t header('HTTP/1.1 301 Moved Permanently');\n\t header('Location: ' . $redirect);\n\t exit();\n\t}\n}", "public function isSecure()\n {\n return (prent::isSecure()\n || $this->getServer('X_FORWARDED_PROTO') === parent::SCHEME_HTTPS);\n }", "public function requiresAuthentication() {\n return false;\n }", "public function secure()\n {\n return $this->server()->is('HTTPS', 'on');\n }" ]
[ "0.7629247", "0.6483349", "0.6483349", "0.6221475", "0.6219704", "0.607342", "0.6046817", "0.59489435", "0.59404254", "0.59313446", "0.59069496", "0.5902335", "0.5901926", "0.5899939", "0.5794965", "0.5794198", "0.5760691", "0.57158405", "0.56829065", "0.56658196", "0.5651665", "0.5632013", "0.5621812", "0.557082", "0.55653334", "0.555433", "0.55540866", "0.55403614", "0.5533095", "0.55219257" ]
0.6814595
1
Single login function for all nonOAuth logins. I've created this function to try and get things consistent across the entire phpSmug functionality. This method will determine the login type from the arguments provided. If no arguments are provide, anonymous login will be used.
public function login() { if ( func_get_args() ) { $args = phpSmug::processArgs( func_get_args() ); if ( array_key_exists( 'EmailAddress', $args ) ) { // Login with password $this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) ); } else if ( array_key_exists( 'UserID', $args ) ) { // Login with hash $this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) ); } $this->loginType = 'authd'; } else { // Anonymous login $this->loginType = 'anon'; $this->request( 'smugmug.login.anonymously' ); } $this->SessionID = $this->parsed_response['Login']['Session']['id']; return $this->parsed_response ? $this->parsed_response['Login'] : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkLogin($type=''){\n\t\tif ($type == 'A'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n\t\t}else if ($type == 'P'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n\t\t}else if ($type == 'U'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n\t\t}else if ($type == 'T'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\n\t\t}\n }", "public function checkLogin($type=''){\n \tif ($type == 'A'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n \t}else if ($type == 'P'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n \t}else if ($type == 'U'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n \t}else if ($type == 'T'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\t\t\t\n \t}\n }", "public function login()\n\t{\n\t\tif (func_num_args() < 2)\n\t\t{\n\t\t\tthrow new Auth_Exception('Minimum two params required to log in');\n\t\t}\n\n\t\t// automatically logout\n\t\t$this->logout();\n\n\t\t$params = func_get_args();\n\t\t$driver_name = array_shift($params);\n\t\t$driver = $this->driver($driver_name);\n\t\tif ($user = call_user_func_array(array($driver, 'login'), $params))\n\t\t{\n\t\t\t$this->_complete_login($user, $driver_name);\n\t\t\t// check for autologin option\n\t\t\t$remember = (bool)arr::get($params, 1, FALSE);\n\t\t\tif ($remember)\n\t\t\t{\n\t\t\t\t$token = $this->orm()->generate_token($user, $driver_name, $this->_config['lifetime']);\n\t\t\t\tCookie::set($this->_autologin_key, $token->token);\n\t\t\t}\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "abstract protected function doLogin();", "function is_login()\n {\n }", "public function getLoginType()\n {\n $value = $this->get(self::LOGIN_TYPE);\n return $value === null ? (integer)$value : $value;\n }", "function getLoginUserType()\n {\n if (evo()->isFrontend() && evo()->session('webValidated')) {\n return 'web';\n }\n\n if (evo()->isBackend() && evo()->session('mgrValidated')) {\n return 'manager';\n }\n\n return '';\n }", "abstract protected function loginImpl(string $username, string $password): bool;", "public function isLogin();", "protected function detectLoginProvider() {}", "public function login();", "public function login();", "public function actionLogin($type) {\n\t\t$type = @$_GET['type'];\n\t\tif (!$type)\n\t\t\treturn $this->redirect(array('site/index'));\n\t\tYii::app()->session['type'] = $type;\n\t\t$authUrl = Yii::app()->singly->getAuthServiceUrl($this->getCallbackUrl(), $type);\n\t\t$this->redirect($authUrl);\n\t}", "abstract public function createLoginService($type='');", "function loginUser($username,$password,$return=true);", "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "function login();", "public function login($request)\n {\n $loginType = strtolower($request->type);\n try {\n switch ($loginType) {\n case 'member':\n return $this->memberLogin($request);\n break;\n case 'user':\n return $this->userLogin($request);\n break;\n default:\n throw new \\App\\Exceptions\\MemberLoginWrongTypeException;\n break;\n }\n } catch (\\Exception $err) {\n throw $err;\n }\n }", "public static function LogIn ($userName = '', $password = '');", "function verify_login($user_type, $index_page){\n\t$user_info = isset($_SESSION['user_info']) ? unserialize($_SESSION['user_info']) : null;\n\t//echo \"info: \".var_dump($user_info);\n\n\t// if the user isn't logged in or it doesn't have the proper rights\n\tif ($user_info == null or \n\t\t$user_info->user_type != strtolower($user_type) or \n\t\t!isset($_SESSION['authorized']) or \n\t\t$_SESSION['authorized'] != 1) {\n\t\treserved_area_message($index_page);\n\t\texit();\n\t}\n\n\t// Ohterwise show the username\n\t$username = $user_info->username; \n\techo \"$user_type username: $username\";\n}", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function login($userName, $password);", "function login_user( $user, $password )\n {\n //Unimplemented\n }", "public function login(string $username, string $password): int|string|null;", "function login()\n\t{\n\t\t$GLOBALS['appshore']->session->createSession();\n\n\t\t$GLOBALS['appshore_data']['layout'] = 'auth';\n\t\t\n\t\t// define next action\n\t\t$result['action']['auth'] = 'login';\n\n\t\t// if a query_string was passed without being auth we keep it to deliver it later\n\t\tif( strpos( $_SERVER[\"QUERY_STRING\"], 'op=') !== false )\n\t\t\t$result['nextop'] = base64_encode($_SERVER[\"QUERY_STRING\"]);\n\t\t\t\n\t\treturn $result;\n\t}", "function handle_logins()\n{\n if (get_param_integer('httpauth', 0) == 1) {\n require_code('users_inactive_occasionals');\n force_httpauth();\n }\n $username = trim(post_param_string('login_username', ''));\n if (($username != '') && ($username != do_lang('GUEST'))) {\n require_code('users_active_actions');\n handle_active_login($username);\n }\n\n // If it was a log out\n $page = get_param_string('page', ''); // Not get_page_name for bootstrap order reasons\n if (($page == 'login') && (get_param_string('type', '', true) == 'logout')) {\n require_code('users_active_actions');\n handle_active_logout();\n }\n}", "public static function loginBySession()\n\t{\n\t\tif (Sessions::get('loggedIn')) :\n\t\t\tAuth::redirectUser(Sessions::get('user/type'));\n\t\tendif;\n\t}" ]
[ "0.6717653", "0.6710744", "0.6575434", "0.65627545", "0.6548706", "0.64384073", "0.6414711", "0.639196", "0.63869643", "0.6370147", "0.63649166", "0.63566893", "0.63566893", "0.63230646", "0.6279442", "0.6231368", "0.6199923", "0.61956143", "0.6194676", "0.6190852", "0.6181086", "0.6176532", "0.6176532", "0.6176532", "0.61649776", "0.6159264", "0.6148792", "0.61362183", "0.6113181", "0.60964584" ]
0.7755936
0
Sign the passed resource with the OAuth params. This essentially generates a signature for the passed URL and returns a string with the OAuth parameters and signature appended. This is very useful for allowing people to display images that are not set to allow external view within the gallery's settings on SmugMug.
public function signResource( $url ) { if ( $this->OAuthSecret ) { $sig = $this->generate_signature( null, null, $url ); $oauth_params = array ( 'oauth_version' => '1.0', 'oauth_nonce' => $this->oauth_nonce, 'oauth_timestamp' => $this->oauth_timestamp, 'oauth_consumer_key' => $this->APIKey, 'oauth_signature_method' => $this->oauth_signature_method, 'oauth_token' => $this->oauth_token, 'oauth_signature' => $sig ); // Build and return the query string. return $url . '?' . http_build_query( $oauth_params ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sign($url) {\n $url_parts = parse_url($url);\n $name_value_pairs = isset($url_parts['query']) ? explode(\"&\",$url_parts['query']) : array();\n $query_string_params = array();\n foreach($name_value_pairs as $nvp) {\n $param = explode('=',$nvp);\n $query_string_params[urldecode($param[0])] = count($param>1) ? urldecode($param[1]) : \"\";\n }\n\n if(!isset($url_parts['port'])) \n $port = \"\";\n else \n $port = \":\".$url_parts['port'];\n\n $url_no_params = $url_parts['scheme'].\"://\".$url_parts['host'].$port.$url_parts['path'];\n $req = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, \"GET\", $url_no_params, $query_string_params);\n $req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, $this->access_token);\n $signed_url = $req->to_url();\n // dbg(\"Authorized $url as $signed_url\");\n return $signed_url;\n }", "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "public function signature( $oauth_params, $resource, $rest_method, &$request_params=null, $param_filter='', $encode=true )\n {\n // open data\n $data = strtoupper($rest_method) . \"&\" . urlencode($resource) . \"&\";\n\n // build request params\n $sig_params = $oauth_params->signature_parameters();\n //print_r($sig_params);\n\n // append params, no overwrite\n if( $request_params != null && is_array($request_params) )\n {\n\tforeach( $request_params as $k=>$v )\n\t{\n\t $uk = urlencode($k);\n\t if( !isset($sig_params[$uk]) && \n\t !isType($param_filter, $k) && \n\t !isType('oauth_signature|oauth_token_secret', $k))\n\t $sig_params[ $uk ] = $encode ? urlencode($v) : $v;\n\t}\n }\n\n // sort\n ksort( $sig_params, SORT_STRING );\n //print_r($sig_params);\n\n // key=value\n array_walk( $sig_params, create_function('&$i,$k', '$i = \"{$k}={$i}\";') );\n\n // delimit &\n $data .= implode( \"&\", $sig_params );\n\n //echo '<br />' . $data . '<br />';\n\n // sign with params\n return $oauth_params->sign( $data );\n }", "function signUrl($myUrlToSign, $privateKey)\n{\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "function signUrl($myUrlToSign, $privateKey) {\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "public function sign($http_method, $url, $params, $secret) {\n $sig = array(\n strtoupper($http_method),\n preg_replace('/%7E/', '~', rawurlencode($url)),\n rawurlencode($this->get_signable_parameters($params)),\n );\n\n $base_string = implode('&', $sig);\n $sig = base64_encode(hash_hmac('sha1', $base_string, $secret, true));\n return $sig;\n }", "private function _generateSignature($params, $request_method = 'GET', $url = self::API_REST_URL)\n {\n uksort($params, 'strcmp');\n $params = self::url_encode_rfc3986($params);\n\n // Make the base string\n $base_parts = array(\n strtoupper($request_method),\n $url,\n urldecode(http_build_query($params, '', '&'))\n );\n $base_parts = self::url_encode_rfc3986($base_parts);\n $base_string = implode('&', $base_parts);\n\n // Make the key\n $key_parts = array(\n $this->_consumer_secret,\n ($this->_token_secret) ? $this->_token_secret : ''\n );\n $key_parts = self::url_encode_rfc3986($key_parts);\n $key = implode('&', $key_parts);\n\n // Generate signature\n return base64_encode(hash_hmac('sha1', $base_string, $key, true));\n }", "public function signRequest(OAuth_Request $request, $consumer_secret, $token_secret = '');", "function MakeSignedRequest()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'Version',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result);\n echo $result['body'];\n}", "function get_signable_parameters($params){\n $sorted = $params;\n ksort($sorted);\n\n $total = array();\n foreach ($sorted as $k => $v) {\n if ($k == 'oauth_signature') {\n continue;\n }\n\n $total[] = rawurlencode($k) . '=' . rawurlencode($v);\n }\n return implode('&', $total);\n }", "private function sign_url( $myUrlToSign, $privateKey ) {\n\t\t\t// parse the url\n\t\t\t$url = parse_url( $myUrlToSign );\n\n\t\t\t$urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n\t\t\t// Decode the private key into its binary format\n\t\t\t$decodedKey = $this->decode_Base64UrlSafe( $privateKey );\n\n\t\t\t// Create a signature using the private key and the URL-encoded\n\t\t\t// string using HMAC SHA1. This signature will be binary.\n\t\t\t$signature = hash_hmac( \"sha1\", $urlPartToSign, $decodedKey, true );\n\n\t\t\t$encodedSignature = $this->encode_Base64UrlSafe( $signature );\n\n\t\t\treturn $myUrlToSign . \"&signature=\" . $encodedSignature;\n\t\t}", "public function signParams($params) {\n $signing = '';\n $values = array();\n\t\t$secret = $this->getSecret();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return implode('&', $values);\n }", "public function sign($url, $expiration, $timeunit);", "public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string\n {\n $aUrl = parse_url($sUrlToSign);\n $aUrl['query'] .= '&client=' .$sClientId;\n\n $aUrlToSign = $aUrl['path'].\"?\".$aUrl['query'];\n\n $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));\n\n $sSignature = hash_hmac(\"sha1\", $aUrlToSign, $decodedKey, true);\n\n $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));\n\n $sOriginalUrl = $aUrl['scheme'].\"://\".$aUrl['host'].$aUrl['path'] . \"?\".$aUrl['query'];\n\n return $sOriginalUrl. '&signature='. $sEncodedSignature;\n }", "public function get_signable_parameters()\n {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n if (isset($params['oauth_signature']))\n unset($params['oauth_signature']);\n\n // Urlencode both keys and values\n $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));\n $values = OAuthUtil::urlencode_rfc3986(array_values($params));\n $params = array_combine($keys, $values);\n\n // Sort by keys (natsort)\n uksort($params, 'strcmp');\n\n // Generate key=value pairs\n $pairs = array();\n foreach ($params as $key=>$value )\n {\n if (is_array($value))\n {\n // If the value is an array, it's because there are multiple\n // with the same key, sort them, then add all the pairs\n natsort($value);\n foreach ($value as $v2)\n $pairs[] = $key . '=' . $v2;\n }\n else\n $pairs[] = $key . '=' . $value;\n }\n\n // Return the pairs, concated with &\n return implode('&', $pairs);\n }", "public function getSignature(RequestInterface $request, array $params)\r\n {\r\n\r\n // Remove oauth_signature if present\r\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\r\n unset($params['oauth_signature']);\r\n\r\n // Add POST fields if the request uses POST fields and no files\r\n $body = $request->getBody();\r\n if ($body instanceof PostBodyInterface && !$body->getFiles()) {\r\n $query = Query::fromString($body->getFields(true));\r\n $params += $query->toArray();\r\n }\r\n\r\n // Parse & add query string parameters as base string parameters\r\n $query = Query::fromString((string)$request->getQuery());\r\n $query->setEncodingType(Query::RFC1738);\r\n $params += $query->toArray();\r\n\r\n $baseString = $this->createBaseString(\r\n $request,\r\n $this->prepareParameters($params)\r\n );\r\n\r\n // changed code\r\n return base64_encode(hash_hmac('sha1', $baseString, $this->consumer_secret, true));\r\n }", "public function get_signature_base_string() {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "public function sign($uri)\n {\n $url = parse_url($uri);\n if (isset($url['query'])) {\n parse_str($url['query'], $params);\n } else {\n $params = array();\n }\n\n $uri = $this->buildUrl($url, $params);\n\n return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri);\n }", "public function get_signature_base_string()\n {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "abstract public function build_signature($request, $consumer, $token);", "abstract public function build_signature($request, $consumer, $token);", "public function get_signable_parameters() {\n\t\t// Grab all parameters\n\t\t$params = $this->params;\n\n\t\t// Remove oauth_signature if present\n\t\t// Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n\t\tif ( isset( $params[ static::prefix . 'signature' ] ) ) {\n\t\t\tunset( $params[ static::prefix . 'signature' ] );\n\t\t}\n\n\t\treturn \\OAuthSignature::build_http_query( $params );\n\t}", "private function generate_signature( $apicall, $apiargs = NULL, $url = NULL )\n\t {\n\t\t$this->oauth_timestamp = time();\n\t\t$this->oauth_nonce = md5(time() . mt_rand());\n\n\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) {\n\t\t\tif ( substr( $apicall,0,8 ) != 'smugmug.' ) {\n\t\t\t\t$apicall = 'smugmug.' . $apicall;\n\t\t\t}\n\t\t}\n\t\tif ( $this->oauth_signature_method == 'PLAINTEXT' ) {\n\t\t\treturn phpSmug::urlencodeRFC3986( $this->OAuthSecret ).'&'.phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t} else {\n\t\t\t$this->oauth_signature_method = 'HMAC-SHA1';\n\t\t\t$encKey = phpSmug::urlencodeRFC3986( $this->OAuthSecret ) . '&' . phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t\t\n\t\t\tif ( is_null( $apicall ) && !is_null( $url ) ) {\n\t\t\t\t$endpoint = $url;\n\t\t\t} else if ( strpos( $apicall, 'Token' ) || $this->secure && $apicall != 'Upload' ) {\n\t\t\t\t$endpoint = \"https://secure.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t//$proto = ( $this->oauth_signature_method == 'PLAINTEXT' || $this->secure ) ? 'https' : 'http';\n\t\t\t\t//$endpoint = $proto . '://upload.smugmug.com/'.$apiargs['FileName'];\t// No support for secure uploads yet\n\t\t\t\t$endpoint = 'http://upload.smugmug.com/'.$apiargs['FileName'];\n\t\t\t} else {\n\t\t\t\t$endpoint = \"http://api.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_null( $apicall ) ) {\n\t\t\t\t$method = 'GET';\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t$method = 'PUT';\n\t\t\t} else {\n\t\t\t\t$method = 'POST';\n\t\t\t}\n\t\t\t$params = array (\n\t\t\t\t'oauth_version' => '1.0',\n\t\t\t\t'oauth_nonce' => $this->oauth_nonce,\n\t\t\t\t'oauth_timestamp' => $this->oauth_timestamp,\n\t\t\t\t'oauth_consumer_key' => $this->APIKey,\n\t\t\t\t'oauth_signature_method' => $this->oauth_signature_method\n\t\t\t\t);\n\t\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) $params = array_merge( $params, array('method' => $apicall ) );\n\t\t\t$params = ( !empty( $this->oauth_token ) ) ? array_merge( $params, array( 'oauth_token' => $this->oauth_token ) ) : $params;\n\t\t\tif ( $apicall != 'Upload' ) $params = ( !empty( $apiargs ) ) ? array_merge( $params, $apiargs ) : $params;\n\t\t $keys = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_keys( $params ) );\n\t\t $values = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_values( $params ) );\n\t\t\t$params = array_combine( $keys, $values );\n\t\t // Sort by keys (natsort)\n\t\t uksort( $params, 'strnatcmp' );\n\t\t\t// We can't use implode() here as it plays havoc with array keys with empty values.\n\t\t\t$count = count( $params );\n\t\t\t$string = '';\n\t\t\tforeach ( $params as $key => $value ) {\n\t\t\t\t$count--;\n\t\t\t\t$string .= $key . '=' . $value;\n\t\t\t\tif ( $count )\t{\n\t\t\t\t\t$string .= '&';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$base_string = $method . '&' . phpSmug::urlencodeRFC3986( $endpoint ) . '&' . phpSmug::urlencodeRFC3986( $string );\n\t\t\t$sig = base64_encode( hash_hmac( 'sha1', $base_string, $encKey, true ) );\n\t\t\treturn $sig;\n\t\t}\n\t }", "private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}", "public function generateSignature(string $toSign): GenerateSignatureResponse;", "public function signUrl($url)\n {\n return $this->signer->signUrl($url);\n }", "public function get_signable_parameters() {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n if (isset($params['oauth_signature'])) {\n unset($params['oauth_signature']);\n }\n\n return OAuthUtil::build_http_query($params);\n }", "public function sign() {\n header('Content-type: application/json');\n $sign = Signer::sign(input(\"document_key\"), input(\"actions\"), input(\"docWidth\"), input(\"signing_key\"), true);\n if ($sign) {\n exit(json_encode(responder(\"success\", \"Alright!\", \"Document successfully saved.\",\"reload()\")));\n }else{\n exit(json_encode(responder(\"error\", \"Oops!\", \"Something went wrong, please try again.\")));\n }\n \n }", "public function testRequestSigning() {\n\t\t$signer = new Auth_OAuth_Signer();\n\n\t\t// test 1\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array('PLAINTEXT', 'HMAC-SHA1') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('PLAINTEXT', $request->getSignatureMethod());\n\t\t$this->assertEquals('kd94hf93k423kf44&pfkkdhi9sl3r4s00', $request->getSignature());\n\n\n\t\t// test 2\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array( 'INVALID-METHOD', 'HMAC-SHA1', 'PLAINTEXT') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('HMAC-SHA1', $request->getSignatureMethod());\n\t\t$this->assertEquals('tR3+Ty81lMeYAr/Fid0kMTYa/WM=', $signer->getSignature($request, $server, $token));\n\t}", "public function get_signature_base_string() {\n\t\t$parts = \\OAuthSignature::urlencode_rfc3986( array(\n\t\t\t$this->get_normalized_http_method(),\n\t\t\t$this->get_normalized_http_url(),\n\t\t\t$this->get_signable_parameters(),\n\t\t) );\n\n\t\treturn implode( '&', $parts );\n\t}" ]
[ "0.6546233", "0.63520104", "0.615349", "0.61214733", "0.60465074", "0.59580374", "0.58563226", "0.5769632", "0.5754695", "0.5697552", "0.56857383", "0.5666728", "0.5666559", "0.5650365", "0.5600977", "0.5583906", "0.55525774", "0.55485076", "0.55440557", "0.5519036", "0.5519036", "0.5493029", "0.54807013", "0.54586613", "0.5430139", "0.5422688", "0.542045", "0.5414881", "0.54116976", "0.54084164" ]
0.7601161
0
Return the response headers. Raises a warning and returns if the request wasn't executed yet.
public function getHeaders() { if ( !$this->executed ) { return 'Trying to fetch response headers for a pending request.'; } return $this->response_headers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_response_headers()\n\t{\n\t\tif ( !$this->executed ) {\n\t\t\tthrow new \\Exception( _t( 'Unable to fetch response headers for a pending request.' ) );\n\t\t}\n\n\t\treturn $this->response_headers;\n\t}", "protected static function get_response_headers()\n {\n }", "public function getHeaders() {\n\t\treturn $this->response_headers;\n\t}", "public function getResponseHeaders();", "public function getResponseHeaders()\r\r\n {\r\r\n return $this->responseHeaders;\r\r\n }", "public function getResponseHeaders()\r\n\t{\r\n\t\treturn $this->headers;\r\n\t}", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders()\n {\n return $this->responseHeaders;\n }", "public function getResponseHeaders() {\n return $this->responseHeaders;\n }", "public function getRequestHeaders()\n {\n return curl_getinfo($this->res, CURLINFO_HEADER_OUT);\n }", "function getHeaders()\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"getHeaders()\\n\";\r\n\t\tif( $this->debug & DBGINDATA ) { \r\n\t\t\techo \"DBG.INDATA responseHeaders=\"; print_r( $this->responseHeaders );\r\n\t\t}\r\n\t\treturn $this->responseHeaders;\r\n\t}", "public function getHeaders()\n {\n return $this->headerRequested->get();\n }", "public function getHeaders()\n {\n $headers[\"HTTP/1.1 $this->_status\"] = true;\n\n if ($this->_status == '200 OK') {\n $headers[\"Connection: close\"] = true;\n $headers[\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"] = true;\n\n // Try to keep browser from caching any screen to ensure current data.\n if ($this->_preventCache && !isset($this->_headers[\"Expires: 0\"])) {\n $headers[\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"] = true;\n $headers[\"Cache-Control: no-store, no-cache, must-revalidate\"] = true;\n $headers[\"Pragma: no-cache\"] = true;\n }\n }\n return array_merge($this->_headers, $headers);\n }", "function getResponseHeaders();", "public function GetHeaders()\n {\n return HttpResponse::extractHeaders($this->_rawHttpBatchResponse);\n }", "public function get_headers() {\n\t\tif (!$this->is_open()) return false;\n\t\treturn $this->HEADERS;\n\t}", "public function getHeaders()\n {\n return apache_request_headers();\n }", "public function headers() {\n\t\treturn $this->getAllHeaders();\n\t}", "public static function getRequestHeaders() {}", "public function getResponseHeaders(): array\n {\n return $this->responseHeaders;\n }", "public function headers()\r\n {\r\n return $this->headers;\r\n }", "public function headers()\r\n {\r\n return $this->headers;\r\n }", "public function getHeaders()\n {\n return empty($this->headers) ? $this->parseHeaders($this->rawResponseHeaders) : $this->headers;\n }", "public function getHeaders() {}", "public function getStatusHeaders() {}", "public function headers(): array\n\t{\n\t\t// If no headers are defined, but the user is\n\t\t// requesting it, then it's likely they want\n\t\t// it to be populated so do that...\n\t\tif (empty($this->headers))\n\t\t{\n\t\t\t$this->populateHeaders();\n\t\t}\n\n\t\treturn $this->headers;\n\t}" ]
[ "0.84360623", "0.7967158", "0.7838367", "0.77513504", "0.772623", "0.7628168", "0.761955", "0.761955", "0.761955", "0.761955", "0.761955", "0.761955", "0.7575078", "0.7523615", "0.7480291", "0.7461244", "0.74569726", "0.73560166", "0.7326027", "0.7278213", "0.7235361", "0.7229162", "0.7198586", "0.71599776", "0.7076762", "0.7076762", "0.7076039", "0.7058147", "0.70390433", "0.7036183" ]
0.85918343
0
Set the adapter to use. Accepted values are "curl" and "socket"
public function setAdapter( $adapter ) { $adapter = strtolower( $adapter ); if ( $adapter == 'curl' || $adapter == 'socket' ) { $this->config['adapter'] = $adapter; // We need to reset the processor too. This is quite crude and messy, but we need to do it. if ( function_exists( 'curl_init' ) && ( $adapter == 'curl' ) && ! ( ini_get( 'safe_mode' ) || ini_get( 'open_basedir' ) ) ) { $this->processor = new PhpSmugCurlRequestProcessor; } else { $this->processor = new PhpSmugSocketRequestProcessor; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setConnection(AdapterInterface $adapter);", "public function setDefaultAdapter() {\n\t\t$this->setAdapter(new Client());\n\t}", "public function setAdapter(AdapterInterface $adapter);", "public function setRequestAdapter($adapter)\n {\n $this->connector->setAdapter($adapter);\n }", "public function setAdapter(Adapter $adapter) : void\n {\n $this->adapter = $adapter;\n }", "public function setAdapterMethod($adapter);", "public function setAdapter(AdapterInterface $adapter)\r\n {\r\n\r\n }", "public function setAdapter(\\Phig\\AdapterInterface $adapter)\n\t{\n\t\t$this->adapter = $adapter;\n\t}", "public static function setDefaultAdapter($adapter, $options = array()) \n {\n self::$_defaultAdapter = self::factory($adapter, $options);\n }", "public function adapter( $adapter = null )\n\t{\n\t\treturn $this->useAdapter( $adapter );\n\t}", "public function setHttpClientChannel($adapterInstance = 'Zend_Http_Client_Adapter_Socket')\n\t{\n\t\t$this->_httpClientChannel->setAdapter($adapterInstance);\n\t}", "public function __construct($adapter = null)\n {\n if (empty($adapter)) {\n $this->setAdapter(Mage::getSingleton('minkasu_wallet/api_adapter_curl'));\n } elseif ($adapter instanceof Minkasu_Wallet_Model_Api_Adapter_Abstract) {\n $this->setAdapter($adapter);\n } else {\n Mage::throwException('Invalid client');\n }\n }", "public function setAdapterType($adapterType)\n {\n \t$this->adapterType = $adapterType;\n }", "public static function setAdapter(AbstractApiAdapter $adapter): void\n {\n self::$adapter = $adapter;\n }", "public function setAdapter($adapter_name)\n {\n $adapterClass = \"\\Zrashwani\\NewsScrapper\\Adapters\\\\\".$adapter_name.\"Adapter\";\n if (class_exists($adapterClass)) {\n $this->adapter = new $adapterClass();\n } else {\n $this->adapter = null;\n }\n\n return $this;\n }", "public static function setTestAdapter(): void\n {\n self::$adapter = new KvkTestAdapter();\n }", "public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}", "public static function setProductionAdapter(): void\n {\n self::$adapter = new KvkAdapter();\n }", "public function getHttpAdapter()\n {\n return $this->httpAdapter;\n }", "public function adapter(string $name): AdapterInterface;", "public function setAdapter(AdapterInterface $adapter)\n {\n $this->adapter = $adapter;\n return $this;\n }", "public function setAdapter(AdapterInterface $adapter): self\n {\n $this->adapter = $adapter;\n\n return $this;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }", "public function getAdapter()\n {\n return $this->adapter;\n }" ]
[ "0.66564006", "0.6636478", "0.65077204", "0.63808286", "0.6239431", "0.6182475", "0.5958179", "0.5938879", "0.58823365", "0.58814996", "0.58574927", "0.5824818", "0.5800664", "0.5743228", "0.5669116", "0.5631398", "0.5513992", "0.5484887", "0.5427836", "0.53984195", "0.5373029", "0.53419757", "0.5334555", "0.5334555", "0.5334555", "0.5334555", "0.5334555", "0.5334555", "0.5334555", "0.5334555" ]
0.79114515
0
Return the response body. Raises a warning and returns if the request wasn't executed yet.
public function getBody() { if ( !$this->executed ) { return 'Trying to fetch response body for a pending request.'; } return $this->response_body; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_response_body()\n\t{\n\t\tif ( !$this->executed ) {\n\t\t\tthrow new \\Exception( _t( 'Unable to fetch response body for a pending request.' ) );\n\t\t}\n\n\t\treturn $this->response_body;\n\t}", "function getBody()\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"getBody()\\n\";\r\n\t\treturn $this->responseBody;\r\n\t}", "public function getBody() {\n\t\treturn $this->response_body;\n\t}", "public function getBody()\n {\n return $this->response;\n }", "public function body()\n {\n return (string)$this->response->getBody();\n }", "public function getBody(): string\n {\n return (string) $this->response->getBody();\n }", "public function getResponseBody(){\n\t\treturn $this->response->getBody();\n\t}", "public function getResponseBody()\n\t{\n\t\treturn isset($this->_response['body']) ? $this->_response['body'] : '';\n\t}", "public function getResponseBody()\r\n\t{\r\n\t\treturn $this->body;\r\n\t}", "public function getResponseBody() {\n return $this->body;\n }", "public function getResponseBody()\n {\n return $this->httpResponse;\n }", "public function getResponseBody()\n {\n return $this->responseBody; \n }", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "public function getResponseBody()\n {\n return $this->responseBody;\n }", "public function getBody()\n\t{\n\t\t// yet been initialised\n\t\tif (!$this->contentType) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Response must be initialised first'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Return a decoded body if one is\n\t\t// available, else return the raw body\n\t\treturn ($this->decodedBody) ? $this->decodedBody : $this->rawBody;\n\t\t\n\t}", "public function getRawResponse()\n {\n return $this->response->getBody();\n }", "protected function getBody()\n {\n return $this->getRequest()->getBody();\n }", "public static function getRequestBody() {}", "public function getResponseBody()\n\t{\n\t\treturn $this->_responseBody;\n\t}", "public function getResponseBody()\n {\n if (!$this->response) {\n throw new FlowException('You have to call the request in order to obtain the body of the response');\n }\n\n return json_decode($this->response->getBody(), true);\n }", "public function body()\r\n {\r\n // Only get it once\r\n if (null === $this->body) {\r\n $this->body = @file_get_contents('php://input');\r\n }\r\n\r\n return $this->body;\r\n }", "public function getRawBody()\n\t{\n\t\t// yet been initialised\n\t\tif (!$this->contentType) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'Response must be initialised first'\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $this->rawBody;\n\t\t\n\t}", "public function getResponse()\n {\n return $this->header . \"\\r\\n\\r\\n\" . $this->body;\n }", "public function body() {\n\t\tif ( null === $this->_body ) {\n\t\t\t$this->_body = @file_get_contents( 'php://input' );\n\t\t}\n\n\t\treturn $this->_body;\n\t}", "#[Pure]\nfunction http_get_request_body() {}", "public function response()\n {\n return $this->context->getResponse();\n }", "protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}", "public function getBody() {}", "public function getBody()\n {\n $this->set('returnTransfer', 1);\n\n return $this->send();\n }" ]
[ "0.8026754", "0.7355262", "0.731779", "0.7221386", "0.70006406", "0.68709886", "0.6863773", "0.68593746", "0.6851294", "0.6830669", "0.66897756", "0.6659507", "0.65971935", "0.65971935", "0.65971935", "0.65964866", "0.6578347", "0.6567191", "0.65599173", "0.651113", "0.6481593", "0.64534444", "0.6448731", "0.6440668", "0.6358751", "0.6355309", "0.63485086", "0.6335263", "0.62916297", "0.62550366" ]
0.8042646
0
Merge query params from the URL with given params.
private function mergeQueryParams( $url, $params ) { $urlparts = parse_url( $url ); if ( ! isset( $urlparts['query'] ) ) { $urlparts['query'] = ''; } if ( ! is_array( $params ) ) { parse_str( $params, $params ); } if ( $urlparts['query'] != '' ) { $parts = array_merge( parse_str( $qparts ) , $params ); } else { $parts = $params; } $urlparts['query'] = http_build_query( $parts, '', '&' ); return ( $urlparts['query'] != '' ) ? $url .'?'. $urlparts['query'] : $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function merge_query_params( $url, $params )\n\t{\n\t\t$urlparts = InputFilter::parse_url( $url );\n\n\t\tif ( ! isset( $urlparts['query'] ) ) {\n\t\t\t$urlparts['query'] = '';\n\t\t}\n\n\t\tif ( ! is_array( $params ) ) {\n\t\t\tparse_str( $params, $params );\n\t\t}\n\n\t\t$urlparts['query'] = http_build_query( array_merge( Utils::get_params( $urlparts['query'] ), $params ), '', '&' );\n\n\t\treturn InputFilter::glue_url( $urlparts );\n\t}", "public function addQueryParams($params) {}", "public function appendQueryParams($params) {\n $new_query = $this->getQuery();\n \n if (is_array($params))\n {\n $new_query .= http_build_query($params); \n }\n else\n {\n $new_query .= self::QUERY_PARAM_DELIMITER.$params;\n }\n \n $this->setQuery($new_query);\n }", "function merge_query($newquery) {\r\n foreach (array_merge($_GET,$newquery) as $k=>$v) $temparr[] = urlencode($k).'='.urlencode($v);\r\n return implode('&amp;',$temparr);\r\n}", "function addQuery($url, $params)\n{\n if (is_array($params)){\n if (count($params) > 0){\n $url .= '?';\n foreach ($params as $key => $value):\n $url .= $key . '=' . $value . '&';\n endforeach;\n $url = substr($url, 0, -1);\n }\n } \n return $url;\n}", "function mergeQuery($given_query) { // TODO rename\n parse_str($given_query, $given_queries);\n parse_str($_SERVER['QUERY_STRING'], $queries);\n $new_queries = array_merge($queries, $given_queries);\n return http_build_query($new_queries);\n }", "protected static function parse_query_params(&$url, array $options) {\n if (!empty($options['query'])) {\n $url .= '?' . http_build_query($options['query']);\n }\n }", "function mergeQueryString($options, $prepend = \"?\")\n{\n // Parse querystring into array\n $query = [];\n parse_str($_SERVER[\"QUERY_STRING\"], $query);\n\n // Merge query string with new options\n $query = array_merge($query, $options);\n\n // Build and return the modified querystring as url\n return $prepend . http_build_query($query);\n}", "public function mergeQueryParams($params=array(), Array $files=array()) {\n\t\tif (is_string($params)) {\n\t\t\t$this->parse_str_raw($params,$params);\n\t\t}\n\t\t$params = array_merge($params,$files);\n\t\treturn $params;\n\t}", "public function fill_query_vars($query_vars)\n {\n }", "protected function cleanUrlQueryParams($params)\n {\n if (!empty($params)) {\n foreach ($params as $key => $param) {\n // Check key for question mark.\n if (substr($key, 0, 1) == '?') {\n // Trim question mark.\n $trimmedKey = ltrim($key, '?');\n // Replace key.\n $params[$trimmedKey] = $param;\n unset($params[$key]);\n }\n }\n }\n return $params;\n }", "public function addExtraParameters(array &$params)\n {\n $queryParams = $this->getRequest()->getQueryValue();\n $referrerUrl = $this->getReferrerUrl();\n // if query params for current request are empty, try to detect query params from referrer url (if any)\n if (empty($queryParams) && (strlen($referrerUrl) > 0)) {\n parse_str(parse_url($referrerUrl, PHP_URL_QUERY), $queryParams);\n }\n\n if (!empty($queryParams)) {\n // search results page\n if (isset($queryParams['q'])) {\n $query = trim($queryParams['q']);\n } else {\n $query = http_build_query($queryParams);\n }\n $params[Config::PARAM_QUERY] = $query;\n } else {\n // category view page\n if ($pageId = $this->getLastVisitedCategoryId()) {\n $params[Config::PARAM_PAGE] = $pageId;\n }\n }\n\n return $this;\n }", "private function mergeGetParams(string $urlA, string $urlB): string\n {\n $aParams = [];\n parse_str((string)parse_url($urlA, PHP_URL_QUERY), $aParams);\n\n $bParams = [];\n parse_str((string)parse_url($urlB, PHP_URL_QUERY), $bParams);\n\n foreach ($aParams as $key => $value) {\n $bParams[$key] = $value;\n }\n\n $query = '';\n\n if (count($bParams)) {\n $query = '?' . http_build_query($bParams);\n }\n\n return strtok($urlA, '?') . $query;\n }", "public function add_state_query_params($url)\n {\n }", "function router_add_query($url, array $qp = array())\n{\n if (empty($qp)) {\n return $url;\n }\n if (strpos($url, '?') !== false) {\n list($url, $query_str) = explode('?', $url, 2);\n parse_str($query_str, $old_qp);\n $qp = array_merge($old_qp, $qp);\n }\n if (!empty($qp)) {\n $url .= '?' . http_build_query($qp);\n }\n return $url;\n}", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $catId = isset($_GET['c']) ? (int)$_GET['c'] : 0;\r\n \r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "function _load_get_params(&$app, &$c) {\n\t\t$params =& $c->param('app.view_http.request.params');\n\t\tif (is_array($params)) {\n\t\t\tforeach($params as $p_name => $p_value) {\n\t\t\t\t$this->_http->addQueryString($p_name, $p_value);\n\t\t\t}\n\t\t}\n\t}", "protected function populateParams() {\r\n $this->pageNum = isset($_GET['p']) ? (int)$_GET['p'] : 0;\r\n $this->status = isset($_GET['status']) ? (int)$_GET['status'] : 0;\r\n if ($this->pageNum < 1) {\r\n $this->pageNum = 1;\r\n }\r\n }", "public function set_query_params($params)\n {\n }", "public function FormatParametersForUrl($params) {\n return http_build_query($params, NULL, '&');\n }", "public static function queryParam($params='') {\n\t\t$url =''; // Added because PHP giving silent error of undefined variable\n\t\tforeach ($params as $key => $value) {\n\t\t\t$url .='&'.$key.'='.urlencode($value);\n\t\t}\n\t\treturn $url;\n\t}", "function build_url_params ($url_params, $params = '')\n{\n\tforeach ($url_params as $k=>$v)\n\t{\n\t\t$params .= (strlen($params) ? '&' : '?') . $k . '=' . urlencode($v);\n\t}\n\t\n\treturn $params;\n}", "protected static function _addUrlParams($url, $params) {\n\t\t$params = http_build_query((array) $params);\n\n\t\tif (($pos = strpos($url, '?')) === false) {\n\t\t\t$url .= '?' . $params;\n\t\t}\n\t\telseif ($pos == strlen($url) - 1) {\n\t\t\t$url .= $params;\n\t\t}\n\t\telse {\n\t\t\t$url .= '&' . $params;\n\t\t}\n\t\treturn $url;\n\t}", "function current_request_with_params($params) {\n\t\t$all_params = $_GET;\n\t\tforeach ($params as $key => $value) {\n\t\t\t$all_params[$key] = $value;\n\t\t}\n\t\t$request = $_SERVER['REQUEST_URI'];\n\t\t$query = $_SERVER['QUERY_STRING'];\n\t\tif (strlen($query)) {\n\t\t\t$request = str_replace( $query, \"\", $request);\n\t\t}\n\t\t$sep = \"\";\n\t\tforeach ($all_params as $key => $value) {\n\t\t\t$request = $request . $sep;\n\t\t\t$sep = '&';\n\t\t\t$request = $request . $key . \"=\" . $value;\n\t\t}\n\n\t\treturn $request;\n\t}", "protected function build_query(array $params)\n\t{\n\n\t\tif(!empty($params)) {\n\n\t\t\t$this->build_query = http_build_query($params);\n\t\t\t$this->url = $this->url.'?'.$this->build_query ;\n\t\t\n\t\t}\n\n\t}", "protected function prepare($params) {\r\n\t\tif (isset($params['_args_'])) {\r\n\t\t\t$params = array_merge_recursive(Router::getArgs($params['_args_']), $params);\r\n\t\t\tunset($params['_args_']);\r\n\t\t}\r\n\t\treturn $params + array('url' => array());\r\n\t}", "function url_merge($url, $name = null, $val = null, $ignore = null){\n $u = $url;\n $r = [];\n $f = explode('?',$url);\n $q = '';\n $u = $f[0];\n if(count($f)>1){\n $q = $f[1];\n }\n if($name){\n if(is_string($name)) $r[$name] = $val;\n elseif(is_array($name)){\n foreach($name as $n => $v){\n if(is_string($n)){\n $r[$n] = $v;\n }\n }\n }\n \n }\n if($q || $r){\n $u.='?'.parse_query_string($q, $r, $ignore);\n }\n return $u;\n }", "private function buildParams($params) \n {\n if ($params['action']) {\n $action = $params['action'];\n\n unset($params['action']);\n\n return http_build_query(\n [ 'action' => $action, 'request' => $params ]\n );\n } \n\n return http_build_query($params);\n }", "public function get_query_params()\n {\n }", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }" ]
[ "0.7844842", "0.67367697", "0.6701334", "0.65532637", "0.6409734", "0.6400334", "0.62738305", "0.6230794", "0.6180502", "0.6090327", "0.60874206", "0.6069534", "0.603301", "0.60208654", "0.60070854", "0.6003561", "0.60019267", "0.5996016", "0.59826785", "0.59793067", "0.5968902", "0.59417355", "0.5918695", "0.5895327", "0.5888008", "0.5857335", "0.5855578", "0.58286375", "0.5825519", "0.5815071" ]
0.7434495
1
Loads the forum settings.
public function load() { $statement = $this -> db -> query("SELECT * FROM " . FORUM_DB . ".forum_settings"); while($settingData = $statement -> fetch(PDO::FETCH_ASSOC)) { $this -> settings[$settingData['key']] = new ForumSetting($settingData['key'], $settingData['value']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_settings() {\n\t\t\n\t}", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "private function load_site_settings() {\n\t\t\n\t\t$this->helper->load_editor_settings();\n\t\t$this->settings = array_merge($this->settings,$this->EE->session->cache['eeck']['eeck_settings']);\n\t}", "public function loadSettings()\n {\n $this->loadJSON($this->settings);\n }", "public function load() {\n\t\t$this -> template = TemplateManager::load(\"ForumPreference\");\n\t\t$this -> template -> insert(\"profileImage\", $this -> user -> getProfileImage());\n\t\t$this -> template -> insert(\"signature\", $this -> user -> getSignature());\n\t\t$this -> display();\n\t}", "public function load_settings() {\n\n include( trailingslashit( CUSTOM_LOGIN_DIR ) . 'includes/default-settings.php' );\n $this->settings_api = new CL_Settings_API(\n $sections,\n $fields,\n array(\n 'option_name' => CUSTOM_LOGIN_OPTION,\n 'option_group' => CUSTOM_LOGIN_OPTION . '_group',\n 'domain' => CUSTOM_LOGIN_DIRNAME,\n 'prefix' => $this->prefix,\n 'version' => $this->version,\n 'menu_page' => $this->menu_page,\n 'nonce' => CUSTOM_LOGIN_OPTION . '_nonce_' . CUSTOM_LOGIN_BASENAME,\n 'file' => CUSTOM_LOGIN_FILE,\n )\n );\n $this->settings_api->admin_init();\n }", "function loadSettings() {\n\tsetupSiteURLs();\n}", "protected function load_settings() {\n\t\t$this->settings = WP_United_Settings::Create();\n\t\t$this->init_style_keys();\n\t}", "abstract protected function loadSettings();", "public function loadSettings()\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $cache = $this->getL1Cache();\n\n $settingsLoader = new LibUserSettings($db, $user, $cache);\n\n return $settingsLoader->getUserSetting(EUserSettingType::MESSAGES);\n\n }", "public function loadSettings()\n\t{\n\t\t// Update picto for Dolibarr 12++\n\t\tif (function_exists('version_compare') && version_compare(DOL_VERSION, '12.0.0') >= 0) {\n\t\t\t$this->picto = \"quicknotes_128.png@quicknotes\";\n\t\t}\n\n\t\t$this->addJsFile('quicknotes.js.php');\n\t\t$this->enableHooks(array(\n\t\t\t'toprightmenu',\n\t\t\t'main',\n\t\t\t'login'\n\t\t));\n\t}", "public function load_settings()\r\n\t{\r\n\t\tif (!$this->_use_cache || !($this->_settings = $this->cache->get('settings')))\r\n\t\t{\r\n\t\t\t// Get settings from database\r\n\t\t\t$this->db->select('setting,value');\r\n\t\t\t$query = $this->db->get('settings');\r\n\r\n\t\t\tforeach ($query->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$this->_settings[$row->setting] = $row->value;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we want to cache the results\r\n\t\t\tif ($this->_use_cache)\r\n\t\t\t{\r\n\t\t\t\t$this->cache->save('settings', $this->_settings, $this->_cache_ttl);\r\n\t\t\t\t$this->_repopulated_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function load_from_phpbb() {\n\t\tglobal $config;\n\t\t\n\t\t$wpuString = '';\n\t\t$key = 1;\n\t\twhile(isset( $config[\"wpu_settings_{$key}\"])) {\n\t\t\t$wpuString .= $config[\"wpu_settings_{$key}\"];\n\t\t\t$key++;\n\t\t}\n\n\t\t// convert config value into something just like me :-)\n\t\tif(!empty($wpuString)) {\n\t\t\t$wpuString = gzuncompress(base64_decode($wpuString));\t\n\t\t\t$settingsObj = unserialize($wpuString); \n\t\t\tif(is_object($settingsObj)) {\n\t\t\t\treturn $settingsObj; \n\t\t\t}\n\t\t}\n\t\t\n\t\t// failed on all accounts. Initialise ourselves with defaults\n\t\t$this->settings = $this->get_defaults();\n\t\treturn $this;\n\n\t}", "public function load()\n {\n $this->settings = get_option($this->optionName);\n }", "public function load() {\n // Load settings\n\t $this->lookup_title = $this->getProjectSetting('lookup-title');\n\t $this->lookup_header = $this->getProjectSetting('lookup-header');\n\t $this->lookup_field = $this->getProjectSetting('lookup-field');\n\t $this->lookup_event_id = $this->getProjectSetting('lookup-event-id');\n\t $this->validate_mrn = $this->getProjectSetting('validate-mrn');\n\t $this->found_action = $this->getProjectSetting('found-action');\n\t $this->repeating_event_id = $this->getProjectSetting('repeating-event-id');\n\t $this->repeating_form_name = $this->getProjectSetting('repeating-form-name');\n\t $this->is_loaded = true;\n }", "protected function _loadSettings()\n {\n $settings = Cache::remember('settings', function () {\n /** @var SettingsTable $Settings */\n $Settings = $this->loadModel('Wasabi/Core.Settings');\n return $Settings->getAllKeyValues();\n }, 'wasabi/core/longterm');\n\n $event = new Event('Settings.afterLoad', $settings);\n $this->eventManager()->dispatch($event);\n\n if ($event->result !== null) {\n $settings = $event->result;\n }\n\n Configure::write('Settings', $settings);\n }", "private function action_forumSettings()\n\t{\n\t\tglobal $txt, $incontext, $databases, $db_type, $db_connection;\n\n\t\t$incontext['sub_template'] = 'forum_settings';\n\t\t$incontext['page_title'] = $txt['install_settings'];\n\n\t\t// Let's see if we got the database type correct.\n\t\tif (isset($_POST['db_type'], $databases[$_POST['db_type']]))\n\t\t{\n\t\t\t$db_type = $_POST['db_type'];\n\t\t}\n\n\t\t// Else we'd better be able to get the connection.\n\t\telse\n\t\t{\n\t\t\tload_database();\n\t\t}\n\n\t\t$db_type = $_POST['db_type'] ?? $db_type;\n\n\t\t// What host and port are we on?\n\t\t$host = empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST'];\n\n\t\t// Now, to put what we've learned together... and add a path.\n\t\t$incontext['detected_url'] = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . $host . strtr(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')), array('/install' => ''));\n\n\t\t// Check if the database sessions will even work.\n\t\t$incontext['test_dbsession'] = ini_get('session.auto_start') != 1;\n\t\t$incontext['continue'] = 1;\n\n\t\t// Submitting?\n\t\tif (isset($_POST['boardurl']))\n\t\t{\n\t\t\tif (substr($_POST['boardurl'], -10) == '/index.php')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -10);\n\t\t\t}\n\t\t\telseif (substr($_POST['boardurl'], -1) == '/')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -1);\n\t\t\t}\n\n\t\t\tif (substr($_POST['boardurl'], 0, 7) != 'http://' && substr($_POST['boardurl'], 0, 7) != 'file://' && substr($_POST['boardurl'], 0, 8) != 'https://')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = 'http://' . $_POST['boardurl'];\n\t\t\t}\n\n\t\t\t// Save these variables.\n\t\t\t$vars = array(\n\t\t\t\t'boardurl' => $_POST['boardurl'],\n\t\t\t\t'boarddir' => addslashes(TMP_BOARDDIR),\n\t\t\t\t'sourcedir' => addslashes(TMP_BOARDDIR) . '/sources',\n\t\t\t\t'cachedir' => addslashes(TMP_BOARDDIR) . '/cache',\n\t\t\t\t'mbname' => strtr($_POST['mbname'], array('\\\"' => '\"')),\n\t\t\t\t'language' => substr($_SESSION['installer_temp_lang'], 8, -4),\n\t\t\t\t'extdir' => addslashes(TMP_BOARDDIR) . '/sources/ext',\n\t\t\t);\n\n\t\t\t// Must save!\n\t\t\tif (!updateSettingsFile($vars))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['settings_error'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Make sure it works.\n\t\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\n\t\t\t// Set our db character_set to utf8\n\t\t\tupdateSettingsFile(array('db_character_set' => 'utf8'));\n\n\t\t\t// Good, skip on.\n\t\t\treturn true;\n\t\t}\n\n\t\tdefinePaths();\n\n\t\treturn false;\n\t}", "private function loadSettings()\n {\n if ($this->settingsLoaded)\n {\n return;\n }\n\n $courseTypeIds = json_decode($this->getBlock()->getSetting(self::CONFIGURATION_COURSE_TYPE));\n\n if (!is_array($courseTypeIds))\n {\n $courseTypeIds = array($courseTypeIds);\n }\n\n $this->courseTypeId = $courseTypeIds[0];\n $this->userCourseCategoryId = $courseTypeIds[1];\n $this->settingsLoaded = true;\n }", "protected function loadSettingsIfNotLoaded()\n {\n if ( !$this->loaded ) {\n $this->settings = $this->load();\n $this->loaded = true;\n }\n }", "private function _loadGlobalSettings(){\r\n\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.'global_settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->globalSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $globalSettings = new stdClass();\r\n $globalSettings->website_name = '';\r\n $globalSettings->global_script = '';\r\n file_put_contents($settings, json_encode($globalSettings));\r\n }\r\n\r\n }", "public function load_settings()\n {\n // Basic Settings\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_basic',\n\t\t\t'title'\t\t\t => 'Grundeinstellungen',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_basic = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_send_cache_control_header',\n\t\t\t'title'\t\t\t\t => 'Cache-Control Headers',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_send_cache_control_header = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_etag',\n\t\t\t'title'\t\t\t\t => 'ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_generate_weak_etag',\n\t\t\t'title'\t\t\t\t => 'Weak ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_generate_weak_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_last_modified',\n\t\t\t'title'\t\t\t\t => 'Modified Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_last_modified = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_expires',\n\t\t\t'title'\t\t\t\t => 'Expries Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_expires = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_backwards_cache_control',\n\t\t\t'title'\t\t\t\t => 'Legacy Cache Control',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_backwards_cache_control = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_mobile_detect',\n\t\t\t'title'\t\t\t\t => 'Mobile Geräteerkennung',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_mobile_detect = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_expires_max_age',\n\t\t\t'title'\t\t\t\t => 'Expires Max-Age',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => 'Sekunden',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n\n // Compression\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_compression',\n\t\t\t'title'\t\t\t => 'Kompression',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_compression = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_gzip',\n\t\t\t'title'\t\t\t\t => 'GZip',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_gzip = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_br',\n\t\t\t'title'\t\t\t\t => 'Brotli',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_br = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_deflate',\n\t\t\t'title'\t\t\t\t => 'Deflate (Zlib)',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_deflate = new Field( $args );\n\n // Monitoring\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t => 'Monitoring',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_health = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t\t => 'Health Check',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_health_enable = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health_url',\n\t\t\t'title'\t\t\t\t => 'Health Url',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => 'Z.B. /healthz',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_healt_url= new Field( $args );\n\n // CDN\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_cdn = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_cdn',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'dropdown', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n 'options' => array( CDN::None => 'Keins', CDN::Akamai => 'Akamai', CDN::Cloudfront => 'Cloudfront' )\n\t\t);\n\t\t$asse_http_cdn = new Field( $args );\n\n // Advanced\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_experimental',\n\t\t\t'title'\t\t\t => 'Experimental',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_experimental = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_origin',\n\t\t\t'title'\t\t\t\t => 'Origin',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht! Kann nicht gesetzt werden, wenn HTTP_ORIGIN gesetzt ist',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n 'disabled' => true,\n 'disabled_default' => ORIGIN_HOST, // todo\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_origin = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_replace_urls',\n\t\t\t'title'\t\t\t\t => 'Urls ersetzen',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => true,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_etag_salt',\n\t\t\t'title'\t\t\t\t => 'ETag Salt',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_rewrite_categories',\n\t\t\t'title'\t\t\t\t => 'Rewrite Kategorien',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_try_rewrite_categories = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_catch_404',\n\t\t\t'title'\t\t\t\t => 'Try Catch 404',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n }", "function LoadSettings()\n\t{\n\t\t$stash = IEM_InterspireStash::getInstance();\n\n\t\t/**\n\t\t * Trigger event\n\t\t */\n\t\t\t$tempEventData = new EventData_IEM_SETTINGSAPI_LOADSETTINGS();\n\t\t\t$tempEventData->data = $this;\n\t\t\t$tempEventData->trigger();\n\n\t\t\tunset($tempEventData);\n\t\t/**\n\t\t * -----\n\t\t */\n\n\t\t$areas = $this->Areas;\n\t\tunset($areas['config']);\n\t\tunset($areas['whitelabel']);\n\n\t\t// ----- Obtain the settings value either from the database OR from the stash (ie. cache)\n\t\t\tdo {\n\t\t\t\t// Check if the settings is available in our cache\n\t\t\t\tif ($stash->exists('IEM_SYSTEM_SETTINGS')) {\n\t\t\t\t\t$settings = $stash->read('IEM_SYSTEM_SETTINGS');\n\n\t\t\t\t\tif (!empty($settings) && is_array($settings)) {\n\t\t\t\t\t\tforeach ($settings as $area => $aravalue) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * TODO refactor\n\t\t\t\t\t\t\t * As it stands we are defining constants dynamically. This is a bad programming practice.\n\t\t\t\t\t\t\t * Once you have time, you might want to consider refactoring this code.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * As you may have notice, this is a duplicated code\n\t\t\t\t\t\t\t * (see the codes that fetches this value from database below).\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (!defined('SENDSTUDIO_' . $area)) {\n\t\t\t\t\t\t\t\tdefine('SENDSTUDIO_' . $area, $aravalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t\t// The settings cannot be found in stash cache,\n\t\t\t\t// so we will need to load it from database and put them in our cache\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t\t\t$result = $this->Db->Query(\"SELECT * FROM \" . SENDSTUDIO_TABLEPREFIX . \"config_settings\");\n\n\t\t\t\t\t$settings = array();\n\t\t\t\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t\t\t\t$area = $row['area'];\n\t\t\t\t\t\t// eh? How did a config setting get in the db without it being in the settings api??\n\t\t\t\t\t\tif (!in_array($area, $areas)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// this is for the 'upgrade' process - which moves them from the config file to being in the database.\n\t\t\t\t\t\tif (!defined('SENDSTUDIO_' . $area)) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @todo Remove hacks like these and refactor code that causes us to use these hacks!!!\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif ($area == 'CRON_TRIGGEREMAILS_P' && $row['areavalue'] == '') {\n\t\t\t\t\t\t\t\t$row['areavalue'] = 1440;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * TODO refactor\n\t\t\t\t\t\t\t * As it stands we are defining constants dynamically. This is a bad programming practice.\n\t\t\t\t\t\t\t * Once you have time, you might want to consider refactoring this code.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tdefine('SENDSTUDIO_' . $area, $row['areavalue']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$k = array_search($area, $areas);\n\t\t\t\t\t\tunset($areas[$k]);\n\n\t\t\t\t\t\t$settings[$area] = $row['areavalue'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->Db->FreeResult($result);\n\n\n\n\t\t\t\t\t// Cache the settings\n\t\t\t\t\t$stash->write('IEM_SYSTEM_SETTINGS', $settings, true);\n\t\t\t\t// ------------------------------------------------------------------------\n\t\t\t} while(false);\n\t\t// -----\n\n\n\t\t// ----- Default settings\n\t\t\t// \"Multiple unsubscribe\" feature\n\t\t\tif (!defined('SENDSTUDIO_USEMULTIPLEUNSUBSCRIBE')) {\n\t\t\t\tdefine('SENDSTUDIO_USEMULTIPLEUNSUBSCRIBE', 0);\n\t\t\t}\n\n\t\t\t// As a default you do not want contacts to be able to modify their own email\n\t\t\tif (!defined('SENDSTUDIO_CONTACTCANMODIFYEMAIL')) {\n\t\t\t\tdefine('SENDSTUDIO_CONTACTCANMODIFYEMAIL', '0');\n\t\t\t}\n\n\t\t\t// Number of seconds to sleep when login failed\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_WAIT')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_WAIT', 5);\n\t\t\t}\n\n\t\t\t// Number of attempts threshold\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_COUNT')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_COUNT', 5);\n\t\t\t}\n\n\t\t\t// Number of seconds that wrong login threshold is checking for\n\t\t\t// (ie. 5 failed log in attempts in 300 seconds)\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_DURATION')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_WRONG_LOGIN_THRESHOLD_DURATION', 300);\n\t\t\t}\n\n\t\t\t// Ban duration\n\t\t\tif (!defined('SENDSTUDIO_SECURITY_BAN_DURATION')) {\n\t\t\t\tdefine('SENDSTUDIO_SECURITY_BAN_DURATION', 300);\n\t\t\t}\n\n\t\t\t// Autoresponders takes credit\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_INCLUDE_AUTORESPONDERS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_INCLUDE_AUTORESPONDERS', 1);\n\t\t\t}\n\n\t\t\t// Trigger takes credit\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_INCLUDE_TRIGGERS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_INCLUDE_TRIGGERS', 1);\n\t\t\t}\n\n\t\t\t// Whether or not to enable credit warnings\n\t\t\tif (!defined('SENDSTUDIO_CREDIT_WARNINGS')) {\n\t\t\t\tdefine('SENDSTUDIO_CREDIT_WARNINGS', 1);\n\t\t\t}\n\n\t\t\t// Triggeremails_P is defaulted to run every 24 hours\n\t\t\tif (!defined('SENDSTUDIO_CRON_TRIGGEREMAILS_P')) {\n\t\t\t\tdefine('SENDSTUDIO_CRON_TRIGGEREMAILS_P', 1440);\n\t\t\t}\n\n\t\t\t// Maintenance will default to run once a day\n\t\t\tif (!defined('SENDSTUDIO_CRON_MAINTENANCE')) {\n\t\t\t\tdefine('SENDSTUDIO_CRON_MAINTENANCE', 1440);\n\t\t\t}\n\t\t// -----\n\n\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\t\t// There is an issue with MySQL database connection whereby most server had it's connection set to latin1\n\t\t// The problem lies when we defaulted our database to UTF8 and the application to use UTF8, non standard\n\t\t// English characters will be transformed to latin1, but stored as UTF8 in the database\n\t\t// See Issue 4807 in RedMine.\n\t\t//\n\t\t// A fix proved to be a bit difficult, assuming that there will be alot of people that were affected by this issue.\n\t\t// Once we set the characterset connection to UTF8, non-English characterset will be BROKEN.\n\t\t//\n\t\t// To make sure that only NEW installation uses this fix, the settings DATABASE_UTF8PATCH is introduced.\n\t\t// It will be set to 1 for newer install, but set to 0 for existing install.\n\t\t//\n\t\t// Once we work out the details for converting existing data out, we can safely remove this.\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\t\t\tif (!defined('SENDSTUDIO_DATABASE_UTF8PATCH')) {\n\t\t\t\tdefine('SENDSTUDIO_DATABASE_UTF8PATCH', '0');\n\t\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------\n\n\n\t\t/**\n\t\t * Addons might define their own things.\n\t\t * To make everything work we need to go through the left over $areas items to define them.\n\t\t * If we don't do this, then we'd get errors when we try to view the settings page\n\t\t * as the option/variable would not be defined yet.\n\t\t *\n\t\t * Set them to null by default.\n\t\t */\n\t\tforeach ($areas as $area) {\n\t\t\t$name = 'SENDSTUDIO_' . $area;\n\t\t\tif (!defined($name)) {\n\t\t\t\tdefine($name, null);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Load the whitelabel settings\n\t\t */\n\t\t$this->LoadWhiteLabelSettings();\n\t\t/**\n\t\t * -----\n\t\t */\n\n\t\t$this->CheckCron();\n\t}", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "function phorum_mod_topic_poll_get_forumsettings($forum_id = NULL)\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n if ($forum_id == NULL) {\n $forum_id = $PHORUM[\"forum_id\"];\n }\n\n if (isset($PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id])) {\n return $PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id];\n }\n\n $settings = isset($PHORUM[\"mod_topic_poll\"][$forum_id])\n ? $PHORUM[\"mod_topic_poll\"][$forum_id] : array();\n foreach ($PHORUM[\"mod_topic_poll_defaults\"] as $key => $val) {\n if (!isset($settings[$key])) {\n $settings[$key] = $val;\n }\n }\n\n $GLOBALS[\"PHORUM\"][\"mod_topic_poll_settings_cache\"][$forum_id] = $settings;\n return $settings;\n}", "function plugin_initconfig_forum()\n{\n global $CONF_FORUM, $_FORUM_DEFAULT, $_TABLES;\n\n if (is_array($CONF_FORUM) && (count($CONF_FORUM) > 1)) {\n $_FORUM_DEFAULT = array_merge($_FORUM_DEFAULT, $CONF_FORUM);\n }\n\n $c = config::get_instance();\n $n = 'forum';\n $o = 1;\n if (!$c->group_exists($n)) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $n);\n // ----------------------------------\n $t = 0;\n $c->add('tab_main', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $n, $t);\n $c->add('registration_required', $_FORUM_DEFAULT['registration_required'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('registered_to_post', $_FORUM_DEFAULT['registered_to_post'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_notification', $_FORUM_DEFAULT['allow_notification'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topicreview', $_FORUM_DEFAULT['show_topicreview'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('allow_user_dateformat', $_FORUM_DEFAULT['allow_user_dateformat'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('use_pm_plugin', $_FORUM_DEFAULT['use_pm_plugin'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_topics_perpage', $_FORUM_DEFAULT['show_topics_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_posts_perpage', $_FORUM_DEFAULT['show_posts_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_messages_perpage', $_FORUM_DEFAULT['show_messages_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('show_searches_perpage', $_FORUM_DEFAULT['show_searches_perpage'], 'text', 0, 0, 0, $o++, true, $n, $t);\n $c->add('showblocks', $_FORUM_DEFAULT['showblocks'], 'select', 0, 0, 6, $o++, true, $n, $t);\n $c->add('usermenu', $_FORUM_DEFAULT['usermenu'], 'select', 0, 0, 7, $o++, true, $n, $t);\n //$c->add('use_themes_template', $_FORUM_DEFAULT['use_themes_template'], 'select', 0, 0, 0, $o++, true, $n, $t);\n $c->add('likes_forum', $_FORUM_DEFAULT['likes_forum'], 'select', 0, 0, 41, $o++, true, $n, $t);\n $c->add('recaptcha', $_FORUM_DEFAULT['recaptcha'], 'select', 0, 0, 16, $o++, true, $n, $t);\n // ----------------------------------\n $t = 1;\n $c->add('tab_topicposting', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_topicposting', NULL, 'fieldset', 0, 1, NULL, 0, true, $n, $t);\n $c->add('show_subject_length', $_FORUM_DEFAULT['show_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_username_length', $_FORUM_DEFAULT['min_username_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_subject_length', $_FORUM_DEFAULT['min_subject_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('min_comment_length', $_FORUM_DEFAULT['min_comment_length'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('views_tobe_popular', $_FORUM_DEFAULT['views_tobe_popular'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_speedlimit', $_FORUM_DEFAULT['post_speedlimit'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allowed_editwindow', $_FORUM_DEFAULT['allowed_editwindow'], 'text', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_html', $_FORUM_DEFAULT['allow_html'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('post_htmlmode', $_FORUM_DEFAULT['post_htmlmode'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('convert_break', $_FORUM_DEFAULT['convert_break'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_censor', $_FORUM_DEFAULT['use_censor'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_glfilter', $_FORUM_DEFAULT['use_glfilter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_geshi', $_FORUM_DEFAULT['use_geshi'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_spamx_filter', $_FORUM_DEFAULT['use_spamx_filter'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('show_moods', $_FORUM_DEFAULT['show_moods'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('allow_smilies', $_FORUM_DEFAULT['allow_smilies'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('use_smilies_plugin', $_FORUM_DEFAULT['use_smilies_plugin'], 'select', 0, 1, 0, $o++, true, $n, $t);\n $c->add('avatar_width', $_FORUM_DEFAULT['avatar_width'], 'text', 0, 1, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 2;\n $c->add('tab_centerblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_centerblock', NULL, 'fieldset', 0, 2, NULL, 0, true, $n, $t);\n $c->add('show_centerblock', $_FORUM_DEFAULT['show_centerblock'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_homepage', $_FORUM_DEFAULT['centerblock_homepage'], 'select', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_numposts', $_FORUM_DEFAULT['centerblock_numposts'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('cb_subject_size', $_FORUM_DEFAULT['cb_subject_size'], 'text', 0, 2, 0, $o++, true, $n, $t);\n $c->add('centerblock_where', $_FORUM_DEFAULT['centerblock_where'], 'select', 0, 2, 5, $o++, true, $n, $t);\n // ----------------------------------\n $t = 3;\n $c->add('tab_sideblock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_sideblock', NULL, 'fieldset', 0, 3, NULL, 0, true, $n, $t);\n $c->add('sideblock_numposts', $_FORUM_DEFAULT['sideblock_numposts'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_subject_size', $_FORUM_DEFAULT['sb_subject_size'], 'text', 0, 3, 0, $o++, true, $n, $t);\n $c->add('sb_latestpostonly', $_FORUM_DEFAULT['sb_latestpostonly'], 'select', 0, 3, 0, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_settings', NULL, 'fieldset', 0, 5, NULL, 0, true, $n, $t);\n $c->add('sideblock_enable', $_FORUM_DEFAULT['sideblock_enable'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_isleft', $_FORUM_DEFAULT['sideblock_isleft'], 'select', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_order', $_FORUM_DEFAULT['sideblock_order'], 'text', 0, 5, 0, $o++, true, $n, $t);\n $c->add('sideblock_topic_option',$_FORUM_DEFAULT['sideblock_topic_option'],'select', 0, 5, 15, $o++, true, $n, $t);\n $c->add('sideblock_topic', $_FORUM_DEFAULT['sideblock_topic'], '%select', 0, 5, NULL, $o++, true, $n, $t);\n\n $c->add('fs_sideblock_permissions', NULL, 'fieldset', 0, 6, NULL, 0, true, $n, $t);\n $new_group_id = 0;\n if (isset($_GROUPS['Forum Admin'])) {\n $new_group_id = $_GROUPS['Forum Admin'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Forum Admin'\");\n if ($new_group_id == 0) {\n if (isset($_GROUPS['Root'])) {\n $new_group_id = $_GROUPS['Root'];\n } else {\n $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', \"grp_name = 'Root'\");\n }\n }\n }\n $c->add('sideblock_group_id', $new_group_id, 'select', 0, 6, NULL, $o++, true, $n, $t);\n $c->add('sideblock_permissions', $_FORUM_DEFAULT['sideblock_permissions'], '@select', 0, 6, 14, $o++, true, $n, $t);\n // ----------------------------------\n $t = 4;\n $c->add('tab_rank', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_rank', NULL, 'fieldset', 0, 4, NULL, 0, true, $n, $t);\n $c->add('level1', $_FORUM_DEFAULT['level1'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2', $_FORUM_DEFAULT['level2'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3', $_FORUM_DEFAULT['level3'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4', $_FORUM_DEFAULT['level4'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5', $_FORUM_DEFAULT['level5'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level1name', $_FORUM_DEFAULT['level1name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level2name', $_FORUM_DEFAULT['level2name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level3name', $_FORUM_DEFAULT['level3name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level4name', $_FORUM_DEFAULT['level4name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n $c->add('level5name', $_FORUM_DEFAULT['level5name'], 'text', 0, 4, 0, $o++, true, $n, $t);\n // ----------------------------------\n $t = 5;\n $c->add('tab_menublock', NULL, 'tab', 0, $t, NULL, 0, true, $n, $t);\n $c->add('fs_menublock_settings', NULL, 'fieldset', 0, 7, NULL, 0, true, $n, $t);\n $c->add('menublock_isleft', $_FORUM_DEFAULT['menublock_isleft'], 'select', 0, 7, 0, $o++, true, $n, $t);\n $c->add('menublock_order', $_FORUM_DEFAULT['menublock_order'], 'text', 0, 7, 0, $o++, true, $n, $t);\n }\n\n return true;\n}", "public function load() {\n\t\tif ($this -> user -> getRights() < 2) {\n\t\t\techo \"Permission denied.\";\n\t\t\treturn;\n\t\t}\n\t\t$this -> configure();\n\t\t$this -> template = TemplateManager::load(\"AdministratorPreferences\");\n\t\t$this -> template -> insert(\"worlds\", $this -> getWorlds());\n\t\t$this -> template -> insert(\"configs\", $this -> getConfigs());\n\t\t$this -> display();\n\t}", "public function loadSettings()\n {\n // old Alfred v4 settings\n $settings = \\Alfred\\getVariables(self::$settingsArgs);\n\n\n if (\\Alfred\\getAlfredVersion() >= 5) {\n $new_settings = \\Alfred\\getVariables(self::$settingsArgsV5);\n\n if (!empty($settings['language']) && $settings['language'] !== 'en_EN' && $new_settings['language'] !== 'en_EN') {\n $settings['language'] = $new_settings['language'];\n }\n if (empty($settings['language'])) {\n $settings['language'] = $new_settings['language'];\n }\n if (!empty($new_settings['timezone']) && $new_settings['timezone'] !== 'none') {\n $settings['time_zone'] = $new_settings['timezone'];\n }\n if (!empty($new_settings['base_currencies'])) {\n $settings['base_currency'] = str_replace(' ', '', $new_settings['base_currencies']);\n $settings['base_currency'] = explode(',', $settings['base_currency']);\n }\n if (!empty($new_settings['apikey_fixer'])) {\n $settings['fixer_apikey'] = $new_settings['apikey_fixer'];\n }\n if (!empty($new_settings['apikey_coinmarket'])) {\n $settings['coinmarket_apikey'] = $new_settings['apikey_coinmarket'];\n }\n if (!empty($new_settings['crypto_decimals'])) {\n $settings['crypto_decimals'] = $new_settings['crypto_decimals'];\n }\n if (!empty($new_settings['vat_value'])) {\n $settings['vat_percentage'] = $new_settings['vat_value'];\n }\n if (!empty($new_settings['pixels_base'])) {\n $settings['base_pixels'] = $new_settings['pixels_base'];\n }\n if (\n !empty($new_settings['date_format']) && $new_settings['date_format'] !== 'j F, Y, g:i:s a' ||\n empty($settings['time_format'])\n ) {\n $settings['time_format'] = $new_settings['date_format'];\n if (is_string($settings['time_format'])) {\n $settings['time_format'] = explode('|', $new_settings['date_format']);\n }\n }\n if (!empty($new_settings['number_output_format'])) {\n $settings['number_output_format'] = $new_settings['number_output_format'];\n }\n if (!empty($new_settings['currency_decimals'])) {\n $settings['currency_decimals'] = $new_settings['currency_decimals'];\n }\n }\n\n return $settings;\n }", "private function _loadPageSettings(){\r\n\r\n $uri = $this->_getContentURI();\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.$uri.DS.'settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->pageSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $page_dir = ROOT.DS.'site'.DS.'content';\r\n foreach(explode('/', $uri) as $dir){\r\n $page_dir .= DS.$dir;\r\n if(!file_exists($page_dir)){\r\n mkdir($page_dir);\r\n }\r\n }\r\n $pageSettings = new stdClass();\r\n $pageSettings->page_title = '';\r\n $pageSettings->page_script = '';\r\n file_put_contents($settings, json_encode($pageSettings));\r\n }\r\n\r\n }" ]
[ "0.7123575", "0.70884997", "0.70884997", "0.70869744", "0.694562", "0.68443495", "0.67842174", "0.6721807", "0.6694451", "0.662528", "0.660273", "0.6465523", "0.64469594", "0.6434062", "0.64337057", "0.6419886", "0.63121265", "0.62866616", "0.6134359", "0.6074875", "0.60547554", "0.60418373", "0.6001232", "0.59977406", "0.5988528", "0.5960335", "0.59446245", "0.58957076", "0.58923876", "0.5890144" ]
0.8110576
0
Loads the sidebar modules.
public function loadSidebarModules() { $setting = $this -> getSetting("sidebar_modules"); if (!$setting) { echo "No sidebar modules found."; return; } $user = Registry::get("user"); $modules = explode(',', $setting -> getValue()); foreach($modules as $module) { $user -> getModule($module) -> load(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadModules();", "function get_sidebar() {\n require_once(COMP_DIR . 'sidebars.php');\n }", "private function mapSidebars(){\n \n /* register menu package theme*/\n $manager = app()->make(SidebarManager::class);\n $manager->register(CoreSidebar::class);\n View::composer(\n 'theme::layouts.sidebar', CoreSidebarCompose::class\n );\n }", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "function agnosia_load_main_modules() {\r\n\r\n\tglobal $agnosia_main_modules;\r\n\r\n\tagnosia_load_modules( $agnosia_main_modules );\r\n\r\n}", "function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}", "function mrl_display() {\r\n mrl_load_template('sidebar.php');\r\n}", "public function load()\n {\n if (is_admin()) {\n add_action('admin_menu', array($this, 'addMenus'), 100);\n }\n }", "function register_sidebar_init() {\n\n\t}", "static public function load_modules() {\n\n\t\trequire_once FL_WS_FORM_DIR . 'modules/ws-form/ws-form.php';\n\t}", "public function init() {\n $this->modulesInTopMenu = array(\n 'admin' => array('admin', 'admin/account', 'admin/rbac', 'admin/scheduler', 'admin/sys', 'admin/i18n', 'admin/seo'),\n 'nivoSlider'=>array('admin/nivoSlider'),\n );\n /* Top menu */\n $this->topMenus = array(\n array('label' => 'General', 'url' => array('/admin/default/index'), 'active' => in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu['admin'])),\n array('label' => 'Nivo Slider', 'url' => array('/admin/nivoSlider/sliderImage'), 'active' => in_array(Yii::app()->controller->module->id, $this->modulesInTopMenu['nivoSlider'])),\n array('label' => 'Logout', 'url' => array('/site/logout'), 'itemOptions' => array('style' => 'float:right')),\n );\n\n /* Sidebar Items */\n $this->sidebarItems = array(\n 'admin' => array(\n array('name' => 'RBAC - Account Management', 'items' => array(\n array('label' => 'Manage accounts', 'url' => array('/admin/account/act/admin'), 'active' => Common::checkMCA('admin/account', 'act', 'admin')),\n array('label' => 'Accounts Statistics', 'url' => array('/admin/account/act/statistics'), 'active' => Common::checkMCA('admin/account', 'act', 'statistics')),\n array('label' => 'Add New Authorization', 'url' => array('/admin/rbac/action/create'), 'active' => Common::checkMCA('admin/rbac', 'action', 'create')),\n array('label' => 'Manage RBAC', 'url' => array('/admin/rbac/action/admin'), 'active' => Common::checkMCA('admin/rbac', 'action', 'admin')),\n array('label' => 'Users Activities', 'url' => array('/admin/account/userLog/admin'), 'active' => Common::checkMCA('admin/account', 'userLog', 'admin')),\n ),\n ),\n array('name' => 'I18N', 'items' => array(\n array('label' => 'Add New Language', 'url' => array('/admin/i18n/action/create'), 'active' => Common::checkMCA('admin/i18n', 'action', 'create')),\n array('label' => 'Manage Languages', 'url' => array('/admin/i18n/action/admin'), 'active' => Common::checkMCA('admin/i18n', 'action', 'admin')),\n )\n ),\n array('name' => 'Scheduler', 'items' => array(\n array('label' => 'Add New System Scheduler', 'url' => array('/admin/scheduler/action/create'), 'active' => Common::checkMCA('admin/scheduler', 'action', 'create')),\n array('label' => 'Manage System Scheduler', 'url' => array('/admin/scheduler/action/admin'), 'active' => Common::checkMCA('admin/scheduler', 'action', 'admin')),\n )\n ),\n array('name' => 'System Information', 'items' => array(\n array('label' => 'View Information', 'url' => array('/admin/sys/action/info'), 'active' => Common::checkMCA('admin/sys', 'action', 'info')),\n array('label' => 'View System logs', 'url' => array('/admin/sys/action/listLog'), 'active' => Common::checkMCA('admin/sys', 'action', 'listLog')),\n array('label' => 'View User Agents', 'url' => array('/admin/sys/action/userAgent'), 'active' => Common::checkMCA('admin/sys', 'action', 'userAgent')),\n array('label' => 'View Email Queues', 'url' => array('/admin/sys/action/emailQueue'), 'active' => Common::checkMCA('admin/sys', 'action', 'emailQueue')),\n array('label' => 'General Settings', 'url' => array('/admin/sys/action/setting'), 'active' => Common::checkMCA('admin/sys', 'action', 'setting')),\n array('label' => 'Clear Cache', 'url' => array('/admin/default/clearCache'), 'active' => Common::checkMCA('admin', 'action', 'clearCache')),\n )\n ),\n\n array('name' => 'Static Pages', 'items' => array(\n array('label' => 'About', 'url' => array('/admin/default/staticPage', 'page' => 'about')),\n array('label' => 'Site Disclaimer', 'url' => array('/admin/default/staticPage', 'page' => 'disclaimer')),\n array('label' => 'Privacy Policy', 'url' => array('/admin/default/staticPage', 'page' => 'privacyPolicy')),\n array('label' => 'Guidelines', 'url' => array('/admin/default/staticPage', 'page' => 'guidelines')),\n )\n ),\n ),\n 'nivoSlider' => array(\n array('name' => 'Nivo Slider', 'items' => array(\n array('label' => 'Manage', 'url' => array('/admin/nivoSlider/sliderImage/admin'), 'active' => Common::checkMCA('admin/nivoSlider', 'sliderImage', 'admin')),\n array('label' => 'Create', 'url' => array('/admin/nivoSlider/sliderImage/create'), 'active' => Common::checkMCA('admin/nivoSlider', 'sliderImage', 'create')),\n ),\n ),\n ), \n );\n }", "public function loadModules()\n {\n foreach ($this->getListOfModules() as $module) {\n $this->loadViews($module);\n $this->loadRoutes($module);\n $this->loadMigrations($module);\n }\n }", "public function maybe_load_module() {\n\n\t\tif ( ! Plugin::instance()->dashboard->is_dashboard_page() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$module = Plugin::instance()->dashboard->get_subpage();\n\n\t\t$this->load_module( $module );\n\n\t}", "final public function load() {\n $this->childLoad();\n \\add_action('admin_menu', [$this, 'addAdminMenuEntries']);\n }", "function bridge_qode_load_modules() {\n\t\tforeach(glob(QODE_FRAMEWORK_ROOT_DIR.'/modules/*/load.php') as $module_load) {\n if (strpos($module_load, 'reviews') == false) {\n include_once $module_load;\n }\n\n\t\t}\n\t}", "public static function initModuleLoading(){\n\n\t}", "public function init_modules() {\n\n\t\tif ( wp_doing_ajax() ) {\n\t\t\t$this->maybe_load_module_on_ajax();\n\t\t} else {\n\t\t\t$this->maybe_load_module();\n\t\t}\n\t}", "function activate_bitwise_sidebar_content() {\n\trequire_once __DIR__ . '/includes/class-bitwise-sidebar-content-activator.php';\n\tBitwise_Sidebar_Content_Activator::activate();\n}", "public function load_single_sidebar_component() {\n\n\t\t\t$single_sidebar = amply_option( 'amply_single_sidebar_type' );\n\n\t\t\tif ( 'none' === $single_sidebar ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trequire_once get_template_directory() . '/extra/single/sidebar/class-amply-single-sidebar-component.php';\n\n\t\t}", "function sidebar() {\n\t\t}", "public function LoadApps()\r\n {\r\n $appBlock = new AppBlock($this->Core);\r\n echo $appBlock->LoadApps();\r\n }", "function load() {\n require_once(dirname(__FILE__) . '/helper.php');\n $cards = new Mod_Cards();\n $cards->createTable();\n\n $views = new Default_Views();\n $views->setModule('cards');\n\n //load default view\n if (!Sessions::isAdminLogged()) {\n $views->setModule('users');\n $views->load('admin/login', '', true);\n } else {\n $views->load('admin/home', '', true);\n }\n}", "function WBootStrap_sidebar_init() {\n\tregister_sidebar( array(\n\t\t'name' => 'Page Sidebar',\n\t\t'id' => 'sidebar-page',\n\t\t'description' => 'Sidebar for pages',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\n\tregister_sidebar( array(\n\t\t'name' => 'Blog Sidebar',\n\t\t'id' => 'sidebar-posts',\n\t\t'description' => 'Sidebar for blog',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\n \tregister_sidebar(array(\n \t'name' => 'Home Left',\n\t 'id' => 'home-left',\n\t 'description' => 'Left Sidebar on homepage',\n\t 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t 'after_widget' => '</div>',\n\t 'before_title' => '<h2>',\n\t 'after_title' => '</h2>'\n\t));\n\n register_sidebar(array(\n \t'name' => 'Home Middle',\n \t'id' => 'home-middle',\n \t'description' => 'Middle Sidebar on homepage',\n \t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n \t'after_widget' => '</div>',\n \t'before_title' => '<h2>',\n \t'after_title' => '</h2>'\n \t));\n\n register_sidebar(array(\n \t'name' => 'Home Right',\n \t'id' => 'home-right',\n \t'description' => 'Right Sidebar on homepage',\n \t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n \t'after_widget' => '</div>',\n \t'before_title' => '<h2>',\n \t'after_title' => '</h2>'\n \t));\n\n \tregister_sidebar(array(\n \t'name' => 'Blog Footer',\n \t'id' => 'blog-footer',\n \t'description' => 'Blog footer widgetized area',\n \t'before_widget' => '<div class=\"span4\"><div id=\"%1$s\" class=\"widget %2$s\">',\n \t'after_widget' => '</div></div>',\n \t'before_title' => '<h3>',\n \t'after_title' => '</h3>'\n \t));\n\n \tregister_sidebar(array(\n \t'name' => 'Page Footer',\n \t'id' => 'page-footer',\n \t'description' => 'pages footer widgetized area',\n \t'before_widget' => '<div class=\"span4\"><div id=\"%1$s\" class=\"widget %2$s\">',\n \t'after_widget' => '</div></div>',\n \t'before_title' => '<h3>',\n \t'after_title' => '</h3>'\n \t));\n\n \tregister_sidebar(array(\n \t'name' => 'Home Page Footer',\n \t'id' => 'home-footer',\n \t'description' => 'Home page footer widgetized area',\n \t'before_widget' => '<div class=\"span4\"><div id=\"%1$s\" class=\"widget %2$s\">',\n \t'after_widget' => '</div></div>',\n \t'before_title' => '<h3>',\n \t'after_title' => '</h3>'\n \t));\n\n}", "function rb_sidebar_init()\n{\n register_sidebar( array(\n 'name' => __( 'Top Sidebar' ),\n 'id' => 'sidebar-top',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function load_assets(){\n\t\t\tadd_action('admin_print_scripts', array(&$this, 'template_add_widget_field') );\n\t\t\tadd_action('load-widgets.php', array(&$this, 'add_sidebar_area'), 100);\n\n\t\t\twp_enqueue_script('bridge-qode-sidebar', QODE_ROOT . '/js/admin/qode-sidebar.js');\n\t\t\twp_enqueue_style( 'bridge-qode-sidebar', QODE_ROOT . '/css/admin/qode-sidebar.css');\n\t\t}", "public function setLeftSideBarData()\n\t{\n\t\t$this->isLoggedIn();\n\t\t$role_id \t= $this->role_id;\n\n $modules = Permission::\n where('status','active')\n ->where('can_view',1)\n ->where('role_id',$role_id)\n ->with('module')\n ->get()\n ->where('module.status','active')\n ->groupBy('module.parent_id');\n $parent_menu = $modules[0]->sortBy('module.rank')->unique('module.id')->pluck('module');\n\n $sub_menu = $modules->mapToGroups(function ($item, $key) {\n return [$key => $item->pluck('module')->unique('id')];\n });\n\t\t$this->parent_menu = $parent_menu;\n\t\t$this->sub_menu = $sub_menu;\n\t}", "public function loadModule()\n {\n // Nothing to do here yet.\n }", "function ft_hook_sidebar() {}", "protected function load()\n {\n $moduleVars = $this->variableApi->getAll('ZikulaRoutesModule');\n \n if (isset($moduleVars['routeEntriesPerPage'])) {\n $this->setRouteEntriesPerPage($moduleVars['routeEntriesPerPage']);\n }\n }" ]
[ "0.6854926", "0.6567983", "0.6566914", "0.63984954", "0.63822705", "0.6381198", "0.6372702", "0.631813", "0.62802625", "0.6275981", "0.6257298", "0.6189398", "0.61397094", "0.6131138", "0.6084721", "0.59940994", "0.59857446", "0.59790087", "0.5975131", "0.5969747", "0.594118", "0.5912797", "0.5895294", "0.58908653", "0.5859074", "0.58579993", "0.5857782", "0.58565485", "0.58532226", "0.58409387" ]
0.84616816
0
Gets the forum manager instance.
public function getForumManager() { return $this -> forumManager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }", "public function get_forum() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_forum() function\n\t\t\treturn $this->forum;\n\t\t}", "protected function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager() {\n return $this->manager;\n }", "public function forum()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Forum');\n\t}", "public function forumNode()\n {\n if (!$this->forumNode)\n {\n $this->forumNode = eZContentObjectTreeNode::fetch(\n $this->attribute('node_id'),\n $this->languageCode()\n );\n }\n return $this->forumNode;\n }", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public function getFormManager()\n {\n if(!$this->formManager){\n $this->setFormManager( $this->getServiceLocator()->get('FormElementManager') );\n }\n return $this->formManager;\n\n return $this->formManager;\n }", "public static function &getInstance() {\n\t\tstatic $instance = NULL;\n\t\tif (!isset($instance))\n\t\t\t$instance = new Manager();\n\t\treturn $instance;\n\t}", "public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }", "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}", "public static function getInstance(): Manager\n {\n if (!self::$instance) {\n self::$instance = new Manager();\n }\n return self::$instance;\n }", "public function show(Forum $forum)\n {\n return $forum;\n }", "public static function getInstance()\n\t{\n\t\tstatic $xInstance = null;\n\t\tif(!$xInstance)\n\t\t{\n\t\t\t$xInstance = new Manager();\n\t\t}\n\t\treturn $xInstance;\n\t}", "protected function getMessageManager()\n {\n return $this->getContext()->getMessageManager();\n }", "public function getConnectorManager()\n {\n if (empty($this->connectorManger)) {\n $this->connectorManager = new ConnectorManager();\n }\n return $this->connectorManager;\n }", "protected function getFeed_ForumService()\n {\n return new \\phpbb\\feed\\forum(${($_ = isset($this->services['feed.helper']) ? $this->services['feed.helper'] : $this->getFeed_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, ${($_ = isset($this->services['content.visibility']) ? $this->services['content.visibility'] : $this->getContent_VisibilityService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, 'php');\n }", "public function get_entry_manager() {\n return \\mod_dataform_entry_manager::instance($this->dataid, $this->id);\n }", "public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }", "public function getEventManager()\n {\n if (!isset($this['event.manager'])) {\n $this['event.manager'] = new Manager($this['dispatcher']);\n }\n return $this['event.manager'];\n }", "public static function getInstance()\n {\n if (self::$instance == null) {\n self::$instance = Administrador::select('*')->where('type', '=', self::ADMINISTRADOR)->first();\n }\n return self::$instance;\n }", "function analogue()\n {\n return Manager::getInstance();\n }", "public static function getInstance()\n {\n return Doctrine_Core::getTable('PluginsfForumMessage');\n }", "public function getManager() {\n return $this->em;\n }", "public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }", "public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }", "public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }" ]
[ "0.7137299", "0.70150113", "0.68473834", "0.6838214", "0.6838214", "0.6838214", "0.674113", "0.65930593", "0.6434213", "0.642184", "0.6415215", "0.63737756", "0.62580514", "0.6256893", "0.6238292", "0.6233609", "0.6200585", "0.60999805", "0.6099355", "0.6098383", "0.6036647", "0.5986744", "0.59436685", "0.59275585", "0.59140354", "0.5874056", "0.58588773", "0.585465", "0.585465", "0.585465" ]
0.87442255
0
peerURLs is the list of URLs the member exposes to the cluster for communication. Generated from protobuf field repeated string peerURLs = 3;
public function setPeerURLs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->peerURLs = $arr; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function getPeerInfo();", "public function getReportPeers()\n {\n return [self::ADMIN];\n }", "public function setRpcsByPeer($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::INT32);\n $this->rpcs_by_peer = $arr;\n\n return $this;\n }", "public function getServerUrls() {\n $publicKey = md5(microtime());\n\n return array(\n array('http://imbo', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n array('http://imbo:81', $publicKey, 'http://imbo:81/users/' . $publicKey),\n array('http://imbo:81/prefix', $publicKey, 'http://imbo:81/prefix/users/' . $publicKey),\n array('http://imbo:80', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo:80/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n\n array('https://imbo', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n array('https://imbo:444', $publicKey, 'https://imbo:444/users/' . $publicKey),\n array('https://imbo:444/prefix', $publicKey, 'https://imbo:444/prefix/users/' . $publicKey),\n array('https://imbo:443', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo:443/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n );\n }", "public function getRpcsByPeer()\n {\n return $this->rpcs_by_peer;\n }", "public function getDiscoveryURLs()\n {\n return $this->discoveryURLs;\n }", "public function getMemberLinks()\n {\n return $this->memberLinks;\n }", "public function setClientURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->clientURLs = $arr;\n\n return $this;\n }", "public function onPeerAccept($peer) {\n\n }", "public function getPeer(string &$address, int &$port): void {}", "function get_remote_peers($url, $info_hash, $method = 'scrape') {\n\n if ($method == \"announce\") {\n $get_params = array(\n \"info_hash\" => pack(\"H*\", $info_hash),\n \"peer_id\" => \"-UT1820-5dmPcUOYGnrx\",\n \"port\" => rand(10000, 65535),\n \"uploaded\" => 0,\n \"no_peer_id\" => 1,\n \"downloaded\" => 0,\n \"compact\" => 1,\n \"left\" => 1,\n \"numwant\" => 9999\n );\n } else {\n $urlorig=$url;\n $url = str_replace('announce', 'scrape', $url);\n $get_params = array(\n \"info_hash\" => pack(\"H*\", $info_hash)\n );\n }\n\n\n $urlInfo = @parse_url($url);\n $http_host = $urlInfo['host'];\n $http_port = getUrlPort($urlInfo);\n $scheme = $urlInfo['scheme'];\n\n if ($http_port === 0)\n return array('tracker' => $http_host, 'state' => 'failed:no_port_detected', 'method' => \"$scheme:$method\", 'remote_method' => 'N/A');\n\n\n $http_path = $urlInfo['path'];\n $get_request_params = explode('&', $urlInfo['query']);\n\n foreach (array_filter($get_request_params) as $array_value) {\n list($key, $value) = explode('=', $array_value);\n $new_get_request_params[$key] = $value;\n }\n\n if (!$new_get_request_params) $new_get_request_params=array();\n // Params gathering complete\n\n // Creating params\n $http_params = @http_build_query(@array_merge($new_get_request_params, $get_params));\n $opts = array($scheme =>\n array(\n 'method' => 'GET',\n 'header' => 'User-Agent: uTorrent/1820',\n 'timeout' => 3\n //'Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2',\n )\n );\n\n $req_uri = $scheme.'://'.$http_host.':'.$http_port.$http_path.($http_params ? '?'.$http_params : '');\n\n if ($scheme=='udp'&&$method=='scrape') {\n\n $transaction_id = mt_rand(0,65535);\n $fp = @fsockopen($scheme.'://'.$http_host, $http_port, $errno, $errstr); //sockets only\n if(!$fp) return array('tracker' => $http_host, 'state' => 'failed:timeout', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n stream_set_timeout($fp, 3);\n\n $current_connid = \"\\x00\\x00\\x04\\x17\\x27\\x10\\x19\\x80\";\n\n //Connection request\n $packet = $current_connid . pack(\"N\", 0) . pack(\"N\", $transaction_id);\n fwrite($fp,$packet);\n\n //Connection response\n $ret = fread($fp, 16);\n if(strlen($ret) < 1){ return get_remote_peers($urlorig, $info_hash, \"announce\"); }\n if(strlen($ret) < 16){ return array('tracker' => $http_host, 'state' => 'failed:invalid_udp_packet', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n $retd = unpack(\"Naction/Ntransid\",$ret);\n if($retd['action'] != 0 || $retd['transid'] != $transaction_id){\n return array('tracker' => $http_host, 'state' => 'failed:invalid_udp_response', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n }\n $current_connid = substr($ret,8,8);\n\n //Scrape request\n $packet = $current_connid . pack(\"N\", 2) . pack(\"N\", $transaction_id) . pack('H*', $info_hash);\n fwrite($fp,$packet);\n //Scrape response\n $readlength = 20;//8 + (12);\n $ret = fread($fp, $readlength);\n if(strlen($ret) < 1){ return get_remote_peers($urlorig, $info_hash, \"announce\"); }\n if(strlen($ret) < 8){ array('tracker' => $http_host, 'state' => 'failed:invalid_udp_packet', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n $retd = unpack(\"Naction/Ntransid\",$ret);\n // Todo check for error string if response = 3\n if($retd['action'] != 2 || $retd['transid'] != $transaction_id){\n array('tracker' => $http_host, 'state' => 'failed:invalid_udp_response', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n }\n if(strlen($ret) < $readlength){ return array('tracker' => $http_host, 'state' => 'failed:invalid_udp_packet', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n\n $index = 8;\n $retd = unpack(\"Nseeders/Ncompleted/Nleechers\",substr($ret,$index,12));\n\n return array('tracker' => $http_host, 'seeders' => $retd['seeders'], 'leechers' => $retd['leechers'], 'state'=> 'ok', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n\n }\n\n elseif ($scheme=='udp'&&$method=='announce') {\n $transaction_id = mt_rand(0,65535);\n $fp = @fsockopen($scheme.'://'.$http_host, $http_port, $errno, $errstr); //sockets only\n if(!$fp) return array('tracker' => $http_host, 'state' => 'failed:timeout', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n stream_set_timeout($fp, 3);\n\n $current_connid = \"\\x00\\x00\\x04\\x17\\x27\\x10\\x19\\x80\";\n\n //Connection request\n $packet = $current_connid . pack(\"N\", 0) . pack(\"N\", $transaction_id);\n //var_dump($packet);\n fwrite($fp,$packet);\n\n //Connection response\n $ret = fread($fp, 16);\n\n if(strlen($ret) < 1){ return array('tracker' => $http_host, 'state' => 'failed:no_udp_data', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n if(strlen($ret) < 16){ return array('tracker' => $http_host, 'state' => 'failed:invalid_udp_packet', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n $retd = unpack(\"Naction/Ntransid\",$ret);\n if($retd['action'] != 0 || $retd['transid'] != $transaction_id){\n return array('tracker' => $http_host, 'state' => 'failed:invalid_udp_response', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n }\n $current_connid = substr($ret,8,8);\n //Announce request\n\n $downloaded = \"\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x30\";\n $left = $downloaded;\n $uploaded = $downloaded;\n $packet = $current_connid . pack(\"N\", 1) . pack(\"N\", $transaction_id) . pack('H*',$info_hash). pack('H*','ee3eb1acec1dc7adc73eda16d05a495bea1ddab1').$downloaded.$left.$uploaded.pack(\"N\", 2).pack(\"N\", ip2long($_SERVER['SERVER_ADDR'])).pack(\"N\", 69).pack(\"N\", 500).pack(\"N\", rand(0,65535));\n\n fwrite($fp,$packet);\n\n //Announce response\n $readlength = 20;//8 + (12);\n $ret = fread($fp, $readlength);\n\n if(strlen($ret) < 1){ return array('tracker' => $http_host, 'state' => 'failed:no_udp_data', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n if(strlen($ret) < $readlength){ array('tracker' => $http_host, 'state' => 'failed:invalid_udp_packet', 'method' => \"$scheme:$method\", 'remote_method' => 'socket'); }\n $retd = unpack(\"Naction/Ntransid\",$ret);\n // Todo check for error string if response = 3\n if($retd['action'] != 2 || $retd['transid'] != $transaction_id){\n array('tracker' => $http_host, 'state' => 'failed:invalid_udp_response', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n }\n\n $index = 8;\n $retd = unpack(\"Nleechers/Nseeders\",substr($ret,$index,8));\n\n return array('tracker' => $http_host, 'seeders' => $retd['seeders'], 'leechers' => $retd['leechers'], 'state'=> 'ok', 'method' => \"$scheme:$method\", 'remote_method' => 'socket');\n\n }\n elseif ( function_exists('curl_init') ) {\n if ($ch = @curl_init()) {\n @curl_setopt($ch, CURLOPT_URL, $req_uri);\n @curl_setopt($ch, CURLOPT_PORT, $http_port);\n @curl_setopt($ch, CURLOPT_HEADER, false);\n @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n @curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);\n @curl_setopt($ch, CURLOPT_BUFFERSIZE, 1000);\n @curl_setopt($ch, CURLOPT_USERAGENT, 'uTorrent/1820');\n\n $result = @curl_exec($ch);\n @curl_close($ch);\n }\n $remote_method = 'curl';\n } \telseif ( function_exists('fsockopen') ){\n if ($fp = fsockopen($http_host, preg_replace(\"#[\\D]#i\", \"\", $http_port), $errno, $errstr, 3)) {\n $h = \"GET \".$http_path.($http_params ? '?'.$http_params : '').\" HTTP/1.0\\r\\n\";\n $h .= \"Host: {$http_host}\\r\\n\";\n $h .= \"Connection: close\\r\\n\";\n $h .= \"User-Agent: uTorrent/1820\\r\\n\\r\\n\";\n fputs($fp, $h);\n $buff = '';\n while (!feof($fp)) {\n $buff .= fgets($fp, 128);\n }\n fclose($fp);\n if ($buff) {\n $data = explode(\"\\r\\n\\r\\n\", $buff);\n $result = $data[1];\n }\n }\n $remote_method = 'socket';\n }\n elseif ( function_exists('file_get_contents') && ini_get('allow_url_fopen') == 1 ) {\n $context = @stream_context_create($opts);\n $result = @file_get_contents($req_uri , false, $context);\n $remote_method = 'file';\n }\n if (!$result)\n {\n if ($method=='scrape')\n return get_remote_peers($urlorig, $info_hash, \"announce\"); else\n return array('tracker' => $http_host, 'state' => 'failed:no_benc_result_or_timeout', 'method' => \"$scheme:$method\", 'remote_method' => $remote_method);\n\n }\n\n\n //var_dump($method);\n $resulttemp=$result;\n $result = @bdec($result);\n\n if (!is_array($result)) return array('tracker' => $http_host, 'state' => 'failed:unable_to_bdec:'.$resulttemp, 'method' => \"$scheme:$method\", 'remote_method' => $remote_method);\n unset($resulttemp);\n // print('<pre>'); var_dump($result);\n if ($method == 'scrape') {\n\n if ($result['value']['files']['value']) {\n $peersarray = @array_shift($result['value']['files']['value']);\n return array('tracker' => $http_host, 'seeders' => $peersarray['value']['complete']['value'], 'leechers' => $peersarray['value']['incomplete']['value'], 'state' => check_fail($result), 'method' => \"$scheme:$method\", 'remote_method' => $remote_method);\n } else return get_remote_peers($urlorig, $info_hash, \"announce\");\n }\n\n if($method == 'announce') {\n return array('tracker' => $http_host, 'seeders' => (is_array($result['value']['peers']['value'])?count($result['value']['peers']['value']):(strlen($result['value']['peers']['value'])/6)), 'leechers' => 0, 'state'=> check_fail($result), 'method' => \"$scheme:$method\", 'remote_method' => $remote_method);\n }\n\n}", "protected function prepareClusterEndpoints(): array\n {\n $endpoints = explode(',', constant('REDIS_CLUSTER_ENDPOINTS'));\n\n return array_map(static function (string $elem) {\n return 'tcp://' . $elem;\n }, $endpoints);\n }", "public function get_video_url_list() {\n\n\t\treturn $this->video_url_list;\n\t}", "public function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new J019tParticipantesPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}", "public function getMultiHostServers() {\n $publicKey = md5(microtime());\n\n $hosts = array('http://imbo0', 'http://imbo1/prefix', 'http://imbo2:81', 'http://imbo3:81/prefix', 'http://imbo4:80');\n\n return array(\n array($hosts, $publicKey, 'd1afdbe2950dc1e9fa134d8c91cd1a8b', 'http://imbo4'),\n array($hosts, $publicKey, '5fda26a928c9b0b90ef7b2db0031bfcf', 'http://imbo0'),\n array($hosts, $publicKey, '5d028794b32c2b127875a336b1220dab', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, 'f7dc62518f2967dacbc4c0eead5fabe5', 'http://imbo2:81'),\n array($hosts, $publicKey, '7a4cac9e82c06010293cd6d23708e147', 'http://imbo2:81'),\n array($hosts, $publicKey, '609c8d8350d3b6b294a628835b8e9b59', 'http://imbo1/prefix'),\n array($hosts, $publicKey, '1e68c888fbe0a27276141a1e6fb576f4', 'http://imbo0'),\n array($hosts, $publicKey, '67e45db3a472a90a26bda000c0818bfc', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, '3ad35117949c5a17b9df82c343b4f763', 'http://imbo3:81/prefix'),\n );\n }", "public function setPeerIp($var)\n {\n GPBUtil::checkString($var, True);\n $this->peer_ip = $var;\n\n return $this;\n }", "public function getConnections()\n {\n return $this->edges;\n }", "public function getPeerName()\n {\n return $this->peerName;\n }", "function getServerURLs() {\n\t\treturn $this->m_serverURLs;\n\t}", "function setUserPeer($peer) {\n $this->userPeer = $peer;\n }", "public function setPeerId(int $value): GetMessagesUploadServer\n {\n $this->peerId = $value;\n return $this;\n }", "public function getPartners()\n {\n return $this->partners;\n }", "public function getUrls() {\n return $this->urls;\n }", "public function CheckConnectionWithPeers() {\r\n\r\n //Run subprocess peerAlive per peer\r\n $peers = $this->chaindata->GetAllPeers();\r\n\r\n if (count($peers) > 0) {\r\n Display::_printer(\"Checking status of peers %G%count%W%=\".count($peers));\r\n $id = 0;\r\n foreach ($peers as $peer) {\r\n //Params for subprocess\r\n $params = array(\r\n $peer['ip'],\r\n $peer['port']\r\n );\r\n\r\n //Run subprocess propagation\r\n Subprocess::newProcess(Tools::GetBaseDir().\"subprocess\".DIRECTORY_SEPARATOR,'peerAlive',$params,$id);\r\n $id++;\r\n }\r\n }\r\n }", "public function getpeerinfo(){\n return $this->bitcoin->getpeerinfo();\n }", "public static function getFollowers(){\n\n\t}", "public function list_members() {\n\n\t\t//ignored users\n\t\t$stm = $this->db()->prepare('select \"to_big\" from \"member_settings\" where \"from_big\" = :current_member_big and \"chat_ignore\" = 1');\n\t\t$stm->execute(array(\n\t\t\t':current_member_big'\t=> $this->member_big,\n\t\t));\n\t\t$ignored_members_raw = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t$ignored_members = array(0);\n\t\tforeach($ignored_members_raw as $member) {\n\t\t\t$ignored_members[] = $member['to_big'];\n\t\t}\n\t\t$ignored_members = implode(',', $ignored_members);\n\n\t\t//joined users\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\", (case when \"c\".\"physical\"=1 then \\'onsite\\' else \\'online\\' end) as \"status\"\n\t\t\tfrom \"checkins\" \"c\"\n\t\t\t\tleft join \"members\" \"m\" on (\"c\".\"member_big\" = \"m\".\"big\")\n\t\t\twhere (\"c\".\"checkout\" is null or \"c\".\"checkout\" > now())\n\t\t\t\tand \"c\".\"event_big\" = (select \"event_big\" from \"checkins\" where \"member_big\" = :member_big and (\"checkout\" is null or \"checkout\" > now()) order by \"created\" desc limit 1)\n\t\t\t\tand (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout)\n\t\t\t\tand \"m\".\"big\" != :member_big\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.')\n\t\t\torder by m.big, \"c\".\"created\" asc'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$joined_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$joined_member_bigs = array(0);\n\t\tforeach($joined_members as $member) {\n\t\t\t$joined_member_bigs[] = $member['big'];\n\t\t}\n\t\t$joined_member_bigs = implode(',', $joined_member_bigs);\n\n\t\t//users we already had conversation with\n\t\t$stm = $this->db()->prepare(\n\t\t\t'select distinct on (m.big) \"m\".\"big\", \"m\".\"name\"||\\' \\'||substring(\"m\".\"surname\" from 1 for 1)||\\'.\\' as \"name\",\n\t\t\t\t(case when (\"m\".\"last_web_activity\" > :online_timeout or \"m\".\"last_mobile_activity\" > :online_timeout) then \\'online\\' else \\'offline\\' end) as \"status\"\n\t\t\tfrom \"member_rels\" \"r\"\n\t\t\t\tleft join \"members\" \"m\" on (\"m\".\"big\" = (case when \"r\".\"member1_big\"=:member_big then \"r\".\"member2_big\" else \"r\".\"member1_big\" end))\n\t\t\t\tleft join \"chat_messages\" as \"cm\" on (\"cm\".\"rel_id\" = \"r\".\"id\" and (case when \"cm\".\"from_big\"=:member_big then \"cm\".\"from_status\" else \"cm\".\"to_status\" end) = 1)\n\t\t\twhere \"m\".\"big\" != :member_big\n\t\t\t\tand (r.member1_big = :member_big OR r.member2_big = :member_big)\n\t\t\t\tand \"m\".\"big\" not in ('.$ignored_members.','.$joined_member_bigs.')\n\t\t\t\tand \"cm\".\"id\" > 0\n\t\t\torder by m.big'\n\t\t);\n\t\t$stm->execute(array(\n\t\t\t':member_big'\t\t=> $this->member_big,\n\t\t\t':online_timeout'\t=> date('c', strtotime(ONLINE_TIMEOUT)),\n\t\t));\n\t\t$history_members = $stm->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($joined_members as $key=>$val) {\n\t\t\t$joined_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\t\tforeach($history_members as $key=>$val) {\n\t\t\t$history_members[$key]['img'] = ProfilePicture::get_resized($val['big'], 28, 28);\n\t\t}\n\n\n\t\treturn $this->reply(array(\n\t\t\t'joined' => $joined_members,\n\t\t\t'history' => $history_members,\n\t\t));\n\n\t}", "function get_announce_urls($dict){\n\tif ($dict['value']['announce'] && !$dict['value']['announce-list']) {$anarray[0] = $dict['value']['announce']['value']; return $anarray; }\n\n\tif ($dict['value']['announce-list']) {\n\n\t\tif (!$dict['value']['announce-list']['value']) return false;\n\t\t$retrackers = get_retrackers(true);\n\t\tforeach ($dict['value']['announce-list']['value'] as $urls) {\n\t\t\tif (!in_array($urls['value'][0]['value'],$retrackers))\n\t\t\t$anarray[] = $urls['value'][0]['value'];\n\t\t}\n\n\t\treturn $anarray;\n\n\t}\n}" ]
[ "0.71117014", "0.71117014", "0.52823734", "0.5227439", "0.52265584", "0.51298815", "0.50742507", "0.50643456", "0.5057388", "0.49560156", "0.4914289", "0.4892287", "0.47719508", "0.47663406", "0.4672185", "0.4657408", "0.4636656", "0.45946988", "0.45934263", "0.4579446", "0.45771736", "0.45731595", "0.45690745", "0.45273378", "0.452558", "0.45176166", "0.4465334", "0.44181424", "0.44107035", "0.44043535" ]
0.74189276
1
clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. Generated from protobuf field repeated string clientURLs = 4;
public function getClientURLs() { return $this->clientURLs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setClientURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->clientURLs = $arr;\n\n return $this;\n }", "public function setPeerURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->peerURLs = $arr;\n\n return $this;\n }", "public function setPeerURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->peerURLs = $arr;\n\n return $this;\n }", "public function get_clients(){\n\t\treturn $this->clients;\n\t}", "public function getClients()\n {\n return $this->clients;\n }", "public function getClients()\n {\n return $this->clients;\n }", "public function getMaxClients()\n {\n return $this->_maxClients;\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function getServerUrls() {\n $publicKey = md5(microtime());\n\n return array(\n array('http://imbo', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n array('http://imbo:81', $publicKey, 'http://imbo:81/users/' . $publicKey),\n array('http://imbo:81/prefix', $publicKey, 'http://imbo:81/prefix/users/' . $publicKey),\n array('http://imbo:80', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo:80/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n\n array('https://imbo', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n array('https://imbo:444', $publicKey, 'https://imbo:444/users/' . $publicKey),\n array('https://imbo:444/prefix', $publicKey, 'https://imbo:444/prefix/users/' . $publicKey),\n array('https://imbo:443', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo:443/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n );\n }", "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function clientList() {\n return $this->returnCommand(['CLIENT', 'LIST'], null, null, ResponseParser::PARSE_CLIENT_LIST);\n }", "public function clientList()\n {\n return $this->getParent()->channelGroupClientList($this->getId());\n }", "function renderClients(){\n\t\t$clients = $this->cache->getClients();\n\t\tforeach($clients as $c){\n\t\t\t$size = $c->getSize();\n\t\t\t$this->ret_clients[] = array('ip'=>$c->getIp(),'mb'=>$size['mb']);\n\t\t}\n\t}", "function getServerURLs() {\n\t\treturn $this->m_serverURLs;\n\t}", "public function getDiscoveryURLs()\n {\n return $this->discoveryURLs;\n }", "public function getUrls() {\n return $this->urls;\n }", "public function getClientCount()\n {\n return count($this->clients);\n }", "public function setClientProtobufs($protobufs, $protofile) {\n\t\t$this->clientProtobufs = $protobufs;\n\t\t$this->clientProtoFile = $protofile;\n\t}", "function setServerURLs($serverURLs) {\n\t\t$this->m_serverURLs = $serverURLs;\n\t}", "abstract protected function getSubClientNames();", "public function setClient($client);", "public function setReplyUrls($val)\n {\n $this->_propDict[\"replyUrls\"] = $val;\n return $this;\n }", "function ts3client_getChannelClientList($serverConnectionHandlerID, $channelID, &$result) {}", "function getClientList()\n\t{\n\t\t//Update Client List\n\t\t$this->Client_List = null;\n\t\t$assigned_clients_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Client');\n\t\tforeach($assigned_clients_rows as $assigned_client)\n\t\t\t$this->Client_List[] = new Client( $assigned_client['ClientProjectTask'] );\n\t\t\n\t\treturn $this->Client_List;\n\t}", "public function getClientes()\n {\n return $this->clientes;\n }", "public function getClientes()\n {\n return $this->clientes;\n }", "function retrieve_promoter_clients_list(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\t$clients = $this->CI->users_promoters->retrieve_promoter_clients_list($this->promoter->up_id, $this->promoter->team->t_fan_page_id);\n\t\tforeach($clients as $key => &$client){\n\t\t\t\n\t\t\tif($client->pglr_user_oauth_uid === null){\n\t\t\t\tunset($clients[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$client = $client->pglr_user_oauth_uid;\n\t\t}\n\t\treturn $clients;\n\t\t\n\t}", "function get_pubsub_endpoints() {\n\t\treturn $this->vars['endpoints'];\n\t}", "public function testMultipleClients()\n {\n self::$mediumString = TestHelper::makeBigString(2);\n\n $this->assertEquals(self::$multiple, $this->query(['method' => 'resetMultiple']));\n $parallel = 50;\n\n for ($i = 0; $i < $parallel; ++$i) {\n self::newRemoteClient('computeMD5AndSleep');\n }\n\n static::waitForRemoteClientsToExit();\n\n $multiple = $this->query(['method' => 'getMultiple']);\n $this->assertEquals($parallel, $multiple['connections']);\n $this->assertEquals($parallel, $multiple['maxSimultaneousConnections']);\n $this->assertEquals($parallel, $multiple['md5ok']);\n }" ]
[ "0.7543656", "0.5575555", "0.5575555", "0.5374052", "0.5335245", "0.5335245", "0.5020797", "0.498362", "0.49752897", "0.49725452", "0.49725452", "0.4877334", "0.48250157", "0.48209542", "0.48073673", "0.4806828", "0.47610402", "0.47603902", "0.4745423", "0.47416723", "0.4734566", "0.46185747", "0.46075082", "0.45849258", "0.45530033", "0.45409665", "0.45409665", "0.45240802", "0.45075235", "0.44895917" ]
0.6256952
1
clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. Generated from protobuf field repeated string clientURLs = 4;
public function setClientURLs($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); $this->clientURLs = $arr; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientURLs()\n {\n return $this->clientURLs;\n }", "public function setPeerURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->peerURLs = $arr;\n\n return $this;\n }", "public function setPeerURLs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->peerURLs = $arr;\n\n return $this;\n }", "public function get_clients(){\n\t\treturn $this->clients;\n\t}", "public function getClients()\n {\n return $this->clients;\n }", "public function getClients()\n {\n return $this->clients;\n }", "public function getMaxClients()\n {\n return $this->_maxClients;\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function getServerUrls() {\n $publicKey = md5(microtime());\n\n return array(\n array('http://imbo', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n array('http://imbo:81', $publicKey, 'http://imbo:81/users/' . $publicKey),\n array('http://imbo:81/prefix', $publicKey, 'http://imbo:81/prefix/users/' . $publicKey),\n array('http://imbo:80', $publicKey, 'http://imbo/users/' . $publicKey),\n array('http://imbo:80/prefix', $publicKey, 'http://imbo/prefix/users/' . $publicKey),\n\n array('https://imbo', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n array('https://imbo:444', $publicKey, 'https://imbo:444/users/' . $publicKey),\n array('https://imbo:444/prefix', $publicKey, 'https://imbo:444/prefix/users/' . $publicKey),\n array('https://imbo:443', $publicKey, 'https://imbo/users/' . $publicKey),\n array('https://imbo:443/prefix', $publicKey, 'https://imbo/prefix/users/' . $publicKey),\n );\n }", "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function getPeerURLs()\n {\n return $this->peerURLs;\n }", "public function clientList() {\n return $this->returnCommand(['CLIENT', 'LIST'], null, null, ResponseParser::PARSE_CLIENT_LIST);\n }", "public function clientList()\n {\n return $this->getParent()->channelGroupClientList($this->getId());\n }", "function renderClients(){\n\t\t$clients = $this->cache->getClients();\n\t\tforeach($clients as $c){\n\t\t\t$size = $c->getSize();\n\t\t\t$this->ret_clients[] = array('ip'=>$c->getIp(),'mb'=>$size['mb']);\n\t\t}\n\t}", "function getServerURLs() {\n\t\treturn $this->m_serverURLs;\n\t}", "public function getDiscoveryURLs()\n {\n return $this->discoveryURLs;\n }", "public function getUrls() {\n return $this->urls;\n }", "public function getClientCount()\n {\n return count($this->clients);\n }", "function setServerURLs($serverURLs) {\n\t\t$this->m_serverURLs = $serverURLs;\n\t}", "public function setClientProtobufs($protobufs, $protofile) {\n\t\t$this->clientProtobufs = $protobufs;\n\t\t$this->clientProtoFile = $protofile;\n\t}", "abstract protected function getSubClientNames();", "public function setClient($client);", "public function setReplyUrls($val)\n {\n $this->_propDict[\"replyUrls\"] = $val;\n return $this;\n }", "function ts3client_getChannelClientList($serverConnectionHandlerID, $channelID, &$result) {}", "function getClientList()\n\t{\n\t\t//Update Client List\n\t\t$this->Client_List = null;\n\t\t$assigned_clients_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Client');\n\t\tforeach($assigned_clients_rows as $assigned_client)\n\t\t\t$this->Client_List[] = new Client( $assigned_client['ClientProjectTask'] );\n\t\t\n\t\treturn $this->Client_List;\n\t}", "public function getClientes()\n {\n return $this->clientes;\n }", "public function getClientes()\n {\n return $this->clientes;\n }", "function retrieve_promoter_clients_list(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\t$clients = $this->CI->users_promoters->retrieve_promoter_clients_list($this->promoter->up_id, $this->promoter->team->t_fan_page_id);\n\t\tforeach($clients as $key => &$client){\n\t\t\t\n\t\t\tif($client->pglr_user_oauth_uid === null){\n\t\t\t\tunset($clients[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$client = $client->pglr_user_oauth_uid;\n\t\t}\n\t\treturn $clients;\n\t\t\n\t}", "function get_pubsub_endpoints() {\n\t\treturn $this->vars['endpoints'];\n\t}", "public function testMultipleClients()\n {\n self::$mediumString = TestHelper::makeBigString(2);\n\n $this->assertEquals(self::$multiple, $this->query(['method' => 'resetMultiple']));\n $parallel = 50;\n\n for ($i = 0; $i < $parallel; ++$i) {\n self::newRemoteClient('computeMD5AndSleep');\n }\n\n static::waitForRemoteClientsToExit();\n\n $multiple = $this->query(['method' => 'getMultiple']);\n $this->assertEquals($parallel, $multiple['connections']);\n $this->assertEquals($parallel, $multiple['maxSimultaneousConnections']);\n $this->assertEquals($parallel, $multiple['md5ok']);\n }" ]
[ "0.6257284", "0.55756074", "0.55756074", "0.5374163", "0.5335374", "0.5335374", "0.5020187", "0.4984704", "0.49747455", "0.49726826", "0.49726826", "0.48765936", "0.48242775", "0.4820912", "0.48079878", "0.4807234", "0.47617048", "0.47596228", "0.47440386", "0.47440186", "0.4734876", "0.46195266", "0.46055737", "0.45854583", "0.45525172", "0.45406562", "0.45406562", "0.45229155", "0.4508005", "0.4488058" ]
0.754419
0
Test that custom definitions are not passed through to dependencies. Surprising things would happen if this did occur.
public function testCustomDefinitionNotPassedThrough() { $injector = new Injector(); $injector->share('Auryn\Test\DependencyWithDefinedParam'); $injector->make('Auryn\Test\RequiresDependencyWithDefinedParam', array(':foo' => 5)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddInvalid()\n {\n $this->todo('stub');\n }", "public function testRuleAppliesTwiceToClassWithNotImportedDependencies()\n {\n $rule = $this->getRule();\n $rule->setReport($this->getReportMock(2));\n $rule->apply($this->getMethod());\n }", "public function testAddInvalids()\n {\n $this->todo('stub');\n }", "public function testRuleDoesNotApplyWhenSuppressed()\n {\n $rule = new MissingImport();\n $rule->addProperty('ignore-global', 'true');\n $files = $this->getFilesForCalledClass('testRuleAppliesTo*');\n foreach ($files as $file) {\n // Covers case when the new property is set and the rule *should* apply.\n if (strpos($file, 'WithNotImportedDeepDependencies')) {\n $this->expectRuleHasViolationsForFile($rule, static::ONE_VIOLATION, $file);\n continue;\n }\n // Covers case when the new property is set and the rule *should not* apply.\n $this->expectRuleHasViolationsForFile($rule, static::NO_VIOLATION, $file);\n }\n }", "public function test_undocumented_hook() {\n\n\t\t$this->assertHookHasDocs(\n\t\t\t'undocumented_hook'\n\t\t\t, array(\n\t\t\t\t'description' => '',\n\t\t\t)\n\t\t);\n\t}", "public function testGetDependents()\n {\n }", "public function notATestCase() {}", "public function testSpecial(): void {\n\t}", "private function missingDependencies() {\n }", "public function testGetForeignWhereMods()\n {\n $this->todo('stub');\n }", "public function testHasWillAssertBooleanFalseForNonRegisteredService(): void\n {\n $container = new Container();\n\n $name = \\stdClass::class;\n\n $this->assertFalse($container->has($name));\n }", "public function testExtendThrowsExceptionWhenUnregisteredDefinitionIsGiven()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container;\n $c->extend('does_not_exist');\n }", "public function testNotChangingOtherLibraries() {\n $libraries = [];\n \\mask_library_info_alter($libraries, 'foo');\n\n $this->assertEmpty($libraries);\n }", "public function testIgnoreCustom()\n {\n $this->app['config']->set('jsvalidation.ignore', ':hidden');\n $jsValidator = $this->app['jsvalidator']->make([]);\n\n $this->assertArrayHasKey('ignore', $jsValidator->toArray());\n $this->assertEquals(\":hidden\", $jsValidator->toArray()['ignore']);\n }", "function require_dependencies() {\n //nothing needed by default - this is a report-specific hook\n }", "public function testIgnoreCustom2()\n {\n $jsValidator = $this->app['jsvalidator']->make([]);\n $jsValidator->ignore(':hidden');\n\n $this->assertArrayHasKey('ignore', $jsValidator->toArray());\n $this->assertEquals(\":hidden\", $jsValidator->toArray()['ignore']);\n }", "public function testHasDependedModuleClasses(): void\n {\n $this->assertNotEmpty(\n App::getModule($this->getModuleClass())->getDependedModuleClasses()\n );\n }", "public function testGetRelatedBuildTypes()\n {\n }", "public function testNotOperational2()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['extensionsNotExisting'] = ['gd'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkOperationality();\r\n $pretend['extensionsNotExisting'] = [];\r\n }", "#[@test, @expect('lang.ElementNotFoundException')]\n public function non_existant() {\n \\lang\\ClassLoader::registerPath('@@non-existant@@');\n }", "public function testRegistrationFieldsMissing(): void { }", "public function testNoImports(): void\n {\n $importing = new Importing(__NAMESPACE__);\n\n $importing->prepare();\n\n self::assertSame([], $importing->imports());\n self::assertSame([], $importing->replacePairs());\n }", "function disableExpectationNameChecks() {\n $this->is_strict = false;\n }", "public function test_metadata_not_found_in_wordpress_core() {\n\t\t$result = register_block_type_from_metadata( 'unknown' );\n\n\t\t$this->assertFalse( $result );\n\t}", "public function testCustomProductPluginIsSkipped()\n {\n # build a repo that would return nothing...just in case ;)\n $fakeRepoProducts = new FakeProductRepository(null, null);\n\n # build a product line item with * as number.\n # this is what custom products does.\n # and just to be safe, let's try it with a space ;)\n $item = $this->buildProductLineItem('* ');\n\n $vouchers = new VoucherService($fakeRepoProducts, new NullLogger());\n $voucherType = $vouchers->getFinalVoucherType($item, $this->salesChannelContext);\n\n $this->assertEquals('', $voucherType);\n }", "public function testValidateDocumentAutodetectValidation()\n {\n }", "function testPostTypeNotExistsGenerateExpectsWPError() {\n\t\t// Arrange\n\t\t$stub = $this->getMockBuilder('TestValidBox')\n\t\t\t->setMethods(array('check_post_type'))\n\t\t\t->getMock();\n\t\t$stub->expects($this->once())\n\t\t\t->method('check_post_type')\n\t\t\t->with($stub->post_type[0])\n\t\t\t->will($this->returnValue(false));\n\t\t$error = $this->getMock('\\WP_Error', array('get_error_message'));\n\t\t$stub->error_handler(get_class($error));\n\t\t// act\n\t\t$actual = $stub->generate();\n\n\t\t// Assert\n\t}", "public function testContainerThrowsWhenCannotGetDefinitionToExtend()\n {\n $this->expectException(NotFoundException::class);\n\n $container = new Container;\n\n $this->assertFalse($container->has(Foo::class));\n\n $container->extend(Foo::class);\n }", "public function test()\n {\n $doc = <<<DOC\n/**\n * Just some description. Should be ignored.\n */\nDOC;\n\n $this->tags['bar']->expects($this->never())->method('process');\n $this->tags['foo']->expects($this->never())->method('process');\n $this->tags['qux']->expects($this->never())->method('process');\n\n $result = $this->parser->parse($doc);\n\n $this->assertSame([], $result);\n }", "public function testIgnoredAnnotationSkippedBeforeReflection() {\n $annotation = 'neverReflectThis';\n $parser = new DocParser();\n $parser->setIgnoredAnnotationNames([$annotation => TRUE]);\n $parser->addNamespace('\\\\Arbitrary\\\\Namespace');\n\n // Register our class loader which will fail if the parser tries to\n // autoload disallowed annotations.\n $autoloader = function ($class_name) use ($annotation) {\n $name_array = explode('\\\\', $class_name);\n $name = array_pop($name_array);\n if ($name == $annotation) {\n $this->fail('Attempted to autoload an ignored annotation: ' . $name);\n }\n };\n spl_autoload_register($autoloader, TRUE, TRUE);\n // Perform the parse.\n $this->assertEmpty($parser->parse('@neverReflectThis'));\n // Clean up after ourselves.\n spl_autoload_unregister($autoloader);\n }" ]
[ "0.6088606", "0.6087949", "0.6076389", "0.58834934", "0.58617955", "0.5830857", "0.58256596", "0.5783857", "0.57835245", "0.57812285", "0.57788897", "0.5745005", "0.5738211", "0.57338595", "0.5703734", "0.5700072", "0.569276", "0.56750834", "0.56738603", "0.5614036", "0.5554518", "0.5522665", "0.5506566", "0.54605025", "0.54543626", "0.5450487", "0.5431088", "0.54204065", "0.5415901", "0.54148954" ]
0.7236046
0
Test coverage for delegate closures that are defined outside of a class.ph
public function testDelegateClosure() { $delegateClosure = \Auryn\Test\getDelegateClosureInGlobalScope(); $injector = new Injector(); $injector->delegate('Auryn\Test\DelegateClosureInGlobalScope', $delegateClosure); $injector->make('Auryn\Test\DelegateClosureInGlobalScope'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClosure()\n {\n }", "public function getDelegate();", "public function testWithClosure()\n\t{\n\t\t$container = new Container();\n\t\t$container['service'] = function ()\n\t\t{\n\t\t\treturn new Service();\n\t\t};\n\n\t\t$this->assertInstanceOf(Service::class, $container['service']);\n\t}", "public function test_dispatching_closure()\n {\n $function = function () {\n return true;\n };\n $result = $this->dispatcher->dispatch($function);\n $this->assertTrue($result);\n }", "public function setFunctionCallAnalyzer(Closure $closure): void;", "public function testEventWithClosure()\n {\n $eventManager = new EventManager;\n $secret = '1234';\n $eventManager->listen('secret', function ($newSecret) use ($secret) {\n $this->assertEquals($newSecret, $secret);\n });\n $eventManager->fire('secret', $secret);\n }", "abstract protected function createDelegate($source, $dest);", "public function testEventCallBackGetInboundReferences()\n {\n }", "public function isClosure()\n\t{\n\t\treturn false;\n\t}", "public function testEventCallBackGetMacros()\n {\n }", "public function testSubsequentCallsProduceDifferentClasses()\n {\n $builder = new MockDelegateFunctionBuilder();\n\n $builder->build();\n $class1 = $builder->getFullyQualifiedClassName();\n\n $builder->build();\n $class2 = $builder->getFullyQualifiedClassName();\n \n $builder2 = new MockDelegateFunctionBuilder();\n $builder2->build();\n $class3 = $builder2->getFullyQualifiedClassName();\n \n $this->assertNotEquals($class1, $class2);\n $this->assertNotEquals($class1, $class3);\n $this->assertNotEquals($class2, $class3);\n }", "public function testEventCallBackPatch()\n {\n }", "function noop(): Closure\n{\n return function () {\n };\n}", "private function privateDummy()\n {\n }", "public function testCoverAllMethods();", "function testCallable() {}", "function runkit_method_add(string $classname, string $methodname, Closure $closure, int $flags = RUNKIT_ACC_PUBLIC, string $doc_comment = null, bool $is_strict = null) : bool {\n}", "public function testContainerAddsAndGetsFromDelegate()\n {\n $delegate = new ReflectionContainer;\n $container = new Container;\n\n $container->delegate($delegate);\n\n $foo = $container->get(Foo::class);\n\n $this->assertInstanceOf(Foo::class, $foo);\n }", "public function isClosure() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "function before(\\Closure $closure)\n{\n pho\\before($closure);\n}", "public function allow_replacing_internal_functions()\n {\n FunctionMocker::replace('array_reduce', 2323);\n\n $this->assertEquals(2323, array_reduce([2, 3, 4, 5], function () {\n return 23;\n }));\n }", "protected function setUp() {\n $this->object = new CallableActionProxy(function() {\n return 'test_proxy';\n });\n }", "function getDelegateClassNames() {\n\t\tassert(false);\n\t}", "public function testAttach()\n {\n $event = new EventManager();\n\n /** @var \\Closure $closure */\n $closure = function () {\n return $this->listeners;\n };\n\n $this->mvcKeeper->attach($event);\n\n $getListeners = $closure->bindTo($this->mvcKeeper, get_class($this->mvcKeeper));\n $listeners = $getListeners();\n\n foreach ($listeners as $listener) {\n $this->assertInstanceOf('Zend\\Stdlib\\CallbackHandler', $listener);\n }\n }", "private function aFunc()\n {\n }", "public static function callbackStaticTestFunction() {}", "public function testStoresAndInvokesClosure()\n {\n $c = new Container;\n\n $c->add('foo', function () {\n $foo = new \\League\\Container\\Test\\Asset\\Foo(\n new \\League\\Container\\Test\\Asset\\Bar(\n new \\League\\Container\\Test\\Asset\\Baz\n )\n );\n\n $foo->injectBaz(new \\League\\Container\\Test\\Asset\\Baz);\n\n return $foo;\n });\n\n $foo = $c->get('foo');\n\n $this->assertInstanceOf('League\\Container\\Test\\Asset\\Foo', $foo);\n $this->assertInstanceOf('League\\Container\\Test\\Asset\\Bar', $foo->bar);\n $this->assertInstanceOf('League\\Container\\Test\\Asset\\Baz', $foo->baz);\n }", "public function testEventCallBackCreate()\n {\n }", "function test(){\r\n //placeholder for future test functions\r\n }", "#[Depends('testFactoryReturnsCallable')]\n public function testFactoryIsAClosure(callable $factory): void\n {\n $this->assertNotSame([ServerRequestFactory::class, 'fromGlobals'], $factory);\n $this->assertNotSame(ServerRequestFactory::class . '::fromGlobals', $factory);\n $this->assertInstanceOf(Closure::class, $factory);\n }" ]
[ "0.61740226", "0.61498696", "0.5824732", "0.5815946", "0.5633426", "0.55182683", "0.5500732", "0.54276323", "0.54195625", "0.5344668", "0.5340726", "0.5317321", "0.5262389", "0.5251866", "0.52285445", "0.52080905", "0.5182088", "0.5180927", "0.5173353", "0.5171993", "0.50985444", "0.5085097", "0.50848204", "0.5071974", "0.5061792", "0.5055233", "0.50496805", "0.5048063", "0.5028986", "0.5025367" ]
0.76464486
0
Store a newly created resource in storage. POST /estimateentries
public function store() { App::error(function(ModelNotFoundException $e) { App::abort(404); }); $entry = new EstimateEntry; $get = Input::get(); $entry->estimate_id = $get['estimate_id']; $entry->title = $get['title']; $entry->hours = isset($get['hours']) ? $get['hours'] : $entry->hours; $entry->save(); return $entry; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $estimate = new Estimate;\n $estimate->user_id = Auth::user()->id;\n $estimate->description = $request->description;\n $estimate->hours = $request->hours;\n $estimate->estimate_request_id = $request->estimate_request_id;\n $estimate->save();\n return redirect()->route('estimates.index');\n }", "public function store(StoreEstimateRequest $request)\n {\n\t\tDB::beginTransaction();\n\t\ttry {\n\t\t\t$estimate = new Estimate;\n\t\t\t$estimate->fill($request->all());\n\t\t\t$estimate->setRedundantData(auth()->user());\n\n\t\t\t$details_input = $request->get('details');\n\t\t\t$details = [];\n\t\t\tforeach ($details_input as $detail) {\n\t\t\t\tif (!$detail['is_delete']) {\n\t\t\t\t\t$details[] = new EstimateDetail($detail);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$estimate->total_price = $estimate->calc_price($details);\n\t\t\t$estimate->save();\n\t\t\t$estimate->estimate_details()->saveMany($details);\n\t\t\tDB::commit();\n\t\t} catch (Exception $e) {\n\t\t\tDB::rollback();\n\t\t\treturn back()->withInput();\n\t\t}\n\n\t\treturn redirect()\n\t\t\t\t->route('estimates.index')\n\t\t\t\t->withInput()\n\t\t\t\t->with('message', '登録しました');\n }", "public function store(CreateEstimateRequest $request)\n {\n // dd(request()->all());\n $data = $request->validated();\n $data['admin_id'] = auth()->id();\n\n $this->verifyCustomerProject($data['customer_id'], $data['project_id']);\n\n $estimate = DocumentService::generateDocument($data, true);\n\n $this->saveEstimate($data, $estimate);\n\n return redirect()->route('admin.estimates.index')->with([\n 'alertType' => 'success',\n 'alertMessage' => 'Le devis a bien été générée.',\n ]);\n }", "public function store()\n\t{\n\t\tif( !$this->validator->passes() )\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($this->validator->errors);\n\t\t}\n\t\t\n\t\t$foodEntry = $this->foodEntry->create(Input::all());\n\n\t\treturn Redirect::back()\n\t\t->with('success', 'Entry added successfully');\n\t}", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validator = Validator::make($input,\n\t\t\tarray(\n\t\t\t\t'date' => 'required',\n\t\t\t\t'difference' => 'required',\n\t\t\t\t'invoice_id' => '',\n\t\t\t\t'description' => 'required',\n\t\t\t\t'notes' => ''\n\t\t\t\t)\n\t\t\t);\n\n\t\tif ($validator->fails()) {\n\t\t\techo 'Uh oh, you bad. Error: ' . var_dump($validator->messages()) . '.';\n\t\t} else {\n\t\t\t$entry = new Entry();\n\t\t\t$entry->date = Input::get('date');\n\t\t\t$entry->difference = Input::get('difference');\n\t\t\t$entry->invoice_id = Input::get('invoice_id');\n\t\t\t$entry->description = Input::get('description');\n\t\t\t$entry->notes = Input::get('notes');\n\n\t\t\t$entry->save();\n\n\t\t\treturn Redirect::to('/')->with('result', 'Entry created.');\n\t\t}\n\t}", "public function store()\n\t{\n $validator = Validator::make($this->_request->all(),\n ['tax' => 'required']\n );\n if($validator->fails())\n {\n return response()->json([\n 'status' => 'required',\n 'message' => 'tax'\n ], 200);\n }\n try {\n $this->_tax->fill($this->_request->all());\n $this->_tax->save();\n $rate = $this->_tax->tax;\n\n return response()->json(['status' => 'success', 'message' => $rate]);\n } catch(Exception $e) {\n return response()->json(['status' => 'unique', 'message' => 'An error has occurred']);\n }\n\t}", "public function store(StoreTimeEntriesRequest $request)\n {\n if (! Gate::allows('time_entry_create')) {\n return abort(401);\n }\n $time_entry = TimeEntry::create($request->all());\n $time_entry->student()->sync(array_filter((array)$request->input('student')));\n\n\n\n return redirect()->route('admin.time_entries.index');\n }", "public function store() {\n\n //custom error messages\n $messages = [];\n\n //validate\n $validator = Validator::make(request()->all(), [\n 'taxrate_name' => 'required',\n 'taxrate_value' => [\n 'required',\n 'numeric',\n function ($attribute, $value, $fail) {\n if ($value <= 0) {\n return $fail(__('lang.tax_rate_greater_than_zero'));\n }\n },\n ],\n ], $messages);\n\n //errors\n if ($validator->fails()) {\n $errors = $validator->errors();\n $messages = '';\n foreach ($errors->all() as $message) {\n $messages .= \"<li>$message</li>\";\n }\n \n abort(409, $messages);\n }\n\n //create the taxrate\n if (!$taxrate_id = $this->taxraterepo->create()) {\n abort(409, __('lang.error_request_could_not_be_completed'));\n }\n\n //get the taxrate object (friendly for rendering in blade template)\n $taxrates = $this->taxraterepo->search($taxrate_id);\n\n //counting rows\n $rows = $this->taxraterepo->search();\n $count = $rows->total();\n\n //reponse payload\n $payload = [\n 'taxrates' => $taxrates,\n 'count' => $count,\n ];\n\n //process reponse\n return new StoreResponse($payload);\n\n }", "public function store(Request $request)\n {\n \n\n $match = Match::findOrFail($request->match_id);\n\n $match->statistics()->create($request->only(\n 'match_id', 'vojenske_skore', 'ekonomicke_skore', 'technologicke_skore', 'socialni_skore', 'doba_preziti' \n ));\n\n $statistic = Statistic::orderby('created_at', 'desc')->first();\n\n return redirect()->route('statistic.show', $statistic->id );\n }", "public function postCreate(EntityStorageInterface $storage);", "public function store(Request $request)\n {\n $ingredientsupplyorder = new IngredientSupplyOrder;\n $ingredientsupplyorder->supplyorder_id = $request->supplyorder_id;\n $ingredientsupplyorder->ingredient_id = $request->Ingredient;\n $ingredientsupplyorder->quantity = $request->Quantity;\n $ingredientsupplyorder->save();\n\n $ingredient = Ingredient::find($ingredientsupplyorder->ingredient_id);\n\n Activity::log('Added ' . $ingredient->name . ' to the supply order.');\n\n return Redirect::back()->with('status','Supply order updated!');\n }", "public function store()\n {\n $this->storeKeys();\n }", "public function store()\n {\n $input = Request::all();\n\n $validator = Validator::make($input, MarketSourceSpent::getRules());\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n try {\n $spent = $this->repo->saveSpent($input);\n\n return ApiResponse::success([\n 'message' => trans('response.success.saved', ['attribute' => 'Market Source Spent']),\n 'data' => $spent,\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function store()\n\t{\n\t\t$entry = new Offering;\n\t\t$entry->deposit_id = Input::get('deposit_id');\t\t\n\t\t$entry->name = Input::get('name');\n\t\t$entry->created_at = Input::get('created_at');\n\t\t$entry->memo = Input::get('memo');\n\t\t$entry->save();\n\t \n\t\treturn Redirect::to('accounting/deposits/'.$entry->deposit->id.'#'.$entry->name)->with('message', 'Offering Successfully created!');\n\t}", "public function store(Request $request)\n {\n $data = $request->all();\n TempStorage::create($data);\n $space = DB::table('warehouses')->select('free_space')->where('w_id',$request->w_id)->first()->free_space;\n $shelve = DB::table('warehouses')->select('free_shelves')->where('w_id',$request->w_id)->first()->free_shelves;\n $updateSpace = $space - $request->space_taken;\n $updateShelve = $shelve - $request->shelves_taken;\n DB::table('warehouses')->where('w_id',$request->w_id)->update([\n 'free_space'=>$updateSpace,\n 'free_shelves'=>$updateShelve\n ]);\n return redirect(route('temp.index'));\n }", "public function store(createArticleRequest $request)\n\t{\n\t\t$article = new Article($request->all());\n\n\t\t$name = $request->input('interest');\n\n\t\t$tag_id = DB::table('interests')\n\t\t\t->select('interests.id')\n\t\t\t->where('name','=',$name)->get();\n\n\t\t$article->interest()->attach($tag_id);\n\n\t\tAuth::user()->article()->save($article);\n\n\n\n\t\tflash()->overlay('Your article has been created', 'Thank you for posting');\n\t\t\n\t\treturn redirect('article');\n\t}", "protected function save() {\n $values = $this->values;\n\n $values[self::METADATA_NAMESPACE] = array(\n 'first_trace' => $this->getFirstTrace(),\n 'last_trace' => $this->getLastTrace(),\n 'regeneration_trace' => $this->getRegenerationTrace(),\n 'requests_count' => $this->getRequestsCounter(),\n 'fingerprint' => $this->getFingerprint(),\n );\n\n return $this->getStorage()->store($this->getId(), $values);\n }", "public function store(ItemEntryRequest $request)\n {\n /* store a new record */\n\n //get validated input\n $name = (Input::has('name')) ? Input::get('name') : NULL;\n $price = (Input::has('price')) ? Input::get('price') : 0.0;\n\n //create object\n $paramObj = new Item();\n $paramObj->name = $name;\n $paramObj->price = $price;\n\n // save the object using repository\n $result = $this->repo->create($paramObj);\n\n return redirect()->action('ItemController@index')->with('status', $result['statusMessage']);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'storage_code' => ['required', 'max:255', 'unique:silo_actuals'],\n 'date' => ['required'],\n 'value_actual' => ['required'],\n ]);\n\n $silo = SiloActual::create($request->except('_token'));\n try {\n $request->request->add(['id' => $silo->id]);\n SiloActualCloud::create($request->except('_token'));\n } catch (\\Throwable $th) {\n return redirect('setting/silo-actual')->with(['update' => 'Data saved successfully! + ' . $th->getMessage()]);\n }\n return redirect('setting/silo-actual')->with(['create' => 'Data saved successfully!']);\n }", "function store() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the default model\n\t\t$model = $this->getDefaultModel();\n\n\t\tif (!$model) {\n\t\t\tthrow new Exception('Store task called, but there is no model assigned to that controller. Check method getDefaultModel.');\n\t\t}\n\n\t\t// Make a normalized data object from HTTP request data\n\t\t$data = $model->getDataFromRequest();\n\n\t\t// Prepare the data (auto-fill data like empty URL segment fields and similar)\n\t\t$model->prepareForStorage($data);\n\n\t\t// Check if the data validates\n\t\t$checkResult = $model->validateData($data);\n\n\t\t$isInsert = $model->isInsert($data);\n\n\t\t// Abort and send feedback if validation fails\n\t\tif ($checkResult === false) {\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t\t$response = new stdClass();\n\t\t\t$response->success = false;\n\t\t\t$response->errors = $model->getErrors();\n\t\t\techo json_encode($response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the data stored\n\t\t$success = $model->store($data);\n\n\t\t// Run the afterSave stuff\n\t\t$this->afterStore($success);\n\n\t\t// Abort and send feedback if storage fails\n\t\tif ($success === false) {\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t\t$response = new stdClass();\n\t\t\t$response->success = false;\n\t\t\t$response->errors = $model->getErrors();\n\t\t\techo json_encode($response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Purge the cache\n\t\t$this->purgeCache();\n\n\t\t// Bring the good news\n\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\t\t$response = new stdClass();\n\t\t$response->success = true;\n\t\t$response->messages = array();\n\t\t$response->wasInsert = $isInsert;\n\t\t$response->messages[] = KText::_('Record saved.');\n\n\t\t// Add the current record data to the response\n\t\tif (!empty($data->id)) {\n\t\t\t$model->forgetRecord($data->id);\n\t\t\t$response->data = $model->getRecord($data->id);\n\t\t}\n\t\telse {\n\t\t\t$response->data = NULL;\n\t\t}\n\n\t\tif (KRequest::getKeyword('task') == 'apply') {\n\t\t\t// On inserts, we redirect to the right edit URL (have the right ID set)\n\t\t\tif ($isInsert) {\n\t\t\t\t// Get the controller name\n\t\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t\t// Get the redirect URL\n\t\t\t\t$url = 'index.php?option='.$this->component.'&controller='.$controllerName.'&task=edit&id='.$data->id;\n\t\t\t\t// If the return param is sent along, append it\n\t\t\t\tif (KRequest::getString('return')) {\n\t\t\t\t\t$url .= '&return='.KRequest::getString('return');\n\t\t\t\t}\n\t\t\t\t// Get it all together\n\t\t\t\t$response->redirectUrl = KLink::getRoute($url, false);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (KRequest::getString('return')) {\n\t\t\t\t$url = KLink::base64UrlDecode(KRequest::getString('return'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Get the controller name\n\t\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t\t// Get the redirect URL\n\t\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t\t}\n\n\t\t\t$response->redirectUrl = $url;\n\t\t}\n\n\t\techo json_encode($response);\n\n\t}", "public function store(Request $request)\n {\n //\n Interest::create($request->all());\n\n\n\n return redirect('admin/interests');\n }", "public function store(Request $request)\n {\n //dd($request->all());\n Auth::user()->authorizeRoles(['1', '3']);\n\n $sampleCost = new SampleArticle();\n $sampleCost = $sampleCost->getValuePerSample($request->all());\n\n //Store on SampleArticle Class\n $sampleArticle= new SampleArticle();\n $sampleArticle->user_id = Auth::id();\n $sampleArticle->reference = $request->reference;\n $sampleArticle->description = $request->description;\n //Store Image\n $file = $request->file('image_url');\n if($file) {\n $filename = 'sampleArticles/' . explode('.', $file->getClientOriginalName())[0] . '-' . Carbon::now('Europe/London')->format('YmdHis') . '.jpg';\n Storage::disk('public')->put($filename, File::get($file));\n $sampleArticle->image_url = $filename;\n }\n else {\n $sampleArticle->image_url = $request->img_path_duplicated;\n }\n //End Store Image\n $sampleArticle->tamanho1 = $request->tamanho1 ? $request->tamanho1 : '0';\n $sampleArticle->pe1 = $request->pe1 ? $request->pe1 : '0';\n $sampleArticle->perna1 = $request->perna1 ? $request->perna1 : '0';\n $sampleArticle->punho1 = $request->punho1 ? $request->punho1 : '0';\n $sampleArticle->malha1 = $request->malha1 ? $request->malha1 : '0';\n $sampleArticle->maq1 = $request->maq1 ? $request->maq1 : '0';\n $sampleArticle->forma1 = $request->forma1 ? $request->forma1 : '0';\n $sampleArticle->tamanho2 = $request->tamanho2 ? $request->tamanho2 : '0';\n $sampleArticle->pe2 = $request->pe2 ? $request->pe2 : '0';\n $sampleArticle->perna2 = $request->perna2 ? $request->perna2 : '0';\n $sampleArticle->punho2 = $request->punho2 ? $request->punho2 : '0';\n $sampleArticle->malha2 = $request->malha2 ? $request->malha2 : '0';\n $sampleArticle->maq2 = $request->maq2 ? $request->maq2 : '0';\n $sampleArticle->forma2 = $request->forma2 ? $request->forma2 : '0';\n $sampleArticle->tamanho3 = $request->tamanho3 ? $request->tamanho3 : '0';\n $sampleArticle->pe3 = $request->pe3 ? $request->pe3 : '0';\n $sampleArticle->perna3 = $request->perna3 ? $request->perna3 : '0';\n $sampleArticle->punho3 = $request->punho3 ? $request->punho3 : '0';\n $sampleArticle->malha3 = $request->malha3 ? $request->malha3 : '0';\n $sampleArticle->maq3 = $request->maq3 ? $request->maq3 : '0';\n $sampleArticle->forma3 = $request->forma3 ? $request->forma3 : '0';\n $sampleArticle->tamanho4 = $request->tamanho4 ? $request->tamanho4 : '0';\n $sampleArticle->pe4 = $request->pe4 ? $request->pe4 : '0';\n $sampleArticle->perna4 = $request->perna4 ? $request->perna4 : '0';\n $sampleArticle->punho4 = $request->punho4 ? $request->punho4 : '0';\n $sampleArticle->malha4 = $request->malha4 ? $request->malha4 : '0';\n $sampleArticle->maq4 = $request->maq4 ? $request->maq4 : '0';\n $sampleArticle->forma4 = $request->forma4 ? $request->forma4 : '0';\n $sampleArticle->cost1 = round($sampleCost['cor1'], 2);\n $sampleArticle->cost2 = round($sampleCost['cor2'], 2);\n $sampleArticle->cost3 = round($sampleCost['cor3'], 2);\n $sampleArticle->cost4 = round($sampleCost['cor4'], 2);\n $sampleArticle->cor1 = $request->cor1;\n $sampleArticle->cor2 = $request->cor2;\n $sampleArticle->cor3 = $request->cor3;\n $sampleArticle->cor4 = $request->cor4;\n $sampleArticle->save();\n\n //Store on SampleArticleWire Class\n //Run for each row of the table\n for($i = 1; $i < $request->rowCount; $i++) {\n $step = 'row-'.$i.'-step';\n $grams = 'row-'.$i.'-grams';\n $reference = 'row-'.$i.'-reference';\n $guiafios = 'row-'.$i.'-guiafios';\n $wire = new sampleArticlesWire();\n $wire->sample_article_id = $sampleArticle->id;\n $wire->step_id = $request->$step ? $request->$step : '0';\n $wire->warehouse_product_id = $request->$reference;\n $wire->guiafios_id = $request->$guiafios ?: 9;\n $wire->grams = $request->$grams ? $request->$grams : '0';\n $wire->save();\n\n //Store on SampleArticleColor Class\n //Run for the different number of colors\n for($j = 1; $j < $request->colorsCount; $j++) {\n $colorFromWarehouse = 'row-'.$i.'-color'.$j;\n $wireColor = new sampleArticleColor();\n $wireColor->sample_articles_wire_id = $wire->id;\n $wireColor->warehouse_product_spec_id = $request->$colorFromWarehouse ? $request->$colorFromWarehouse : '0';\n $wireColor->save();\n }\n }\n\n\n //Enviar email para criadores de encomendas indicando que uma amostra acabou de ser criada\n /*$users = Role::find(4)->users()->orderBy('name')->get();\n $subject = \"Nova amostra criada.\";\n $body = \"Uma amostra de produto foi terminada e pode ser utilizada nas suas encomendas:\n <br>Referência da Amostra INDMEI: \". $request->reference .\"\n <br>Descrição: \". $request->description .\"\n <br>Imagem: <br><img src='\". url('storage/'.$sampleArticle->image_url) .\"' style='width:300px'>\n <br><br>\n Para aceder à encomenda, dirija-se à plataforma, ou clique\n <a href='\".url(\"/orders/list/\").\"' target='_blank'>aqui</a>.\";\n foreach($users as $user) {\n Mail::to($user->email)->send(new sendSimpleEmail($subject, $body));\n } */\n\n flash('A Amostra de Artigo com a referência: \"'. $sampleArticle->reference . '\", e descrição: \"'. $sampleArticle->description .'\" foi criada com sucesso!')->success();\n\n return redirect()->action('SampleArticleController@index');\n\n }", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n \n EnergyFactoryInformation::create($requestData);\n\n return redirect('energy-factory-information')->with('flash_message', 'EnergyFactoryInformation added!');\n }", "public function store(EntryRequest $request)\n {\n $input = $request->all();\n// dd($input);\n $entry = $this->entryRepository->create($input);\n\n Flash::success(__('cms.entries.saved_success'));\n\n return Input::get('_previous_') ? redirect(Input::get('_previous_')) : redirect(route('cms.entries.index'));\n\n }", "public function store(Request $request)\n {\n $product = new Product();\n\n $product->name = $request->name;\n $product->unitprice = $request->unitprice;\n $product->description = $request->description;\n $product->provider_id = $request->provider_id;\n \n $product->save();\n\n $storage = new Storage();\n $storage->product_id = $product->id;\n $storage->amount = 0;\n\n $storage->save();\n\n return redirect()->route('providers.index');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(StoreWaiterRequest $request)\n {\n $waiter = new Waiter;\n $waiter->restaurant_id = $request->input('restaurant_id');\n $waiter->fullname = $request->input('fullname');\n $waiter->phone_number = $request->input('phone_number');\n $waiter->pin = $request->input('pin');\n $waiter->employment_type = $request->input('employment_type');\n $waiter->on_shift = $request->input('on_shift');\n\n if($request->hasFile('profile_pic')) {\n $image = request()->file('profile_pic');\n $name = $waiter->id . '_' . $waiter->phone_number . '_profile_pic' . '.' . $image->getClientOriginalExtension();\n $folder = '/uploads/waiter/profile';\n $filePath = $this->uploadOne($image, $folder, $name);\n $waiter->profile_pic = $filePath;\n $waiter->save();\n }\n $waiter->save();\n\n return new WaiterResource($waiter);\n }" ]
[ "0.63667125", "0.62025654", "0.605977", "0.6030217", "0.6027675", "0.59355557", "0.59071696", "0.5870117", "0.58633107", "0.57887506", "0.577713", "0.576839", "0.5764867", "0.57625514", "0.5749911", "0.5726238", "0.5711676", "0.57058454", "0.5703605", "0.570117", "0.56932986", "0.56805414", "0.56747574", "0.56719166", "0.5665614", "0.56628174", "0.5651743", "0.5651743", "0.5651743", "0.56515867" ]
0.6711255
0
Sapphire class autoloader. Requires the ManifestBuilder to work. $_CLASS_MANIFEST must have been loaded up by ManifestBuilder for this to successfully load classes. Classes will be loaded from any PHP file within the application. If your class contains an underscore, for example, Page_Controller, then the filename is expected to be the stuff before the underscore. In this case, Page.php.
function __autoload($className) { global $_CLASS_MANIFEST; if(($pos = strpos($className,'_')) !== false) $className = substr($className,0,$pos); if(isset($_CLASS_MANIFEST[$className])) include_once($_CLASS_MANIFEST[$className]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function class_loader($class) {\n require('classes/' . $class . '.php');\n}", "public static function autoload($class) {\n if (0 !== strpos($class, 'Mirage')) {\n return;\n }\n die(var_dump($class));\n if (is_file($file = dirname(__FILE__) . '/../' . str_replace(array('_', \"\\0\"), array('/', ''), $class) . '.php')) {\n require_once $file;\n }\n }", "function class_autoloader($class_name) {\n include 'classes/' .$class_name . '.php';\n}", "function class_loader($class) {\r\n require_once('classes/' . strtolower($class) . '.class.php');\r\n}", "function class_autoloader($class)\n{\n $filename = dirname(__FILE__) . DS . '..' . DS . 'includes' . DS . 'class-' . strtolower($class) . '.php';\n\n if (file_exists($filename)) {\n require $filename;\n }\n}", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "function autoload($class)\n{\n require dirname($_SERVER['SCRIPT_FILENAME']) . '//..//..//' . str_replace('\\\\', '/', $class) . '.php';\n}", "function my_class_loader ($class) {\n include 'classes' . DIRECTORY_SEPARATOR . $class . '.class.php';\n}", "function classLoader($className) {\n\t\trequire_once dirname(__FILE__) .\"/Classes/\". $className . '.php';\n\t}", "function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}", "function __autoload($className){\n include_once \"Classes/$className.php\";\n}", "function __autoload($class){\n require \"classes/\".$class.\".php\";\n }", "function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function class_autoloader($class)\n {\n $prefix = 'App\\\\';\n\n $length = strlen($prefix);\n\n $base_directory = base_directory() . '/app/';\n\n //echo $prefix.', '.$class.', '. $length;//die;\n\n if (strncmp($prefix, $class, $length) !== 0) {\n throw new Exception('Namespace does not exists.');\n return;\n }\n\n $class_end = substr($class, $length);\n\n //echo $class.', '.$class_end.', '.$base_directory;\n\n $file = $base_directory . str_replace('\\\\', '/', $class_end) . '.php';\n\n echo 'File included : ' . $file . '<br/>';//die;\n\n if (file_exists($file)) {\n require $file;\n } else {\n throw new Exception('Class : ' . $class . ' does not exists.');\n }\n }", "function my_autoloader($class) {\n if ( $class != \"ACF\" )\n include 'classes/' . $class . '.class.php';\n }", "function class_autoloader($class) {\r\n require make_url(\"class/$class.php\");\r\n}", "function __autoload($class) {\n require ($class . '.php');\n}", "public function autoload($class) {\n if (isset(static::$map[$class])){\n $pathInfo = static::$map[$class];\n Yaf_Loader::import(sprintf('%s%s',$pathInfo[0], $pathInfo[1]));\n } else if (strpos($class, 'Builder') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/views/builder/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Pagelet') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/pagelets/%s.php', APPLICATION_PATH, $class));\n } else if (strpos($class, 'Halo') === 0){\n Yaf_Loader::import(sprintf('%s/halo/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Util') == strlen($class) - 4 || strpos($class, 'Utils') == strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/utils/%s.php',LIB_PATH,$class));\n } else if (strpos($class, 'Model') === strlen($class) - 5){\n Yaf_Loader::import(sprintf('%s/application/models/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'Service') === strlen($class) - 7){\n Yaf_Loader::import(sprintf('%s/application/service/%s.php',APPLICATION_PATH,$class));\n } else if (strpos($class, 'HTMLPurifier') !== false){\n Yaf_Loader::import(sprintf('%s/htmlpurifier/HTMLPurifier.safe-includes.php',LIB_PATH));\n }else if (strpos($class, 'Api') === strlen($class) - 3){\n Yaf_Loader::import(sprintf('%s/application/Api/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'Object') === strlen($class) - 6){\n Yaf_Loader::import(sprintf('%s/application/objects/%s.php',APPLICATION_PATH,$class));\n }else if (strpos($class, 'MemCache') === 0){\n// var_dump('================');\n// /Users/worker/php/wk/wcontact_cache/lib/wcontact/MemCacheBase.php\n Yaf_Loader::import(sprintf('%s/wzhaopin/%s.php',LIB_PATH, $class));\n }\n }", "function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}", "function __autoload($classname)\n{\n $classpart = explode('\\\\',$classname);\n if (false==strpos('//',$classname)):\n $classpart = explode('\\\\',$classname);\n if ('App' == $classpart[0]):\n unset($classpart[0]);\n $load = __DIR__ . '/' . implode('/', $classpart) . '.php';\n echo $load . '<br>';\n require $load;\n endif;\n endif;\n}", "function my_autoloader($class) {\r\n\t require_once ($class.'.php');\r\n\t}", "function __autoload($class)\n{\n require(str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');\n}", "function __autoload($class_name) {include $class_name . '.php';}", "function autoload($class)\n{\n require('classes/' . $class . '.class.php');\n}", "function classLoader($class)\r\n{\r\n $parts = explode('_', $class);\r\n $namespace = $parts[0];\r\n $classname = $parts[1];\r\n \r\n switch($namespace)\r\n {\r\n case 'Base':\r\n $filename = B_PATH . $classname . '.php';\r\n break;\r\n case 'Controller':\r\n $filename = C_PATH . $classname . '.php';\r\n break;\r\n case 'Model':\r\n $filename = M_PATH . $classname . '.php';\r\n break;\r\n }\r\n\r\n if (!file_exists($filename)) {\r\n return false;\r\n }\r\n require_once $filename;\r\n}", "function __autoload($className) {\n require PATH_ZABBIX_API_CLASSES_DIRECTORY.'/'.$className.'.php';\n}", "function my_autoloader($class) {\n require_once './../../classes/' . $class . '.php';\n}" ]
[ "0.6716876", "0.6601714", "0.6583701", "0.65539217", "0.6533331", "0.6504325", "0.64990515", "0.6481289", "0.6475481", "0.6472019", "0.64702404", "0.64696884", "0.64671844", "0.6442735", "0.6442276", "0.6442276", "0.64359194", "0.64357644", "0.6435124", "0.6429324", "0.6427928", "0.64276433", "0.6419753", "0.6416403", "0.64133704", "0.64025986", "0.63912606", "0.63902336", "0.638148", "0.6375806" ]
0.6842501
0
/ / Add Custom Apple Touch Icon /
function wap8_touch_icon() { $touch_icon = of_get_option( 'sans_apple_icon' ); if ( !empty( $touch_icon ) ) { echo '<link rel="apple-touch-icon" href="' . esc_url( $touch_icon ) . '"/>' . "\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function anva_apple_touch_icon() {\n\t$image_path = get_template_directory_uri() . '/assets/images';\n\t?>\n\t<!-- ICONS (start) -->\n\t<link rel=\"shortcut icon\" href=\"<?php echo $image_path . '/favicon.png'; ?>\" />\n\t<link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"<?php echo $image_path . '/apple-touch-icon-76x76.png'; ?>\" />\n\t<link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"<?php echo $image_path . '/apple-touch-icon-120x120.png'; ?>\" />\n\t<link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"<?php echo $image_path . '/apple-touch-icon-152x152.png'; ?>\" />\n\t<!-- ICONS (end) -->\n\t<?php\n}", "public function SettingsController_TouchIcon_Create($Sender) {\n $Sender->Permission('Garden.Settings.Manage');\n $Sender->AddSideMenu('dashboard/settings/touchicon');\n $Sender->Title(T('Touch Icon'));\n \n if ($Sender->Form->AuthenticatedPostBack()) {\n $Upload = new Gdn_UploadImage();\n try {\n // Validate the upload\n $TmpImage = $Upload->ValidateUpload('TouchIcon', FALSE);\n if ($TmpImage) {\n // Save the uploaded image\n $Upload->SaveImageAs(\n $TmpImage,\n PATH_ROOT.'/uploads/TouchIcon/apple-touch-icon.png',\n 114,\n 114,\n array('OutputType' => 'png', 'ImageQuality' => '8')\n );\n SaveToConfig('Plugins.TouchIcon.Uploaded', TRUE);\n }\n } catch (Exception $ex) {\n $Sender->Form->AddError($ex->getMessage());\n }\n \n $Sender->InformMessage(T('TouchIconSaved', \"Your icon has been saved.\"));\n }\n \n $Sender->Render($this->GetView('touchicon.php')); \n }", "function thirdtheme_custom_icon()\n {\n add_theme_support('post-thumbnails');\n add_image_size('iconsize',55,45);\n $args = array(\n 'labels' => array('name' =>__('icon'),\n 'add_new' =>__('add new icon')),\n \n 'public' => true,\n 'menu_icon' => 'dashicons-art',\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title','editor','thumbnail' )); \n register_post_type('icon',$args);\n }", "public function icon($icon);", "function addIcon($i){\n return $this->add('Icon',null,'Icon')->set($i)->addClass('atk-size-mega');\n }", "protected function get__icon()\n\t{\n\t\treturn 'coffee';\n\t}", "function tac_add_favicon() {\n\t?>\n\t<link rel=\"shortcut icon\" href=\"<?php echo esc_html( get_stylesheet_directory_uri() ); ?>/img/favicon.png\"/>\n\t<link rel=\"apple-touch-icon\" href=\"<?php echo esc_html( get_stylesheet_directory_uri() ); ?>/img/apple-touch-icon.png\">\n<?php\n}", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}", "public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}", "protected function establish_icon() {\n\t\t$this->icon = \"<i class='sw swp_{$this->key}_icon'></i>\";\n\t}", "public function setIcon($icon);", "public function getIconForResourceWithCustomImageMimeTypeReturnsImageIcon() {}", "public function Icon()\n {\n $ext = strtolower($this->getExtension());\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = $this->appCategory();\n }\n\n if (!Director::fileExists(FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\")) {\n $ext = \"generic\";\n }\n\n return FRAMEWORK_DIR . \"/images/app_icons/{$ext}_32.gif\";\n }", "function screen_icon()\n {\n }", "function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}", "public function getIcon() {}", "protected function registerTCAIcons() {}", "public function getIcon()\n {\n }", "public function get_icon()\n {\n return 'fa fa-image';\n }", "function atom_site_icon()\n {\n }", "public function get_icon() {\n\t\treturn 'eicon-image';\n\t}", "function wp_site_icon()\n {\n }", "public function icon(): string;", "function myousic_cpt_icon_shows(){\n?>\n\n<style>\n#adminmenu .menu-icon-shows div.wp-menu-image:before {\n content: \"\\f231\";\n}\n</style>\n\n<?php\n}", "function get_screen_icon()\n {\n }", "function av_icon_display($char, $extra_class = \"\")\n{\n\treturn \"<span class='av-icon-display {$extra_class}' \".av_icon_string($char).\"></span>\";\n}" ]
[ "0.72151935", "0.6754782", "0.65640014", "0.6481932", "0.64289725", "0.6346609", "0.63426703", "0.6300716", "0.6300716", "0.6300716", "0.6285573", "0.6285573", "0.6285573", "0.6220128", "0.619563", "0.6050486", "0.60321933", "0.60308677", "0.60025436", "0.59957725", "0.59876424", "0.59652436", "0.5949387", "0.59363705", "0.59242874", "0.5917225", "0.59149665", "0.5849249", "0.5834231", "0.57927454" ]
0.7411081
0
Retrieves one lob_repo_entry object via the foreign key lob_repo_entry_id.
function getLobRepoEntryByLobRepoEntryId($dsn='default') { if ( $this->lobRepoEntryId == '' ) { trigger_error('Peer doSelect with empty key'); return false; } $array = LobRepoEntryPeer::doSelect('lob_repo_entry_id = \''.$this->lobRepoEntryId.'\'',$dsn); if ( count($array) > 1 ) { trigger_error('multiple objects on one-to-one relationship'); } return $array[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEntry($id) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('entry', 'getByAtomId');\t\t\n\t\t$stm->execute(array(\n\t\t\t':id' => $id\n\t\t));\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif ($entry = $stm->fetchObject()) {\n\t\t\t$entry = $this->_hydrateEntry($entry);\n\t\t\treturn $entry;\n\t\t}\t\n\t\treturn NULL;\n\t}", "public function getEntryById($row_id) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('entry', 'getById');\n\t\t$stm->execute(array(\n\t\t\t':row_id' => $row_id\n\t\t));\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif ($entry = $stm->fetchObject()) {\n\t\t\t$entry = $this->_hydrateEntry($entry);\n\t\t\treturn $entry;\n\t\t}\t\n\t\treturn NULL;\n\t}", "function &getRepoEntry() {\n\t\treturn $this->repoObj;\n\t}", "public function getEntry($entryId) {\n $rowset = $this->_tableGw->select(array('id' => (int) $entryId));\n $entry = $rowset->current();\n if (!$entry) {\n throw new \\Exception(\"Could not find entry with id: $entryId\");\n }\n return $entry;\n }", "public function getEntry()\n {\n if (empty($this->_entry)) {\n $this->_entry = $this->getTable('HistoryLogEntry')->find($this->entry_id);\n }\n return $this->_entry;\n }", "public function getEntry();", "public function getEntry($db, $entry_id){\n\n $sql = 'SELECT * FROM posts WHERE id = ?';\n\n try {\n $results = $db->prepare($sql);\n $results->bindValue(1, $entry_id, PDO::PARAM_INT);\n $results->execute();\n } catch (Exception $e) {\n echo $e->getMessage();\n return false;\n }\n return $results->fetch();\n }", "private function getEntry()\n {\n $entry_id = $this->getEntryIdFromSession();\n\n if ($entry_id > 0) {\n $entry = Entry::find($entry_id);\n if ($entry) return $entry;\n else $this->removeEntryIdFromSession();\n }\n\n return NULL;\n }", "public function getRevision(RepositoryEntry $repository, $branch);", "public function getBlogEntry( $blog_id) {\r\n $sql = \"SELECT blog_id, blog_title, blog_text, creation_date FROM blog_entry_table WHERE blog_id = ?\";\r\n $data = array( $blog_id );\r\n $statement = $this->makeStatement( $sql, $data);\r\n $model = $statement->fetchObject();\r\n return $model;\r\n }", "public function getOne($id)\n {\n return $this->repository->find($id);\n }", "private function get_entry_or_redirect( $id ) : Entry {\n\t\tif ( ! is_numeric( $id ) ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Entry id not valid.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t}\n\n\t\t$id = intval( $id );\n\n\t\t$entry = $this->db->get_entry_by_id( $id );\n\t\tif ( null === $entry ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Entry could not be found.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t}\n\n\t\treturn $entry;\n\t}", "public function get_entry( $entry_id ) {\n\t\t/** @var \\wpdb $wpdb */\n\t\tglobal $wpdb;\n\t\t$entry = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->actionscheduler_logs} WHERE log_id=%d\", $entry_id ) );\n\n\t\treturn $this->create_entry_from_db_record( $entry );\n\t}", "public function find(int $id)\n {\n try {\n $data = self::getObjectDataById(self::ENTRY, $id);\n } catch (\\UnexpectedValueException $e) {\n return null;\n }\n\n return $this->build($data);\n }", "function get_channel_entry()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('entry_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_channel_entry_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_channel_entry($vars['entry_id'])->result();\n\t\t\n\t\t// expand file fields\n\t\tif (count($data)) \n\t\t{\n\t\t\t$channel_id = $data[0]->channel_id;\n\t\t\t$data = $this->_expand_file_fields($channel_id, $data);\n\t\t}\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_channel_entry_end', $data);\n\n\t\t$this->response($data);\n\t}", "public function fetchEntry($id) { \t\n $select = $this->select();\n $select->setIntegrityCheck(false)\n ->from(array('j'=>'job_category'),array('j.*'))\t\t\t\t\n ->where('j.id = ?' ,$id);\t\t\t\t\t\t\t\t\t\t\n \t\n \t$select = $this->fetchRow($select);\n\t$select = $select->toArray(); \t\t\t\n\t\t\t\t\n\tif($select)\n return $select;\n\telse\n return null; \n }", "public function getOne($id)\n {\n $sql = \"SELECT * FROM \".$this->table.\" WHERE id =\" . $id;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetch(PDO::FETCH_OBJ);\n }", "public function loadById(int $id)\n {\n\n $queryBuilder = $this->getQueryBuilder()\n ->select(\"*\")\n ->from(\"entry\")\n ->where(\"ID = ?\")\n ->setParameter(0, $id);\n\n $result = $queryBuilder->execute();\n\n if ($result->rowCount() >= 1) {\n\n // get the data form the result\n $result = $result->fetchAll();\n\n // create and return an new entry instance with the result\n return $this->createEntryFromResult($result);\n }\n }", "private function findEntryById( $type, $id, $updateInteractionLabel = true )\n {\n $this->setActionId() ;\n \n $this->log( \"Find \" . $type . \" by id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n $entry = null ;\n\n $extType = $this->entitiesMgr->getEntityType( $type ) ;\n $raw = $this->interactionMgr->getSingleEntry( $extType, $id ) ;\n\n if( empty( $raw ) )\n {\n $this->log( \"=> Not found : \" . $type . \" id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n return null ;\n }\n\n $this->log( \"=> Found : \" . $type . \" id : \" . $id, Logger::LOG_INFO, __METHOD__ ) ;\n $entry = $this->entitiesMgr->getEntryInstance( $type, $raw, $updateInteractionLabel ) ;\n\n $this->clearActionId() ;\n\n return $entry ;\n }", "protected function findEntity($id, $repositoryName=\"\")\n {\n return $this->getRepository($repositoryName)->find($id);\n }", "public function getEntry()\n {\n return ($this->current() !== null ? $this->provideLDAPEntry($this->current()) : null);\n }", "public function getEntry($entryid){\n\t\t$user = $this->getUser();\n\t\t$query = Queries::getentry($entryid, $where, $user[\"id\"]);\n\t\t$entry = $this->query($query);\n\t\tif(count($entry)==0||!$entry)return false;\n\t\t$entry = $entry[0];\n\t\t$query = Queries::getusertags($entryid);\n\t\t$entry[\"tags\"]=$this->query($query);\n\t\t$query = Queries::getimages($entryid);\n\t\t$images = $this->query($query);\n\t\tforeach($images as $key=>$val){\n\t\t\t$path = $val[\"path\"];\n\t\t\t$small = $this->getThumbnail($path, \"s\");\n\t\t\t$medium = $this->getThumbnail($path, \"m\");\n\t\t\t$large = $this->getThumbnail($path, \"l\");\n\t\t\t$images[$key][\"thumbnail\"]=$medium;\n\t\t\t$images[$key][\"smallthumbnail\"]=$small;\n\t\t\t$images[$key][\"largethumbnail\"]=$large;\n\t\t}\n\t\t$entry[\"images\"]=$images;\n\t\t$query = Queries::getratings($entryid, $user[\"id\"]);\n\t\t$entry[\"ratings\"]=$this->query($query);\n\t\t$query = Queries::getinformation($entryid);\n\t\t$entry[\"information\"]=$this->query($query);\n\t\t$query = Queries::getnextentries($entryid);\n\t\t$next = $this->query($query);\n\t\t$query = Queries::getpreventries($entryid);\n\t\t$prev = $this->query($query);\n\t\t$entry[\"next\"] = $next;\n\t\t$entry[\"prev\"] = $prev;\n\t\treturn $entry;\n\t}", "public function get_log_entry_by_id( $id ) {\n\t\t$post = get_post( $id );\n\n\t\treturn $this->wp_to_obj( $post );\n\t}", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function get(string $entryIdentifier);", "function get_single_branche($branch_id)\r\r\n\t{\r\r\n\t\t$this->db->where('branch_id',$branch_id);\r\r\n\r\r\n\t\t$query = $this->db->get($this->_table_branches);\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->row();\r\r\n\t\t}\r\r\n\t}", "public function getById($id) {\r\n\r\n $data = $this->adapter->request('GET', \"{$this->url}/{$id}\");\r\n\r\n return $this->_makeEntry($data, $id, \"{$this->url}/{$id}\");\r\n\r\n }", "public function getById($id)\n {\n parent::open();\n\n $res = null;\n $stmt = null;\n $p1 = (integer)$id[\"userId\"];\n $p2 = (integer)$id[\"channelId\"];\n\n try {\n $stmt = parent::prepareStatement(self::$SQL_CHANNEL_USER_ENTRY_BY_ID);\n $stmt->bind_param(\"ii\", $p1, $p2);\n $stmt->execute();\n $res = $stmt->get_result()->fetch_object();\n } catch (\\Exception $e) {\n parent::rollback();\n throw new DbException(\"Error on executing query '\" . self::$SQL_CHANNEL_USER_ENTRY_BY_ID . \"'\" . PHP_EOL . \"Error: '\" . $e->getMessage());\n } finally {\n if (isset($stmt)) {\n $stmt->free_result();\n $stmt->close();\n }\n parent::close();\n }\n\n return $res;\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "function getOne( $rID ) {\r\n\t\t\r\n\t\tif( !$this->queried ) {\r\n\t\t\t$this->error( \"Database hasn't been queried yet\" );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$thing = mysqli_fetch_assoc( $this->results[ $rID ] );\r\n\t\t\r\n\t\treturn $thing;\r\n\t\t\r\n\t}" ]
[ "0.60026747", "0.59394115", "0.58072275", "0.5761696", "0.57089466", "0.5557064", "0.54359233", "0.5417182", "0.5396182", "0.53627706", "0.53291416", "0.5315984", "0.5303665", "0.5233274", "0.5147509", "0.5144037", "0.5129586", "0.512721", "0.51170224", "0.5103033", "0.5088645", "0.5058547", "0.50426674", "0.50346047", "0.5023574", "0.49924985", "0.4990275", "0.49841362", "0.49764523", "0.497631" ]
0.7666886
0
The index function lists all of the teams, along with its home field name.
function index() { $teams = $this->teams->retrieve_with_field(); $data = array( 'title' => 'Teams', 'teams' => $teams, 'js' => array(''), 'css' => array('/styles/admin.css'), 'sidenav' => self::$user_links ); $this->load->view('admin/show_all_teams.php', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index($season)\n {\n return Team::all('id', 'name', 'location', 'stadium', 'season');\n }", "public function index()\n {\n //\n\n return view('admin.team.index')->withEntries(Team::orderByDesc('id')->get());\n }", "public function index()\n {\n $team = Team::all();\n return $team;\n }", "public function index()\n {\n return view('teams.index', ['teams' => HelpdeskTeam::all()]);\n }", "public function index()\n {\n $teams = Team::all();\n \n return view('teams.index', compact('teams'));\n }", "public function index()\n {\n //\n\n $teams = Team::all();\n\n return view('admin.teams.index', compact('teams'));\n }", "public function index()\n\t{\n $teams = Team::all();\n return view('teams.index', compact('teams'));\n\t}", "public function index()\n {\n $teams = team::all();\n \n\n return view('/teamindex', compact('teams'));\n }", "public function index()\n {\n $teams = Team::all();\n return view('admin.team.index',compact('teams'));\n }", "public function index()\n {\n return view('employees::teams.index');\n }", "public function index()\n {\n return response(League::withCount('teams')->get());\n }", "public function index()\n {\n $team = Team::all();\n return view('admin.team.index')->with('team',$team);\n }", "public function index()\n {\n $this->groups = Team::all();\n return view('admin.teams.index', $this->data);\n }", "public function index( Request $request )\n {\n $limit = 1000;\n $search_term = $request->input( 'search', false );\n\n if ( $search_term ) {\n $teams = Team::where( 'team_name', 'ilike', '%' . $search_term . '%' )->orderBy('team_name')->paginate( $limit );\n } else {\n $teams = Team::orderBy( 'team_name' )->paginate( $limit );\n }\n\n return view( 'project1.viewAllTeams ', compact( 'teams' ) );\n }", "public function index()\n {\n $teams = \\App\\Team::all();\n return view('team.index', compact('teams'));\n }", "public function index()\n {\n $teams = Team::all();\n return view('teams.index', ['teams' => $teams]);\n }", "public function index()\n {\n $teams = Team::latest()->paginate(20);\n return view('system.teams.index',compact(['teams']));\n }", "public function index()\n {\n $teams = \\App\\Team::join('games', 'teams.game', '=', 'games.game')\n ->orderBy('date','asc')\n ->orderBy('time','asc')\n ->select('teams.*')\n ->get();\n $data = compact('teams');\n return view('m.teams.index', $data);\n }", "public function index()\n {\n $people = People::paginate(15);\n return view('admin.pages.team.index')\n ->with('people', $people);\n }", "public function index()\n {\n \n $teams = Team::paginate();\n\n return view('team.index', compact('teams'))\n ->with('i', (request()->input('page', 1) - 1) * $teams->perPage());\n }", "public function index()\n {\n Gate::authorize('teams');\n\n $teams = Team::paginate();\n return view('admin.teams.index',[\n 'teams' => $teams,\n ]);\n }", "public function index()\n {\n $teams = Team::paginate(6);\n return view('admin.about.team.index',compact('teams'));\n }", "public function admin_index() {\n\t\t$this->Team->recursive = 0;\n\t\t$teams = $this->Team->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Team.id >=' => 1,\n\t\t\t\t//'Team.status' => array(StatusOfTeam::Active)\n\t\t\t)\n\t\t));\n\t\t$this->set('teams', $teams);\n\t}", "public function index()\n\t{\n\t\t$teams = Team::orderBy(\"rank\", \"ASC\")->where(\"rank\",\">\", 0)->get();\n\t\treturn View::make('teams.index', compact('teams'));\n\t}", "public function getAll()\n {\n return Team::all();\n }", "public function index()\n {\n $teams = Team::orderBy('id','asc')->get();\n\n return view('player.teams.index', [\n 'teams' => $teams,\n ]);\n }", "public function index()\n {\n return view('backend.team.index');\n }", "public function index()\n {\n return view('backend.team.index');\n }", "public function index()\n {\n $teams = Team::all();\n return TeamResource::collection($teams);\n }", "public function index()\n {\n return view('teams.index');\n }" ]
[ "0.6993864", "0.6960239", "0.69140905", "0.69030076", "0.6826036", "0.67876905", "0.6787053", "0.6772154", "0.6759351", "0.67578924", "0.6754756", "0.6694994", "0.66769433", "0.6652781", "0.66515136", "0.6623055", "0.66101116", "0.66058445", "0.6598834", "0.65920824", "0.6581794", "0.65707165", "0.6567637", "0.6537221", "0.6535928", "0.65261877", "0.6524294", "0.6524294", "0.65104616", "0.65080434" ]
0.70675546
0
Function to show the roster.
function show_roster() { // Retrieve all the players, teams, or seasons. $teams = $this->teams->retrieve_roster(); $seasons = $this->seasons->retrieve_roster(); // If there are no players, teams, or seasons... if (!$teams || !$seasons) { show_error('At least one team, one player, and one season must be added for roster functions to work.'); } $data = array( 'form_action' => 'action_show_roster', 'title' => 'Show Roster', 'js' => array('/js/admin/show_roster.js'), 'css' => array('/styles/admin.css'), 'teams' => $teams, 'seasons' => $seasons, 'submit_message' => 'Show Roster', 'sidenav' => self::$user_links ); $this->load->helper(array('form')); $this->load->view('admin/show_roster.php', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function action_show_roster()\n\t{\n\t\t// Loading form validation helper.\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('tid', 'Team ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('sid', 'Season ID', 'trim|required|xss_clean');\n\n\t\t$tid = $this->input->post('tid');\n\t\t$sid = $this->input->post('sid');\n\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t// Get the team roster.\n\t\t\t$data = array(\n\t\t\t\t'players' => $this->roster->view_team_roster($tid, $sid)\n\t\t\t);\n\n\t\t\t$this->load->view('admin/show_teams.php', $data);\n\t\t\treturn;\n\t\t}\n\n\t\techo 'Please select a Team and a Season for the given team.';\n\t}", "public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}", "public function rosterview()\n\t{\n\n\t\t$employee = Employee::find(Input::get('employeeid'));\n\n $leaveapplications = DB::table('leaveapplications')->where('employee_id', '=', $employee->id)->where('is_roster', '=', 1)->whereYear('application_date', '=', Input::get('period'))->get();\n\n return View::make('leaveapplications.leaveroster', compact('employee', 'leaveapplications'));\n\t}", "public function show(Renters $renters)\n {\n //\n }", "public function show(resturant $resturant)\n {\n //\n }", "public function show(retiro $retiro)\n {\n //\n }", "public function index()\n {\n /**\n * 這是用於房客資訊 uses->userId => house->houseId 取出房東擁有的房子 => resident->取出房客 & houseadmin->該房子的聯絡人\n */\n return view('pages.landlord');\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function roster()\n\t{\n\n\t\t$employees = Employee::getActiveEmployee();\n\n\t\t$branches = Branch::whereNull('organization_id')->orWhere('organization_id',Confide::user()->organization_id)->get();\n $departments = Department::whereNull('organization_id')->orWhere('organization_id',Confide::user()->organization_id)->get();\n\n\t\t Audit::logaudit('Employees', 'view', 'viewed employee list');\n\n\t\treturn View::make('leaveapplications.employees', compact('employees','branches','departments'));\n\t}", "public function show(Resturant $resturant)\n {\n //\n }", "private function show_page()\n\t{\n\t\t$parse['user_link']\t= $this->_base_url . 'recruit/' . $this->_friends[0]['user_name'];\n\t\n\t\t$this->template->page ( FRIENDS_FOLDER . 'friends_view' , $parse );\t\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function index()\n {\n $renters = Renter::current()->get();\n return view('dashboard.renters',compact('renters'));\n }", "public function show(Libro $libro)\n {\n //\n }", "public function room() {\n return view('scholarships.room');\n }", "function show_standings()\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$leagues = $this->league->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$leagues || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one league, one team, and one season must be added for standings functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_show_standings',\n\t\t\t'title' => 'View Standings',\n\t\t\t'js' => array('/js/admin/show_roster.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'leagues' => $leagues,\n\t\t\t'seasons' => $seasons,\n\t\t\t'msg' => 'Please select the league and the season for the standings you wish to see.',\n\t\t\t'submit_message' => 'Show Standings',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/show_standings.php', $data);\n\t}", "public function show(Relevamiento $relevamiento)\n\t{\n\t\t//\n\t}", "function print_all_rooms(){\n $rooms = new RoomsView();\n $rooms->print_all_rooms();\n }", "public function show(Riesgo_evento $riesgo_evento)\n {\n //\n }", "public function show()\n\t{\n\n\t}", "public function show(Rattrapage $rattrapage)\n {\n //\n }", "public function show()\n {\n //\n return 'Rosie can i have a dance';\n }", "public function show()\n {\n //the board string is used in the view\n $data = $this->getBoardAsString();\n require VIEW_PATH.'web.php';\n\n }", "public function show(Reviewer $reviewer)\n {\n //\n }", "public function show();", "public function show();", "public function show();", "public function show();" ]
[ "0.65671235", "0.6464007", "0.6398984", "0.6296228", "0.6222879", "0.6131415", "0.6127024", "0.60896206", "0.60896206", "0.60896206", "0.60511744", "0.60122025", "0.5989021", "0.5976034", "0.5964917", "0.5960634", "0.5957453", "0.590321", "0.589855", "0.5879422", "0.5866", "0.5864881", "0.58618176", "0.5861169", "0.5857624", "0.5853856", "0.5803476", "0.5803476", "0.5803476", "0.5803476" ]
0.7986567
0
Action function to completely show a roster. If no roster exists for a team for that season, a friendly error is shown.
function action_show_roster() { // Loading form validation helper. $this->load->library('form_validation'); $this->form_validation->set_rules('tid', 'Team ID', 'trim|required|xss_clean'); $this->form_validation->set_rules('sid', 'Season ID', 'trim|required|xss_clean'); $tid = $this->input->post('tid'); $sid = $this->input->post('sid'); if ($this->form_validation->run()) { // Get the team roster. $data = array( 'players' => $this->roster->view_team_roster($tid, $sid) ); $this->load->view('admin/show_teams.php', $data); return; } echo 'Please select a Team and a Season for the given team.'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_roster()\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$teams = $this->teams->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$teams || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one team, one player, and one season must be added for roster functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_show_roster',\n\t\t\t'title' => 'Show Roster',\n\t\t\t'js' => array('/js/admin/show_roster.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'teams' => $teams,\n\t\t\t'seasons' => $seasons,\n\t\t\t'submit_message' => 'Show Roster',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/show_roster.php', $data);\n\t}", "function action_show_standings()\n\t{\n\t\t// Loading form validation helper.\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('lid', 'League ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('sid', 'Season ID', 'trim|required|xss_clean');\n\n\t\t$lid = $this->input->post('lid');\n\t\t$sid = $this->input->post('sid');\n\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t// Get the team roster.\n\t\t\t$data = array(\n\t\t\t\t'teams' => $this->standings->retrieve($lid, $sid)\n\t\t\t);\n\n\t\t\t$this->load->view('admin/action_show_standings.php', $data);\n\t\t\treturn;\n\t\t}\n\n\t\techo 'Please select a Team and a Season for the given team.';\n\t}", "public function show(Season $season)\n {\n //\n }", "public function show(Season $season)\n {\n //\n }", "function show_standings()\n\t{\n\t\t// Retrieve all the players, teams, or seasons.\n\t\t$leagues = $this->league->retrieve_roster();\n\t\t$seasons = $this->seasons->retrieve_roster();\n\n\t\t// If there are no players, teams, or seasons...\n\t\tif (!$leagues || !$seasons)\n\t\t{\n\t\t\tshow_error('At least one league, one team, and one season must be added for standings functions to work.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_show_standings',\n\t\t\t'title' => 'View Standings',\n\t\t\t'js' => array('/js/admin/show_roster.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'leagues' => $leagues,\n\t\t\t'seasons' => $seasons,\n\t\t\t'msg' => 'Please select the league and the season for the standings you wish to see.',\n\t\t\t'submit_message' => 'Show Standings',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/show_standings.php', $data);\n\t}", "public function season()\n {\n $this->load->view('admin/header');\n $data['all_hotels'] = $this->hotelInfoModel->getHotelList();\n $data['seasons'] = $this->common_model->getAll('sett_season');\n $this->load->view('setting/season',$data);\n $this->load->view('admin/footer');\n }", "function showGames( $curDivision=\"\" ) {\n\n/* ... define values for template variables to display on page */\n if ($curDivision == \"\") {\n $data['title'] = \"Playoffs - \".$this->config->item( 'siteName' );\n }\n else {\n $data['title'] = \"Division \".$curDivision.\" Playoffs - \".$this->config->item( 'siteName' );\n }\n\n/* ... get the schedule details from the database */ \n if ($curDivision == \"\") { \n $data['tournDetails'] = $this->Model_Tournament->getAllDetails();\n $data['tournHeader'] = \"League Playoff Schedule\";\n }\n else {\n $data['tournDetails'] = $this->Model_Tournament->getDivDetails( $curDivision );\n $data['tournHeader'] = \"Division \".$curDivision.\" Playoff Schedule\";\n }\n\n/* ... replace seeding placeholders in the schedule with appropriate team ids */\n for ($i=0; $i < count( $data['tournDetails'] ); $i++) {\n\n if ($data['tournDetails'][$i]['Status'] == \"SCHEDULED\") {\n if ($curDivision == \"\") {\n $seedDiv = substr( $data['tournDetails'][$i]['TournamentID'], 0, 1 );\n }\n else {\n $seedDiv = $curDivision;\n }\n if ($data['tournDetails'][$i]['HomeTeamID'] == NULL && $data['tournDetails'][$i]['HomeSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['HomeSeed'], $seedDiv );\n $data['tournDetails'][$i]['HomeTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n if ($data['tournDetails'][$i]['VisitTeamID'] == NULL && $data['tournDetails'][$i]['VisitSeed'] != NULL) {\n $teamID = $this->Model_Tournament->getSeedTeamID( $data['tournDetails'][$i]['VisitSeed'], $seedDiv );\n $data['tournDetails'][$i]['VisitTeamID'] = $teamID > 0 ? $teamID : \"\";\n }\n }\n }\n \n/* ... set the name of the page to be displayed */\n $data['main'] = \"schedule/sched_tournamentMaster\";\n\n $this->index( $data );\n \n/* ... time to go */\n return;\n }", "public function rosterview()\n\t{\n\n\t\t$employee = Employee::find(Input::get('employeeid'));\n\n $leaveapplications = DB::table('leaveapplications')->where('employee_id', '=', $employee->id)->where('is_roster', '=', 1)->whereYear('application_date', '=', Input::get('period'))->get();\n\n return View::make('leaveapplications.leaveroster', compact('employee', 'leaveapplications'));\n\t}", "public function showStudents($season_id = null)\n {\n if (is_null($season_id)){\n $season_id = \\App\\Season::getLastSeasonID();\n }\n\n $student_registrations = \\App\\Registration::where([\n [\"season\",'=', $season_id]\n ])->get();\n \n $students = array();\n //get student infomations through registration->user_id\n foreach ($student_registrations as $registration) {\n $student = \\App\\User::join('student_infos','student_infos.user_id','=','users.id')\n ->where('user_id','=',$registration->user_id)\n ->select('users.name','student_infos.*')\n ->first();\n array_push($students, $student);\n }\n // dd($student_registrations);\n $all_season_id = \\App\\Season::getAllSeasonIDs();\n\n return view('internship.students-in-season',compact('students','all_season_id'));\n }", "public function actionDisplay() {\r\n global $mainframe, $user; \r\n $tourID = Request::getVar('tourID',0);\r\n $model = Tournament::getInstance();\r\n $tour_detail = $model->getItem($tourID);\r\n $lists = $model->getLists($tourID, $tour_detail); \r\n \r\n $this->addBarTitle(\"Tournament: <small>$tour_detail->name</small>\", \"tournaments\"); \r\n $this->addIconToolbar(\"Apply\", Router::buildLink(\"gamesport\", array(\"view\"=>\"tournament\", \"layout\" => \"save\",\"tourID\"=>$tourID)), \"apply\");\r\n addSubMenuGameSportTour('tournament');\r\n \r\n $this->render('teamjoined', array('tour_detail'=> $tour_detail,'lists' => $lists));\r\n }", "public function departmentRoster()\n {\n $user = auth()->user();\n\n $members = User::where('rank_id', $user->rank->id)->where('role_id', 4)->where('is_active', 1)->get();\n\n return view('facultyhead.departmentrosters')->with('user', $user)->with('members', $members);\n \n }", "public function show($slug)\n {\n $gamer=Gamer::where('slug', $slug)->firstOrFail();\n $games=0;\n $winners=0;\n $winnerTournaments=0;\n $default=0;\n $gamesInfo=[];\n foreach ($gamer->couples as $couple) {\n $winners+=GameWinner::where('couple_id', $couple->id)->count();\n\n $winnerTournaments+=TournamentWinner::where('couple_id', $couple->id)->count();\n\n foreach ($couple->games as $game) {\n if ($game->state==1 || $game->state==2) {\n $default++;\n }\n $gamesInfo[$games]=['slug' => $game->slug, 'type' => $game->type, 'state' => $game->state, 'created_at' => $game->created_at];\n $games++;\n }\n }\n $loses=$games-$winners-$default;\n $num=1;\n\n return view('admin.gamers.show', compact(\"gamer\", \"games\", \"winners\", \"loses\", \"winnerTournaments\", 'gamesInfo', 'num'));\n }", "function showteam( $ffanumber, $lastname )\n{\n\t\t$db_hostname = 'gungahlinunitedfc.org.au';\n\t\t$db_username = 'gufcweb_dev';\n\t\t$db_password = 'deve!oper';\n\t\t$db_database = 'gufcweb_player';\n\n \t$mysqli = new mysqli($db_hostname,$db_username,$db_password, $db_database);\n\n\t\t$playerteam = \"\";\n\t\t\n\t\t$sqlinner = \" SELECT * FROM gufcdraws.player where FFANumber = '\".$ffanumber.\"' and LastName = '\".$lastname.\"' and display = 'Y'\";\n\n\t\t$sqlexample1 = \" SELECT * FROM gufcdraws.player where FFANumber = 28069631 and LastName = 'Chilmaid' and display = 'Y' \";\n\t\t$sqlexample2 = \" SELECT * FROM gufcdraws.player where fkteamid = 'U16 Div 2 Boys' and display = 'Y' \";\n\t\t\n\t\t$r_queryinner = $mysqli->query($sqlinner);\n\n\t\t$todays_date = date(\"Y-m-d\");\t\t\t\t\t\t\n\n\t\t$msg = 'No player found.';\t\n\n\t\techo '<table class=\"table\" align=\"center\" border=\"1\" >';\n\t\techo '<th>First Name</th>';\n\t\techo '<th>Last Name</th>';\n\t\techo '<th>Team Name</th>';\n\n\t\tif ( ! $r_queryinner )\n\t\t{\n\t\t\techo 'Player not found'; \n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sqlteam = \" SELECT FirstName,LastName,fkteamid FROM gufcdraws.player where fkteamid = '\".$playerteam.\"' and display = 'Y'\";\n\t\t\t\n\t\t\t$r_queryteam = $mysqli->query($sqlteam);\n\t\t\t\n\t\t\tif ( $r_queryteam ) {\n\t\t\t\n\t\t\t\t$rowteam = mysqli_fetch_assoc($r_queryteam)\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$rowteam['FirstName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['LastName'].'</td>';\n\t\t\t\techo '<td>'.$rowteam['fkteamid'].'</td>';\n\t\t\t\techo '</tr>';\n\t\t\t}\n\t\t\techo '</table>';\n\t\t\techo '<p/>';\n\t\t}\n}", "public function seasonTitleDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Season Title is displayed on the Edit Episode page. - C15619');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Season Title is displayed.');\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->see('Season View Filled Data For Automation', ContentPage::$seasonTitleRow);\n }", "public function checkValidSeason()\n {\n if (!$this->season_helper->isValidSeason($this->selected_season)) {\n $this->selected_season = $this->season_helper->getSeasonId(date('r'));\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\n }", "public function show(TournamentNode $tournamentNode)\n {\n //\n }", "public function pastSeasons(){\n $json = file_get_contents('http://ergast.com/api/f1/seasons.json?limit=100');\n $f1json = json_decode($json);\n return view('seasons.pastRaces')\n ->with([\n 'f1json' => $f1json\n ]);\n }", "function b_minitable_show( ) {\n global $xoopsDB;\n $module_handler =& xoops_gethandler('module');\n $module =& $module_handler->getByDirname('cricketstats');\n //Get config for News module\n $config_handler =& xoops_gethandler('config');\n if ($module) {\n $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));\n }\n \n //Season id\n $sql = \"SELECT SeasonID, SeasonName FROM \".$xoopsDB->prefix(\"cricket_seasonnames\").\" WHERE SeasonDefault=1\";\n $cricket_seasonname = $xoopsDB->query($sql);\n $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname);\n $cricket_season_id = $cricket_seasonname['SeasonID'];\n $cricket_seasonname = $cricket_seasonname['SeasonName']; \n \n //League id\n $sql2 = \"SELECT LeagueID, LeagueName FROM \".$xoopsDB->prefix(\"cricket_leaguenames\").\" WHERE LeagueDefault=1\";\n $cricket_leaguename = $xoopsDB->query($sql2);\n $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename);\n $cricket_league_id = $cricket_leaguename['LeagueID'];\n $cricket_leaguename = $cricket_leaguename['LeagueName']; \n\n //For win, draw and lost?\n $cricket_for_win = $moduleConfig['forwin'];\n $cricket_for_draw = $moduleConfig['fordraw'];\n $cricket_for_lose = $moduleConfig['forloss'];\n \n //Query to get teams from selected season & league\n $cricket_get_teams = $xoopsDB->query(\"SELECT DISTINCT\n O.OpponentName AS name,\n O.OpponentID AS id\n FROM \".$xoopsDB->prefix(\"cricket_opponents\").\" O, \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND\n\t\t\t\t\t\tLM.LeagueMatchLeagueID = '$cricket_league_id' AND\n (O.OpponentID = LM.LeagueMatchHomeID OR\n O.OpponentID = LM.LeagueMatchAwayID)\n ORDER BY name\");\n \n //Lets read teams into the table\n $i = 0;\n while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams))\n {\n $team[$cricket_data['id']]['name'] = $cricket_data['name'];\n $team[$cricket_data['id']]['homewins'] = 0;\n $team[$cricket_data['id']]['awaywins'] = 0;\n $team[$cricket_data['id']]['homeloss'] = 0;\n $team[$cricket_data['id']]['awayloss'] = 0;\n $team[$cricket_data['id']]['hometie'] = 0;\n $team[$cricket_data['id']]['awaytie'] = 0;\n $team[$cricket_data['id']]['homerunsfor'] = 0;\n $team[$cricket_data['id']]['homerunsagainst'] = 0;\n $team[$cricket_data['id']]['awayrunsfor'] = 0;\n $team[$cricket_data['id']]['awayrunsagainst'] = 0;\n $team[$cricket_data['id']]['matches'] = 0;\n }\n \n //Match data\n $query = $xoopsDB->query(\"SELECT\n LM.LeagueMatchID AS mid, \n LM.LeagueMatchHomeID as homeid,\n LM.LeagueMatchAwayID as awayid, \n LM.LeagueMatchHomeRuns as homeruns,\n LM.LeagueMatchAwayRuns as awayruns \n FROM\n \".$xoopsDB->prefix(\"cricket_leaguematches\").\" LM\n \tWHERE\n LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND\n\t\t\t\t\t\t\t\tLM.LeagueMatchHomeRuns IS NOT NULL\");\n while ($cricket_matchdata = $xoopsDB->fetchArray($query)) {\n $cricket_hometeam = $cricket_matchdata['homeid'];\n $cricket_awayteam = $cricket_matchdata['awayid'];\n \n $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1;\n $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1;\n \n $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns'];\n $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns'];\n $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns'];\n \n $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns'];\n if ($rundiff > 0) {\n $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1;\n $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1;\n }\n elseif ($rundiff == 0) {\n $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1;\n $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1;\n }\n elseif ($rundiff < 0) {\n $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1;\n $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1;\n }\n }\n $cricket_get_deduct = $xoopsDB->query(\"SELECT points, teamid FROM \".$xoopsDB->prefix(\"cricket_deductedpoints\").\" WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'\");\n while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) {\n $team[$cricket_d_points[\"teamid\"]]['d_points'] = $cricket_d_points['points'];\n }\n foreach ($team as $teamid => $thisteam) {\n $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0;\n $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points;\n $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor'];\n $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst'];\n }\n array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC);\n \n //Print the table\n $block['title'] = _BL_CRICK_MINITABLE;\n $block['content'] = \"<table width='100%' cellspacing='2' cellpadding='2' border='0'>\n <tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_TEAM.\"</u></span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_POINTS.\"</u></span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>\"._BL_CRICK_RUNS.\"</u></span></td> \n </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>\";\n foreach ($team as $teamid => $thisteam)\n {\n $block['content'] .= \"<tr>\n <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>\".$thisteam['name'].\"</span></td>\n <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_points[$teamid].\"</span></td>\n <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>\".$cricket_runsfor[$teamid].\"-\".$cricket_runsagainst[$teamid].\"</span></td>\n </tr>\";\n }\n $block['content'] .= \"</table><br><div align=\\\"center\\\"><a href=\\\"\".XOOPS_URL.\"/modules/cricketstats/index.php\\\">\"._BL_CRICK_GOTOMAIN.\"</a></div></marquee>\";\n return $block;\n}", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "public function show(Team $team)\n {\n //\n }", "function display_player_stats($res) {\n\n echo '<br><div class=\"stat-sheet\"><h3>Regular Season Stats</h3><br>';\n\n // Table header:\n echo '<table class=\"player-tbl\" cellspacing=\"5\" cellpadding=\"5\"\n width=\"75%\">\n\t<tr class=\"player-stat-heading\">\n\t\t<td align=\"left\"><b>Year</b></td>\n\t\t<td align=\"left\"><b>Team</b></td>\n\t\t<td align=\"left\"><b>Lg</b></td>\n\t\t<td align=\"left\"><b>G</b></td>\n\t\t<td align=\"left\"><b>Min</b></td>\n\t\t<td align=\"left\"><b>Pts</b></td>\n\t\t<td align=\"left\"><b>PPG</b></td>\n\t\t<td align=\"left\"><b>FGM</b></td>\n\t\t<td align=\"left\"><b>FGA</b></td>\n\t\t<td align=\"left\"><b>FGP</b></td>\n\t\t<td align=\"left\"><b>FTM</b></td>\n\t\t<td align=\"left\"><b>FTA</b></td>\n\t\t<td align=\"left\"><b>FTP</b></td>\n\t\t<td align=\"left\"><b>3PM</b></td>\n\t\t<td align=\"left\"><b>3PA</b></td>\n\t\t<td align=\"left\"><b>3PP</b></td>\n\t\t<td align=\"left\"><b>ORB</b></td>\n\t\t<td align=\"left\"><b>DRB</b></td>\n\t\t<td align=\"left\"><b>TRB</b></td>\n\t\t<td align=\"left\"><b>RPG</b></td>\n\t\t<td align=\"left\"><b>AST</b></td>\n\t\t<td align=\"left\"><b>APG</b></td>\n\t\t<td align=\"left\"><b>STL</b></td>\n\t\t<td align=\"left\"><b>BLK</b></td>\n\t\t<td align=\"left\"><b>TO</b></td>\n\t\t<td align=\"left\"><b>PF</b></td>\n\t</tr>\n';\n\n // Fetch and print all the records:\n while ($row = mysqli_fetch_array($res, MYSQLI_ASSOC)) {\n echo '<tr class=\"player-stat\">\n\t\t\t<td align=\"left\">' . $row['year'] . '</td>\n\t\t\t<td align=\"left\">' . $row['team'] . '</td>\n\t\t\t<td align=\"left\">' . $row['lg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['g'] . '</td>\n\t\t\t<td align=\"left\">' . $row['min'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pts'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ppg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fga'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fgp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['fta'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ftp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpm'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpa'] . '</td>\n\t\t\t<td align=\"left\">' . $row['tpp'] . '</td>\n\t\t\t<td align=\"left\">' . $row['orb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['drb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['trb'] . '</td>\n\t\t\t<td align=\"left\">' . $row['rpg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['ast'] . '</td>\n\t\t\t<td align=\"left\">' . $row['apg'] . '</td>\n\t\t\t<td align=\"left\">' . $row['stl'] . '</td>\n\t\t\t<td align=\"left\">' . $row['blk'] . '</td>\n\t\t\t<td align=\"left\">' . $row['turnover'] . '</td>\n\t\t\t<td align=\"left\">' . $row['pf'] . '</td>\n\t\t</tr>\n\t\t';\n }\n\n echo '</table></div>';\n\n}", "public function show(SedamFail $sedamFail)\n {\n //\n }", "function action_add_roster()\n\t{\n\t\t// Loading form validation helper.\n\t\t$this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('pid', 'Player ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('tid', 'Team ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('sid', 'Season ID', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('squad_number', 'Squad Number', 'trim|required|xss_clean');\n\n\t\t$pid = $this->input->post('pid');\n\t\t$tid = $this->input->post('tid');\n\t\t$sid = $this->input->post('sid');\n\t\t$squad_number = $this->input->post('squad_number');\n\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t// Invalid Squad Number\n\t\t\tif ($squad_number < 1 || $squad_number > 99)\n\t\t\t{\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'status' => 'danger',\n\t\t\t\t\t'message' => 'The squad number must be between 0 and 99.'\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If an object is returned, that means either the player is already on the roster\n\t\t\t// or the squad number has been assigned.\n\t\t\tif ($this->roster->is_invalid_player($pid, $tid, $sid, $squad_number))\n\t\t\t{\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'status' => 'danger',\n\t\t\t\t\t'message' => 'Either the player is already on the roster or the squad number has been assigned.'\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ($this->roster->insert($pid, $tid, $sid, $squad_number))\n\t\t\t{\n\t\t\t\techo json_encode(array(\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'message' => 'Player successfully added to roster!'\n\t\t\t\t));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\techo json_encode(array(\n\t\t\t'status' => 'danger',\n\t\t\t'message' => 'One or more of the fields are invalid.'\n\t\t));\n\t}", "public function showSpecificTeamAction(Team $team)\n {\n $activeTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByTeam($team);\n $inActiveTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findInactiveTeamMembershipsByTeam($team);\n usort($activeTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n usort($inActiveTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n\n $user = $this->getUser();\n $currentUserTeamMembership = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByUser($user);\n $isUserInTeam = false;\n foreach ($currentUserTeamMembership as $wh) {\n if (in_array($wh, $activeTeamMemberships)) {\n $isUserInTeam = true;\n }\n }\n\n // Return the view with suitable variables\n return $this->render('team_admin/specific_team.html.twig', array(\n 'team' => $team,\n 'activeTeamMemberships' => $activeTeamMemberships,\n 'inActiveTeamMemberships' => $inActiveTeamMemberships,\n 'isUserInTeam' => $isUserInTeam,\n ));\n }", "public function getSeason(){\n if ($this->season == NULL){\n $rss = selectQueryGetAll($this->dsseason->select_query());\n $this->season = $this->dsseason->rdisplay($rss[0]['KOID']);\n }\n return $this->season;\n }", "public function show()\n\t{\n $this->load->helper('url'); \n\t\t$this->load->view('game_view');\n\n\t}" ]
[ "0.73752326", "0.6504252", "0.6302066", "0.6302066", "0.62489116", "0.5633495", "0.5620838", "0.5595325", "0.54984736", "0.540403", "0.53705233", "0.5352601", "0.53130436", "0.5280591", "0.5267167", "0.524794", "0.52144045", "0.52117443", "0.51892495", "0.51892495", "0.51892495", "0.51892495", "0.51892495", "0.51892495", "0.51864994", "0.5153495", "0.5145139", "0.51324093", "0.51292974", "0.51231027" ]
0.771471
0
Check if ws is available for the setted sender and enviroment.
private function test_availability() { $this->add_log('test_availability: Testing ws availability...', 'DEBUG'); $params = new stdClass(); $params->from = @new SoapVar($this->sender, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema"); $this->call_function('disponibilitat', $params); $this->add_log('test_availability: Server avalaible', 'DEBUG'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkws () {\n $ck_name = \"_wsinfstat\";\n if (!isset($_COOKIE[$ck_name])) {\n $wsowner = ws_owner();\n if (!$wsowner || \\in_array($wsowner->status, [\"BANNED\", \"SUSPENDED\", \"DISABLED\"])) {\n Header::badRequest(true, \"This web store cannot be viewed at this time. If you are the owner; kindly contact admin/support.\");\n }\n $wsinfo = ws_info();\n if (!$wsinfo || \\in_array($wsinfo->status, [\"BANNED\", \"SUSPENDED\", \"DISABLED\"])) {\n Header::badRequest(true, \"WS: This web store cannot be viewed at this time. If you are the owner; kindly contact admin/support.\");\n }\n // create cookie\n \\setcookie($ck_name, 1, \\strtotime(\"+14 Minutes\"), \"/\", get_constant(\"PRJ_DOMAIN\"), false, true);\n }\n\n}", "function is_wg_enabled() {\n\tglobal $config;\n\n\twg_globals();\n\n\tforeach ($wgg['tunnels'] as $tunnel) {\n\n\t\tif (empty($tunnel['enabled'])) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\treturn false;\n}", "function websocket(&$responses = NULL):bool\n\t{\n\t\treturn ($responses = $this->headers([\n\t\t\t'Upgrade' => 'websocket',\n\t\t\t'Connection' => 'Upgrade',\n\t\t\t'Sec-WebSocket-Version' => 13,\n\t\t\t'Sec-WebSocket-Key' => base64_encode(random_bytes(16))\n\t\t])->request('GET', $this->path))\n\t\t&& $responses[0] === 'HTTP/1.1 101 Switching Protocols'\n\t\t&& array_key_exists('Sec-WebSocket-Accept', $responses)\n\t\t&& base64_encode(sha1(\"{$this->headers['Sec-WebSocket-Key']}258EAFA5-E914-47DA-95CA-C5AB0DC85B11\", TRUE)) === $responses['Sec-WebSocket-Accept'];\n\t}", "public function hasWeddingmsg(){\n return $this->_has(25);\n }", "public function hasW()\n {\n return isset($this->w);\n }", "public function hasW()\n {\n return isset($this->w);\n }", "function isListening() {\n\t\treturn !empty($this->data['INFO_REMOTE_METHOD']) && !empty($this->data['INFO_REMOTE_URI']);\n\t}", "function air_helper_mail_delivery_check() {\n if ( class_exists( 'Mailgun' ) && getenv( 'MAILGUN_API_KEY' ) && ( defined( 'MAILGUN_USEAPI' ) && MAILGUN_USEAPI ) ) {\n return true;\n }\n\n // SendGrid for legacy support.\n if ( class_exists( 'Sendgrid_Tools' ) && getenv( 'SENDGRID_API_KEY' ) ) {\n return true;\n }\n\n // Do not show the notice in dev.\n if ( 'development' === wp_get_environment_type() ) {\n return true;\n }\n\n add_action( 'admin_notices', 'air_helper_mail_delivery_not_configured_notice' );\n return false;\n}", "function available() {\n\t\treturn function_exists('fsockopen');\n\t}", "public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "function works() {\n\t$data = createMessagePayload('Flarum is able to contact this Telegram room. Great!');\n\n\ttry {\n\t\t$result = Request::sendMessage($data);\n\n\t\treturn $result->isOk();\n\t} catch (TelegramException $e) {\n\t\treturn false;\n\t}\n}", "private function init_soap() {\r\n\r\n if ($this->environment != 'REMOTE') {\r\n $currentfile = dirname(__FILE__).'/wsdl/wsdl-'.$this->environment.'.wsdl';\r\n if (is_file($currentfile)) {\r\n $this->add_log('init_soap: OK Local wsdl ->'.$currentfile, 'DEBUG');\r\n $this->get_soapclient($currentfile);\r\n return true;\r\n }\r\n }\r\n\r\n // Check if $url is empty\r\n if (empty($this->wsurl)) {\r\n $this->add_log('init_soap: wsurl is empty', 'ERROR');\r\n return false;\r\n }\r\n\r\n $this->add_log('init_soap: OK Remote wsdl -> '.$this->wsurl, 'DEBUG');\r\n\r\n @$this->get_soapclient($this->wsurl . '?wsdl');\r\n\r\n $this->add_log('init_soap: Soap Client WSDL loaded', 'DEBUG');\r\n return true;\r\n }", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "private function isInstalled()\n {\n /** @var \\Magento\\Framework\\App\\DeploymentConfig $deploymentConfig */\n $deploymentConfig = $this->objectManager->get(\\Magento\\Framework\\App\\DeploymentConfig::class);\n return $deploymentConfig->isAvailable();\n }" ]
[ "0.6823314", "0.6091921", "0.5772746", "0.5694601", "0.5679683", "0.5679683", "0.56632", "0.5655221", "0.5613046", "0.560945", "0.5585456", "0.55526024", "0.5524844", "0.5524844", "0.5524844", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.55238265", "0.5490001" ]
0.69391865
0
////////////////////////////////////////////////////// //////// SET/GET FUNCTIONS ///////// ////////////////////////////////////////////////////// Check and set idApp
private function set_idapp($idapp = '') { if (empty($idapp)) { $this->add_log('set_idapp: IdApp KO, parameter is empty', 'ERROR'); return false; } $this->add_log('set_idapp: IdApp OK, setted to "'.$idapp.'"'); $this->idApp = $idapp; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setAppId($value)\n {\n $this->_props['AppId'] = $value;\n }", "public function setAppID($id)\n {\n $this->parameters['appid'] = $id;\n }", "public function setApplicationID($app_id) \n\t{\n\t\t$this->application_id = $app_id;\n\t}", "public function setUseAppID($use_appid) \n \t{\n \t\t$this->use_appid = $use_appid;\n \t}", "public function setAppId($value);", "function GET_APP_ID(){\n return \"7d0df388-f064-48eb-9092-27fbbf0a438e\";\n}", "public function getUseAppID() \n \t{\n \t\treturn $this->use_appid;\n \t}", "public function setAppId($val)\n {\n $this->_propDict[\"appId\"] = $val;\n return $this;\n }", "public function getAppId();", "public function getAppId(): int;", "public function getAppId()\n {\n }", "public function getAppId(){\n return $this->appId;\n }", "public function setApp($app)\n {\n $this->app = $app;\n }", "public function display_app_id() {\n\t\t// Now grab the options based on what we're looking for\n\t\t$opts = get_option( 'emcl_settings' );\n\t\t$emc_client_id = isset( $opts['emc_client_id'] ) ? $opts['emc_client_id'] : '';\n\t\t// And display the view\n\t\tinclude_once $this->views . 'settings-app-client-id-field.php';\n\t}", "function getAppId()\n {\n return $this->_props['AppId'];\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "public function getAppId()\n {\n return $this->app_id;\n }", "private function setApplicationDefinitionId($appId) {\n\t\t\\Scrivo\\ArgumentCheck::assertArgs(func_get_args(), array(\n\t\t\tarray(\\Scrivo\\ArgumentCheck::TYPE_INTEGER)\n\t\t));\n\n\t\tif ($this->applicationDefinitionId) {\n\t\t\tthrow new \\Scrivo\\SystemException(\n\t\t\t\t\"Can't reset the the application id\");\n\t\t}\n\t\treturn $this->applicationDefinitionId = $appId;\n\t}", "public function updateappname() \n \t{\n \t\ttry \n \t\t{\n\t\t\t// select mongoDB collection\n \t\t\t$app_collection \t= \t$this->mongo_db->db->used;\n\t\t\t// preparing data\n \t\t\t$prepare_data \t\t= \tarray(\n \t\t\t\t'$set' \t\t\t=> \t\tarray(\n \t\t\t\t\t'use_appname' \t=> \t$this->use_appname\n \t\t\t\t\t)\n \t\t\t\t);\n\t\t\t// update to database\n \t\t\t$app_collection->update(array(\n \t\t\t\t'use_appid' \t=> \t$this->use_appid\n \t\t\t\t),\n \t\t\t$prepare_data, array(\n \t\t\t\t'multiple' \t\t=> \ttrue\n \t\t\t\t)\n \t\t\t);\n \t\t\treturn true;\n \t\t} \n \t\tcatch (Exception $e) \n \t\t{\n \t\t\treturn false;\n \t\t}\n \t}", "public function getOGApplicationID();", "public function getSettingID($companyId, $app) {\n\t\t$sql = $this->select();\n\t\t$sql = $sql->setIntegrityCheck(false);\n\t\t$sql = $sql->from('application_settings_2');\n\t\t$sql = $sql->where(\"company_id = '{$companyId}'\");\n\t\t$row = $this->_db->fetchRow($sql);\n\t\t$setting_id = '';\n\t\t$setting_ids = json_decode($row['settings_ids'])->applications;\n\t\t\n\t\tforeach($setting_ids as $key => $opt) {\n\t\t\tif($key == $app) {\n\t\t\t\t$setting_id = $opt;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $setting_id;\n\t}", "public function load($id) {\n\t\t\t$query = $this->system->mysql->query(\"SELECT * FROM applications WHERE appId=$id LIMIT 1\");\n\t\t\t\n\t\t\t$row = $query->fetch_assoc();\n\t\t\t\n\t\t\t$this->id = $row['appId'];\n\t\t\t$this->name = $row['name'];\n\t\t\t$this->ftpBackup = $row['ftpBackup'];\n\t\t\t\n\t\t\t$this->ftp = array(\n\t\t\t\t'server' => $row['ftpServer'],\n\t\t\t\t'user' => $row['ftpUser'],\n\t\t\t\t'password' => $row['ftpPassword'],\n\t\t\t\t'defaultDirectory' => $row['ftpDir'],\n\t\t\t\t'method' => $row['ftpMethod']\n\t\t\t);\n\t\t\t\n\t\t\t$this->dbBackup = $row['dbBackup'];\n\t\t\t\n\t\t\t$this->db = array(\n\t\t\t\t'server' => $row['dbServer'],\n\t\t\t\t'user' => $row['dbUser'],\n\t\t\t\t'password' => $row['dbPassword'],\n\t\t\t\t'database' => $row['dbDatabase'],\n\t\t\t\t'method' => $row['dbMethod'],\n\t\t\t);\n\t\t\t\n\t\t\t$this->dateLimit = $row['dateLimit'];\n\t\t\t\n\t\t\t$this->dates = array(\n\t\t\t\t'from' => $row['backupFrom'],\n\t\t\t\t'to' => $row['backupTo']\n\t\t\t);\n\t\t\t\n\t\t\t$this->frequency = $row['frequency'];\n\t\t\t\n\t\t\t$this->weekday = $row['weekday'];\n\t\t\t\n\t\t\t$this->backupTime = $row['time'];\n\t\t}", "public function getAppId() {\n return $this->app_id;\n }", "public function setActiveEntry($appId);", "public function getAppId(): string;" ]
[ "0.72380155", "0.70585686", "0.704561", "0.70331615", "0.69627553", "0.67790014", "0.6620967", "0.6578225", "0.6420999", "0.6363238", "0.6343049", "0.6264861", "0.62423706", "0.6224836", "0.6211544", "0.6191849", "0.6191849", "0.6191849", "0.6191849", "0.6191849", "0.6191849", "0.6191849", "0.6184838", "0.6175023", "0.6153275", "0.6116481", "0.6105746", "0.6070421", "0.60684276", "0.6059383" ]
0.8089351
0
Check and set replyAddress
function set_replyAddress($replyAddress = '') { $replyAddress = trim($replyAddress); $replyAddress = strtolower($replyAddress); $replyAddress = addslashes($replyAddress); if (!preg_match("/^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9]+@[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/", $replyAddress)) { $this->add_log('set_replyAddress: "'.$replyAddress.'" is not a valid email address', 'ERROR'); return false; } $this->add_log('set_replyAddress: OK Reply Address:"'.$replyAddress.'"', 'DEBUG'); $this->replyAddress = $replyAddress; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_reply($reply)\n\t{\n\t\t$this->reply_to = $reply;\n\t}", "public function set_reply_to(EmailAddress $address) {\n $this->reply_to = $address->as_string();\n return TRUE;\n\t}", "public function set_reply_to(EmailAddress $address);", "protected function setReplyTo() {}", "public function setAutoResponderFromAddress($value) { $this->_autoResponderFromAddress = $value; }", "function reply_to( $address = '', $name = '' )\n\t{\n\t\tif (!$address)\n\t\t\treturn FALSE;\n\t\t\n\t\t//if required, test the email for validity\n\t\tif ($this->config['validate'])\n\t\t{\n\t\t\tif (!$this->email_is_valid( $address, true ))\n\t\t\t\t$this->debug('Invalid reply-to email was supplied: '.$address);\n\t\t}\n\t\t\n\t\tif ($name)\n\t\t\t$this->reply_to = $name.' <'.$address.'>';\n\t\telse\n\t\t\t$this->reply_to = $address;\n\t\t\t\n\t\treturn TRUE;\t\t\t\t\n\t}", "public function setAutoResponderReplyTo($value) { $this->_autoResponderReplyTo = $value; }", "public function setSender($address);", "public function setReplyTo($replyTo);", "public function setAutoResponderToAddressField($value) { $this->_autoResponderToAddressField = $value; }", "public function exchange_add_address($username, $emailaddress, $default=FALSE, $isGUID=false) {\n if ($username===NULL){ return (\"Missing compulsory field [username]\"); } \n if ($emailaddress===NULL) { return (\"Missing compulsory fields [emailaddress]\"); }\n \n $proxyvalue = 'smtp:';\n if ($default === true) {\n $proxyvalue = 'SMTP:';\n }\n \n // Find the dn of the user\n $user=$this->user_info($username,array(\"cn\",\"proxyaddresses\"),$isGUID);\n if ($user[0][\"dn\"]===NULL){ return (false); }\n $user_dn=$user[0][\"dn\"];\n \n // We need to scan existing proxy addresses and demote the default one\n if (is_array($user[0][\"proxyaddresses\"]) && $default===true) {\n $modaddresses = array();\n for ($i=0;$i<sizeof($user[0]['proxyaddresses']);$i++) {\n if (strstr($user[0]['proxyaddresses'][$i], 'SMTP:') !== false) {\n $user[0]['proxyaddresses'][$i] = str_replace('SMTP:', 'smtp:', $user[0]['proxyaddresses'][$i]);\n }\n if ($user[0]['proxyaddresses'][$i] != '') {\n $modaddresses['proxyAddresses'][$i] = $user[0]['proxyaddresses'][$i];\n }\n }\n $modaddresses['proxyAddresses'][(sizeof($user[0]['proxyaddresses'])-1)] = 'SMTP:' . $emailaddress;\n \n $result=@ldap_mod_replace($this->_conn,$user_dn,$modaddresses);\n if ($result==false){ return (false); }\n \n return (true);\n }\n else {\n // We do not have to demote an email address from the default so we can just add the new proxy address\n $attributes['exchange_proxyaddress'] = $proxyvalue . $emailaddress;\n \n // Translate the update to the LDAP schema \n $add=$this->adldap_schema($attributes);\n \n if (!$add){ return (false); }\n \n // Do the update\n // Take out the @ to see any errors, usually this error might occur because the address already\n // exists in the list of proxyAddresses\n $result=@ldap_mod_add($this->_conn,$user_dn,$add);\n if ($result==false){ return (false); }\n \n return (true);\n }\n }", "public function setReplyTo($addresses);", "function reply_to ($email, $name=null) {\n if (!$email) return false;\n\n if ($this->check_address && !$this->validate_email($email)) {\n throw new Exception(\"Bad email address $stack: $email\");\n }\n\n $this->xheaders['Reply-To'] = ($name == null) ? $email : '\"'.$name.'\" <'.$email.'>';\n }", "public function isReplyTo() {}", "public function setCorrespondentAddress($value) {\n\t\tself::$_correspondentAddress = $value;\n\t}", "public function setEmailReplyToAddress($value) { $this->_emailReplyToAddress = $value; }", "public function setReplyTo(?string $replyTo): void {\n\t\tself::checkValidEMail($replyTo);\n\n\t\t$this->replyTo = $replyTo;\n\t}", "public function setReplyEmail($value)\n {\n return $this->set('ReplyEmail', $value);\n }", "public function setAutoResponderReplyToName($value) { $this->_autoResponderReplyToName = $value; }", "public function setAddress($address);", "public function setAddress($address);", "public function SetFrom($address, $name = '', $auto=1) {\n $address = trim($address);\n $name = trim(preg_replace('/[\\r\\n]+/', '', $name)); //Strip breaks and trim\n if (!self::ValidateAddress($address)) {\n\n return false;\n }\n $this->From = $address;\n $this->FromName = $name;\n if ($auto) {\n if (empty($this->ReplyTo)) {\n $this->AddAnAddress('ReplyTo', $address, $name);\n }\n }\n return true;\n }", "public function setReplyToEmailAddress($replyToEmailAddress, $replyToName);", "public function setAddress(Address $address);", "public function setAddress($value)\n {\n $this->_address = $value;\n }", "public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}", "function get_reply_to($string){\n\t\t$addresses = explode(', ', $string);\n\t\tforeach($addresses as $value){\n\t\t\t$element = count($this->reply_to);\n\t\t\t$this->reply_to[$element] = $value;\n\t\t}\n\t}", "protected function _setDestinationAddress($address) {\n\t\t//$shippingAddress = $quote->getShippingAddress();\n\t\t//$street = $address->getStreet();\n\t\t$street = array();\n\t\t$street1 = isset($street[0]) ? $street[0] : null;\n\t\t$street2 = isset($street[1]) ? $street[1] : null;\n\t\t$city = $address->getCity();\n\t\t$zip = preg_replace('/[^0-9\\-]*/', '', $address->getPostcode());\n\t\t$state = Mage::getModel('directory/region')->load($address->getRegionId())->getCode(); \n\t\t$country = $address->getCountry();\n\t\t \n\t\tif(($city && $state) || $zip) {\n\t\t\t$address = $this->_newAddress($street1, $street2, $city, $state, $zip, $country);\n\t\t\treturn $this->_request->setDestinationAddress($address);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setAddr($value)\n {\n return $this->set(self::_ADDR, $value);\n }", "public function setAddress($address)\n {\n $this->mail->addAddress(Helper::sanitizeInput($address));\n }" ]
[ "0.6910569", "0.6768336", "0.66688424", "0.66045934", "0.64851975", "0.647443", "0.60504997", "0.6046929", "0.59513015", "0.5945489", "0.5781774", "0.5757276", "0.57436824", "0.5712577", "0.56954587", "0.56323856", "0.56307566", "0.5626689", "0.5618188", "0.5530642", "0.5530642", "0.5526055", "0.5525406", "0.55050373", "0.55008674", "0.5492294", "0.5488315", "0.5464948", "0.54128575", "0.53870535" ]
0.7840499
0
Check if the sender is allowed and set it
function set_sender($sender = '') { if (!array_key_exists($sender, $this->allowed_senders)) { $this->add_log('set_sender: "'.$sender.'" is not a valid sender', 'ERROR'); $this->sender = null; return false; } $this->add_log('set_sender: Sender: "'.$sender.'"', 'DEBUG'); $this->sender = $this->allowed_senders[$sender]; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateSender(){\n\t\tglobal $ENABLE_SECURITY;\n\t\tif(in_array($this->sender, $this->validSenders) || $ENABLE_SECURITY == false){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function allowMessage()\n {\n $this->_data['Mensaje'] = 1;\n }", "public function setSender($sender);", "function __allowRelay($allow)\n {\n $this->__relayAllowed=$allow;\n }", "public function setAllow($value) {\r\n $this->allow = $value;\r\n }", "public function setSender($sender ){\n $this->sender = $sender;\n }", "function setCurrentUserAsSender(){\n if( !SessionUser::isLoggedIn() ) return false;\n $this->From = SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN;\n $this->FromName = SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" (\".SessionUser::getProperty(\"username\").\")\";\n }", "public function userModel_beforeRegister_handler($sender, $args) {\n // Get the user's email domain.\n $email = val('Email', $args['RegisteringUser']);\n $domain = strtolower(substr($email, strrpos($email, '@')+1));\n\n // Check the user's email domain against our private lists.\n $domainList = array_merge($this->getBurnerDomains(), $this->getFreemailDomains());\n if (in_array($domain, $domainList)) {\n // Block the registration.\n $args['Valid'] = false;\n // Provide matching error as if a ban rule was invoked.\n $sender->Validation->addValidationResult('UserID', 'Sorry, permission denied.');\n }\n }", "public function setSender($sender) {\n $this->_sender = $sender;\n }", "protected function allow() {\n\t\t\n\t\treturn true;\n\t}", "public static function setSender($val) \n { \n emailSettings::$sender = $val; \n }", "function setSender($from){\n $this->From = $from;\n }", "public function approved_sender()\n\t{\n\t\t//pe($this->that);\n\t\tif (is_null($this->approved_sender))\n\t\t{\n\t\t\t$add = strtolower($this->get_address_from());\n\t\t\t$approved_arr = $this->get_approved();\n\t\t\tforeach($approved_arr as $check_add)\n\t\t\t{\n\t\t\t\tif ($add == strtolower($check_add))\n\t\t\t\t{\n\t\t\t\t\t$this->approved_sender = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\t\t\t}\n\t\t\t$this->that->log_state('Sender '. $add .' approved? : ' . var_export($this->approved_sender,TRUE));\n\t\t}\n\t\treturn $this->approved_sender;\n\t}", "public function setSender($address);", "public function isValidSender($sender) {\n\t\treturn (int)0xFFFFFFFF == $sender ? false : true;\n\t}", "protected function beforeSending()\n {\n }", "function setFrom($to_set=\"noreply\"){\n\t\t\t$this->from_mail = $to_set;\n\t\t}", "public function checkUserAccess() {\n $conversation = Conversation::find($this->conversation_id);\n if (!$conversation->isConversationMember($this->user_id)) {\n $this->addError('user_id', 'User can\\'t send messages to this conversation.');\n }\n }", "public function allowDeliveryAddress()\n {\n $this->_data['DireccionEnvio'] = 1;\n }", "public function testSetFromDoesNotOverruleExistingSender()\n {\n $sender = '[email protected]';\n $this->Mail->Sender = $sender;\n\n $result = $this->Mail->setFrom('[email protected]');\n\n self::assertTrue($result, 'setFrom failed');\n self::assertSame($sender, $this->Mail->Sender, 'Sender has been overruled');\n }", "public function setSender($sender)\n {\n throw new \\Ovh\\Exceptions\\InvalidParameterException(\"Sender is incompatible with message for response\");\n }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function testSetFromDoesNotOverruleSenderWithAutoFalse()\n {\n $result = $this->Mail->setFrom('[email protected]', 'some name', false);\n\n self::assertTrue($result, 'setFrom failed');\n self::assertSame('', $this->Mail->Sender, 'Sender has been overruled');\n }", "function setSharingEnabled($value);", "public function testPointsCanSendByOnlyAuthorizedUsers()\n {\n $this->model = new \\app\\models\\SendForm([\n 'receiverName' => 'demo',\n 'amount' => 100\n ]);\n\n \\Yii::$app->user->identity = null;\n expect_not($this->model->validate());\n expect($this->model->errors)->hasKey('receiverName');\n }", "function setBlacklistedEmail($val) {\n\t\tif($val && $this->owner->Email) {\n\t\t\t$blacklisting = new NewsletterEmailBlacklist();\n\t \t\t$blacklisting->BlockedEmail = $this->owner->Email;\n\t \t\t$blacklisting->MemberID = $this->owner->ID;\n\t \t\t$blacklisting->write();\n\t\t}\n\n\t\t$this->owner->setField(\"BlacklistedEmail\", $val);\n\t\t// Save the BlacklistedEmail field to the Member table\n\t\t$this->owner->write();\n\t}", "public function setSent();", "public function setGiftcardSenderEmail($value);", "public function isAllow()\n {\n return $this->allow;\n }", "function setFromName($to_set=\"noreply\"){\n\t\t\t$this->from_name = $to_set;\n\t\t}" ]
[ "0.6775954", "0.6456651", "0.62458575", "0.6116966", "0.6038681", "0.5928464", "0.58638376", "0.5862621", "0.5788316", "0.57794297", "0.57433134", "0.5720087", "0.5714129", "0.5685744", "0.56004727", "0.5550348", "0.5531194", "0.5495579", "0.5475062", "0.5468812", "0.5465942", "0.5462193", "0.5448113", "0.5426893", "0.5409676", "0.53715235", "0.5365933", "0.5347943", "0.53429276", "0.53424186" ]
0.6847715
0
Print de log generated by the class
public function print_log() { if ($this->logger) { $this->logger->print_log(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function printLogMgm() {}", "protected function log() {\n }", "public static function logging()\n {\n }", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "public function getLog();", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }", "public function printTSlog() {}", "public function printTSlog() {}", "public function log()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n foreach (func_get_args() as $argument) {\n $output->dump($argument);\n }\n $output->close();\n }", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "function log()\n {\n }", "public function dprint()\n\t{\n\t\tprint_r( $this->debug );\n\t}", "public static function print_log() {\n $line_break = PHP_SAPI != \"cli\" ? \"<hr/>\" : PHP_EOL; //If not cmd. EOL is a cross platform new line\n //generate a string and output\n foreach (self::$log_message as &$log) {\n $log = \"* \".$log;\n echo $log . $line_break;\n }\n //Create header with timestamp\n self::construct_header();\n array_unshift(self::$log_message,PHP_EOL);\n //Write and display\n self::write_to_file();\n self::clear_log();\n }", "public function printErrorLog() {}", "protected function writeLog()\n {\n $calledClass = get_called_class();\n $this->logger->debug('- BEGIN: ' . $calledClass);\n if (method_exists($this->getRequest(), 'getPostValue')) {\n $this->logger->debug('-- PostValue --');\n $this->logger->debug(print_r($this->getRequest()->getPostValue(), true));\n }\n $this->logger->debug('-- Params --');\n $this->logger->debug(print_r($this->getRequest()->getParams(), true));\n $this->logger->debug('- END: ' . $calledClass);\n }", "public function printClass() {\n print $this->track_id . '::' . $this->track_name . '::' . $this->track_icon . '::' . $this->track_primary_color . '::' . $this->track_secondary_color . '::' . $this->track_date_insert . '::' . $this->track_last_update;\n }", "function &getLog()\r\n\t{\r\n\t\treturn Logger::getLogger('phase.compiler.PhaseParser');\r\n\t}", "public function debug(){\n echo\"<pre><code>\";\n var_dump($this);\n echo \"</code></pre>\";\n }", "private function print() {\n\t\tvar_dump($this->getParams());\n\t}", "private function action_debug(){\n\t\tvar_dump($this);\n\t}", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function dump()\n {\n var_dump($this); exit;\n }", "protected function _debug()\n {\n $file = self::DEFAULT_LOG_FILE;\n Mage::getModel('core/log_adapter', $file)->log($this->_debugData);\n }", "public function debug($var){\n\t\t////$this->core->log($var);\n\t}", "protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }", "public static function debugTrail() {}", "public function logTrace()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n \\DebugHelper::dump()->showtrace($output);\n $output->close();\n }", "public function __toString() {\n\t\treturn $this->debug();\n\t}", "function toDebug($nl = '<br>')\n {\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n echo \"$k [\" . $this->$k . \"]{$nl}\";\n }\n }" ]
[ "0.7271405", "0.72196174", "0.7187643", "0.7183202", "0.7147934", "0.71100724", "0.7020852", "0.6983955", "0.6983955", "0.68706495", "0.681529", "0.6752521", "0.6742889", "0.66945916", "0.65374804", "0.652746", "0.65054417", "0.6493807", "0.6459312", "0.644791", "0.6430648", "0.6387114", "0.6382402", "0.6375061", "0.6371157", "0.63630635", "0.6359611", "0.6356393", "0.634965", "0.63116366" ]
0.7347737
0
OneToMany (owning side) Get fkLicitacaoLicitacoes
public function getFkLicitacaoLicitacoes() { return $this->fkLicitacaoLicitacoes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}", "function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}", "public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }", "public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }", "public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }", "public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }", "public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }", "public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }", "public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }", "public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }", "public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }", "public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }", "public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }", "public function getFkImobiliarioAtributoTipoLicencas()\n {\n return $this->fkImobiliarioAtributoTipoLicencas;\n }", "public function getFkImobiliarioTipoLicencaDocumentos()\n {\n return $this->fkImobiliarioTipoLicencaDocumentos;\n }", "public function senarai_licenses()\n {\n return $this->hasMany(License::class);\n }", "public function license()\n {\n return $this->belongsTo('CityBoard\\Entities\\License');\n }", "public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }", "public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }", "public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }", "public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }", "public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }", "public function licenses()\n {\n // belongsToMany(RelatedModel, pivotTable, thisKeyOnPivot = computer_id, otherKeyOnPivot = license_id)\n return $this->belongsToMany(License::class, 'assign_licenses');\n }", "public function acceso_bibliotecas(){\n\t\treturn $this->hasMany('App\\AccesoBiblioteca', 'Bib_ID_Asp');\n\t}", "public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }", "public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }", "public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }", "public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }", "public function getLicences()\r\n\t{\r\n\t\treturn $this->Licences;\r\n\t}", "public function comisiones()\n {\n return $this->hasMany('App\\Commissions', 'idBanca');\n }" ]
[ "0.7806485", "0.7769196", "0.7687912", "0.725875", "0.72260725", "0.7027727", "0.7027727", "0.6792753", "0.67544675", "0.6741008", "0.6731578", "0.6580049", "0.6521308", "0.64379", "0.6420448", "0.6383024", "0.63504493", "0.6295227", "0.62679446", "0.62295556", "0.61642784", "0.61642784", "0.61402696", "0.60076743", "0.59980977", "0.59670407", "0.590206", "0.5890466", "0.5889912", "0.588265" ]
0.78587395
0
Get Address type Type of the address. This is a code. You can find the possible values at Guidelines
public function getAddressType(): ?string { return $this->AddressType ?? null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEntityTypeCode()\n {\n return 'customer_address';\n }", "function &addressType()\n {\n $addressType = new eZAddressType( $this->AddressTypeID );\n return $addressType;\n }", "function wcs_get_address_type_to_display( $address_type ) {\n\tif ( ! is_string( $address_type ) ) {\n\t\treturn new WP_Error( 'woocommerce_subscription_wrong_address_type_format', __( 'Can not get address type display name. Address type is not a string.', 'woocommerce-subscriptions' ) );\n\t}\n\n\t$address_types = apply_filters( 'woocommerce_subscription_address_types', array(\n\t\t'shipping' => __( 'Shipping Address', 'woocommerce-subscriptions' ),\n\t\t'billing' => __( 'Billing Address', 'woocommerce-subscriptions' ),\n\t) );\n\n\t// if we can't find the address type, return the raw key\n\t$address_type_display = isset( $address_types[ $address_type ] ) ? $address_types[ $address_type ] : $address_type;\n\n\treturn apply_filters( 'woocommerce_subscription_address_type_display', $address_type_display, $address_type );\n}", "public function getTypeCode(): int\n {\n return $this->typeCode;\n }", "public final function getTypeCode(): int\n {\n return self::TYPE_CODE;\n }", "function setAddressType( &$value )\n {\n if( is_numeric( $value ) )\n {\n $this->AddressTypeID = $value;\n }\n \n if( get_class( $value ) == \"ezaddresstype\" )\n {\n $this->AddressTypeID = $value->id();\n }\n }", "public function getType() {\n return 'A0';\n }", "public function get_type();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();", "public function getType();" ]
[ "0.6543431", "0.6517596", "0.642937", "0.63354874", "0.6272734", "0.6077691", "0.60380185", "0.59818393", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293", "0.59714293" ]
0.72235703
0
Set Area Area of the address
public function setArea(string $area) { $this->Area = $area; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCanSetAndGetAdministrativeArea()\n {\n $mockAdministrativeArea = 'Texas';\n\n $this->dataCenter->setAdministrativeArea($mockAdministrativeArea);\n\n $this->assertEquals($mockAdministrativeArea, $this->dataCenter->getAdministrativeArea());\n }", "public function set_local_area($local_area)\r\n\t {\r\n\r\n\t }", "public function area(MBID $mbid): void\n {\n $this->setEntityId($mbid);\n $this->setEntityType(new EntityType(EntityType::AREA));\n }", "public function saveArea($area, $request) {\n $area->name = $request->name;\n $area->country = $request->country;\n $area->zip_code = $request->zip_code;\n $area->save();\n }", "public function setAddress(Address $address);", "public function setIdArea($id) {\n $this->_id = $id; \n }", "public function setAddress($address);", "public function setAddress($address);", "public function setAreaID($value) {\n return $this->set(self::AREAID, $value);\n }", "public function __construct($area)\n {\n parent::__construct(null);\n $this->_area = $area;\n }", "public function setArea($area)\n {\n $this->area = $area;\n\n return $this;\n }", "public function setAddress($value)\n {\n $this->_address = $value;\n }", "public function setAddress($address)\n {\n $this->set('address', $address);\n }", "public function setAddress($address) {\n\t\t$this->address = $address;\n\t}", "public function setConfineArea($confine) {\n $this->_confine = $confine; \n }", "public function setAddress($address)\n {\n $this->address = $address;\n }", "public function setAddress(string $address):void\n {\n $this->address = $address;\n }", "function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' )\n {\n // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. \"WORK;PARCEL;POSTAL\"\n $key = 'ADR';\n if ( $type != '' ) {\n $key .= ';'. $type;\n }\n $key.= ';ENCODING=QUOTED-PRINTABLE';\n $this->properties[$key] = encode( $postoffice ) . ';' . encode( $extended ) .';'. encode( $street ) .';'. encode( $city ) .';'. encode( $region) .';'. encode( $zip ) .';'. encode( $country );\n }", "public function addMapareas( $value){\n return $this->_add(30, $value);\n }", "public function setMinArea($minArea);", "public function edit(Area $area)\n {\n //\n }", "public function setStreetAddress($value) {\n\t\tself::$_streetAddress = $value;\n\t}", "public function update(Request $request, Area $area)\n {\n //\n }", "public function getAreaId()\n {\n return $this->area;\n }", "public function setMaxArea($maxArea);", "abstract protected function getArea();", "function getArea(){}", "public function setAreaRegion($area_region)\n {\n $this->area_region = $area_region;\n return $this;\n }", "function setEntireAddress($address1, $address2, $city, $state, $zipCode)\n\t{\n\t\t$this->setAddress1($address1);\n\t\t$this->setAddress2($address2);\n\t\t$this->setCity($city);\n\t\t$this->setState($state);\n\t\t$this->setZipCode($zipCode);\n\t}", "public function setLocalAddress(string $address): void {}" ]
[ "0.609671", "0.5967248", "0.595136", "0.59242433", "0.58411294", "0.58334804", "0.5822524", "0.5822524", "0.57935756", "0.5788519", "0.5692092", "0.5655351", "0.5552519", "0.5455902", "0.5424002", "0.5402384", "0.5400035", "0.532917", "0.53059566", "0.528521", "0.52375835", "0.52343845", "0.5209897", "0.52089334", "0.52028084", "0.5175352", "0.5174219", "0.5145206", "0.51441497", "0.5141454" ]
0.6220996
0
Set Floor Send to specific floor of a company.
public function setFloor(string $floor) { $this->Floor = $floor; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setBidFloor($bidFloor)\n {\n $this->bidFloor = $bidFloor;\n }", "public function setDeliveryToFloorNo($deliveryToFloorNo) {\n $this->_deliveryToFloorNo = $deliveryToFloorNo;\n }", "public function setFloorAttribute($input)\n {\n $this->attributes['floor'] = $input ? $input : null;\n }", "public function setEntity( $entity )\n {\n\n $this->setEntityWbfsysMessageSendway( $entity );\n\n }", "public function updateFloor() {\n $errors = $this->checkIsValidForAdd_Update();\n if($errors === false){\n if($this->existsFloor()){\n if($this->getplanFloor('name') == ''){\n $sql = \"UPDATE `SM_FLOOR` SET sm_idFloor = '$this->idFloor', sm_nameFloor = '$this->nameFloor', sm_builtSurfaceFloor = '$this->builtSurfaceFloor', sm_surfaceUsefulFloor = '$this->surfaceUsefulFloor' WHERE sm_idBuilding = '$this->idBuilding' AND sm_idFloor = '$this->idFloor'\";\n } else {\n $this->deleteDirPhoto();\n $planFloorBD =$this->dirPhoto.$this->getplanFloor('name');\n $sql = \"UPDATE `SM_FLOOR` SET sm_idFloor = '$this->idFloor', sm_nameFloor = '$this->nameFloor', sm_planFloor = '$planFloorBD', sm_builtSurfaceFloor = '$this->builtSurfaceFloor', sm_surfaceUsefulFloor = '$this->surfaceUsefulFloor' WHERE sm_idBuilding = '$this->idBuilding' AND sm_idFloor = '$this->idFloor'\";\n $this->updateDirPhoto();\n }\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else{\n return true;\n }\n }else{\n return \"There isn't a floor with that identifier in the building\";\n }\n } else{\n return $errors;\n }\n }", "function setBidFloorCurrency($bidFloorCurrency)\n {\n $this->bidFloorCurrency = $bidFloorCurrency;\n }", "public function setCompany(string $company): void\n {\n $this->_company = $company;\n }", "public function setCompany($company)\n {\n $this->company = $company;\n }", "public function setEntityWbfsysMessageSendway( $entity )\n {\n\n $this->register( 'entityWbfsysMessageSendway', $entity );\n $this->register( 'main_entity', $entity );\n\n }", "public function getIdFloor(){\n return $this->idFloor;\n }", "public function update(UpdateFloorRequest $request, Floor $floor)\n {\n //Input received from the request\n $input = $request->except(['_token']);\n //Update the model using repository update method\n $this->floor->update( $floor, $input );\n //return with successfull message\n return new RedirectResponse(route('admin.floors.index'), ['flash_success' => trans('alerts.backend.floors.updated')]);\n }", "public function getDeliveryToFloorNo() {\n return $this->_deliveryToFloorNo;\n }", "public function setCompany($company_nid);", "public function setShippingCompany($companyName = '') {\n $company = array(\n 'x_ship_to_company'=>$this->truncateChars($companyName, 50),\n );\n $this->NVP = array_merge($this->NVP, $company); \n }", "public function setCompany($quote, $company)\n {\n $quote->getBillingAddress()->setCompany($company)->save();\n $quote->getShippingAddress()->setCompany($company)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setCompany($company)->save();\n }\n }", "public function setCompany($quote, $company)\n {\n $quote->getBillingAddress()->setCompany($company)->save();\n $quote->getShippingAddress()->setCompany($company)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setCompany($company)->save();\n }\n }", "public function setInteriorCarpetFloor($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 6 : // Malo\n return 10;\n break;\n }\n }", "public function store(FloorRequest $request)\n {\n $input = [\n 'number' => $request['number'],\n 'block_id' => $request['block_id']\n ];\n\n $floor = Floor::create($input);\n\n return redirect()->route('admin.etages.show', ['id' => $floor->id])\n ->with('success', 'Étage ajouté avec succès.');\n }", "public function floor()\n {\n return $this->belongsTo('App\\Floor', 'FLOOR_ID', 'FLOOR_ID');\n }", "public function floor()\n {\n return $this->belongsTo('App\\Floor', 'FLOOR_ID' ,'FLOOR_ID');\n }", "public function setCompany($company = null)\n {\n // validation for constraint: float\n if (!is_null($company) && !(is_float($company) || is_numeric($company))) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($company, true), gettype($company)), __LINE__);\n }\n if (is_null($company) || (is_array($company) && empty($company))) {\n unset($this->company);\n } else {\n $this->company = $company;\n }\n return $this;\n }", "public function setCompany(\\App\\Domain\\Model\\Company $object) : void\n {\n $this->setRef('from__company_id__to__table__companies__columns__id', $object, 'products');\n }", "public function update(Request $request, FloorName $floorName)\n {\n $request->validate([\n 'letter' => ['required','string'],\n 'name' => ['required','string']\n ]);\n\n $floorName->update($request->all());\n return $floorName;\n }", "public function store(FloorCreateRequest $request)\n {\n\n Floor::create([\n\n 'name'=> $request->name,\n 'number'=>rand(1, 9999),\n 'manger_id'=>Auth::user()->user_id,\n\n\n ]);\n\n return redirect()->route('floors.index');\n }", "public function getFloor(): ?string\n {\n return $this->Floor;\n }", "public static function updateCompanyDimension($company_id, $company_name, $company_city, $company_street, $company_user_name, $company_user_surname) {\n CompanyDimension::where(['company_id' => $company_id])->update(['company_name' => $company_name, 'company_city' => $company_city, 'company_street' => $company_street, 'company_user_name' => $company_user_name, 'company_user_surname' => $company_user_surname]);\n }", "public function update(FloorRequest $request, $id)\n {\n $floor = Floor::findOrFail($id);\n\n $input = [\n 'number' => $request['number'],\n 'block_id' => $request['block_id']\n ];\n\n $floor->update($input);\n\n return redirect()->route('admin.etages.show', ['id' => $floor->id])\n ->with('success', 'Étage modifié avec succès.');\n }", "public function addFloor() {\n\n $errors = $this->checkIsValidForAdd_Update();\n if($errors === false){\n if(!$this->existsFloor()){\n $planFloorBD = $this->dirPhoto.$this->getplanFloor('name');\n $sql = \"INSERT INTO `SM_FLOOR` (sm_idBuilding, sm_idFloor, sm_nameFloor, sm_planFloor, sm_builtSurfaceFloor, sm_surfaceUsefulFloor) VALUES ('$this->idBuilding', '$this->idFloor', '$this->nameFloor', '$planFloorBD', $this->builtSurfaceFloor, $this->surfaceUsefulFloor)\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n $this->updateDirPhoto();\n return true;\n }\n }else{\n return \"There is already a floor with that id in this building\";\n }\n }else {\n return $errors;\n }\n }", "public function getAllowanceDeliveryToFloor() {\n return $this->_allowanceDeliveryToFloor;\n }", "public function setCompanyShort($company)\n\t\t{\n\t\t\t$this->company = $company;\n\t\t}" ]
[ "0.5907326", "0.5649089", "0.5601465", "0.54947346", "0.5409364", "0.5354194", "0.5293211", "0.5282636", "0.52580017", "0.5023991", "0.49677098", "0.48287302", "0.47865462", "0.47696722", "0.4739707", "0.4739707", "0.47255003", "0.47116464", "0.46574515", "0.4621772", "0.4617428", "0.45612454", "0.45372686", "0.45103928", "0.45083362", "0.44896537", "0.44639748", "0.4459538", "0.4449757", "0.44486699" ]
0.5938194
0
Get House Nr Ext House number extension
public function getHouseNrExt(): ?string { return $this->HouseNrExt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNUMERO_EXT()\r\n {\r\n return $this->NUMERO_EXT;\r\n }", "public function getNUMEROEXT()\r\n {\r\n return $this->NUMERO_EXT;\r\n }", "public function getStreetHouseNrExt(): ?string\n {\n return $this->StreetHouseNrExt ?? null;\n }", "public function setHouseNrExt(string $houseNrext)\n {\n $this->HouseNrExt = $houseNrext;\n return $this;\n }", "function getExtension() ;", "public function extension(): string;", "public function guessExtension();", "abstract public function getExtensionName();", "public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }", "public function get_extension()\n {\n }", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public abstract function getExtension();", "abstract function getExtension(): string;", "public function getExtensionName() {}", "public function getExtension() : string;", "public function getExtension() {}", "public function getExtension() {}", "private function get_ext( $filename='' )\n\t{\n\t\treturn substr( $filename, strrpos( $filename, '.' ) + 1);\t\n\t}", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function extension()\n\t{\n\t\t$type = $this->type();\n\t\treturn self::getExtension($type);\n\t}", "public function get_extension()\n {\n return $this->m_extension;\n }", "public function getPhoneExtension()\n {\n return $this->getParameter('billingPhoneExtension');\n }", "public function getExtensionIdentifier();", "public function getExtension(): string\n {\n return $this->getMeta()->getExtension();\n }", "function getExt() {\n\t\treturn $this->_Ext;\n\t}", "public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }", "public function extension() : string {\n return $this->file->extension;\n }" ]
[ "0.702107", "0.6901878", "0.6805921", "0.65295374", "0.64102876", "0.6309599", "0.6274928", "0.6239638", "0.6234429", "0.6223021", "0.61749154", "0.61749154", "0.61749154", "0.6156332", "0.6145746", "0.613606", "0.6122616", "0.61093265", "0.6107866", "0.6071061", "0.6057824", "0.6057824", "0.6033058", "0.60308033", "0.60233915", "0.59765697", "0.5973937", "0.5971557", "0.59698945", "0.59203565" ]
0.73245966
0
Set House Nr Ext House number extension
public function setHouseNrExt(string $houseNrext) { $this->HouseNrExt = $houseNrext; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStreetHouseNrExt(string $streetHouseNrExt)\n {\n $this->StreetHouseNrExt = $streetHouseNrExt;\n return $this;\n }", "public function setNUMERO_EXT($NUMERO_EXT)\r\n {\r\n $this->NUMERO_EXT = $NUMERO_EXT;\r\n\r\n return $this;\r\n }", "public function setNUMEROEXT($NUMERO_EXT)\r\n {\r\n $this->NUMERO_EXT = $NUMERO_EXT;\r\n\r\n return $this;\r\n }", "public function setExtension($ext)\n {\n if (!empty($ext)){\n $this->extension = $ext;\n }\n }", "public function setExtension($ext);", "public function getHouseNrExt(): ?string\n {\n return $this->HouseNrExt;\n }", "public function getNUMERO_EXT()\r\n {\r\n return $this->NUMERO_EXT;\r\n }", "public function setExtension($extension)\n\t{\n\t\t$this->extension = ltrim($extension, '.');\n\t}", "public function getStreetHouseNrExt(): ?string\n {\n return $this->StreetHouseNrExt ?? null;\n }", "public function getNUMEROEXT()\r\n {\r\n return $this->NUMERO_EXT;\r\n }", "public function update_extension(){}", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setExtension($extension) {\n $this->_extension = $extension;\n }", "public function setExtension($name, $baseVersion, $extensionLevel) {}", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "private function _saveExt() {\r\n\r\n }", "public function setExtension(string $extension = '.serial') : self\n\t\t{\n\t\t$this->extension = $extension;\n\n\t\treturn $this;\n\t\t}", "public function setHouseNumber($houseNumber = \"\");", "private function addExtension($extension) {\n $extension = trim(strtolower($extension));\n $extension = preg_quote($extension, \"#\");\n\n if ($extension === \"jpg\" || $extension === \"jpeg\")\n $extension = \"jpe?g\";\n\n // don't add duplicates!\n if (!in_array($extension, $this->extensions)) {\n $this->extensions[] = $extension;\n }\n }", "function setExt($inExt) {\n\t\tif ( $inExt !== $this->_Ext ) {\n\t\t\t$this->_Ext = $inExt;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setExtension(Extension $extension)\n {\n $this->extension = $extension;\n }", "function set_template_ext($ext = NULL)\n\t{\n\t\t//make sure the extension starts with a .\n\t\tif (strpos( $ext, '.' ) !== 0)\n\t\t\t$ext = '.'.$ext;\n\t\t\n\t\t$this->template_ext = $ext;\n\t}", "public function addExtension(string $extension);", "public function guessExtension();", "public function set_post_extension(string $extension) {\n\t\t$this->post_extension = $extension;\n\t}", "public function Extension($extension){\r\n $fullpath=YEXTENTIONDIR.ucwords($extension).EXT;\r\n $this->Load($fullpath);\r\n }", "public function setExt($ext)\n {\n if ($ext) {\n $this->env['EXT'] = '.' . ltrim($ext, '.');\n } else {\n $this->env['EXT'] = '';\n }\n\n return $this;\n }", "public function addExtAddon($addon);", "function addExtension($mode, $ext) {\r\n\t\t$this->_file_extensions[$ext] = $mode;\r\n\t\treturn $this;\r\n\t}" ]
[ "0.67135334", "0.6133606", "0.6124855", "0.5796428", "0.5768478", "0.57374156", "0.5489238", "0.54830986", "0.54139805", "0.53745824", "0.5368581", "0.5298979", "0.5298979", "0.52520704", "0.52103114", "0.5191169", "0.5180162", "0.51444656", "0.5115058", "0.50961673", "0.5082665", "0.5068854", "0.50625646", "0.5051005", "0.5018199", "0.5001879", "0.49752873", "0.49640873", "0.49397326", "0.49240115" ]
0.72882456
0
Set Remark Remark of the shipment
public function setRemark(string $remark) { $this->Remark = $remark; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRemark($remark)\n {\n $this->remark = $remark;\n\n return $this;\n }", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "public function getRemark()\n {\n return $this->remark;\n }", "public function getRemark()\n {\n return $this->remark;\n }", "public function getRemark()\n {\n return $this->remark;\n }", "public function getRemarks()\n {\n return $this->remarks;\n }", "public function save()\n {\n parent::save();\n\n $oRemark = oxNew(\"oxremark\");\n\n // try to load if exists\n $oRemark->load(oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\"));\n\n $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarktext\"));\n $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarkheader\"));\n $oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());\n $oRemark->oxremark__oxtype = new oxField(\"r\");\n $oRemark->save();\n }", "public function setRemarks(array $remarks)\n {\n $this->remarks = $remarks;\n return $this;\n }", "public function setRemark(array $remark)\n {\n $this->remark = $remark;\n return $this;\n }", "public function setRemark($Remark)\n {\n $this->remark = $Remark;\n\n return $this;\n }", "private function setPurchaseNote() {\n $this->product->set_purchase_note($this->wcData->getPurchaseNote());\n }", "public function setNote($text){\r\n $this->note = $text;\r\n }", "public function setRemark($remark = null)\n {\n // validation for constraint: string\n if (!is_null($remark) && !is_string($remark)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($remark)), __LINE__);\n }\n if (is_null($remark) || (is_array($remark) && empty($remark))) {\n unset($this->Remark);\n } else {\n $this->Remark = $remark;\n }\n return $this;\n }", "public function addToRemarks(\\horstoeko\\ubl\\entities\\cbc\\Remarks $remarks)\n {\n $this->remarks[] = $remarks;\n return $this;\n }", "function set_comment_on_receipt() {\n $this->sale_lib->set_comment_on_receipt($this->input->post('show_comment_on_receipt'));\n }", "public function getRemark()\n {\n return isset($this->Remark) ? $this->Remark : null;\n }", "public function edit(Mark $mark)\n {\n //\n }", "public function remarks()\n {\n\t\treturn $this->belongsToMany(\n\t\t\tRemark::class,\n\t\t\t'daily_sale_remark',\n\t\t\t'daily_sale_id',\n\t\t\t'remark_id'\n\t\t);\n }", "public static function __setRemarks($code, $score){\r\n if($score <= self::DEFAULT_LIMIT){\r\n self::$_remarks[] = $code;\r\n }\r\n }", "public function render()\n {\n parent::render();\n\n $soxId = $this->getEditObjectId();\n $sRemoxId = oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\");\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oUser = oxNew(\"oxuser\");\n $oUser->load($soxId);\n $this->_aViewData[\"edit\"] = $oUser;\n\n // all remark\n $oRems = oxNew(\"oxlist\");\n $oRems->init(\"oxremark\");\n $sQuotedUserId = oxDb::getDb()->quote($oUser->getId());\n $sSelect = \"select * from oxremark where oxparentid=\" . $sQuotedUserId . \" order by oxcreate desc\";\n $oRems->selectString($sSelect);\n foreach ($oRems as $key => $val) {\n if ($val->oxremark__oxid->value == $sRemoxId) {\n $val->selected = 1;\n $oRems[$key] = $val;\n break;\n }\n }\n\n $this->_aViewData[\"allremark\"] = $oRems;\n\n if (isset($sRemoxId)) {\n $oRemark = oxNew(\"oxRemark\");\n $oRemark->load($sRemoxId);\n $this->_aViewData[\"remarktext\"] = $oRemark->oxremark__oxtext->value;\n $this->_aViewData[\"remarkheader\"] = $oRemark->oxremark__oxheader->value;\n }\n }\n\n return \"user_remark.tpl\";\n }", "public function getRemark(): ?string\n {\n return $this->Remark ?? null;\n }", "public function addToRemark(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\ParagraphType $remark)\n {\n $this->remark[] = $remark;\n return $this;\n }", "public function issetRemarks($index)\n {\n return isset($this->remarks[$index]);\n }", "public function unsetRemarks($index)\n {\n unset($this->remarks[$index]);\n }", "public function setRecall($recall)\n {\n $this->_recall = $recall;\n }", "public function setNote($note);", "function setDesc_teleco($sdesc_teleco = '')\n {\n $this->sdesc_teleco = $sdesc_teleco;\n }", "protected function setSuccessContent()\n {\n $this->title = 'Meditation Restored';\n \n $content = $this->getTitle();\n $content .= \"Your meditation time on <b>\";\n $content .= $this->data['long_date'];\n $content .= \"</b> has been restored.</p>\";\n \n $content .= '<p><a href=\"/journal\">Back to Journal</a></p>';\n \n $this->content = $content;\n }", "public function setInReplyTo(\\SetaPDF_Core_Document_Page_Annotation_Markup $annotation) {}", "public function setAddressNote($address_note)\n {\n $this->json()->address_note = $address_note;\n }" ]
[ "0.61302036", "0.60908955", "0.6038287", "0.6038287", "0.6038287", "0.60250074", "0.6017689", "0.59990376", "0.5970357", "0.5952395", "0.5919696", "0.5861901", "0.5833563", "0.55943817", "0.55715424", "0.55706996", "0.55160505", "0.547566", "0.53790295", "0.5322313", "0.5292604", "0.5280953", "0.5220262", "0.5213229", "0.5183139", "0.5176098", "0.51582754", "0.510893", "0.5100582", "0.506144" ]
0.6292784
0
Get Street + House number + Ext Combination of Street, HouseNr and HouseNrExt. The field StreetHouseNrExt is only usable for locations in NL, BE and DE. Please see Guidelines for the explanation.
public function getStreetHouseNrExt(): ?string { return $this->StreetHouseNrExt ?? null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStreetHouseNrExt(string $streetHouseNrExt)\n {\n $this->StreetHouseNrExt = $streetHouseNrExt;\n return $this;\n }", "public function getStreetNumber();", "public function setHouseNrExt(string $houseNrext)\n {\n $this->HouseNrExt = $houseNrext;\n return $this;\n }", "function _splitStreetAddressNl($streetAddress) {\n $result = array();\n /*\n * do nothing if streetAddress is empty\n */\n if (!empty($streetAddress)) {\n /*\n * split into parts separated by spaces\n */\n $addressParts = explode(\" \", $streetAddress);\n $foundStreetNumber = false;\n $streetName = null;\n $streetNumber = null;\n $streetUnit = null;\n foreach($addressParts as $partKey => $addressPart) {\n /*\n * if the part is numeric, there are several possibilities:\n * - if the partKey is 0 so it is the first element, it is\n * assumed it is part of the street_name to cater for \n * situation like 2e Wormenseweg\n * - if not the first part and there is no street_number yet (foundStreetNumber\n * is false), it is assumed this numeric part contains the street_number\n * - if not the first part but we already have a street_number (foundStreetNumber\n * is true) it is assumed this is part of the street_unit\n */\n if (is_numeric($addressPart)) {\n if ($foundStreetNumber == false) {\n $streetNumber = $addressPart;\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".$addressPart;\n }\n } else {\n /*\n * if part is not numeric, there are several possibilities:\n * - if the street number is found, set the whole part to streetUnit\n * - if there is no streetNumber yet and it is the first part, set the\n * whole part to streetName\n * - if there is no streetNumber yet and it is not the first part,\n * check all digits:\n * - if the first digit is numeric, put the numeric part in streetNumber\n * and all non-numerics to street_unit\n * - if the first digit is not numeric, put the lot into streetName\n */\n if ($foundStreetNumber == true) {\n if (!empty($streetName)) {\n $streetUnit .= \" \".$addressPart;\n } else {\n $streetName .= \" \".$addressPart;\n }\n } else {\n if ($partKey == 0) {\n $streetName .= $addressPart;\n } else {\n $partLength = strlen($addressPart);\n if (is_numeric(substr($addressPart, 0, 1))) {\n for ($i=0; $i<$partLength; $i++) {\n if (is_numeric(substr($addressPart, $i, 1))) {\n $streetNumber .= substr($addressPart, $i, 1);\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".substr($addressPart, $i, 1);\n }\n }\n } else {\n $streetName .= \" \".$addressPart;\n }\n }\n }\n }\n }\n $result['street_name'] = trim($streetName);\n $result['street_number'] = $streetNumber;\n $result['street_unit'] = trim($streetUnit);\n /*\n * if we still have no street_number, add contact to checkgroup\n */\n \n }\n return $result;\n}", "public function getHouseNrExt(): ?string\n {\n return $this->HouseNrExt;\n }", "function _glueStreetAddressNl($params) {\n $parsedStreetAddressNl = \"\";\n /*\n * do nothing if no street_name in params\n */\n if (isset($params['street_name'])) {\n $parsedStreetAddressNl = trim($params['street_name']);\n if (isset($params['street_number']) && !empty($params['street_number'])) {\n $parsedStreetAddressNl .= \" \".trim($params['street_number']);\n }\n if (isset($params['street_unit']) && !empty($params['street_unit'])) {\n $parsedStreetAddressNl .= \" \".trim($params['street_unit']);\n }\n }\n return $parsedStreetAddressNl;\n}", "public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }", "public function getStreet();", "public function getPropertyFullAddressAttribute()\n {\n $address = [];\n if ($this->house_no) {\n $address[] = '#' . $this->house_no;\n }\n if ($this->street_no) {\n $address[] = 'St.' . $this->street_no;\n }\n\n $fullAddress = optional($this->khAddress)->FullAddress;\n if ($fullAddress) {\n $address[] = trim($fullAddress);\n }\n return implode(', ', $address);\n }", "function get_address_data($address) {\n\n\t$data = explode(',', $address);\n\n\n\t$house = trim($data[count($data)-1]); //last\n\tpreg_match_all('/[\\d]+/m', $house, $matches, PREG_SET_ORDER, 0);\n\t$house = $matches[0][0];\n\n\tif ($house == null) {\n\t\t$house = 0;\n\t\t$street = trim($data[count($data)-1]);\n\t}\n\telse {\n\t\t$street = trim($data[count($data)-2]);\n\t}\n\n\t\n\n\t$street = str_replace('ул.', '', $street);\n\t$street = str_replace('улица', '', $street);\n\t$street = trim($street);\n\t\n\n\treturn [\n\t\t'street' => $street,\n\t\t'house' => $house\n\t];\n}", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "public function getStreetName();", "function getFieldStreetAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sstreet');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sstreet');\n\t\t$tooltip = setToolTipNotification(\"sstreet\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sstreet') === 'sstreet' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='sstreetNo' id='sstreetNo' value='\".$value1.\"' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='sstreetName' id='sstreetName' value='\".$value2.\"' size='12' class='srms-field \".(get_axl_req_fields('sstreet') === 'sstreet' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function get_formatted_address() {\n\n\t\t\t$address_parts = array(\n\t\t\t\t'store' => '<br/>',\n\t\t\t\t'address' => '<br/>',\n\t\t\t\t'address2' => '<br/>',\n\t\t\t\t'city' => ', ',\n\t\t\t\t'state' => ' ',\n\t\t\t\t'zip' => '<br/>',\n\t\t\t\t'country' => '',\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_address_elements\n\t\t\t *\n\t\t\t * @params string[] and array of the property names (key) and after-field suffix (value) we want to use to build the string.\n\t\t\t *\n\t\t\t * @return string[] modified list of property names\n\t\t\t */\n\t\t\t$address_parts = apply_filters( 'slp_formatted_location_address_elements', $address_parts );\n\n\t\t\t// Get the valid non-empty properties.\n\t\t\t//\n\t\t\t$valid_parts = array();\n\t\t\tforeach ( $address_parts as $property => $suffix ) {\n\t\t\t\tif ( property_exists( $this, $property ) && ( ! empty ( $this->$property ) ) ) {\n\t\t\t\t\t$valid_parts[] = $this->$property . $suffix;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * FILTER: slp_formatted_location_address\n\t\t\t *\n\t\t\t * @params string the formatted name\n\t\t\t *\n\t\t\t * @return string the modified name\n\t\t\t */\n\t\t\treturn apply_filters( 'slp_formatted_location_address', join( ' ', $valid_parts ) );\n\t\t}", "public function getFullAddress() {\n $address = '';\n if (isset($this->street)) {\n $address .= $this->street . ', ';\n }\n\n if (isset($this->postcode)) {\n $address .= $this->postcode . ' ';\n }\n\n if (isset($this->city)) {\n $address .= $this->city . ', ';\n }\n\n// if (isset($this->state)) {\n// $address .= $this->state . ', ';\n// }\n\n if (isset($this->country)) {\n $address .= trans('countries.' . $this->country);\n }\n\n return $address;\n }", "function getFieldPortalAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_street');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_street');\n\t\t$tooltip = setToolTipNotification(\"street\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('street') === 'street' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='streetNo' value='\".$value1.\"' id='streetNo' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='streetName' value='\".$value2.\"' id='streetName' size='12' class='srms-field \".(get_axl_req_fields('street') === 'street' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function recurlyAddress()\n {\n return [\n 'phone' => '+4912345678901',\n 'street1' => 'Eine Strasse 1',\n 'street2' => '',\n 'city' => 'Berlin',\n 'region' => 'Berlin',\n 'postal_code' => '13409',\n 'country' => 'DE',\n ];\n }", "function getAddress($str){\n $street = preg_match_all('/<span itemprop=\\\"streetAddress\\\">(.*?)<\\/span>/s', $str, $streetInfo);\n $city = preg_match_all('/<span itemprop=\\\"addressLocality\\\">(.*?)<\\/span>/s', $str, $cityInfo);\n $state = preg_match_all('/<span itemprop=\\\"addressRegion\\\">(.*?)<\\/span>/s', $str, $stateInfo);\n $country = preg_match_all('/<span itemprop=\\\"addressCountry\\\">(.*?)<\\/span>/s', $str, $countryInfo);\n $postalCode = preg_match_all('/<span itemprop=\\\"postalCode\\\">(.*?)<\\/span>/s', $str, $zipInfo);\n $telephone = preg_match_all('/<span itemprop=\\\"telephone\\\">(.*?)<\\/span>/s', $str, $telephoneInfo);\n $Address['street'] = strip_tags($streetInfo[0][0]);\n $Address['city'] = strip_tags($cityInfo[0][0]);\n $Address['state'] = strip_tags($stateInfo[0][0]);\n $Address['country'] = strip_tags($countryInfo[0][0]);\n $Address['zipcode'] = strip_tags($zipInfo[0][0]);\n $telephone = strip_tags($telephoneInfo[0][0]);\n $Address['telephone'] = preg_replace('/\\D+/', '', $telephone);\n\n return $Address;\n}", "public static function generateAddress($property)\n {\n global $mainframe, $configClass;\n $configClass = OSPHelper::loadConfig();\n $address = array();\n $languages = self::getLanguages();\n $translatable = JLanguageMultilang::isEnabled() && count($languages);\n if($translatable){\n $property_address = self::getLanguageFieldValue($property,'address');\n }else{\n $property_address = $property->address;\n }\n\n if ((trim($property_address) != \"\") and ($property_address != \"&nbsp;\")) {\n $address[0] = trim($property_address);\n } else {\n $address[0] = \"\";\n }\n $address[1] = self::loadCityName($property->city);\n $address[2] = self::loadSateCode($property->state);\n $address[3] = $property->region;\n $address[4] = $property->postcode;\n\n $address_format = $configClass['address_format'];\n if ($address_format == \"\") { //default value\n $address_format = \"0,1,2,3,4\";\n }\n //echo $address_format;\n //echo $address_format;\n $returnAddress = array();\n $address_formatArr = explode(\",\", $address_format);\n for ($i = 0; $i < count($address_formatArr); $i++) {\n $item = $address_formatArr[$i];\n if ($address[$item] != \"\") {\n $returnAddress[] = $address[$item];\n }\n }\n if (HelperOspropertyCommon::checkCountry()) {\n $returnAddress[] = self::loadCountryName($property->country);\n }\n if (count($returnAddress) > 0) {\n return implode(\", \", $returnAddress);\n } else {\n return \"\";\n }\n }", "public function getNameAddr()\n {\n $addr = $this->long_name;\n\n if ($this->street1) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street1;\n }\n \n if ($this->street2) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street2;\n }\n \n if ($this->city) {\n if ($addr) $addr .= ', ';\n $addr .= $this->city;\n }\n \n if ($this->state) {\n if ($addr) $addr .= ', ';\n $addr .= $this->state;\n }\n \n if ($this->zip) {\n if ($addr) $addr .= ' ';\n $addr .= $this->zip;\n }\n \n return $addr;\n }", "public static function data_addresses() {\n\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'address' => '1175 Stony Park Witch Hazel, Nebraska 69258-4226',\n\t\t\t\t'phone' => '(308) 588-6126',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2854 Burning Pine Route Dog Corner, New Mexico 87313-2329',\n\t\t\t\t'phone' => '(505) 665-5353',\n\t\t\t\t'lat' => '35.76488',\n\t\t\t\t'lng' => '-108.1903059',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Broad Pond Edge Brown Shanty, Colorado 81686-3084',\n\t\t\t\t'phone' => '(303) 410-6031',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8711 Fallen By-pass Free, Arkansas 72968-5919',\n\t\t\t\t'phone' => '(479) 272-1089',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4987 Merry Fox Falls Speedsville, New Mexico 87609-9834',\n\t\t\t\t'phone' => '(505) 523-5318',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4338 Easy Lagoon Mews Finland, North Dakota 58905-5049',\n\t\t\t\t'phone' => '(701) 474-6073',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Cinder View Trace Deloraine, Michigan 48363-3520',\n\t\t\t\t'phone' => '(313) 089-6913',\n\t\t\t\t'lat' => '42.7664746',\n\t\t\t\t'lng' => '-83.1541796',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6613 Golden Corner Polecat Bay, South Carolina 29248-0849',\n\t\t\t\t'phone' => '(843) 922-1045',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '305 Jagged Grounds Estiffanulga, Minnesota 55180-3195',\n\t\t\t\t'phone' => '(320) 498-0046',\n\t\t\t\t'lat' => '46.729553',\n\t\t\t\t'lng' => '-94.6858998',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6860 Crystal Ridge Possum Trot, Tennessee 37454-4951',\n\t\t\t\t'phone' => '(931) 573-5387',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3551 Pleasant Point Glen Raven, District of Columbia 20054-8428',\n\t\t\t\t'phone' => '(202) 389-4349',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7199 Sunny Nook Paydown, Maine 04353-6633',\n\t\t\t\t'phone' => '(207) 674-4096',\n\t\t\t\t'lat' => '44.2238966',\n\t\t\t\t'lng' => '-69.6199357',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2743 Thunder Port Chestermere, Missouri 63937-5966',\n\t\t\t\t'phone' => '(417) 123-9433',\n\t\t\t\t'lat' => '36.9301095',\n\t\t\t\t'lng' => '-90.7722974',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3760 Silver Prairie Townline Tiger Tail, Utah 84609-2369',\n\t\t\t\t'phone' => '(435) 290-2684',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2546 Clear Bear Range Tunnel Hill, Wyoming 83067-1217',\n\t\t\t\t'phone' => '(307) 236-9552',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2758 Cotton Campus Swindleville, Oklahoma 73758-8899',\n\t\t\t\t'phone' => '(580) 622-1215',\n\t\t\t\t'lat' => '36.9587896',\n\t\t\t\t'lng' => '-98.068343',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9000 Indian Embers Trail Little Water, North Dakota 58269-0906',\n\t\t\t\t'phone' => '(701) 719-4564',\n\t\t\t\t'lat' => '48.6914843',\n\t\t\t\t'lng' => '-98.165204',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '544 Noble Mountain Dell Ste. Rose du Lac, Nevada 88962-4758',\n\t\t\t\t'phone' => '(775) 731-8736',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6074 Emerald Gate Passage Waggy, Louisiana 70677-4881',\n\t\t\t\t'phone' => '(225) 476-0583',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9159 Hazy Zephyr Moor Gravesend, Vermont 05333-5210',\n\t\t\t\t'phone' => '(802) 410-3565',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9919 Green Wagon Impasse Manifest, Hawaii 96717-8463',\n\t\t\t\t'phone' => '(808) 083-9986',\n\t\t\t\t'lat' => '21.5707975',\n\t\t\t\t'lng' => '-157.8927472',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1355 Blue Cove Scooba, Maine 04243-6502',\n\t\t\t\t'phone' => '(207) 298-7328',\n\t\t\t\t'lat' => '44.1',\n\t\t\t\t'lng' => '-70.22',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6356 Sleepy Chase Zipperlandville, Illinois 61835-9234',\n\t\t\t\t'phone' => '(815) 108-7735',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2531 Rustic Anchor Acres Hungry Hill, Maryland 20768-4906',\n\t\t\t\t'phone' => '(240) 370-9692',\n\t\t\t\t'lat' => '39',\n\t\t\t\t'lng' => '-76.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9957 Gentle Arbor Irricana, Delaware 19897-5853',\n\t\t\t\t'phone' => '(302) 440-8338',\n\t\t\t\t'lat' => '39.7856696',\n\t\t\t\t'lng' => '-75.5461494',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3187 High Promenade Fairdealing, Nebraska 69508-1675',\n\t\t\t\t'phone' => '(531) 725-6138',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6337 Amber Bend Funny River, Illinois 62817-4327',\n\t\t\t\t'phone' => '(217) 557-9408',\n\t\t\t\t'lat' => '37.9788798',\n\t\t\t\t'lng' => '-88.4500789',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9266 Shady Willow Cape Antlers, Alaska 99623-7664',\n\t\t\t\t'phone' => '(907) 409-4067',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Bright Goose Pike Big Black, Arkansas 71766-8350',\n\t\t\t\t'phone' => '(870) 377-6554',\n\t\t\t\t'lat' => '33.7046265',\n\t\t\t\t'lng' => '-92.4801989',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4111 Dewy Oak Manor Tennis, Massachusetts 02575-2415',\n\t\t\t\t'phone' => '(774) 709-4623',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '847 Rocky Cider Mountain Smoke Tree, North Carolina 28828-1331',\n\t\t\t\t'phone' => '(910) 433-1420',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7617 Wishing Brook Close Red Scaffold, Indiana 46881-1212',\n\t\t\t\t'phone' => '(574) 444-1553',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2480 Foggy Common Ragged Top, Washington 98961-5250',\n\t\t\t\t'phone' => '(360) 421-1646',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3492 Grand Forest Khwunrghunme, Michigan 49756-9037',\n\t\t\t\t'phone' => '(734) 937-3419',\n\t\t\t\t'lat' => '44.8212897',\n\t\t\t\t'lng' => '-84.3121264',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7416 Little Sky Freeway Rockglen, District of Columbia 20019-1929',\n\t\t\t\t'phone' => '(202) 237-8148',\n\t\t\t\t'lat' => '38.8910932',\n\t\t\t\t'lng' => '-76.947022',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9615 Iron Gate Four Locks, Nevada 89913-4822',\n\t\t\t\t'phone' => '(775) 426-4311',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6148 Old Diversion Tuggleville, Massachusetts 02337-2879',\n\t\t\t\t'phone' => '(857) 963-7280',\n\t\t\t\t'lat' => '42.0135823',\n\t\t\t\t'lng' => '-70.9618707',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6296 Quiet Limits Fort Nonsense, Alabama 35677-0818',\n\t\t\t\t'phone' => '(334) 098-7277',\n\t\t\t\t'lat' => '34.9568241',\n\t\t\t\t'lng' => '-88.0314174',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8939 Hidden Shadow Farms Granum, Connecticut 06587-8468',\n\t\t\t\t'phone' => '(475) 803-0416',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9165 Umber Horse Lane Pukwana, Utah 84914-5320',\n\t\t\t\t'phone' => '(801) 644-3244',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8216 Dusty Meadow India, Idaho 83960-6689',\n\t\t\t\t'phone' => '(208) 435-1588',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2405 Velvet Place Rob Roy, Oklahoma 74463-5905',\n\t\t\t\t'phone' => '(580) 100-1857',\n\t\t\t\t'lat' => '35.7558792',\n\t\t\t\t'lng' => '-95.5551652',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2739 Tawny Hills Harbour Kansas City, Minnesota 55068-2994',\n\t\t\t\t'phone' => '(763) 680-7609',\n\t\t\t\t'lat' => '44.7530325',\n\t\t\t\t'lng' => '-93.0776568',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3633 Round Elk Street Lick Fork, Colorado 80247-7628',\n\t\t\t\t'phone' => '(303) 519-5784',\n\t\t\t\t'lat' => '39.6974551',\n\t\t\t\t'lng' => '-104.8746508',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5392 Harvest Log Villas Beantown, Virginia 24261-9429',\n\t\t\t\t'phone' => '(757) 666-1162',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3766 Red Quail Expressway Sopchoppy, Missouri 65567-6848',\n\t\t\t\t'phone' => '(660) 947-1822',\n\t\t\t\t'lat' => '37.8343507',\n\t\t\t\t'lng' => '-92.5495112',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5648 Honey Hill Fair Play, Nevada 89530-3031',\n\t\t\t\t'phone' => '(775) 838-1520',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6422 Fallen Fox Dell Uchi, Rhode Island 02952-2526',\n\t\t\t\t'phone' => '(401) 087-8528',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2316 Cinder Sky Moor Morning View, New Mexico 87980-3617',\n\t\t\t\t'phone' => '(505) 298-8521',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2219 Quiet Embers Thicket Seven Oaks, Louisiana 70773-8954',\n\t\t\t\t'phone' => '(318) 793-9794',\n\t\t\t\t'lat' => '30.6070469',\n\t\t\t\t'lng' => '-91.3710402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9442 Rustic Concession Kidtown, Illinois 61570-6195',\n\t\t\t\t'phone' => '(217) 402-8450',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1909 Cozy Via Hooker Corner, Utah 84719-1105',\n\t\t\t\t'phone' => '(385) 721-9721',\n\t\t\t\t'lat' => '37.6775836',\n\t\t\t\t'lng' => '-112.8343844',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2904 Heather Quail View Ernfold, Florida 34857-4872',\n\t\t\t\t'phone' => '(305) 192-2293',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9839 Harvest Terrace Ohiopyle, Wyoming 82363-8477',\n\t\t\t\t'phone' => '(307) 786-6676',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5298 Gentle Harbour Swamp Fox, Arizona 85258-7476',\n\t\t\t\t'phone' => '(480) 945-9607',\n\t\t\t\t'lat' => '33.5669912',\n\t\t\t\t'lng' => '-111.8985922',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9469 Thunder Port Forget, West Virginia 25796-2759',\n\t\t\t\t'phone' => '(304) 930-4028',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7187 Hazy Private Birtle, Alabama 35219-5488',\n\t\t\t\t'phone' => '(256) 624-0268',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1033 Bright Forest Shin Hollow, New York 12454-5275',\n\t\t\t\t'phone' => '(718) 871-5723',\n\t\t\t\t'lat' => '42.2910991',\n\t\t\t\t'lng' => '-74.1592278',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4634 Old Branch Heath Crumrod, Washington 99353-4257',\n\t\t\t\t'phone' => '(360) 093-9697',\n\t\t\t\t'lat' => '46.4132585',\n\t\t\t\t'lng' => '-119.4197414',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '428 Wishing Park Frostproof, Oregon 97948-9195',\n\t\t\t\t'phone' => '(458) 093-6584',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8095 Silent Autumn Mews Summertime, Oklahoma 73173-9098',\n\t\t\t\t'phone' => '(580) 064-3854',\n\t\t\t\t'lat' => '35.3364517',\n\t\t\t\t'lng' => '-97.6222665',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3838 Cotton Bend Rapture, District of Columbia 20092-1246',\n\t\t\t\t'phone' => '(202) 408-8807',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '136 Green Prairie By-pass Chappaquiddick, Alabama 35143-8644',\n\t\t\t\t'phone' => '(334) 878-7089',\n\t\t\t\t'lat' => '33.0991185',\n\t\t\t\t'lng' => '-86.5602614',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6744 Foggy Panda Hollow Four Bears Village, Massachusetts 01836-1710',\n\t\t\t\t'phone' => '(339) 877-5101',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Pleasant Cloud Corners Bucklesberry, Texas 79634-2471',\n\t\t\t\t'phone' => '(430) 045-9307',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7739 Golden Leaf Highway Sixes, California 94802-8145',\n\t\t\t\t'phone' => '(408) 759-3038',\n\t\t\t\t'lat' => '37.94',\n\t\t\t\t'lng' => '-122.36',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7761 Quaking Cove Waldheim, Alabama 36811-9935',\n\t\t\t\t'phone' => '(256) 439-3656',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2016 Honey Downs Lunenburg, Alabama 36444-4744',\n\t\t\t\t'phone' => '(334) 539-9475',\n\t\t\t\t'lat' => '31.6711853',\n\t\t\t\t'lng' => '-87.4405786',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4862 Jagged Goose Woods Hog Eye, Idaho 83723-2986',\n\t\t\t\t'phone' => '(208) 870-7519',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3085 Blue Hickory Quay Bell Buckle, Massachusetts 01800-4101',\n\t\t\t\t'phone' => '(508) 992-6644',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1970 Round Freeway Frog Town, Washington 98616-3325',\n\t\t\t\t'phone' => '(253) 244-8709',\n\t\t\t\t'lat' => '46.1794789',\n\t\t\t\t'lng' => '-122.1561155',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3350 Emerald Expressway Hardup, Rhode Island 02983-8455',\n\t\t\t\t'phone' => '(401) 829-1654',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4668 Dusty Spring Link Lampadocia, Florida 33678-2548',\n\t\t\t\t'phone' => '(850) 277-3318',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5044 Rocky Falls Scratch Ankle, Massachusetts 02233-6502',\n\t\t\t\t'phone' => '(339) 608-9455',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4990 Indian Run Jumbo Landing, Kansas 66264-6247',\n\t\t\t\t'phone' => '(913) 450-8901',\n\t\t\t\t'lat' => '39.011902',\n\t\t\t\t'lng' => '-98.4842465',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5366 Iron Round Hardmoney, Mississippi 38651-2412',\n\t\t\t\t'phone' => '(228) 415-6114',\n\t\t\t\t'lat' => '34.8955106',\n\t\t\t\t'lng' => '-90.0466559',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9587 Noble Fawn Wood Silton, Utah 84515-3673',\n\t\t\t\t'phone' => '(435) 680-2014',\n\t\t\t\t'lat' => '38.911433',\n\t\t\t\t'lng' => '-109.140438',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7947 Tawny Bank Glen Campbell, New Jersey 08965-3916',\n\t\t\t\t'phone' => '(908) 243-5474',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4086 Shady Swale Symbol, Connecticut 06452-9480',\n\t\t\t\t'phone' => '(860) 816-1261',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5450 Red Point Thankful, District of Columbia 20085-4124',\n\t\t\t\t'phone' => '(202) 097-4695',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8648 Sunny Abbey Poysippi, Arkansas 71807-9239',\n\t\t\t\t'phone' => '(479) 685-9599',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9671 Amber Meadow Bullhead City, Connecticut 06195-6843',\n\t\t\t\t'phone' => '(475) 181-4842',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1003 Velvet Passage Swamproot, Florida 32977-8675',\n\t\t\t\t'phone' => '(305) 352-4895',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1822 Clear Rabbit Heights Hardscrabble Corner, Maryland 21902-5168',\n\t\t\t\t'phone' => '(240) 459-3194',\n\t\t\t\t'lat' => '39.5519225',\n\t\t\t\t'lng' => '-76.0667488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Red Cape Jumbotown, South Dakota 57009-7025',\n\t\t\t\t'phone' => '(605) 051-3665',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1736 Lost Lake Private Apponagansett, Colorado 81664-5410',\n\t\t\t\t'phone' => '(719) 056-7029',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3840 Easy Bend Village Thirteen, North Carolina 28961-7505',\n\t\t\t\t'phone' => '(828) 335-6063',\n\t\t\t\t'lat' => '33.9790349',\n\t\t\t\t'lng' => '-81.0094511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4449 Emerald Goose Corner White Swan, Delaware 19914-5031',\n\t\t\t\t'phone' => '(302) 768-7121',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1726 Iron Pond Key Farewell, Utah 84430-5042',\n\t\t\t\t'phone' => '(801) 997-1471',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7984 Hidden Hills Route Radical, Maryland 21826-2709',\n\t\t\t\t'phone' => '(301) 118-3207',\n\t\t\t\t'lat' => '38.319091',\n\t\t\t\t'lng' => '-75.6237184',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '254 Jagged Grove Towers Skokomish, Michigan 49764-5965',\n\t\t\t\t'phone' => '(810) 808-1222',\n\t\t\t\t'lat' => '45.4227613',\n\t\t\t\t'lng' => '-84.8275195',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7013 Amber Butterfly Carrefour White Iron, Alabama 36391-7622',\n\t\t\t\t'phone' => '(251) 184-2094',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2152 Foggy Brook Turnabout Hangman Crossing, Connecticut 06556-8181',\n\t\t\t\t'phone' => '(203) 471-8901',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3522 Stony Timber Swale Little Black, Nebraska 68531-8030',\n\t\t\t\t'phone' => '(531) 896-6498',\n\t\t\t\t'lat' => '40.8991047',\n\t\t\t\t'lng' => '-96.722641',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5903 Velvet Log Square Tingle, Nevada 89258-0703',\n\t\t\t\t'phone' => '(775) 480-4956',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1666 Tawny Hickory Bay Quoddy, South Carolina 29810-1362',\n\t\t\t\t'phone' => '(864) 760-6510',\n\t\t\t\t'lat' => '32.98209',\n\t\t\t\t'lng' => '-81.3619402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '549 Golden Cider Moor Changewater, Idaho 83736-4490',\n\t\t\t\t'phone' => '(208) 757-6906',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6342 Sunny Embers Trail Nickajack, Louisiana 71225-2282',\n\t\t\t\t'phone' => '(337) 704-5874',\n\t\t\t\t'lat' => '32.5040767',\n\t\t\t\t'lng' => '-92.3517526',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '870 Round Circuit Crumrod, North Dakota 58569-6155',\n\t\t\t\t'phone' => '(701) 752-7907',\n\t\t\t\t'lat' => '46.2326345',\n\t\t\t\t'lng' => '-101.2387062',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Gentle Run Mudtavern, South Dakota 57420-4755',\n\t\t\t\t'phone' => '(605) 329-6911',\n\t\t\t\t'lat' => '45.2565588',\n\t\t\t\t'lng' => '-100.162177',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7000 Honey Fox Ridge Asphaltum, Oklahoma 74163-8162',\n\t\t\t\t'phone' => '(918) 254-3808',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5404 Thunder Vale Paydown, Utah 84529-9748',\n\t\t\t\t'phone' => '(801) 496-4369',\n\t\t\t\t'lat' => '39.7235022',\n\t\t\t\t'lng' => '-110.7956878',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5715 Harvest Gate Vista Perennial, Massachusetts 01775-4618',\n\t\t\t\t'phone' => '(351) 819-4468',\n\t\t\t\t'lat' => '42.4195323',\n\t\t\t\t'lng' => '-71.5130445',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3792 Misty Forest Loop Nanatlugunyi, Florida 34626-6008',\n\t\t\t\t'phone' => '(561) 250-4253',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8967 Wishing Robin Abbey Delightful, California 91223-0883',\n\t\t\t\t'phone' => '(858) 369-2837',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7881 Clear Deer Orchard Earth City, North Carolina 28790-1923',\n\t\t\t\t'phone' => '(334) 742-0656',\n\t\t\t\t'lat' => '35.2122099',\n\t\t\t\t'lng' => '-82.4861053',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1424 Blue Freeway Calypso, Oregon 97366-8616',\n\t\t\t\t'phone' => '(541) 518-7818',\n\t\t\t\t'lat' => '44.5772172',\n\t\t\t\t'lng' => '-124.053674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6984 Green Crest Comet, Colorado 80879-7122',\n\t\t\t\t'phone' => '(303) 805-7076',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3444 Merry Zephyr Bank St. Anthony, Maryland 21537-8641',\n\t\t\t\t'phone' => '(240) 544-8665',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2369 Noble Link Pilchuck, Mississippi 38792-0814',\n\t\t\t\t'phone' => '(769) 452-9691',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1272 Colonial Woods California, District of Columbia 20026-2848',\n\t\t\t\t'phone' => '(202) 663-3795',\n\t\t\t\t'lat' => '38.88546',\n\t\t\t\t'lng' => '-77.02612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2483 Cinder Blossom Townline Smittle, Michigan 48648-1860',\n\t\t\t\t'phone' => '(586) 711-0904',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4352 Sleepy Acres Turkey Foot Corner, Arizona 85149-8474',\n\t\t\t\t'phone' => '(480) 488-6822',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2334 Broad Centre Quebec, Arkansas 72840-9638',\n\t\t\t\t'phone' => '(870) 138-9435',\n\t\t\t\t'lat' => '35.4784895',\n\t\t\t\t'lng' => '-93.6319131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '926 Silver Rabbit Heath Biggar, Wyoming 82485-7427',\n\t\t\t\t'phone' => '(307) 598-8660',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2095 Dewy Valley Poland, North Carolina 28675-0245',\n\t\t\t\t'phone' => '(828) 268-1449',\n\t\t\t\t'lat' => '36.517185',\n\t\t\t\t'lng' => '-81.1416691',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9664 Heather Apple Lane Rock Run, Ohio 44631-4798',\n\t\t\t\t'phone' => '(567) 477-8961',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4413 Cotton Passage Money Creek, South Dakota 57464-6212',\n\t\t\t\t'phone' => '(605) 769-3389',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '498 Grand Autumn Manor Sinks, Maryland 21080-2555',\n\t\t\t\t'phone' => '(240) 883-6381',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4880 Cozy Bluff Wynd Dime, Wyoming 82623-0557',\n\t\t\t\t'phone' => '(307) 789-9254',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1631 Bright Pointe Atlantic, Montana 59633-0116',\n\t\t\t\t'phone' => '(406) 254-9193',\n\t\t\t\t'lat' => '46.8567824',\n\t\t\t\t'lng' => '-112.3514774',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1882 Amber Quay Stamping Ground, Nevada 89168-3744',\n\t\t\t\t'phone' => '(702) 523-2993',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1184 Honey Rabbit Byway Security, Rhode Island 02976-3161',\n\t\t\t\t'phone' => '(401) 196-3344',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7312 Rustic Shadow Crescent Quispamsis, Missouri 64437-0634',\n\t\t\t\t'phone' => '(573) 055-5313',\n\t\t\t\t'lat' => '40.1640348',\n\t\t\t\t'lng' => '-95.3730176',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4235 Easy Hollow Terramuggus, Massachusetts 01190-1126',\n\t\t\t\t'phone' => '(339) 768-8087',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3275 Bright Rise Tobin Lake, Missouri 63434-6747',\n\t\t\t\t'phone' => '(636) 770-5547',\n\t\t\t\t'lat' => '39.9029582',\n\t\t\t\t'lng' => '-91.9685826',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6974 Lazy Hickory Lookout Bingo Creek Landing, Ohio 43915-4308',\n\t\t\t\t'phone' => '(330) 540-7539',\n\t\t\t\t'lat' => '39.7283144',\n\t\t\t\t'lng' => '-80.9207737',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9571 Iron Impasse Speedway, Kentucky 41048-7538',\n\t\t\t\t'phone' => '(270) 173-4041',\n\t\t\t\t'lat' => '39.0871388',\n\t\t\t\t'lng' => '-84.7211074',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3955 Silent Autumn Port Fairbanks, North Carolina 28288-9288',\n\t\t\t\t'phone' => '(704) 022-2545',\n\t\t\t\t'lat' => '35.2299999',\n\t\t\t\t'lng' => '-80.84',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6612 Rocky Square Wink, New Mexico 88011-7952',\n\t\t\t\t'phone' => '(575) 508-3628',\n\t\t\t\t'lat' => '32.3035838',\n\t\t\t\t'lng' => '-106.6055534',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7468 Merry Glade Wynyard, Oklahoma 74155-6173',\n\t\t\t\t'phone' => '(918) 189-7319',\n\t\t\t\t'lat' => '36.1',\n\t\t\t\t'lng' => '-95.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8814 Blue Bank Chickahominy, Rhode Island 02870-2801',\n\t\t\t\t'phone' => '(401) 398-9638',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7805 Misty Estates Orderville, Arizona 85006-4165',\n\t\t\t\t'phone' => '(480) 709-9395',\n\t\t\t\t'lat' => '33.4636012',\n\t\t\t\t'lng' => '-112.0535987',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8128 Colonial View Jetty Ruff, Alaska 99974-7657',\n\t\t\t\t'phone' => '(907) 844-0966',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2915 Quiet Log Run Conquest Beach, Pennsylvania 19688-3627',\n\t\t\t\t'phone' => '(570) 679-4418',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8984 Crystal Village Box Ankle, Arizona 86462-7020',\n\t\t\t\t'phone' => '(602) 319-0178',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6651 Jagged Quail Parade Kaihon Kug, Minnesota 56043-3914',\n\t\t\t\t'phone' => '(320) 120-3165',\n\t\t\t\t'lat' => '43.6400477',\n\t\t\t\t'lng' => '-93.2281983',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2721 Umber Goose Inlet Whipup, California 90450-4108',\n\t\t\t\t'phone' => '(310) 337-3085',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2346 Grand Embers Autoroute Pee Dee, Delaware 19827-5252',\n\t\t\t\t'phone' => '(302) 130-8743',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1014 Tawny Barn Campus Moab, Wisconsin 54395-8609',\n\t\t\t\t'phone' => '(715) 451-7568',\n\t\t\t\t'lat' => '43.7844397',\n\t\t\t\t'lng' => '-88.7878678',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4766 Middle Apple Walk Mctaggart, Georgia 39974-6914',\n\t\t\t\t'phone' => '(770) 180-8724',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1357 Stony Spring Falls Pyro, Minnesota 56430-2366',\n\t\t\t\t'phone' => '(651) 112-8227',\n\t\t\t\t'lat' => '46.24',\n\t\t\t\t'lng' => '-93.27',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '741 Little Road Hotchkissville, South Carolina 29980-2982',\n\t\t\t\t'phone' => '(803) 271-1505',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4800 Indian Abbey Blowing Rocks, Indiana 46110-0404',\n\t\t\t\t'phone' => '(317) 118-3274',\n\t\t\t\t'lat' => '39.5487322',\n\t\t\t\t'lng' => '-85.899783',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7564 Hazy End Quonochontaug, Iowa 50994-1984',\n\t\t\t\t'phone' => '(641) 188-5763',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8297 Green Fox Boulevard Oskaloosa, Delaware 19768-0727',\n\t\t\t\t'phone' => '(302) 991-2140',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3485 High Elk Highlands Alabama, Illinois 60056-5509',\n\t\t\t\t'phone' => '(630) 741-5152',\n\t\t\t\t'lat' => '42.0646736',\n\t\t\t\t'lng' => '-87.9383822',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1086 Sleepy River Highway Deep Tunnel, Nebraska 69944-7258',\n\t\t\t\t'phone' => '(402) 487-2266',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4287 Hidden Pathway Dogs Corners, Texas 77703-3455',\n\t\t\t\t'phone' => '(214) 064-5285',\n\t\t\t\t'lat' => '30.1123243',\n\t\t\t\t'lng' => '-94.1053307',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9353 Broad Lake Green Magic City, Connecticut 06944-8343',\n\t\t\t\t'phone' => '(860) 742-6128',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '837 Pleasant Leaf Mountain Badwater, Michigan 49485-3681',\n\t\t\t\t'phone' => '(989) 918-6526',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '39 Heather Deer Terrace Thumpertown Beach, South Carolina 29522-8274',\n\t\t\t\t'phone' => '(864) 481-1621',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3339 Old Bear Pike Pierceland, South Dakota 57415-3788',\n\t\t\t\t'phone' => '(605) 629-5218',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8761 Red Pines Rice City, Washington 99321-1500',\n\t\t\t\t'phone' => '(206) 943-5709',\n\t\t\t\t'lat' => '46.8302172',\n\t\t\t\t'lng' => '-119.9753806',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7767 Silver Alley Noordeloos, Iowa 51745-0727',\n\t\t\t\t'phone' => '(641) 192-2090',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1435 Fallen Mountain Vale Fond du Lac, Virginia 22856-9291',\n\t\t\t\t'phone' => '(757) 141-8626',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2933 Sunny Lagoon Carrefour Tok, Alabama 36623-1322',\n\t\t\t\t'phone' => '(251) 692-9694',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2269 Green Estates Lancer, Virginia 23433-5801',\n\t\t\t\t'phone' => '(276) 386-1910',\n\t\t\t\t'lat' => '36.9096727',\n\t\t\t\t'lng' => '-76.4736602',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5102 Crystal Campus Africa, Arkansas 72941-1369',\n\t\t\t\t'phone' => '(501) 425-6290',\n\t\t\t\t'lat' => '35.3406757',\n\t\t\t\t'lng' => '-94.1718542',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6263 Dusty Via Westlock, North Carolina 27880-2868',\n\t\t\t\t'phone' => '(252) 729-9770',\n\t\t\t\t'lat' => '35.7274657',\n\t\t\t\t'lng' => '-78.1222336',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '901 Emerald Dale Trail Tropic, Alabama 36195-8065',\n\t\t\t\t'phone' => '(256) 750-0498',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9909 Stony Treasure Run Bowlegs, New York 14280-7238',\n\t\t\t\t'phone' => '(718) 645-5353',\n\t\t\t\t'lat' => '42.88',\n\t\t\t\t'lng' => '-78.83',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '375 Grand Circuit Big Lick, North Dakota 58673-0849',\n\t\t\t\t'phone' => '(701) 249-6415',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6622 Shady Willow Extension Singing Brook, Florida 34850-0832',\n\t\t\t\t'phone' => '(904) 520-9731',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3788 Golden Path Ouzinkie, Nevada 89414-0520',\n\t\t\t\t'phone' => '(702) 834-3786',\n\t\t\t\t'lat' => '41.0357702',\n\t\t\t\t'lng' => '-117.1264753',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2770 Hidden Leaf Autoroute Skin Corner, Wisconsin 53103-7447',\n\t\t\t\t'phone' => '(414) 483-1760',\n\t\t\t\t'lat' => '42.8791805',\n\t\t\t\t'lng' => '-88.2169027',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4453 Cinder Island Stead Oblong, Washington 98115-4132',\n\t\t\t\t'phone' => '(509) 550-3940',\n\t\t\t\t'lat' => '47.6849444',\n\t\t\t\t'lng' => '-122.2982224',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3154 Easy Beacon Grounds Queonemysing, Rhode Island 02899-2050',\n\t\t\t\t'phone' => '(401) 107-0559',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5753 Umber Blossom Close Broomtown, Nebraska 68105-7145',\n\t\t\t\t'phone' => '(531) 625-0429',\n\t\t\t\t'lat' => '41.2418116',\n\t\t\t\t'lng' => '-95.9673967',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5314 Colonial Shadow Green Okahta Talaia, West Virginia 26565-0046',\n\t\t\t\t'phone' => '(304) 871-6111',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7366 Gentle Gate Pines Anaconda, Pennsylvania 17700-1378',\n\t\t\t\t'phone' => '(878) 984-2742',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6390 Amber Hills Range Chiawuli Tak, Alaska 99585-0460',\n\t\t\t\t'phone' => '(907) 482-1567',\n\t\t\t\t'lat' => '61.9319969',\n\t\t\t\t'lng' => '-162.2708169',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9656 Blue Goose Passage Bootjack, District of Columbia 20050-2319',\n\t\t\t\t'phone' => '(202) 047-2431',\n\t\t\t\t'lat' => '38.9',\n\t\t\t\t'lng' => '-77.04',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3292 Dewy Fox Square Gassaway, Mississippi 38750-3303',\n\t\t\t\t'phone' => '(662) 414-3997',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3621 Lost Barn Key Turkey Scratch, Nebraska 68376-3092',\n\t\t\t\t'phone' => '(308) 123-0375',\n\t\t\t\t'lat' => '40.1975037',\n\t\t\t\t'lng' => '-95.940971',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '779 Quaking Bend Pink Arrow, Maine 04229-9316',\n\t\t\t\t'phone' => '(207) 751-1259',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '859 Little Place Prairie Queen, South Carolina 29009-4151',\n\t\t\t\t'phone' => '(864) 042-0986',\n\t\t\t\t'lat' => '34.4614628',\n\t\t\t\t'lng' => '-80.3881333',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5454 Burning Apple Plaza Montmartre, Indiana 47837-8211',\n\t\t\t\t'phone' => '(317) 656-5951',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3019 Tawny Nectar Canyon Twentysix, Rhode Island 02953-3262',\n\t\t\t\t'phone' => '(401) 205-0347',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1693 Heather Park Choccolocco, Nevada 89121-6915',\n\t\t\t\t'phone' => '(702) 497-5280',\n\t\t\t\t'lat' => '36.1165487',\n\t\t\t\t'lng' => '-115.0881146',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4694 Harvest Grove Cape Farmlife, Delaware 19851-7155',\n\t\t\t\t'phone' => '(302) 677-0905',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6793 Noble Prairie Farm Cheesequake, South Carolina 29321-0502',\n\t\t\t\t'phone' => '(843) 039-9935',\n\t\t\t\t'lat' => '34.7346757',\n\t\t\t\t'lng' => '-81.7130522',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7422 Lazy Ridge Possum Bluff, North Dakota 58730-0556',\n\t\t\t\t'phone' => '(701) 951-9221',\n\t\t\t\t'lat' => '48.8755921',\n\t\t\t\t'lng' => '-103.3383503',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9342 Round Rabbit Gate Latexo, Ohio 44353-0469',\n\t\t\t\t'phone' => '(740) 126-5652',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9030 Red Abbey Pointblank, Oregon 97693-1636',\n\t\t\t\t'phone' => '(458) 273-1218',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7 High Mountain Glade Pontiac, Arizona 86330-0582',\n\t\t\t\t'phone' => '(928) 447-4570',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5726 Fallen Embers Thicket Port Protection, Ohio 44035-5738',\n\t\t\t\t'phone' => '(740) 066-8548',\n\t\t\t\t'lat' => '41.3534148',\n\t\t\t\t'lng' => '-82.1496049',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5589 Thunder Point Wawota, Louisiana 71490-1808',\n\t\t\t\t'phone' => '(985) 711-3587',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8346 Silver Limits Battle Mountain, New York 12016-4484',\n\t\t\t\t'phone' => '(347) 919-0371',\n\t\t\t\t'lat' => '42.93',\n\t\t\t\t'lng' => '-74.3199999',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5933 Quiet Valley Ko Ko, Colorado 81549-9872',\n\t\t\t\t'phone' => '(719) 129-0748',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5148 Clear Vale Poor Town, Massachusetts 02575-2791',\n\t\t\t\t'phone' => '(339) 153-3036',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6704 Hazy Lookout Weed, Iowa 50719-6158',\n\t\t\t\t'phone' => '(712) 771-7469',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3575 Middle Drive Koggiung, Maryland 21558-6166',\n\t\t\t\t'phone' => '(443) 915-6824',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9365 Grand Pointe Nanton, New Jersey 07685-8905',\n\t\t\t\t'phone' => '(973) 220-5840',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9796 Cozy Cider Boulevard Weirdale, Rhode Island 02968-5568',\n\t\t\t\t'phone' => '(401) 569-3091',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5297 Merry Woods Mexican Hat, Arizona 86615-1139',\n\t\t\t\t'phone' => '(623) 535-6319',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7427 Jagged Brook Bank Ah Fong Village, South Dakota 57890-7849',\n\t\t\t\t'phone' => '(605) 276-0864',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '754 Tawny Pony Alley Ak-Chin Village, Pennsylvania 17528-2354',\n\t\t\t\t'phone' => '(878) 610-1011',\n\t\t\t\t'lat' => '40.1281362',\n\t\t\t\t'lng' => '-75.998932',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4504 Lost Pine Jetty Ashepoo, Indiana 46332-6909',\n\t\t\t\t'phone' => '(765) 658-9671',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7349 Wishing Pioneer Carrefour Fearnowville, Nebraska 69992-2859',\n\t\t\t\t'phone' => '(531) 755-7518',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8125 Sleepy Wagon Walk Quails Nest, Washington 98914-0393',\n\t\t\t\t'phone' => '(360) 759-8355',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4848 Rustic Creek Field Extra, Florida 32134-3480',\n\t\t\t\t'phone' => '(772) 410-4020',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9972 Red Island Parade Quinhagak, Arkansas 72321-2240',\n\t\t\t\t'phone' => '(870) 781-2491',\n\t\t\t\t'lat' => '35.8197959',\n\t\t\t\t'lng' => '-89.9323304',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6636 Crystal Chase Skidaway Island, Connecticut 06780-4384',\n\t\t\t\t'phone' => '(475) 727-7385',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6444 Pleasant Bluff Gate Axehandle, Arkansas 72928-3456',\n\t\t\t\t'phone' => '(479) 819-5947',\n\t\t\t\t'lat' => '35.2937406',\n\t\t\t\t'lng' => '-93.9368439',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9235 Blue Villas Half Hell, Washington 98641-6518',\n\t\t\t\t'phone' => '(206) 611-7946',\n\t\t\t\t'lat' => '46.5782535',\n\t\t\t\t'lng' => '-124.0028498',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6226 Cinder Quail Townline Ohoopee, Florida 32498-0673',\n\t\t\t\t'phone' => '(386) 072-5373',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4445 Harvest Timber Autoroute Sugar House, Tennessee 38360-7057',\n\t\t\t\t'phone' => '(931) 262-1016',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1977 Stony Fawn Stead Mervin, Virginia 22113-0967',\n\t\t\t\t'phone' => '(757) 167-5136',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1394 Noble Downs Flickersville, Idaho 83613-3584',\n\t\t\t\t'phone' => '(208) 823-5774',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5874 Hidden Common Ugashik, Delaware 19881-6924',\n\t\t\t\t'phone' => '(302) 305-4954',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9383 Gentle Grove Meadow Normalville, West Virginia 25919-8033',\n\t\t\t\t'phone' => '(681) 917-8401',\n\t\t\t\t'lat' => '37.8131224',\n\t\t\t\t'lng' => '-81.1835839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7371 Honey Sky Link Fort Spunky, Alabama 35100-5594',\n\t\t\t\t'phone' => '(334) 624-5222',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6632 High Lane Twisp, Louisiana 71003-4067',\n\t\t\t\t'phone' => '(985) 211-3060',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2365 Foggy Rise Swale Tribune, District of Columbia 20032-3585',\n\t\t\t\t'phone' => '(202) 865-0334',\n\t\t\t\t'lat' => '38.8372336',\n\t\t\t\t'lng' => '-77.0161436',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '293 Quiet Canyon Pondlick, Oklahoma 74029-6738',\n\t\t\t\t'phone' => '(405) 584-2135',\n\t\t\t\t'lat' => '36.832666',\n\t\t\t\t'lng' => '-95.8353837',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1074 Emerald Mall Archerwill, Maine 04935-6012',\n\t\t\t\t'phone' => '(207) 343-0489',\n\t\t\t\t'lat' => '44.4486337',\n\t\t\t\t'lng' => '-69.6062394',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6450 Little Robin Glade Pothook, Tennessee 38145-7689',\n\t\t\t\t'phone' => '(931) 676-3145',\n\t\t\t\t'lat' => '35.15',\n\t\t\t\t'lng' => '-90.05',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3990 Velvet Shadow Landing Crumpecker, Georgia 39823-3094',\n\t\t\t\t'phone' => '(762) 086-4610',\n\t\t\t\t'lat' => '31.3021309',\n\t\t\t\t'lng' => '-84.981754',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5560 Amber Highway Osoyoos, Colorado 81022-7656',\n\t\t\t\t'phone' => '(719) 296-9040',\n\t\t\t\t'lat' => '38.1345872',\n\t\t\t\t'lng' => '-104.4257533',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4068 Golden Moor High Lonesome Wells, Nevada 89929-1910',\n\t\t\t\t'phone' => '(775) 336-5382',\n\t\t\t\t'lat' => '41.1115888',\n\t\t\t\t'lng' => '-114.96449',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5720 Dewy Valley Tropic, Ohio 45591-1583',\n\t\t\t\t'phone' => '(216) 223-1805',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4649 Indian Oak Trace Cincinnati, Arkansas 72188-8555',\n\t\t\t\t'phone' => '(501) 108-3473',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4571 Dusty Crest Torquay, South Carolina 29071-4011',\n\t\t\t\t'phone' => '(843) 590-3879',\n\t\t\t\t'lat' => '33.9799999',\n\t\t\t\t'lng' => '-81.24',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '338 Rocky Nectar By-pass Slapneck, Idaho 83647-7054',\n\t\t\t\t'phone' => '(208) 458-6847',\n\t\t\t\t'lat' => '43.4969131',\n\t\t\t\t'lng' => '-115.5314511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9878 Thunder Arbor Kalifornsky, Arizona 86631-5352',\n\t\t\t\t'phone' => '(623) 658-2751',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5226 Shady Goose Impasse Alberton, Colorado 81299-4296',\n\t\t\t\t'phone' => '(970) 381-4534',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9048 Sleepy Dale Maze Lucky, Tennessee 37271-0904',\n\t\t\t\t'phone' => '(865) 587-0661',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8484 Foggy Canyon Delaware, Washington 98893-5880',\n\t\t\t\t'phone' => '(425) 905-3571',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7644 Dusty Lake Lookout Legal, Nevada 89531-1567',\n\t\t\t\t'phone' => '(702) 991-0236',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2965 Colonial Pond Byway Kabetogama, Oklahoma 73592-8085',\n\t\t\t\t'phone' => '(580) 099-9725',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7035 Amber Bank Big Timber, Montana 59099-3359',\n\t\t\t\t'phone' => '(406) 046-1326',\n\t\t\t\t'lat' => '45.8343543',\n\t\t\t\t'lng' => '-109.9540644',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4491 Quiet Port Indialantic, Maryland 21062-4405',\n\t\t\t\t'phone' => '(240) 553-5943',\n\t\t\t\t'lat' => '39.1599999',\n\t\t\t\t'lng' => '-76.63',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2907 Middle Anchor Row Scarce Grease, Delaware 19991-0100',\n\t\t\t\t'phone' => '(302) 649-3078',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3924 Gentle Inlet Suquamish, Arizona 86166-6269',\n\t\t\t\t'phone' => '(623) 883-2017',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9823 Umber Prairie Crossing Teaticket, Montana 59309-4514',\n\t\t\t\t'phone' => '(406) 118-8472',\n\t\t\t\t'lat' => '46.8796822',\n\t\t\t\t'lng' => '-110.3625658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '265 Noble Apple Forest Vermont, Georgia 39813-3675',\n\t\t\t\t'phone' => '(229) 050-5836',\n\t\t\t\t'lat' => '31.4035879',\n\t\t\t\t'lng' => '-84.6688348',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8866 Rocky Trace Four Bears Village, Illinois 60491-6196',\n\t\t\t\t'phone' => '(815) 414-5669',\n\t\t\t\t'lat' => '41.6131315',\n\t\t\t\t'lng' => '-87.962884',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1412 Cotton Bay Star, Oklahoma 74194-3598',\n\t\t\t\t'phone' => '(918) 954-0869',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9766 Clear Pony Hill Handsome Eddy, Arizona 86422-7832',\n\t\t\t\t'phone' => '(623) 376-5382',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2824 Quaking Cloud Ridge Sun Valley, Virginia 24342-7446',\n\t\t\t\t'phone' => '(804) 394-6011',\n\t\t\t\t'lat' => '33.6496426',\n\t\t\t\t'lng' => '-92.7743809',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6841 Indian Cider Path Welfare, New York 14291-2909',\n\t\t\t\t'phone' => '(646) 281-2945',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5451 Broad Shadow Range Zewapeta, Alabama 36223-8635',\n\t\t\t\t'phone' => '(256) 964-1223',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6326 Little Pines Lake of the Woods, Wyoming 82150-2725',\n\t\t\t\t'phone' => '(307) 203-4687',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5711 Blue Deer Private Bullet Hole, Missouri 65105-1282',\n\t\t\t\t'phone' => '(660) 895-5372',\n\t\t\t\t'lat' => '38.5',\n\t\t\t\t'lng' => '-92.15',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '283 Hidden Spring Wood Boot Jack, District of Columbia 20021-8192',\n\t\t\t\t'phone' => '(202) 730-6835',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2005 Old Towers Ahwatukee, North Dakota 58517-9863',\n\t\t\t\t'phone' => '(701) 623-1368',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '97 Easy Chase Thunder Hawk, Nevada 89426-3672',\n\t\t\t\t'phone' => '(775) 120-7206',\n\t\t\t\t'lat' => '41.5598843',\n\t\t\t\t'lng' => '-117.4086488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '751 Round Heath Bingo, Wyoming 82547-6473',\n\t\t\t\t'phone' => '(307) 934-0757',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Pleasant Avenue Tinkertown, California 92022-5662',\n\t\t\t\t'phone' => '(562) 143-2770',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1681 Silent Corners Ben Arnold, Massachusetts 01528-4491',\n\t\t\t\t'phone' => '(508) 951-3124',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4399 Cinder Key Minnehaha, Oregon 97070-3784',\n\t\t\t\t'phone' => '(971) 108-8608',\n\t\t\t\t'lat' => '45.3018169',\n\t\t\t\t'lng' => '-122.7751561',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Cozy Creek By-pass Telbasta, Iowa 50183-6396',\n\t\t\t\t'phone' => '(563) 119-5041',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8328 Jagged Abbey Turkeyfoot, South Dakota 57773-5048',\n\t\t\t\t'phone' => '(605) 557-3188',\n\t\t\t\t'lat' => '43.6076792',\n\t\t\t\t'lng' => '-103.5935897',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2335 Heather Grove Michigan Bar, Minnesota 56333-9494',\n\t\t\t\t'phone' => '(952) 500-4492',\n\t\t\t\t'lat' => '42.2663981',\n\t\t\t\t'lng' => '-83.7081315',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3991 Fallen Brook Cove Chi Chil Tah, Utah 84075-6499',\n\t\t\t\t'phone' => '(801) 958-0611',\n\t\t\t\t'lat' => '41.0541918',\n\t\t\t\t'lng' => '-112.1191757',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1105 Merry Barn Road Yaphank, Mississippi 39434-7368',\n\t\t\t\t'phone' => '(228) 295-0195',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8420 Stony Wagon Crest Runnymeade, Washington 98237-6997',\n\t\t\t\t'phone' => '(206) 831-6478',\n\t\t\t\t'lat' => '48.57163',\n\t\t\t\t'lng' => '-121.6648381',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9921 Grand Court Piddleville, Louisiana 70297-1882',\n\t\t\t\t'phone' => '(985) 897-9654',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2870 Iron Extension Bermuda, Colorado 80910-6158',\n\t\t\t\t'phone' => '(720) 166-0253',\n\t\t\t\t'lat' => '38.8064287',\n\t\t\t\t'lng' => '-104.7695962',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6803 Wishing View Arbor Cat Square, West Virginia 25027-6576',\n\t\t\t\t'phone' => '(304) 952-4973',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '950 Red Thicket Wickatunk, Washington 99133-1072',\n\t\t\t\t'phone' => '(509) 283-9110',\n\t\t\t\t'lat' => '48.0361158',\n\t\t\t\t'lng' => '-119.0618141',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5401 Misty Robin Crescent Kill Buck, Rhode Island 02808-3785',\n\t\t\t\t'phone' => '(401) 473-6664',\n\t\t\t\t'lat' => '41.4026135',\n\t\t\t\t'lng' => '-71.7503855',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6237 Sleepy Lane Frisbie, Idaho 83214-5294',\n\t\t\t\t'phone' => '(208) 804-9330',\n\t\t\t\t'lat' => '42.5407152',\n\t\t\t\t'lng' => '-112.262246',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4801 Misty Passage Castor, Georgia 39917-9448',\n\t\t\t\t'phone' => '(223) 387-9176',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4539 Shady Robin Autoroute Albertville, Maryland 21561-3867',\n\t\t\t\t'phone' => '(240) 077-3317',\n\t\t\t\t'lat' => '39.4962475',\n\t\t\t\t'lng' => '-79.1774268',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5696 Clear Anchor Heath Sedgewick, Maine 04746-1418',\n\t\t\t\t'phone' => '(207) 790-0462',\n\t\t\t\t'lat' => '47.2192967',\n\t\t\t\t'lng' => '-68.1272872',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5953 Fallen Gardens Diagonal, Kentucky 40141-1739',\n\t\t\t\t'phone' => '(606) 649-9284',\n\t\t\t\t'lat' => '37.8393332',\n\t\t\t\t'lng' => '-84.2700179',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5039 Sunny Vale Hells Half Acre, Illinois 61429-4296',\n\t\t\t\t'phone' => '(630) 322-6634',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6708 Dewy Boulevard Aylsham, West Virginia 26949-2429',\n\t\t\t\t'phone' => '(681) 442-9535',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1696 Rocky Lagoon Glade Saltcoats, Kansas 66020-4409',\n\t\t\t\t'phone' => '(620) 939-6715',\n\t\t\t\t'lat' => '39.3532738',\n\t\t\t\t'lng' => '-95.1223608',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '351 Quaking Lake Bank Lone Star, Arkansas 72198-3208',\n\t\t\t\t'phone' => '(870) 320-2825',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1194 Emerald Mall Sparkle, South Carolina 29968-2223',\n\t\t\t\t'phone' => '(864) 030-8670',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4540 Lazy Canyon Texico, Nevada 89065-4845',\n\t\t\t\t'phone' => '(775) 281-6892',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '928 Broad Pointe St. Paul, South Dakota 57151-9943',\n\t\t\t\t'phone' => '(605) 506-3672',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9319 High Hickory Way Whitchurch-Stouffville, Idaho 83396-2356',\n\t\t\t\t'phone' => '(208) 092-9832',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Cotton Pond View Cloudcroft, Washington 99318-3295',\n\t\t\t\t'phone' => '(206) 319-5326',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4832 Velvet Ledge Lick Creek, North Dakota 58132-3790',\n\t\t\t\t'phone' => '(701) 089-2211',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6205 Gentle Pioneer Orchard Nebraska, Utah 84873-7158',\n\t\t\t\t'phone' => '(801) 379-8953',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1507 Dusty Horse Key Stenen, Connecticut 06463-8750',\n\t\t\t\t'phone' => '(475) 436-2630',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7582 Blue Pathway Peoples, District of Columbia 20097-5618',\n\t\t\t\t'phone' => '(202) 414-2722',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Old Parade Swift Current, Wyoming 82321-7674',\n\t\t\t\t'phone' => '(307) 310-9791',\n\t\t\t\t'lat' => '41.2694332',\n\t\t\t\t'lng' => '-107.811',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7006 Cozy Mountain Range Treherne, Ohio 44000-7746',\n\t\t\t\t'phone' => '(937) 218-0393',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2108 Hidden Inlet Blackduck, Michigan 49830-1870',\n\t\t\t\t'phone' => '(517) 014-1990',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4810 Round Berry Ramp Fannie, Michigan 49584-3163',\n\t\t\t\t'phone' => '(616) 917-3110',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1648 Easy Pine Impasse Humboldt, Alaska 99632-0756',\n\t\t\t\t'phone' => '(907) 398-7468',\n\t\t\t\t'lat' => '62.1075171',\n\t\t\t\t'lng' => '-163.6530901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4535 Foggy Rabbit End Houston, Maryland 21707-7837',\n\t\t\t\t'phone' => '(301) 637-4559',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7673 Pleasant Field Truly, Texas 77079-1885',\n\t\t\t\t'phone' => '(936) 494-0756',\n\t\t\t\t'lat' => '29.7801889',\n\t\t\t\t'lng' => '-95.6090009',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3474 Thunder Dell Owl Hoot, South Carolina 29164-3631',\n\t\t\t\t'phone' => '(843) 611-3991',\n\t\t\t\t'lat' => '33.6536164',\n\t\t\t\t'lng' => '-81.4059186',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9142 Amber Bend Egorkovskoi, New Jersey 08747-9332',\n\t\t\t\t'phone' => '(908) 187-4092',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6565 Cinder View Villas Cathlapotle, Maine 04459-1231',\n\t\t\t\t'phone' => '(207) 831-9138',\n\t\t\t\t'lat' => '45.5738851',\n\t\t\t\t'lng' => '-68.3533229',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '518 Red Mews Zero, New York 10921-2823',\n\t\t\t\t'phone' => '(914) 172-6342',\n\t\t\t\t'lat' => '41.1333442',\n\t\t\t\t'lng' => '-74.0022524',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9170 Honey Quay Smalltown, Idaho 83491-3357',\n\t\t\t\t'phone' => '(208) 768-3359',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2063 Indian Prairie Landing Blackhawk, Missouri 64773-8741',\n\t\t\t\t'phone' => '(573) 448-2155',\n\t\t\t\t'lat' => '37.9642529',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1177 Silent Wynd Prelate, Michigan 49755-2114',\n\t\t\t\t'phone' => '(906) 346-4118',\n\t\t\t\t'lat' => '45.6521002',\n\t\t\t\t'lng' => '-84.7814432',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5550 Harvest Street Yreka, Alabama 35589-7414',\n\t\t\t\t'phone' => '(256) 126-4821',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6650 Wishing Rise Ketchikan, Colorado 81727-6300',\n\t\t\t\t'phone' => '(303) 649-9421',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '896 Quiet Shadow Grove Okeewemee, Maine 04888-5600',\n\t\t\t\t'phone' => '(207) 887-6714',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5221 Hazy Cove Pigeon Run, Rhode Island 02844-5518',\n\t\t\t\t'phone' => '(401) 397-0342',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4009 Misty Log Mews Potato Patch, Texas 79949-7016',\n\t\t\t\t'phone' => '(432) 694-5133',\n\t\t\t\t'lat' => '31.76',\n\t\t\t\t'lng' => '-106.49',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3121 Blue Road Cheektowasa, Ohio 44178-5872',\n\t\t\t\t'phone' => '(614) 541-7135',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7745 Quaking Island Private Vamoosa, Florida 33726-8437',\n\t\t\t\t'phone' => '(352) 417-7732',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2964 Round Bend Three V Crossing, New York 12895-6061',\n\t\t\t\t'phone' => '(516) 933-1701',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8929 Wishing Brook Close Mudtown, Arkansas 72307-8524',\n\t\t\t\t'phone' => '(870) 040-5761',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9857 Shady Barn Corners Boiling Point, Illinois 62370-8259',\n\t\t\t\t'phone' => '(618) 865-5959',\n\t\t\t\t'lat' => '39.5028435',\n\t\t\t\t'lng' => '-91.0011902',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8122 Foggy By-pass Refuge, Georgia 39825-9760',\n\t\t\t\t'phone' => '(404) 653-2379',\n\t\t\t\t'lat' => '30.9942599',\n\t\t\t\t'lng' => '-84.7106567',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9352 Sleepy Creek Mall Lorida, Connecticut 06685-5331',\n\t\t\t\t'phone' => '(860) 074-9188',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1740 Silent Goose Promenade Gothic, Virginia 23080-3616',\n\t\t\t\t'phone' => '(703) 804-6802',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9748 Gentle Rabbit Canyon Laird, New York 11444-2032',\n\t\t\t\t'phone' => '(518) 987-5742',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '14 Burning Butterfly Impasse Frugality, Utah 84659-3929',\n\t\t\t\t'phone' => '(385) 531-1381',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1002 Red Gate Cape Big Cut, Vermont 05637-0939',\n\t\t\t\t'phone' => '(802) 022-4379',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2826 Velvet Blossom Hill Pearl City, West Virginia 25995-8728',\n\t\t\t\t'phone' => '(681) 707-4520',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6397 Colonial Via Lonesome Prairie, Vermont 05009-4463',\n\t\t\t\t'phone' => '(802) 938-7061',\n\t\t\t\t'lat' => '43.6474348',\n\t\t\t\t'lng' => '-72.342588',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7824 Umber Fox Parkway Roche Percee, Nebraska 69310-7287',\n\t\t\t\t'phone' => '(308) 868-7311',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8786 Iron Grove Ah Fong Village, Colorado 80951-9857',\n\t\t\t\t'phone' => '(720) 743-9084',\n\t\t\t\t'lat' => '38.8622755',\n\t\t\t\t'lng' => '-104.6733584',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1582 Sunny Inlet Mctaggart, New Hampshire 03648-2975',\n\t\t\t\t'phone' => '(603) 770-8206',\n\t\t\t\t'lat' => '43.1938516',\n\t\t\t\t'lng' => '-71.5723953',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4191 Rustic Dale Common Rainbow City, West Virginia 26463-4803',\n\t\t\t\t'phone' => '(304) 618-7564',\n\t\t\t\t'lat' => '39.4349029',\n\t\t\t\t'lng' => '-80.3534899',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6761 Merry Parade Rainbow Bend, Pennsylvania 15102-8551',\n\t\t\t\t'phone' => '(484) 597-9344',\n\t\t\t\t'lat' => '40.3167073',\n\t\t\t\t'lng' => '-80.0423151',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9422 Middle Berry Street Humboldt, Alaska 99574-3449',\n\t\t\t\t'phone' => '(907) 657-0496',\n\t\t\t\t'lat' => '60.7356503',\n\t\t\t\t'lng' => '-145.5826187',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2415 Silver Lagoon Highlands Saltcoats, Louisiana 70086-3885',\n\t\t\t\t'phone' => '(337) 079-1229',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5293 Honey View Crossing Radical, Connecticut 06000-2541',\n\t\t\t\t'phone' => '(860) 898-9772',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2018 Hidden Limits Cockeysville, New Jersey 08526-2387',\n\t\t\t\t'phone' => '(551) 133-0241',\n\t\t\t\t'lat' => '40.17',\n\t\t\t\t'lng' => '-74.51',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1187 Noble River Thicket Tat Momoli, Texas 78085-3232',\n\t\t\t\t'phone' => '(903) 016-0722',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4799 Jagged Robin Beach Weirdale, Minnesota 56231-9007',\n\t\t\t\t'phone' => '(507) 950-8070',\n\t\t\t\t'lat' => '45.2842156',\n\t\t\t\t'lng' => '-95.7948769',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6967 Golden Line Parrots, Alaska 99990-7560',\n\t\t\t\t'phone' => '(907) 102-7536',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5766 Tawny Green Valley of Enchantment, Maryland 20850-1890',\n\t\t\t\t'phone' => '(410) 816-6230',\n\t\t\t\t'lat' => '39.0839994',\n\t\t\t\t'lng' => '-77.1527813',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2690 Lazy Jetty Saxman, Massachusetts 02411-2917',\n\t\t\t\t'phone' => '(339) 206-8396',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1858 Heather Lake Abbey Enough, Alaska 99700-6940',\n\t\t\t\t'phone' => '(907) 915-5318',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2284 Harvest Sky Edge Bungy, Oklahoma 74224-8696',\n\t\t\t\t'phone' => '(580) 287-3530',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2875 Dusty Cloud Centre Happy Valley-Goose Bay, Maine 04130-1318',\n\t\t\t\t'phone' => '(207) 707-6131',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2442 Cotton Campus Arabia, Florida 32543-2413',\n\t\t\t\t'phone' => '(813) 412-6448',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6054 Thunder Rise Subdivision Buzzards Roost, North Carolina 27577-9290',\n\t\t\t\t'phone' => '(828) 877-4968',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4442 Old Cider Lookout Alabama Village, Utah 84844-5606',\n\t\t\t\t'phone' => '(435) 733-2606',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5484 Bright Willow Pike Sunizona, New Mexico 87149-6244',\n\t\t\t\t'phone' => '(505) 333-5135',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t);\n\n\t\treturn $data;\n\t}", "public function getOwmsCompanyAddress()\n {\n $location = str_replace(' ', '', $this->getField('companyzipcode'));\n $location .= $this->getField('companyaddressnumber');\n $location .= $this->getField('companyaddressadditional');\n return $location;\n }", "public function getPayerAddressStreet2() {\n\t\treturn $this->_getField(self::$PAYER_ADDRESS_STREET_2);\n\t}", "public function getJkw_hospitalAddressStr () {\n return $this->xprovince->name . $this->xcity->name . $this->xcounty->name . $this->content;\n }", "public function getStreetNumber()\n {\n return isset($this->address_data['street_number']) ? $this->address_data['street_number'] : null;\n }", "private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}", "public function getCrmDataByExtNum($extNum)\r\n {\r\n $result = $this->getBitrixApi(array(\r\n 'FILTER' => array('PHONE' => $extNum),\r\n 'SELECT' => array('NAME', 'LAST_NAME', 'ASSIGNED_BY_ID'),\r\n ), 'crm.contact.list');\r\n\r\n $name = '';\r\n if ($result && isset($result['total']) && $result['total'] > 0) {\r\n $name = $result['result'][0]['NAME'] . '_' . $result['result'][0]['LAST_NAME'];\r\n } else {\r\n $result = $this->getBitrixApi(array(\r\n 'FILTER' => array('PHONE' => $extNum),\r\n 'SELECT' => array('TITLE', 'ASSIGNED_BY_ID'),\r\n ), 'crm.company.list');\r\n\r\n if ($result && isset($result['total']) && $result['total'] > 0) {\r\n $name = $result['result'][0]['TITLE'];\r\n }\r\n }\r\n\r\n $phone = '';\r\n if (!empty($name) && !empty($result['result'][0]['ASSIGNED_BY_ID'])) {\r\n $phone = $this->getIntNumByUserId($result['result'][0]['ASSIGNED_BY_ID']);\r\n }\r\n return empty($name) ? false : ['name' => $name, 'responsible' => $phone];\r\n }", "public static function getAdditionalAddressLine(Address $address)\n {\n $fields = static::getAddressLineFields($address->id_country);\n if (!in_array('address2', $fields)) {\n return $address->address2;\n }\n\n return '';\n }", "protected function street_number($reverse_geocoding)\n {\n return $this->getWithType($reverse_geocoding, 'street_number');\n }", "public function getStreetAddress2()\n {\n return $this->street_address_2;\n }" ]
[ "0.6631983", "0.5953681", "0.59221333", "0.57358956", "0.56342095", "0.55995417", "0.54174936", "0.5392165", "0.5302117", "0.52973795", "0.5278261", "0.5273488", "0.5185292", "0.5183462", "0.5172293", "0.5148002", "0.5144037", "0.5097462", "0.5093048", "0.5083149", "0.50584495", "0.50505716", "0.504559", "0.49910423", "0.49231493", "0.49216148", "0.49097627", "0.49016455", "0.4884252", "0.48826963" ]
0.62387604
1
Set Street + House number + Ext Combination of Street, HouseNr and HouseNrExt. The field StreetHouseNrExt is only usable for locations in NL, BE and DE. Please see Guidelines for the explanation.
public function setStreetHouseNrExt(string $streetHouseNrExt) { $this->StreetHouseNrExt = $streetHouseNrExt; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_street_address($name='*', $suffix='*', $street_num='*', $apt_num='*')\r\n{\r\n\tif ( $this->debug ) $this->print_d(__FUNCTION__ . ' : set street address');\r\n\t\r\n\t// random apartment num\r\n\tif ( $apt_num == '*' ) $apt_num = $this->_get_random_apt_num();\r\n\t\r\n\t// random suffix (St, Ave, Blvd, etc.)\r\n\tif ( $suffix == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_SUFFIX = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$suffix = $_SUFFIX[1];\r\n\t\tif ( $this->debug ) $this->print_d(\"random suffix: $suffix\");\r\n\t}\r\n\t\r\n\t// random street name\r\n\tif ( $name == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_NAME = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$name = $_NAME[0];\r\n\t\tif ( $this->debug ) $this->print_d(\"random name: $name\");\r\n\t}\r\n\t\r\n\t// street number (quick and dirty)\r\n\tif ( $street_num == '*' )\r\n\t{\r\n\t\t$street_num = mt_rand(1,12500);\r\n\t\tif ( $this->debug ) $this->print_d(\"random street number: $street_num\");\r\n\t}\r\n\t\r\n\t// set street prop\r\n\t$this->street_address = trim(ucwords(strtolower(\"$street_num $name $suffix $apt_num\")));\r\n\tif ( $this->debug ) $this->print_d(\"random street_address : {$this->street_address}\");\r\n\treturn;\r\n}", "public function setHouseNrExt(string $houseNrext)\n {\n $this->HouseNrExt = $houseNrext;\n return $this;\n }", "function setAddress( $postoffice='', $extended='', $street='', $city='', $region='', $zip='', $country='', $type='HOME;POSTAL' )\n {\n // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. \"WORK;PARCEL;POSTAL\"\n $key = 'ADR';\n if ( $type != '' ) {\n $key .= ';'. $type;\n }\n $key.= ';ENCODING=QUOTED-PRINTABLE';\n $this->properties[$key] = encode( $postoffice ) . ';' . encode( $extended ) .';'. encode( $street ) .';'. encode( $city ) .';'. encode( $region) .';'. encode( $zip ) .';'. encode( $country );\n }", "public function setStreet($street = \"\");", "public function setStreetAddress($value) {\n\t\tself::$_streetAddress = $value;\n\t}", "function setStreet1( &$value )\n {\n $this->Street1 = $value;\n }", "public final function setFullStreet($street) {\n\t\ttrigger_error('[DHL-PHP-SDK]: Called deprecated method ' . __METHOD__ . ': Buggy on some addresses, please separate the number and street by yourself. This method will removed in the future!', E_USER_DEPRECATED);\n\n\t\t$match = array();\n\n\t\tpreg_match('/^([^\\d]*[^\\d\\s]) *(\\d.*)$/', $street, $match);\n\n\t\tif(count($match) == 0) return;\n\n\t\t$this->setStreetName($match[1]);\n\t\t$this->setStreetNumber($match[2]);\n\t}", "public function street1($street1) {\n $this->data['attachment']['payload']['address']['street_1'] = $street1;\n\n return $this;\n }", "function setStreet2( &$value )\n {\n $this->Street2 = $value;\n }", "function setEntireAddress($address1, $address2, $city, $state, $zipCode)\n\t{\n\t\t$this->setAddress1($address1);\n\t\t$this->setAddress2($address2);\n\t\t$this->setCity($city);\n\t\t$this->setState($state);\n\t\t$this->setZipCode($zipCode);\n\t}", "public function setStreetAddress($var)\n {\n GPBUtil::checkString($var, True);\n $this->street_address = $var;\n\n return $this;\n }", "public function set_address_1( $address ) {\n\t\t$this->set_prop( 'address_1', $address );\n\t}", "public function setHouseNumber($houseNumber = \"\");", "public function setAddressFromEsd($addr, esdAddress $esdAddress) {\n for ($i = 0; isset($esdAddress->street[$i]) && $i < 3; $i++)\n if ($i == 0)\n $addr->address->street[$i] = $esdAddress->street[$i]; // fixme: multiple?\n else \n $addr->address->street[] = $esdAddress->street[$i];\n \n $addr->address->city = $esdAddress->city;\n $addr->address->state = $esdAddress->state;\n if ($esdAddress->country)\n $addr->address->country = $esdAddress->country;\n $addr->address->postcode = $esdAddress->zip;\n $addr->phone = $esdAddress->telephone;\n }", "public function setAddress($street1, $street2, $city, $state, $countrycode, $zip)\n {\n $this->street1 = rawurlencode($street1);\n $this->street2 = rawurlencode($street2);\n $this->city = rawurlencode($city);\n //Paypal wants iso state codes like CA or FL\n if($countrycode == \"US\" || $countrycode == \"CA\")\n {\n if(States::getStateByCode($state) == null)\n {\n //Check if it's a valid state name\n $stateInfo = States::getCodeByState($state);\n if($stateInfo != null)\n {\n $this->state = $stateInfo->stateCode;\n }\n else\n {\n $this->state = null;\n }\n }\n else\n {\n //Matched a valid state, we can use it\n $this->state = $state;\n }\n }\n $this->countrycode = strtoupper($countrycode);\n $this->zip = rawurlencode($zip);\n }", "public function street2($street2) {\n $this->data['attachment']['payload']['address']['street_2'] = $street2;\n\n return $this;\n }", "public function setStreet($street) {\n\t\t$this->street = $street;\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 }", "public function setAddress($type, $street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)\n\t{\n\t\t$address = new stdClass();\n\t\t$address->street = $street;\n\t\t$address->streetNumber = $number;\n\t\t$address->complement = $complement;\n\t\t$address->district = $district;\n\t\t$address->city = $city;\n\t\t$address->state = $state;\n\t\t$address->country = $country;\n\t\t$address->zipCode = $zip;\n\n\t\t$this->data->billingAddress = $address;\n\n\t\treturn $this;\n\t}", "public function setAddress($address);", "public function setAddress($address);", "public function getStreetHouseNrExt(): ?string\n {\n return $this->StreetHouseNrExt ?? null;\n }", "public function setStreetAddress($street_address): void\n {\n $this->_streetAddress = $street_address;\n }", "public function setAddress($val)\n {\n $this->_propDict[\"address\"] = $val;\n return $this;\n }", "public function set_address_2( $address ) {\n\t\t$this->set_prop( 'address_2', $address );\n\t}", "function getFieldStreetAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sstreet');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sstreet');\n\t\t$tooltip = setToolTipNotification(\"sstreet\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sstreet') === 'sstreet' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='sstreetNo' id='sstreetNo' value='\".$value1.\"' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='sstreetName' id='sstreetName' value='\".$value2.\"' size='12' class='srms-field \".(get_axl_req_fields('sstreet') === 'sstreet' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function setStreet($street) \n {\n $this->street = $street;\n\n return $this;\n }", "public function setStreet($street)\n {\n $this->setParameter('street', $street);\n\n return $this;\n }", "public static function addressExtendedAddress()\n {\n return new TextNode('address_extended_address');\n }", "function setAddress($add) {\n if ( strpos($add->value, \"BEGIN:VCARD\") || strpos($add->value, \"begin:vcard\") )\n $add->type = 'text/directory';\n else\n $add->type = 'text/plain';\n $this->address = $add;\n $changed = true;\n }" ]
[ "0.653905", "0.6217615", "0.59952104", "0.5681976", "0.5654412", "0.55757797", "0.55592585", "0.5501735", "0.5403478", "0.5307102", "0.52656025", "0.525156", "0.5187446", "0.51689655", "0.51421046", "0.5124851", "0.5079204", "0.50033283", "0.49663797", "0.49525276", "0.49525276", "0.4935346", "0.491805", "0.49094582", "0.48889732", "0.48816687", "0.48699662", "0.48487902", "0.4834658", "0.48222944" ]
0.7140926
0
Parses the passed stream into a ZBateson\MailMimeParser\Message object and returns it.
public function parse(StreamInterface $stream) { $partBuilder = $this->read($stream); return $partBuilder->createMessagePart($stream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function withBody(ReadableStream $stream): Message;", "public function readMessage($stream)\n {\n fseek($stream, 0);\n $contents = stream_get_contents($stream);\n return json_decode($contents);\n }", "public function get_body()\n\t{\n\t\t// headers are retrieved first so body() is decoupled\n\t\t// and messages() in peek class might have deleted this message\n\t\t// but it is still in the object tree, check if it has been marked\n\t\tif ($this->get_mark_delete())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// NOTE: calling this function removes message from \n\t\t\t// gmail's POP3 INBOX - not by deleting it, but making \n\t\t\t// it effectively invisible (depending on gmail account's POP3 settings)\n\t\t\t$this->log_state('Fetching structure for email #'.$this->Msgno);\t\t\t\n\t\t\t$structure = @imap_fetchstructure($this->peek_parent->resource, $this->Msgno);\n\t\t\t\n\t\t\t// make sure $structure is not null - can happen if passed MsgNo 0\n\t\t\t// log state\n\t\t\t// TODO: build error handling, exception\n\t\t\tif ($structure===NULL) $this->log_state('get_body() method $structure is NULL. MsgNo is: '.(int)$this->MsgNo);\n\t\t\t\n\t\t\t// check for mail server errors here to clear the \n\t\t\t// error stack and prevent it from posting\n\t\t\t// PHP errors about badly formatted emails\n\t\t\t// should probably store the errors with the email in a db\n\t\t\t$this->_check_imap_errors('imap_fetchstructure');\n\t\t\t\n\t\t\t// pull out the raw email body here for \n\t\t\t// storage/export potential eg allowing mbox export\n\t\t\t$this->log_state('Getting body for email #'.$this->Msgno);\t\t\t\n\t\t\t$this->body_string = @imap_body($this->peek_parent->resource,$this->Msgno);\n\t\t\t$this->_check_imap_errors('imap_body');\n\n\t\t\t// see if it is a multipart messsage\n\t\t\t// fill $this->parts_array with the parts\n\t\t\t// could handle both these cases in the extract_parts function\n\t\t\tif (isset($structure->parts) && count($structure->parts))\n\t\t\t{\n\t\t\t\t// extract every part of the email into the parts_array var\n\t\t\t\t// this is a custom array with objects to help unify what we need from the parts\n\t\t\t\t// extract this part of email, stores the data in properties\n\t\t\t\t// recurses if necessary to get all the parts into the array\n\t\t\t\t// this is a little weird here since the method is in a sub class\n\t\t\t\t// and you have to make sure the class is loaded before extracting\n\t\t\t\tif (class_exists($this->parts_class))\n\t\t\t\t{\n\t\t\t\t\t$this->extract_parts($structure->parts);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log_state(\n\t\t\t\t\t'No parts class defined in body. imap_fetchstructure() parsing ( method extract_parts() ) failed.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{ \n\t\t\t\t// not a multipart message\n\t\t\t\t// get the body of message\n\t\t\t\t// decode if quoted-printable or base64\n\t\t\t\tif ($structure->encoding==3) \n\t\t\t\t{\n\t\t\t\t\t$body=base64_decode($this->body_string);\n\t\t\t\t}\n\t\t\t\telseif ($structure->encoding==4)\n\t\t\t\t{\n\t\t\t\t\t$body=quoted_printable_decode($this->body_string);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$body = $this->body_string;\n\t\t\t\t}\n\t\t\t\t// if this is a PLAIN or HTML part it will\n\t\t\t\t// be written to the respective property\n\t\t\t\t// create a var for $this->PLAIN or $this->HTML\n\t\t\t\t$sub_type = strtoupper($structure->subtype);\n\t\t\t\tif ($sub_type === 'PLAIN')\n\t\t\t\t{\n\t\t\t\t\t$this->PLAIN = $body;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($sub_type === 'HTML')\n\t\t\t\t{\n\t\t\t\t\t$this->HTML = $body;\n\t\t\t\t\t// DEC 20101210 turn off this line until needed\n\t\t\t\t\t// deals with encoded HTML iso-8859-1 that needs \n\t\t\t\t\t// to get inserted as UTF-8 into db but insert fails\n\t\t\t\t\t// this should fix it, insert only inserts HTML \n\t\t\t\t\t// up to encoded char and then silently drops the rest\n\t\t\t\t\tif (0) $this->HTML = $this->decode_mime($this->HTML);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t// parts_array filled by peek_mail_parts class\n\t\t\t\n\t\t\t// represent internal date as UNIX timestamp\n\t\t\t// this is actually the timestamp of \n\t\t\t// when the message was put into this class\n\t\t\t// rather than \"received\" (which should better\n\t\t\t// be the datestamp for when the message\n\t\t\t// was accepted to the receiving SMTP server)\n\t\t\t$this->timestamp_pulled = time();\n\t\t\t\n\t\t\t// return TRUE to allow this to function as a \n\t\t\t// kind of default detector if needed\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t}", "public function parse(AbstractStream $stream)\n {\n $value = $this->format($this->read($stream));\n $this->validate($value);\n return $value;\n }", "public function getMIMEMessageAsStream();", "function mime_decode($message)\n {\n if (!class_exists('Mail_mimeDecode'))\n {\n @include_once('Mail/mimeDecode.php');\n }\n\n $this->_message = $message;\n\n $this->headers['User-Agent'] = 'Midgard/' . substr(mgd_version(), 0, 4);\n $this->headers['X-Originating-Ip'] = '[' . $_SERVER['REMOTE_ADDR'] . ']';\n\n $this->encoding = $this->_i18n->get_current_charset();\n\n if (!class_exists('Mail_mimeDecode'))\n {\n debug_add('Cannot decode without Mail_mimeDecode, aborting', MIDCOM_LOG_ERROR);\n return false;\n }\n\n // Make sure we only have NL linebreaks\n $this->_message = preg_replace(\"/\\n\\r|\\r\\n|\\r/\", \"\\n\", $this->_message);\n\n $this->_check_boundary();\n\n $args = array();\n $args['include_bodies'] = true;\n $args['decode_bodies'] = true;\n $args['decode_headers'] = true;\n $args['crlf'] = \"\\n\";\n $args['input'] = $this->_message;\n\n $decoder = new Mail_mimeDecode($this->_message);\n $this->__mime = $decoder->decode($args);\n\n if (is_a($this->__mime, 'pear_error'))\n {\n return false;\n }\n\n // ucwords all header keys\n if (is_array($this->__mime->headers))\n {\n reset ($this->__mime->headers);\n foreach ($this->__mime->headers as $k => $v)\n {\n $this->headers[str_replace(\" \", \"-\", ucwords(str_replace(\"-\", \" \", $k)))] =& $this->__mime->headers[$k];\n }\n }\n\n if ( !empty($this->__mime->parts)\n && is_array($this->__mime->parts))\n {\n // Start with empty body and append all text parts to it\n $this->body = '';\n foreach ($this->__mime->parts as $part)\n {\n $this->_part_decode($part);\n }\n }\n else\n { //No parts, just body\n switch (strtolower($this->__mime->ctype_secondary))\n {\n default:\n case \"plain\":\n $this->body =& $this->__mime->body;\n break;\n case \"html\":\n $this->html_body =& $this->__mime->body;\n $this->body = $this->html2text($this->__mime->body);\n break;\n }\n if ( isset($this->__mime->ctype_parameters['charset'])\n && !$this->__orig_encoding)\n {\n $this->__orig_encoding = $this->__mime->ctype_parameters['charset'];\n }\n }\n\n // Charset conversions\n debug_add('calling $this->_charset_convert($this->body, $this->__orig_encoding);');\n $this->body = $this->_charset_convert($this->body, $this->__orig_encoding);\n debug_add('calling $this->_charset_convert($this->html_body, $this->__orig_encoding);');\n $this->html_body = $this->_charset_convert($this->html_body, $this->__orig_encoding);\n foreach ($this->headers as $header => $value)\n {\n debug_add(\"calling _charset_convert for header '{$header}'\");\n $this->headers[$header] = $this->_charset_convert($value, $this->__orig_encoding);\n }\n foreach ($this->attachments as $key => $data)\n {\n debug_add(\"calling _charset_convert for attachment '{$data['name']}'\");\n $this->attachments[$key]['name'] = $this->_charset_convert($data['name'], $this->__orig_encoding);\n }\n\n //Strip whitespace around bodies\n $this->body = ltrim(rtrim($this->body));\n $this->html_body = ltrim(rtrim($this->html_body));\n\n //TODO Figure if decode was successful or not and return true/false instead\n return $this->__mime;\n }", "public function parse(): array\n {\n // Text.\n if ($this->type === 'text') {\n return [\n 'text' => $this->message,\n ];\n }\n\n // Template.\n if ($this->type === 'template') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n\n // Generic template.\n if (Arr::get($payload, 'template_type') === 'generic') {\n return [\n 'generic' => $this->parseGenericTempalte($payload),\n ];\n }\n }\n\n // Image\n if ($this->type === 'image') {\n $payload = Arr::get($this->message, 'attachments.0.payload');\n return [\n 'image' => $this->parseImageAttachment($payload),\n ];\n }\n\n // This for unsupported messages.\n return [];\n }", "public function decode($buffer, $connection)\n { \n return new Message($buffer);\n }", "private function getPayloadParser(array $message)\n {\n if (isset($message['Body']) === true) {\n $body = \\GuzzleHttp\\json_decode($message['Body'], true);\n if (isset($body['Type']) === true && $body['Type'] === 'Notification') {\n return new SqsSnsPayloadParser();\n }\n }\n\n return new SqsStandardPayloadParser();\n }", "public function getMessage() {\n if ($this->message instanceof MessageInterface) {\n return $this->message;\n }\n return $this->mesage = new SmsMessageModel();\n }", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "public function readone() {\n\t\t$msg = Core_Ipc_Messages::find(['stream' => md5($this->stream)], ['limit' => 1, 'order' => 'msgid']);\n\t\tif(empty($msg)) {\n\t\t\treturn false;\n\t\t}\n\t\t$msg->delete();\n\t\treturn $msg->instance;\n\t}", "private function decode_raw_message($raw_message, $decode_bodies = TRUE) {\n\n /*\n * Cached content exists?\n */\n// $cache_key = \"MIME_DECODED_MESSAGE_\" . md5($raw_message);\n// $mime_decoded_message_cached = $this->get_cache($cache_key);\n// if (is_object($mime_decoded_message_cached)) {\n// return $mime_decoded_message_cached;\n// }\n\n $mime_decode = new Mail_mimeDecode($raw_message);\n\n $decode_params = array(\n 'include_bodies' => TRUE,\n 'decode_bodies' => $decode_bodies,\n 'decode_headers' => TRUE,\n 'rfc_822bodies' => TRUE\n );\n\n /*\n * add error suppression to avoid \"Deprecated: preg_replace(): The /e modifier \n * is deprecated, use preg_replace_callback instead in \n * ..../roundcube/vendor/pear-pear.php.net/Mail_mimeDecode/Mail/mimeDecode.php on line 762\"\n */\n $decoded = @$mime_decode->decode($decode_params);\n\n /*\n * add mime_id attributes to '$decoded' array items (pass by reference)\n */\n $mime_decode->getMimeNumbers($decoded);\n\n /*\n * Store cached content\n */\n// $this->update_cache($cache_key, $decoded);\n\n return $decoded;\n }", "private function retrieveMessage() : ?string {\n $message = [];\n\n // The regex to find the head of the message wrapper (message lies between head and foot wrapper)\n $messageHeadWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD ,\n self::REGEX_MESSAGE_WRAPPER_BODY,\n \"(\\s{2})\"\n ], \"\", \"\");\n\n // The regex to find the foot of the message wrapper (message lies between head and foot wrapper)\n $messageFootWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD,\n self::REGEX_MESSAGE_WRAPPER_BODY\n ], \"\", \"\");\n\n // The regex for querying the message, including its queried wrapper\n $messageRegex = $this->buildRegex([\n $messageHeadWrapperRegex,\n self::REGEX_ALL,\n $messageFootWrapperRegex\n ]);\n\n // Querying the message\n preg_match($messageRegex, $this->currentEmail, $message);\n\n // If the message not found, there is most likely no message, so return null\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n if (!isset($message[4]))\n return null;\n\n // Return the quoted-printable decoded and trimmed message\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n $message = quoted_printable_decode($message[4]);\n return trim($message);\n }", "protected function extractStream()\n {\n while (true) {\n $buffer = $this->reader->getBuffer(false);\n $length = \\strpos($buffer, 'endstream');\n if ($length === false) {\n if (!$this->reader->increaseLength(100000)) {\n throw new PdfTypeException('Cannot extract stream.');\n }\n continue;\n }\n break;\n }\n\n $buffer = \\substr($buffer, 0, $length);\n $lastByte = \\substr($buffer, -1);\n\n /* Check for EOL marker =\n * CARRIAGE RETURN (\\r) and a LINE FEED (\\n) or just a LINE FEED (\\n},\n * and not by a CARRIAGE RETURN (\\r) alone\n */\n if ($lastByte === \"\\n\") {\n $buffer = \\substr($buffer, 0, -1);\n\n $lastByte = \\substr($buffer, -1);\n if ($lastByte === \"\\r\") {\n $buffer = \\substr($buffer, 0, -1);\n }\n }\n\n // There are streams in the wild, which have only white signs in them but need to be parsed manually due\n // to a problem encountered before (e.g. Length === 0). We should set them to empty streams to avoid problems\n // in further processing (e.g. applying of filters).\n if (trim($buffer) === '') {\n $buffer = '';\n }\n\n return $buffer;\n }", "protected function streamToMime(Swift_OutputByteStream $fromStream, Swift_Message $message)\n {\n $bufferLength = 78;\n $headerData = '';\n\n $fromStream->setReadPointer(0);\n\n while (($buffer = $fromStream->read($bufferLength)) !== false) {\n $headerData .= $buffer;\n\n if (false !== strpos($buffer, \"\\r\\n\\r\\n\")) {\n break;\n }\n }\n\n $headersPosEnd = strpos($headerData, \"\\r\\n\\r\\n\");\n $headerData = trim($headerData);\n $headerData = substr($headerData, 0, $headersPosEnd);\n $headerLines = explode(\"\\r\\n\", $headerData);\n unset($headerData);\n\n $headers = array();\n $currentHeaderName = '';\n\n foreach ($headerLines as $headerLine) {\n // Line separated\n if (ctype_space($headerLines[0]) || false === strpos($headerLine, ':')) {\n $headers[$currentHeaderName] .= ' '.trim($headerLine);\n continue;\n }\n\n $header = explode(':', $headerLine, 2);\n $currentHeaderName = strtolower($header[0]);\n $headers[$currentHeaderName] = trim($header[1]);\n }\n\n $messageStream = new Swift_ByteStream_TemporaryFileByteStream();\n $messageStream->addFilter($this->replacementFactory->createFilter(\"\\r\\n\", \"\\n\"), 'CRLF to LF');\n $messageStream->addFilter($this->replacementFactory->createFilter(\"\\n\", \"\\r\\n\"), 'LF to CRLF');\n\n $messageHeaders = $message->getHeaders();\n\n // No need to check for 'application/pkcs7-mime', as this is always base64\n if ('multipart/signed;' === substr($headers['content-type'], 0, 17)) {\n if (!preg_match('/boundary=(\"[^\"]+\"|(?:[^\\s]+|$))/is', $headers['content-type'], $contentTypeData)) {\n throw new Swift_SwiftException('Failed to find Boundary parameter');\n }\n\n $boundary = trim($contentTypeData['1'], '\"');\n\n // Skip the header and CRLF CRLF\n $fromStream->setReadPointer($headersPosEnd + 4);\n\n while (false !== ($buffer = $fromStream->read($bufferLength))) {\n $messageStream->write($buffer);\n }\n\n $messageStream->commit();\n\n $messageHeaders->remove('Content-Transfer-Encoding');\n $message->setContentType($headers['content-type']);\n $message->setBoundary($boundary);\n $message->setBody($messageStream);\n } else {\n $fromStream->setReadPointer($headersPosEnd + 4);\n\n if (null === $this->headerFactory) {\n $this->headerFactory = Swift_DependencyContainer::getInstance()->lookup('mime.headerfactory');\n }\n\n $message->setContentType($headers['content-type']);\n $messageHeaders->set($this->headerFactory->createTextHeader('Content-Transfer-Encoding', $headers['content-transfer-encoding']));\n $messageHeaders->set($this->headerFactory->createTextHeader('Content-Disposition', $headers['content-disposition']));\n\n while (false !== ($buffer = $fromStream->read($bufferLength))) {\n $messageStream->write($buffer);\n }\n\n $messageStream->commit();\n $message->setBody($messageStream);\n }\n }", "public function recv()\n {\n $message_len = $this->stream->read(4);\n\n if (strlen($message_len) < 4) {\n throw new Exception('Message size payload should be 4 bytes');\n }\n\n $message_len = reset(unpack('N', $message_len));\n $this->stream_wrapper->clear();\n $this->stream_wrapper->write($this->stream->read($message_len));\n $message = Util::decode($this->stream_wrapper);\n return $message;\n }", "public function deserialize($stream) {\n throw new FormatUnsupported('Cannot deserialize '.($this->mime ? 'from '.$this->mime : 'without mime type'));\n }", "public function next_message() \n {\n if( ! $this->is_open() || $this->msgnum === NULL ||\n $this->msgnum > $this->count_messages() ) return false;\n \n $this->msgnum++;\n if( $this->msgnum > $this->count_messages() ) return false; \n\n\n if( ! $rawheaders = @imap_fetchheader($this->imap_stream,$this->msgnum) ){\n $this->errors = imap_errors();\n return false;\n } \n \n if( ! $rawbody = imap_body($this->imap_stream,$this->msgnum) ) {\n $this->errors = imap_errors();\n return false;\n } \n\n imap_errors();\t \n $this->current_msg = new IMAPMessage( $this->msgnum, $rawheaders, $rawbody );\n return $this->current_msg;\n }", "protected function parseMessage($messageText)\n {\n\n $lines = explode(PHP_EOL, $messageText);\n\n // [*17-Aug-2010 13:57:24*] PHP Notice: Undefined variable...\n $time = substr($lines[0], 1, 20);\n $data = array();\n\n // [17-Aug-2010 13:57:24] PHP Notice*:* Undefined variable...\n $typeEndPos = strpos($lines[0], ':', 27);\n // [17-Aug-2010 13:57:24] PHP *Notice*: Undefined variable...\n $type = substr($lines[0], 27, $typeEndPos - 27);\n // [17-Aug-2010 13:57:24] PHP Notice: *Undefined variable...*\n $text = substr($lines[0], $typeEndPos + 2);\n\n // $lines[1] == 'Stack trace:'\n $stackTrace = '';\n $i = 2;\n do {\n $stackTrace .= $lines[$i] . PHP_EOL;\n $i++;\n } while ( strncasecmp('Url:', $lines[$i], 4) !== 0 );\n\n // Url: http://localhost/tlumoceni-preklady.cz/portal/tlumoceni-preklady.cz/htdocs/\tReferer: unknown\n list($url, $referer, $ip) = explode(\"\\t\", $lines[$i]);\n $url = substr($url, 5);\n $referer = substr($referer, 9);\n $ip = substr($ip, 4);\n $key = md5($type . $text);\n\n return new Message(array(\n 'time' => $time,\n 'type' => $type,\n 'text' => $text,\n 'key' => $key,\n 'stackTrace' => $stackTrace,\n 'url' => $url,\n 'referer' => $referer,\n 'ip' => $ip\n ));\n }", "public function testMailParse()\n\t{\n\t\t// Parse a simple email\n\t\t$email_message = new EmailParse();\n\t\t$email_message->read_email(true, $this->_email);\n\n\t\t// Basics\n\t\t$this->assertEquals('\"ElkArte Community\" <[email protected]>', $email_message->headers['reply-to']);\n\t\t$this->assertEquals('[ElkArte Community] Test Message', $email_message->subject);\n\n\t\t// Its marked as spam\n\t\t$email_message->load_spam();\n\t\t$this->assertTrue($email_message->spam_found);\n\n\t\t// A few more details\n\t\t$email_message->load_address();\n\t\t$this->assertEquals('[email protected]', $email_message->email['from']);\n\t\t$this->assertEquals('[email protected]', $email_message->email['to'][0]);\n\n\t\t// The key\n\t\t$email_message->load_key();\n\t\t$this->assertEquals('cd8c399768891330804a1d2fc613ccf3-t4124', $email_message->message_key_id);\n\t\t$this->assertEquals('cd8c399768891330804a1d2fc613ccf3', $email_message->message_key);\n\n\t\t// The plain and HTML messages\n\t\t$this->assertStringContainsString('<strong>Testing</strong>', $email_message->body);\n\t\t$this->assertRegExp('/Testing\\n/', $email_message->plain_body);\n\n\t\t// The IP\n\t\t$this->assertEquals('85.214.104.5', $email_message->load_ip());\n\n\t\t// And some MD as well\n\t\t$markdown = pbe_load_text($email_message->html_found, $email_message, array());\n\t\t$this->assertStringContainsString('[b]Testing[/b]', $markdown);\n\t}", "private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function parseResponse($message);", "public function getStreamParser() {}", "public function getStreamParser() {}", "public function createMimeMessage();", "public function parseRequest($message);", "public function returnImapMailBoxmMsgInfoObj(){\n return imap_mailboxmsginfo($this->stream); \n\t}", "public function parseMailFile($raw){\n\t\t\tif($raw === false) return false;\n\t\t\t$s = array(\t\".\", \t\"+\"\t\t);\n\t\t\t$r = array(\t\"\\.\", \t\"\\+\"\t);\n\t\t\t$m = preg_match(\"/^(From \".preg_quote($this->responseEmail()).\".+)(^From )?/ms\", $raw, $matches);\n\t\t\tif($m)\treturn trim($matches[1]);\n\t\t\telse return false;\n\t\t}", "protected function parseWatsonMessage($message)\n {\n return $message;\n }" ]
[ "0.61567223", "0.6134027", "0.5923734", "0.59130585", "0.5909272", "0.5904806", "0.5702898", "0.56285584", "0.55412", "0.5522763", "0.543806", "0.541851", "0.53849655", "0.5384694", "0.5366702", "0.5331977", "0.5321827", "0.53071076", "0.52907026", "0.5274382", "0.5264614", "0.5250512", "0.5223357", "0.52148765", "0.52148765", "0.51819944", "0.5109718", "0.51016194", "0.5097826", "0.5092933" ]
0.67059743
0
Ensures the header isn't empty and contains a colon separator character, then splits it and calls $partBuilder>addHeader.
private function addRawHeaderToPart($header, PartBuilder $partBuilder) { if ($header !== '' && strpos($header, ':') !== false) { $a = explode(':', $header, 2); $partBuilder->addHeader($a[0], trim($a[1])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "protected function _parseHeader() {}", "function _parseHeader($header) {\n\n\t\tif (is_array($header)) {\n\t\t\tforeach ($header as $field => $value) {\n\t\t\t\tunset($header[$field]);\n\t\t\t\t$field = strtolower($field);\n\t\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\n\t\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t\t}\n\t\t\t\t$header[$field] = $value;\n\t\t\t}\n\t\t\treturn $header;\n\t\t} elseif (!is_string($header)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tpreg_match_all(\"/(.+):(.+)(?:(?<![\\t ])\" . $this->line_break . \"|\\$)/Uis\", $header, $matches, PREG_SET_ORDER);\n\n\t\t$header = array();\n\t\tforeach ($matches as $match) {\n\t\t\tlist(, $field, $value) = $match;\n\n\t\t\t$value = trim($value);\n\t\t\t$value = preg_replace(\"/[\\t ]\\r\\n/\", \"\\r\\n\", $value);\n\n\t\t\t$field = $this->_unescapeToken($field);\n\n\t\t\t$field = strtolower($field);\n\t\t\tpreg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE);\n\t\t\tforeach ($offsets[0] as $offset) {\n\t\t\t\t$field = substr_replace($field, strtoupper($offset[0]), $offset[1], 1);\n\t\t\t}\n\n\t\t\tif (!isset($header[$field])) {\n\t\t\t\t$header[$field] = $value;\n\t\t\t} else {\n\t\t\t\t$header[$field] = array_merge((array) $header[$field], (array) $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $header;\n\t}", "private static function http_parse_headers($header)\n {\n $headers = array();\n $key = '';\n\n foreach(explode(\"\\n\", $header) as $i => $h) {\n $h = explode(':', $h, 2);\n\n if (isset($h[1]))\n {\n if (!isset($headers[$h[0]])) {\n $headers[$h[0]] = trim($h[1]);\n }\n elseif (is_array($headers[$h[0]])) {\n $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));\n }\n else {\n $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));\n }\n\n $key = $h[0];\n }\n else {\n if (substr($h[0], 0, 1) == \"\\t\") {\n $headers[$key] .= \"\\r\\n\\t\".trim($h[0]);\n }\n elseif (!$key) {\n $headers[0] = trim($h[0]);trim($h[0]);\n }\n }\n }\n\n return $headers;\n }", "protected function parseHeader($header)\n {\n $headers = explode(\"\\n\", trim($header));\n $this->parseHeaders($headers);\n }", "public function ParseHeader($header = '')\n\t{\n\t\t$resArr = array();\n\t\t$headerArr = explode(\"\\n\", $header);\n\t\tforeach ($headerArr as $key => $value)\n\t\t{\n\t\t\t$tmpArr = explode(\": \", $value);\n\t\t\tif (count($tmpArr) < 1) continue;\n\t\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t\t}\n\t\treturn $resArr;\n\t}", "public function buildHeaderFields() {}", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "private static function split_header($header)\n {\n $pattern = '/(([-_a-z]*)=(\"([^\"]*)\"|([^,]*)),?)/';\n $offset = 0;\n $params = array();\n while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0)\n {\n $match = $matches[0];\n $header_name = $matches[2][0];\n $header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];\n $params[$header_name] = OAuthUtil::urldecode_rfc3986( $header_content );\n $offset = $match[1] + strlen($match[0]);\n }\n\n if (isset($params['realm']))\n unset($params['realm']);\n\n return $params;\n }", "public function buildHeader ()\n {\n $header = array();\n foreach ($this->header as $param => $value) {\n if ($value != \"\") {\n array_push($header, $param . ': ' . $value);\n }\n }\n return $header;\n }", "private function setHeader($header)\n {\n $this->header = trim((string) $header);\n $this->headerComment = '';\n\n if ('' !== $this->header) {\n $this->headerComment = $this->encloseTextInComment($this->header);\n }\n }", "protected function getPartHeaders($part)\r\n\t{\r\n\t\tif (isset($part['headers'])) {\r\n\t\t\treturn $part['headers'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function parseHeaders($header = \"\")\n {\n $this->headers = array();\n\n foreach (explode(\"\\r\\n\", $header) as $i => $line)\n if ($i === 0) {\n $this->code = $line;\n } else {\n $temp = explode(': ', $line);\n if (empty($temp[0]) || empty($temp[1])) {\n continue;\n }\n $this->headers[strtolower($temp[0])] = $temp[1];\n }\n\n return $this;\n }", "private function build_budget_preHeaders(&$header,$header_col0=''){\n $prev_was_space = False;\n foreach(array_keys($header) as $k){\n if (strpos($k,'space') === False){\n\t$prev_was_space = False;\n }else{\n\tif ($prev_was_space) unset($header[$k]);\n\t$prev_was_space = True;\n }\n }\n\n $n_Accommodation = count(preg_grep('/living/',array_keys($header)));\n $n_Other = count(preg_grep('/other/', array_keys($header)));\n $n_Total = count(preg_grep('/total_/',array_keys($header)));\n $n_Reimbursement = count(preg_grep('/scholarship/',array_keys($header)));\n $n_name = count(array_keys($header)) - $n_Accommodation - $n_Other - $n_Total - $n_Reimbursement - count(preg_grep('/space/',array_keys($header)));\n \n $pre_header = array(\"$n_name:$header_col0\");\n if (isset($header['space0'])) $pre_header[] = \"1:\";\n if ($n_Accommodation > 0) $pre_header[] = \"$n_Accommodation:Accommodation\";\n if (isset($header['space1'])) $pre_header[] = \"1:\";\n if ($n_Reimbursement > 0) $pre_header[] = \"$n_Reimbursement:Reimbursement\";\n if (isset($header['space2'])) $pre_header[] = \"1:\";\n if ($n_Other > 0) $pre_header[] = \"1:\";\n if (isset($header['space3'])) $pre_header[] = \"1:\";\n if ($n_Total > 0) $pre_header[] = \"$n_Total:<span class='bigger-text'>Total</span>\";\n\n return array($pre_header);\n }", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "public function getHeaderSeparator()\n {\n return self::HEADER_SEPARATOR;\n }", "function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }", "public function addHeader()\n {\n }", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "protected function readHeaders($handle, PartBuilder $partBuilder)\n {\n $header = '';\n do {\n $line = $this->readLine($handle);\n if (empty($line) || $line[0] !== \"\\t\" && $line[0] !== ' ') {\n $this->addRawHeaderToPart($header, $partBuilder);\n $header = '';\n } else {\n $line = \"\\r\\n\" . $line;\n }\n $header .= rtrim($line, \"\\r\\n\");\n } while ($header !== '');\n }", "private function buildRequestHeaders()\n {\n // coalesce our header key/value pairs\n $headers = [];\n foreach ($this->headers as $key => $value) {\n if ($key == 'Expect' && $value == '') {\n // drop this pair\n continue;\n }\n\n // add this header key/value pair\n $headers[] = $key.': '.$value;\n }\n\n return implode(\"\\r\\n\", $headers);\n }", "public function header($header = null, $value = null) {\n\t\tif ($header === null) {\n\t\t\treturn $this->_headers;\n\t\t}\n\t\t$headers = is_array($header) ? $header : array($header => $value);\n\t\tforeach ($headers as $header => $value) {\n\t\t\tif (is_numeric($header)) {\n\t\t\t\tlist($header, $value) = array($value, null);\n\t\t\t}\n\t\t\tif ($value === null) {\n\t\t\t\tlist($header, $value) = explode(':', $header, 2);\n\t\t\t}\n\t\t\t$this->_headers[$header] = is_array($value) ? array_map('trim', $value) : trim($value);\n\t\t}\n\t\treturn $this->_headers;\n\t}", "private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }", "protected function _parseHeader( $aHeader )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $aHeader ); ++$i )\n\t\t\t\tif ( $i == 0 ) // the status reply (also starts a new array, which prevents mixing previous header info\n\t\t\t\t{\n\t\t\t\t\t$aHeaderPart = explode( \" \", $aHeader[ $i ], 3 );\n\t\t\t\t\t$this->_requestheader = Array(\n\t\t\t\t\t\t\"response\"=>$aHeader[ $i ],\n\t\t\t\t\t\t\"protocol\"=>$aHeaderPart[ 0 ],\n\t\t\t\t\t\t\"status\"=>$aHeaderPart[ 1 ],\n\t\t\t\t\t\t\"statusinfo\"=>$aHeaderPart[ 2 ]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse // other headers\n\t\t\t\t{\n\t\t\t\t\t$aHeaderPart = explode( \":\", $aHeader[ $i ], 2 );\n\t\t\t\t\t$this->_requestheader[ $aHeaderPart[ 0 ] ] = trim( $aHeaderPart[ 1 ] );\n\t\t\t\t}\n\t\t}", "function getHeader($ch, $header) {\n\t\t\t$i = strpos($header, ':');\n\t\t\tif (!empty($i)) {\n\t\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t\t$this->http_header[$key] = $value;\n\t\t\t}\n\t\t\treturn strlen($header);\n\t\t}", "protected function makeHeader()\n {\n }", "function getHeader($ch, $header) {\r\n\t\t$i = strpos($header, ':');\r\n\t\tif (!empty($i)) {\r\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\r\n\t\t\t$value = trim(substr($header, $i + 2));\r\n\t\t\t$this->http_header[$key] = $value;\r\n\t\t}\t\t\r\n\t\treturn strlen($header);\r\n\t}", "function getHeader($ch, $header) {\n $i = strpos($header, ':');\n if (!empty($i)) {\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n $value = trim(substr($header, $i + 2));\n $this->http_header[$key] = $value;\n }\n return strlen($header);\n }", "function getHeader($ch, $header) {\n\t\t$i = strpos($header, ':');\n\t\tif (!empty($i)) {\n\t\t\t$key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\n\t\t\t$value = trim(substr($header, $i + 2));\n\t\t\t$this->http_header[$key] = $value;\n\t\t}\n\t\treturn strlen($header);\n\t}", "function getHeader($ch, $header) {\r\n $i = strpos($header, ':');\r\n if (!empty($i)) {\r\n $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));\r\n $value = trim(substr($header, $i + 2));\r\n $this->http_header[$key] = $value;\r\n }\r\n return strlen($header);\r\n }" ]
[ "0.63488847", "0.6272041", "0.6093335", "0.598614", "0.5974179", "0.57508093", "0.56601655", "0.5656011", "0.5653876", "0.5631935", "0.56063116", "0.55849534", "0.5550428", "0.55430293", "0.5532497", "0.55167896", "0.5506253", "0.5504489", "0.5491542", "0.5466372", "0.5458938", "0.5443745", "0.5443645", "0.5405249", "0.5400672", "0.53791934", "0.53574735", "0.5353166", "0.53409904", "0.5327262" ]
0.6663151
0
Reads header lines up to an empty line, adding them to the passed $partBuilder.
protected function readHeaders($handle, PartBuilder $partBuilder) { $header = ''; do { $line = $this->readLine($handle); if (empty($line) || $line[0] !== "\t" && $line[0] !== ' ') { $this->addRawHeaderToPart($header, $partBuilder); $header = ''; } else { $line = "\r\n" . $line; } $header .= rtrim($line, "\r\n"); } while ($header !== ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function headerRead(): void\n {\n if (false === $this->getStrategy()->hasHeader() || true === $this->headerRead) {\n return;\n }\n\n $this->rewind();\n $this->skipLeadingLines();\n $this->header = $this->normalizeHeader($this->convertRowToUtf8($this->current()));\n $this->headerRead = true;\n $this->next();\n }", "private function addRawHeaderToPart($header, PartBuilder $partBuilder)\n {\n if ($header !== '' && strpos($header, ':') !== false) {\n $a = explode(':', $header, 2);\n $partBuilder->addHeader($a[0], trim($a[1]));\n }\n }", "public function loadHeader(): void\n {\n $this->openFile('r');\n\n $header = $this->getLine(false);\n --$this->line; // because we don't want to count header line\n\n $this->initializeHeader($header);\n }", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "protected function readPart($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamPartStartPos(ftell($handle));\n \n if ($partBuilder->canHaveHeaders()) {\n $this->readHeaders($handle, $partBuilder);\n $this->lastLineSeparatorLength = 0;\n }\n if ($partBuilder->getParent() === null && !$partBuilder->isMime()) {\n $this->readUUEncodedOrPlainTextMessage($handle, $partBuilder);\n } else {\n $this->readPartContent($handle, $partBuilder);\n }\n }", "public function testEmptyHeaderLines()\n {\n $config = array(\n 'file' => realpath(dirname(__FILE__)).'/../csv/email.csv',\n 'skip_lines' => 1,\n 'header_line' => ''\n );\n\n $node_csv = new \\Giift\\Etl\\Extractor\\Csv($config);\n $node_csv->addOutput($this->node_loader);\n\n $node_csv->extract();\n\n $rs = $this->node_loader->getResult();\n\n $this->assertNotNull($rs);\n $this->assertNotEmpty($rs);\n }", "public function getRawHeader($id = 1, $part = null, $topLines = 0)\n {\n if ($this->_headers === null)\n {\n $EOL = GFNCore_Helper_String::detectEndOfLine($this->_raw);\n if (strpos($this->_raw, $EOL . $EOL) !== false)\n {\n list ($this->_headers) = explode($EOL . $EOL, $this->_raw, 2);\n }\n else\n {\n $this->_headers = '';\n }\n }\n\n return $this->_headers;\n }", "private function parseFileHeader()\n\t{\n\n\t\tif ($this->data)\n\t\t{\n\t\t\t$line = StringHelper::substr($this->data, 0, StringHelper::strpos($this->data, \"\\n\") + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fp = fopen($this->file, 'r');\n\t\t\t$line = fgets($fp, 4096);\n\t\t\t$line = trim($line); // remove white spaces, at the end always \\n (or \\r\\n)\n\t\t\tfclose($fp);\n\t\t}\n\n\t\t$headers = explode($this->columnSeparator, $line);\n\t\t$this->colsNum = count($headers);\n\t\tfor ($i = 0; $i < $this->colsNum; $i++)\n\t\t{\n\t\t\t// -------- remove the utf-8 BOM ----\n\t\t\t$headers[$i] = str_replace(\"\\xEF\\xBB\\xBF\", '', $headers[$i]);\n\t\t\t$this->colsOrder[str_replace('\"', '', trim($headers[$i]))] = $i;\n\t\t\t// some people let white space at the end of text, so better to trim\n\t\t\t// CSV has often begining and ending \" - replace it\n\t\t}\n\t}", "function setHeaders(){\n $position = ftell($this->handle);\n rewind($this->handle);\n $read = $this->readLine();\n if( $read === FALSE){\n die(\"File is empty\");\n \n }else{\n $this->headers = $read;\n }\n\n fseek ($this->handle, $position );\n }", "public function buildHeaderFields() {}", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "private function readHead() {\n\t\t$matches = array();\n\n\t\t// Read and parse status line\n\t\t$status = $this->readLine();\n\t\tif (!preg_match('!^(?:HTTP/(\\d\\.\\d)) (\\d{3})(?: (.+))?!', $status, $matches)) {\n\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Malformed status line: \" . $status);\n\t\t}\n\n\t\t// Debug status line\n\t\tif ($this->client->getLogLevel() >= 2) {\n\t\t\t$this->client->log(\"< \" . trim($status));\n\t\t}\n\n\t\t$this->version = $matches[1];\n\t\t$this->code = intval($matches[2]);\n\t\t$this->message = $matches[3];\n\n\t\t// Read and parse headers\n\t\tdo {\n\t\t\t$line = $this->readLine();\n\n\t\t\t// Debug header line\n\t\t\tif ($this->client->getLogLevel() >= 2) {\n\t\t\t\t$this->client->log(\"< \" . trim($line));\n\t\t\t}\n\n\t\t\tif (preg_match('!^([^\\x00-\\x1f\\x7f-\\xff()<>@,;:\\\\\\\\\"/\\[\\]?={}\\s]+):(.+)$!', $line, $matches)) {\n\t\t\t\t$name = strtolower($matches[1]);\n\t\t\t\t$value = trim($matches[2]);\n\n\t\t\t\t// Put multiple headers with the same name into an array\n\t\t\t\tif (isset($this->headers[$name])) {\n\t\t\t\t\tif (is_array($this->headers[$name])) {\n\t\t\t\t\t\t$this->headers[$name][] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->headers[$name] = array($this->headers[$name], $value);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->headers[$name] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($line !== \"\");\n\t}", "protected function getPartHeaderRaw($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos'], $part['starting-pos-body']);\r\n\t}", "protected function readHeader()\n {\n \t$this->data_mesgs['file_id']['type']=\"TCX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string)$this->file_contents->Activities->Activity->Creator->Name;\n \t$this->data_mesgs['file_id']['number']=(string)$this->file_contents->Author->Build->Version->VersionMajor.\".\".\n \t\t(string)$this->file_contents->Author->Build->Version->VersionMinor;\n \t$datebrut=(string)$this->file_contents->Activities->Activity->Lap['StartTime'];\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t$this->data_mesgs['session']['sport']=(string)$this->file_contents->Activities->Activity['Sport'];\n \t \n }", "function ParseHeader($header='')\n{\n\t$resArr = array();\n\t$headerArr = explode(\"\\n\",$header);\n\tforeach ($headerArr as $key => $value) {\n\t\t$tmpArr=explode(\": \",$value);\n\t\tif (count($tmpArr)<1) continue;\n\t\t$resArr = array_merge($resArr, array($tmpArr[0] => count($tmpArr) < 2 ? \"\" : $tmpArr[1]));\n\t}\n\treturn $resArr;\n}", "private function readPartContent($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $this->findContentBoundary($handle, $partBuilder);\n if ($partBuilder->isMultiPart()) {\n while (!$partBuilder->isParentBoundaryFound()) {\n $child = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getMimePartFactory()\n );\n $partBuilder->addChild($child);\n $this->readPart($handle, $child);\n }\n }\n }", "protected function _readBoxHeader(&$boxLength, &$boxType) {}", "function getQBaseHeaderLine(){\r\n\t\tglobal $LANG;\r\n\t\t$delimeter = $this->extConf['CSV_qualifier'];\r\n\t\t$parter = $delimeter.$this->extConf['CSV_parter'].$delimeter;\r\n\r\n\t\t$csvheader = $delimeter.$this->q_data['uid'].$parter.$this->q_data['header'].$delimeter.\"\\n\\n\";\r\n\r\n\t\t$csvheader .= $delimeter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_questionId').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_questionPlus').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_answer').$parter;\r\n\t\t$csvheader .= $LANG->getLL('CSV_resultIdPlus').$parter;\r\n\t\t$csvheader .= $parter;\r\n\t\t$csvheader .= $delimeter.\"\\n\";\r\n\r\n\t\treturn $csvheader;\r\n\t}", "private function processHeader(): void\n {\n $this->header = $header = $this->translation;\n if (count($description = $header->getComments()->toArray())) {\n $this->translations->setDescription(implode(\"\\n\", $description));\n }\n if (count($flags = $header->getFlags()->toArray())) {\n $this->translations->getFlags()->add(...$flags);\n }\n $headers = $this->translations->getHeaders();\n if (($header->getTranslation() ?? '') !== '') {\n foreach (self::readHeaders($header->getTranslation()) as $name => $value) {\n $headers->set($name, $value);\n }\n }\n $this->pluralCount = $headers->getPluralForm()[0] ?? null;\n foreach (['Language', 'Plural-Forms', 'Content-Type'] as $header) {\n if (($headers->get($header) ?? '') === '') {\n $this->addWarning(\"$header header not declared or empty{$this->getErrorPosition()}\");\n }\n }\n }", "private function _processPDFHeader($matches)\r\n {\r\n //echo \"\\nPDF Header\\n\";\r\n $this->_bagHeader->header = $matches[0]; // matched line\r\n $this->_bagHeader->version = $matches[1]; // version part only\r\n $this->_seenHeader = true;\r\n }", "function\tsetupHeaderMid( $_frm) {\n\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT', FTr::tr( \"Inventory\", null, $this->lang)), $this->defParaFmt) ;\n\t\t$_frm->addLine( iconv( 'UTF-8', 'windows-1252//TRANSLIT',\n\t\t\t\t\t\t\t\t\tFTr::tr( \"Inventory no. #1, Key date #2\",\n\t\t\t\t\t\t\t\t\t\t\tarray( \"%s:\".$this->myInv->InvNo, \"%s:\".$this->myInv->KeyDate),\n\t\t\t\t\t\t\t\t\t\t\t$this->lang)),\n\t\t\t\t\t\t\t\t\t$this->defParaFmt) ;\n\t\t\n\t\t/**\n\t\t * draw the separating line between the header and the document content\n\t\t */\n\t\t$this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0),\n\t\t\t\t\t$_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ;\n\t}", "protected function getPartHeaders($part)\r\n\t{\r\n\t\tif (isset($part['headers'])) {\r\n\t\t\treturn $part['headers'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function readLine()\n {\n $out = $this->read();\n if ($this->withHeader && is_array($out)) {\n $out = array_combine($this->header, $out);\n }\n return $out;\n }", "public function rewind()\n {\n $this->stream->rewind();\n\n // read one line as we do in the constructor\n if ($this->header) {\n $this->header = $this->read();\n }\n }", "protected function parseHeader($header)\n {\n $headers = explode(\"\\n\", trim($header));\n $this->parseHeaders($headers);\n }", "protected function _parseHeader() {}", "function\tsetupHeaderMid( $_frm) {\n\n\t\t$_frm->addLine( \"Kommissionierung\", $this->defParaFmt) ;\n\t\t$_frm->addLine( sprintf( \"Kommission Nr. %s, %s\", $this->myCustomerCommission->CustomerCommissionNo, $this->myCustomerCommission->Datum), $this->defParaFmt) ;\n\n\t\t/**\n\t\t * draw the separating line between the header and the document content\n\t\t */\n\t\t$this->myfpdf->Line( $_frm->horOffs, $_frm->verOffs + $_frm->height + mmToPt( 1.0),\n\t\t\t\t\t\t\t\t$_frm->horOffs + $_frm->width, $_frm->verOffs + $_frm->height + mmToPt( 1.0)) ;\n\t}", "protected function getHeaderPart()\n {\n //$logo_url = ot_get_option('header_logo', 'img/logo.jpg');\n ?>\n <?= $this->version151101() ?>\n <?= $this->getBannerPart() ?>\n <?php\n }", "function privReadFileHeader(&$p_header)\n {\n }" ]
[ "0.66068035", "0.62099993", "0.60436", "0.6035181", "0.59966063", "0.58843535", "0.5817404", "0.5749378", "0.5554507", "0.54822177", "0.5398212", "0.5283301", "0.5273563", "0.52558815", "0.52252173", "0.5161422", "0.51337963", "0.5099408", "0.50793153", "0.5044355", "0.5041578", "0.50356585", "0.5017162", "0.4996249", "0.49839348", "0.492367", "0.49212942", "0.49201143", "0.48871356", "0.48696303" ]
0.7107404
0
Reads lines from the passed $handle, calling $partBuilder>setEndBoundaryFound with the passed line until it returns true or the stream is at EOF. setEndBoundaryFound returns true if the passed line matches a boundary for the $partBuilder itself or any of its parents. Once a boundary is found, setStreamPartAndContentEndPos is called with the passed $handle's read pos before the boundary and its line separator were read.
private function findContentBoundary($handle, PartBuilder $partBuilder) { // last separator before a boundary belongs to the boundary, and is not // part of the current part while (!feof($handle)) { $endPos = ftell($handle) - $this->lastLineSeparatorLength; $line = $this->readBoundaryLine($handle, $this->lastLineSeparatorLength); if ($line !== '' && $partBuilder->setEndBoundaryFound($line)) { $partBuilder->setStreamPartAndContentEndPos($endPos); return; } } $partBuilder->setStreamPartAndContentEndPos(ftell($handle)); $partBuilder->setEof(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function readPartContent($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $this->findContentBoundary($handle, $partBuilder);\n if ($partBuilder->isMultiPart()) {\n while (!$partBuilder->isParentBoundaryFound()) {\n $child = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getMimePartFactory()\n );\n $partBuilder->addChild($child);\n $this->readPart($handle, $child);\n }\n }\n }", "protected function readPart($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamPartStartPos(ftell($handle));\n \n if ($partBuilder->canHaveHeaders()) {\n $this->readHeaders($handle, $partBuilder);\n $this->lastLineSeparatorLength = 0;\n }\n if ($partBuilder->getParent() === null && !$partBuilder->isMime()) {\n $this->readUUEncodedOrPlainTextMessage($handle, $partBuilder);\n } else {\n $this->readPartContent($handle, $partBuilder);\n }\n }", "private function readBoundaryLine($handle, &$lineSeparatorLength = 0)\n {\n $size = 2048;\n $isCut = false;\n $line = fgets($handle, $size);\n while (strlen($line) === $size - 1 && substr($line, -1) !== \"\\n\") {\n $line = fgets($handle, $size);\n $isCut = true;\n }\n $ret = rtrim($line, \"\\r\\n\");\n $lineSeparatorLength = strlen($line) - strlen($ret);\n return ($isCut) ? '' : $ret;\n }", "protected function readUUEncodedOrPlainTextMessage($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $part = $partBuilder;\n while (!feof($handle)) {\n $start = ftell($handle);\n $line = trim($this->readLine($handle));\n if (preg_match('/^begin ([0-7]{3}) (.*)$/', $line, $matches)) {\n $part = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getUUEncodedPartFactory()\n );\n $part->setStreamPartStartPos($start);\n // 'begin' line is part of the content\n $part->setStreamContentStartPos($start);\n $part->setProperty('mode', $matches[1]);\n $part->setProperty('filename', $matches[2]);\n $partBuilder->addChild($part);\n }\n $part->setStreamPartAndContentEndPos(ftell($handle));\n }\n $partBuilder->setStreamPartEndPos(ftell($handle));\n }", "protected function readHeaders($handle, PartBuilder $partBuilder)\n {\n $header = '';\n do {\n $line = $this->readLine($handle);\n if (empty($line) || $line[0] !== \"\\t\" && $line[0] !== ' ') {\n $this->addRawHeaderToPart($header, $partBuilder);\n $header = '';\n } else {\n $line = \"\\r\\n\" . $line;\n }\n $header .= rtrim($line, \"\\r\\n\");\n } while ($header !== '');\n }", "private function readLine($handle)\n {\n $size = 4096;\n $ret = $line = fgets($handle, $size);\n while (strlen($line) === $size - 1 && substr($line, -1) !== \"\\n\") {\n $line = fgets($handle, $size);\n }\n return $ret;\n }", "public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "function readContent(){\n\n if (ftell($this->handle) == 0){\n $this->readLine();\n }\n $this->content = [];\n \n while ( ($read = $this->readLine()) !== FALSE){\n $this->content[] = $read;\n }\n }", "public function handleData($stream)\n {\n // Socket is raw, not using fread as it's interceptable by filters\n // See issues #192, #209, and #240\n $data = stream_socket_recvfrom($stream, $this->bufferSize);;\n\n $limit = $this->state == self::STATUS_BODY ? 1000 : 512;\n if ('' !== $data && false !== $data) {\n $this->lineBuffer .= $data;\n if (strlen($this->lineBuffer) > $limit) {\n $this->sendReply(500, \"Line length limit exceeded.\");\n $this->lineBuffer = '';\n }\n\n $delimiter = \"\\r\\n\";\n while(false !== $pos = strpos($this->lineBuffer, $delimiter)) {\n $line = substr($this->lineBuffer, 0, $pos);\n $this->lineBuffer = substr($this->lineBuffer, $pos + strlen($delimiter));\n $this->emit('line', [$line, $this]);\n }\n }\n\n if ('' === $data || false === $data || !is_resource($stream) || feof($stream)) {\n $this->end();\n }\n }", "private function receiveChunkSizeIndicator($line) {\n $this->chunkLength = (int) hexdec($line);\n $this->chunkPosition = 0;\n\n $this->currentState = ($this->chunkLength === 0)\n ? self::RECEIVE_CHUNKED_FOOTER\n : self::RECEIVE_CHUNKED_DATA;\n }", "protected function read(StreamInterface $stream)\n {\n $partBuilder = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getMessageFactory()\n );\n // the remaining parts use a resource handle for better performance...\n // it seems fgets does much better than Psr7\\readline (not specifically\n // measured, but difference in running tests is big)\n $this->readPart(StreamWrapper::getResource($stream), $partBuilder);\n return $partBuilder;\n }", "public function setHandle($handle)\n\t{\t\t\t\t\n\t\tif ($handle) {\n\t\t\t$this->_handle = $handle;\n\t\t\t\n\t\t\tif ($this->csvSkipFirstLine) {\n\t\t\t\t$this->getItem();\n\t\t\t\t$this->csvSkipFirstLine = 0;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function _getLines(&$text_lines, &$line_no, $end = \\false)\n {\n }", "protected function part($part)\n {\n ['rawHeaders' => $rawHeaders, 'content' => $content] = $this->partHandle($part);\n\n return $this->dataHandle(\n $this->headers($rawHeaders),\n $content\n );\n }", "public function readLine()\n {\n if ($line = trim(fgets($this->fileHandle)))\n {\n return $line;\n }\n\n return false;\n }", "private function _part_decode(&$part)\n {\n //Check for subparts and process them if they exist\n if ( !empty($part->parts)\n && is_array($part->parts))\n {\n foreach ($part->parts as $subPart)\n {\n //We might recurse quite deep so pop here.\n $this->_part_decode($subPart);\n }\n return;\n }\n\n // PONDER: How to handle multiple text bodies better (like in bounce messages)\n\n //Check attachment vs body\n if ( !isset($part->disposition)\n || ( $part->disposition == 'inline'\n && ( isset($part->ctype_primary)\n && strtolower($part->ctype_primary) == 'text')))\n {\n //part is (likely) body\n if ( isset($part->ctype_parameters['charset'])\n && !$this->__orig_encoding)\n {\n $this->__orig_encoding = $part->ctype_parameters['charset'];\n }\n switch (strtolower($part->ctype_secondary))\n {\n default:\n case \"plain\": //Always use plaintext body if found\n // Append *only* if we already have a text body found, otherwise override\n if (!$this->__textBodyFound)\n {\n $this->body = (string)$part->body;\n }\n else\n {\n $this->body .= (string)$part->body;\n }\n $this->__textBodyFound = true;\n break;\n case \"html\":\n if (!$this->__textBodyFound)\n {\n //Try to translate HTML body only if plaintext alternative is not available\n $this->body = $this->html2text($part->body);\n }\n // Append *only* if we already have a HTML body found, otherwise override\n if (!$this->__htmlBodyFound)\n {\n $this->html_body = (string)$part->body;\n }\n else\n {\n $this->html_body .= (string)$part->body;\n }\n $this->__htmlBodyFound = true;\n break;\n }\n }\n else\n {\n //part is (likely) attachment\n /* PONDER: Should we distinguish between attachments and embeds (NOTE: adds complexity to applications\n * using this library since they need the check both arrays and those that actually need to distinguish between\n * the two can also check the attachment['part'] object for details).\n */\n $dataArr = array();\n $dataArr['part'] =& $part;\n $dataArr['mimetype'] = $part->ctype_primary . \"/\" . $part->ctype_secondary;\n $dataArr['content'] =& $dataArr['part']->body;\n if (!empty($part->d_parameters['filename']))\n {\n $dataArr['name'] = $part->d_parameters['filename'];\n }\n else if (!empty($part->ctype_parameters['name']))\n {\n $dataArr['name'] = $part->ctype_parameters['name'];\n }\n else\n {\n $dataArr['name'] = \"unnamed\";\n }\n $this->attachments[] = $dataArr;\n }\n }", "function\n\thandleRawLineByRef (&$line, $pos = null)\n\t{\n\t\tif ((0 == $this->_start) or ($pos < $this->_start))\n\t\t\t$this->_start = $pos;\n\n\t\t$this->_endPos = $pos + strlen ($line);\n\t}", "private function GetSplitLine(&$fh)\n\t{\n\t\tdo {\n\t\t\t$fields = fgetcsv($fh,4096);\n\t\t\tif (is_null($fields) || $fields == FALSE)\n\t\t\t\treturn FALSE;\n\t\t} while (!isset($fields[1]) && is_null($fields[0])); //blank line\n\t\t$some = FALSE;\n\t\t//convert any separator supported by exporter\n\t\tforeach ($fields as &$one) {\n\t\t\tif ($one) {\n\t\t\t\t$some = TRUE;\n\t\t\t\t$one = trim(preg_replace_callback(\n\t\t\t\t\t['/&#\\d\\d;/','/%\\d\\d%/'], [$this,'ToChr'], $one));\n\t\t\t}\n\t\t}\n\t\tunset($one);\n\t\tif ($some)\n\t\t\treturn $fields;\n\t\treturn FALSE; //ignore lines with all fields empty\n\t}", "public function readLine(){\n\t\t\n\t\t$line = '';\n\t\tif( ($offset = strpos($this->data, \"\\r\\n\", 0)) !== false){\n\t\t $line = substr($this->data,0,$offset);\n\t\t $this->data = substr($this->data,$offset+2);\n\t\t $this->_debug(\"line:$line\");\n\t\t $this->_debug(\"left>\\n{$this->data}\");\n\t\t ob_flush();\n\t\t}\n\t\t\n\t\treturn $line;\n\t}", "private function fetch_part_lists($physmessage_id, $part = NULL) {\n\n /*\n * Cached content exists?\n */\n// $cache_key = \"RAW_MESSAGE_{$physmessage_id}_{$part}\";\n// $raw_message_cached = $this->get_cache($cache_key);\n// if (is_object($raw_message_cached)) {\n// return $raw_message_cached;\n// }\n\n $query = \" SELECT dbmail_partlists.part_depth, dbmail_partlists.is_header, dbmail_mimeparts.data \"\n . \" FROM dbmail_partlists \"\n . \" INNER JOIN dbmail_mimeparts on dbmail_partlists.part_id = dbmail_mimeparts.id \"\n . \" WHERE dbmail_partlists.physmessage_id = {$this->dbmail->escape($physmessage_id)} \";\n\n if (strlen($part) > 0) {\n $query .= \" AND dbmail_partlists.part_id = {$this->dbmail->escape($part)} \";\n }\n\n $query .= \" ORDER BY dbmail_partlists.part_key, dbmail_partlists.part_order ASC \";\n\n $result = $this->dbmail->query($query);\n\n $mimeParts = array();\n while ($row = $this->dbmail->fetch_assoc($result)) {\n $mimeParts[] = $row;\n }\n\n $depth = 0;\n $prevdepth = 0;\n $finalized = false;\n $is_header = true;\n $prev_header = true;\n $got_boundary = false;\n $prev_boundary = false;\n $prev_is_message = false;\n $is_message = false;\n $boundary = '';\n $blist = array();\n $index = 0;\n $header = '';\n $body = '';\n $newline = \"\\r\\n\";\n\n foreach ($mimeParts as $mimePart) {\n\n $depth = $mimePart['part_depth'];\n $is_header = $mimePart['is_header'];\n $blob = $mimePart['data'];\n\n if ($is_header) {\n $prev_boundary = $got_boundary;\n\n $is_message = preg_match('~content-type:\\s+message/rfc822\\b~i', $blob);\n }\n\n $got_boundary = false;\n\n $matches = array();\n //$pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\\\s]*)\"?~mi';\n $pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\s]*)\"?~mi';\n if ($is_header && preg_match($pattern, $blob, $matches)) {\n list(,, $boundary) = $matches;\n $got_boundary = true;\n $blist[$depth] = trim($boundary);\n }\n\n /*\n * Code to handle the end of a mime part\n * \n * Testing if:\n * - Previous part was initial part\n * - This part is deeper than the previous (otherwise this part is finalized and the boundary is scrapped)\n * - If a Boundary has been found\n */\n while (($prevdepth > 0) && ($prevdepth - 1 >= $depth) && $blist[$prevdepth - 1]) {\n $body .= $newline . \"--\" . $blist[$prevdepth - 1] . \"--\" . $newline;\n unset($blist[$prevdepth - 1]);\n $prevdepth--;\n $finalized = true;\n }\n\n if (($depth > 0) && (!empty($blist[$depth - 1]))) {\n $boundary = $blist[$depth - 1];\n }\n\n\n /*\n * Code to handle the end of the body\n */\n if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && !$prev_is_message))) {\n //if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && $prev_is_message))) {\n if ($prevdepth > 0) {\n $body .= $newline;\n }\n $body .= \"--\" . $boundary . $newline;\n }\n\n /*\n * Let's handle what we have in the BLOB\n * \n */\n if ($is_header && $depth == 0) {\n $header .= $blob;\n } else {\n $body .= $blob;\n }\n\n $body .= $newline;\n\n /*\n * Saving stuff for next iteration\n */\n $prevdepth = $depth;\n $prev_header = $is_header;\n $prev_is_message = $is_message;\n $index++;\n }\n\n if ($index > 2 && $boundary && !$finalized) {\n $body .= $newline . \"--\" . $boundary . \"--\" . $newline;\n }\n\n $response = new stdClass();\n $response->header = $header;\n $response->body = $body;\n\n /*\n * Store cached content\n */\n// $this->update_cache($cache_key, $response);\n\n return $response;\n }", "public function setLines( mixed $lines );", "private static function has_inline($handle)\n\t{\n\t\tglobal $wp_styles;\n\n\t\tif (isset($wp_styles->registered[$handle]->extra['after']))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "protected function endBoundary($boundary)\n {\n }", "public function testEndline()\n {\n $this->assertEquals( \"\\r\\n\", ezcMailTools::lineBreak() );\n\n // now let's set it and check that it works\n ezcMailTools::setLineBreak( \"\\n\" );\n $this->assertEquals( \"\\n\", ezcMailTools::lineBreak() );\n }", "private function _readLine()\r\n {\r\n if (!feof($this->_fileHandle)) {\r\n $this->_fileBuffer = fgets($this->_fileHandle);\r\n $this->_fileLine++;\r\n //echo htmlentities($this->_fileBuffer);\r\n return 1;\r\n }\r\n \r\n return 0;\r\n }", "public function readLine(int $eol_style): ?string {}", "private function readCurrentRecord()\n {\n if (!$this->valid()) {\n return false;\n }\n \n // === SHX ===\n if (!$this->getOption(Shapefile::OPTION_IGNORE_FILE_SHX)) {\n $this->setFilePointer(Shapefile::FILE_SHX, Shapefile::SHX_HEADER_SIZE + (($this->current_record - 1) * Shapefile::SHX_RECORD_SIZE));\n // Offset (stored as 16-bit words)\n $shp_offset = $this->readInt32B(Shapefile::FILE_SHX) * 2;\n } else {\n $shp_offset = $this->getFilePointer(Shapefile::FILE_SHP);\n }\n \n // === SHP ===\n $this->setFilePointer(Shapefile::FILE_SHP, $shp_offset);\n // Skip Record Number\n $this->setFileOffset(Shapefile::FILE_SHP, 4);\n // Content length (stored as 16-bit words and missing the record header size)\n $content_length = ($this->readInt32B(Shapefile::FILE_SHP) * 2) + Shapefile::SHP_REC_HEADER_SIZE;\n // Shape type\n $shape_type = $this->readInt32L(Shapefile::FILE_SHP);\n if ($shape_type != Shapefile::SHAPE_TYPE_NULL && $shape_type != $this->getShapeType()) {\n throw new ShapefileException(Shapefile::ERR_SHP_WRONG_RECORD_TYPE, $shape_type);\n }\n // Read Geometry\n $Geometry = $this->{self::$shp_read_methods[$shape_type]}();\n // Set SHP file pointer position to next record if there is no SHX file available\n if ($this->getOption(Shapefile::OPTION_IGNORE_FILE_SHX)) {\n $this->setFilePointer(Shapefile::FILE_SHP, $shp_offset + $content_length);\n }\n \n // === DBF ===\n if (!$this->getOption(Shapefile::OPTION_IGNORE_FILE_DBF)) {\n $dbf_file_position = $this->dbf_header_size + (($this->current_record - 1) * $this->dbf_record_size);\n // Check if DBF is not corrupted (some \"naive\" users try to edit the DBF separately...)\n // Some GIS do not include the last Shapefile::DBF_EOF_MARKER (0x1a) byte in the DBF file, hence the \"- 1\" in the following line\n if ($dbf_file_position - 1 >= $this->dbf_file_size - $this->dbf_record_size) {\n throw new ShapefileException(Shapefile::ERR_DBF_EOF_REACHED);\n }\n $this->setFilePointer(Shapefile::FILE_DBF, $dbf_file_position);\n $Geometry->setFlagDeleted($this->readChar(Shapefile::FILE_DBF) === Shapefile::DBF_DELETED_MARKER);\n foreach ($this->dbf_fields as $i => $f) {\n if ($f['ignored']) {\n $this->setFileOffset(Shapefile::FILE_DBF, $f['size']);\n } else {\n $type = $this->getField($f['name'])['type'];\n $value = $this->decodeFieldValue($f['name'], $type, $this->readString(Shapefile::FILE_DBF, $f['size'], true));\n // Memo (DBT)\n if ($type === Shapefile::DBF_TYPE_MEMO && $value) {\n $this->setFilePointer(Shapefile::FILE_DBT, intval($value) * Shapefile::DBT_BLOCK_SIZE);\n $value = '';\n do {\n if ($this->getFilePointer(Shapefile::FILE_DBT) >= $this->dbt_file_size) {\n throw new ShapefileException(Shapefile::ERR_DBT_EOF_REACHED);\n }\n $value .= $this->readString(Shapefile::FILE_DBT, Shapefile::DBT_BLOCK_SIZE, true);\n // Some software only sets ONE field terminator instead of TWO, hence the weird loop condition check:\n } while (ord(substr($value, -1)) != Shapefile::DBT_FIELD_TERMINATOR && ord(substr($value, -2, 1)) != Shapefile::DBT_FIELD_TERMINATOR);\n $value = substr($value, 0, -2);\n }\n $Geometry->setData($f['name'], $value);\n }\n }\n }\n \n // Pair Geometry with Shapefile and return it\n $this->pairGeometry($Geometry);\n return $Geometry;\n }", "public function setMediaBox($boundary, $checkBoundary = true) {}", "public function readLine($length = null, $ending = null)\n {\n // TODO: Implement readLine() method.\n }" ]
[ "0.673486", "0.6716486", "0.5889159", "0.5280628", "0.52759343", "0.50062305", "0.49922523", "0.46349126", "0.44557786", "0.44060352", "0.43990666", "0.43384293", "0.4314821", "0.42370558", "0.42342946", "0.42102474", "0.4207876", "0.41585806", "0.4150167", "0.40995175", "0.40815356", "0.40697467", "0.40530202", "0.4037484", "0.40343964", "0.40339538", "0.40199688", "0.39999563", "0.39986852", "0.399525" ]
0.7598995
0
Reads content for a single part of a MIME message. If the part being read is in turn a multipart part, readPart is called on it recursively to read its headers and content. The start/end positions of the part's content are set on the passed $partBuilder, which in turn sets the end position of the part and its parents.
private function readPartContent($handle, PartBuilder $partBuilder) { $partBuilder->setStreamContentStartPos(ftell($handle)); $this->findContentBoundary($handle, $partBuilder); if ($partBuilder->isMultiPart()) { while (!$partBuilder->isParentBoundaryFound()) { $child = $this->partBuilderFactory->newPartBuilder( $this->partFactoryService->getMimePartFactory() ); $partBuilder->addChild($child); $this->readPart($handle, $child); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function readPart($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamPartStartPos(ftell($handle));\n \n if ($partBuilder->canHaveHeaders()) {\n $this->readHeaders($handle, $partBuilder);\n $this->lastLineSeparatorLength = 0;\n }\n if ($partBuilder->getParent() === null && !$partBuilder->isMime()) {\n $this->readUUEncodedOrPlainTextMessage($handle, $partBuilder);\n } else {\n $this->readPartContent($handle, $partBuilder);\n }\n }", "private function _part_decode(&$part)\n {\n //Check for subparts and process them if they exist\n if ( !empty($part->parts)\n && is_array($part->parts))\n {\n foreach ($part->parts as $subPart)\n {\n //We might recurse quite deep so pop here.\n $this->_part_decode($subPart);\n }\n return;\n }\n\n // PONDER: How to handle multiple text bodies better (like in bounce messages)\n\n //Check attachment vs body\n if ( !isset($part->disposition)\n || ( $part->disposition == 'inline'\n && ( isset($part->ctype_primary)\n && strtolower($part->ctype_primary) == 'text')))\n {\n //part is (likely) body\n if ( isset($part->ctype_parameters['charset'])\n && !$this->__orig_encoding)\n {\n $this->__orig_encoding = $part->ctype_parameters['charset'];\n }\n switch (strtolower($part->ctype_secondary))\n {\n default:\n case \"plain\": //Always use plaintext body if found\n // Append *only* if we already have a text body found, otherwise override\n if (!$this->__textBodyFound)\n {\n $this->body = (string)$part->body;\n }\n else\n {\n $this->body .= (string)$part->body;\n }\n $this->__textBodyFound = true;\n break;\n case \"html\":\n if (!$this->__textBodyFound)\n {\n //Try to translate HTML body only if plaintext alternative is not available\n $this->body = $this->html2text($part->body);\n }\n // Append *only* if we already have a HTML body found, otherwise override\n if (!$this->__htmlBodyFound)\n {\n $this->html_body = (string)$part->body;\n }\n else\n {\n $this->html_body .= (string)$part->body;\n }\n $this->__htmlBodyFound = true;\n break;\n }\n }\n else\n {\n //part is (likely) attachment\n /* PONDER: Should we distinguish between attachments and embeds (NOTE: adds complexity to applications\n * using this library since they need the check both arrays and those that actually need to distinguish between\n * the two can also check the attachment['part'] object for details).\n */\n $dataArr = array();\n $dataArr['part'] =& $part;\n $dataArr['mimetype'] = $part->ctype_primary . \"/\" . $part->ctype_secondary;\n $dataArr['content'] =& $dataArr['part']->body;\n if (!empty($part->d_parameters['filename']))\n {\n $dataArr['name'] = $part->d_parameters['filename'];\n }\n else if (!empty($part->ctype_parameters['name']))\n {\n $dataArr['name'] = $part->ctype_parameters['name'];\n }\n else\n {\n $dataArr['name'] = \"unnamed\";\n }\n $this->attachments[] = $dataArr;\n }\n }", "public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // Get mime content\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id']);\n\n // Decode raw message\n $mime_decoded = $this->decode_raw_message($mime->header . $mime->body);\n if (!$mime_decoded) {\n return FALSE;\n }\n\n // Get message body\n $body = $this->get_message_part_body($mime_decoded, $part);\n\n if ($print) {\n // Print message!\n echo $body;\n }\n return $body;\n }", "protected function part($part)\n {\n ['rawHeaders' => $rawHeaders, 'content' => $content] = $this->partHandle($part);\n\n return $this->dataHandle(\n $this->headers($rawHeaders),\n $content\n );\n }", "protected function getPartBody($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos-body'], $part['ending-pos-body']);\r\n\t}", "public function decodePart(Email $email, $part, $part_number = false)\n {\n $options = ($this->mark_as_read) ? FT_UID : FT_UID | FT_PEEK;\n\n if ($part_number) {\n $data = imap_fetchbody(\n $this->stream(),\n $email->id(),\n $part_number,\n $options\n );\n } else {\n $data = imap_body($this->stream(), $email->id(), $options);\n }\n\n switch ($part->encoding) {\n case 1:\n $data = imap_utf8($data);\n break;\n\n case 2:\n $data = imap_binary($data);\n break;\n\n case 3:\n $data = imap_base64($data);\n break;\n\n case 4:\n $data = quoted_printable_decode($data);\n break;\n }\n\n $params = array();\n if (isset($part->parameters)) {\n foreach ($part->parameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n if (isset($part->dparameters)) {\n foreach ($part->dparameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n // is this part an attachment\n $attachment_id = false;\n $is_attachment = false;\n\n if (\n isset($part->disposition)\n && in_array(strtolower($part->disposition), array('attachment', 'inline'))\n && $part->subtype != 'PLAIN'\n ) {\n $is_attachment = true;\n $attachment_type = strtolower($part->disposition);\n\n if ($attachment_type == 'inline') {\n $is_inline_attachment = true;\n $attachment_id = isset($part->id) ? trim($part->id, \" <>\") : false;\n } else {\n $is_inline_attachment = false;\n $attachment_id = rand();\n }\n }\n\n // if there is an attachment\n if ($is_attachment) {\n $file_name = false;\n\n if (isset($params['filename'])) {\n $file_name = $params['filename'];\n } elseif (isset($params['name'])) {\n $file_name = $params['name'];\n }\n\n if ($file_name) {\n $file_name = $attachment_id . '-' . $file_name;\n\n $attachment = new EmailAttachment();\n $attachment->setId($attachment_id);\n $attachment->setName($file_name);\n\n if ($is_inline_attachment) {\n $attachment->setType('inline');\n } else {\n $attachment->setType('attachment');\n }\n\n if ($this->save_attachments) {\n $attachment->setFilePath(\n $this->attachment_dir . DIRECTORY_SEPARATOR . $attachment->name()\n );\n\n if ($this->attachment_dir && $attachment->filePath()) {\n if (!file_exists($attachment->filePath())) {\n file_put_contents($attachment->filePath(), $data);\n }\n }\n } else {\n //$attachment->setAttachmentContent($data);\n }\n\n $email->addAttachment($attachment);\n }\n } else {\n // if the charset is set, convert to our encoding UTF-8\n if (!empty($params['charset'])) {\n $data = $this->convertEncoding($data, $params['charset']);\n }\n\n // part->type = 0 is TEXT or TYPETEXT\n if (isset($part->type)) {\n if ($part->type == 0) {\n // subpart is either plain text or html version\n if (strtoupper($part->subtype) == 'PLAIN') {\n $email->setPlain($data);\n } else {\n $email->setHTML($data);\n }\n\n // part->type = 2 is MESSAGE\n } elseif ($part->type == 2) {\n $email->setPlain($data);\n }\n }\n }\n\n // rerun for additional parts\n if (!empty($part->parts)) {\n foreach ($part->parts as $subpart_number => $subpart) {\n if ($part->type == 2 && $part->subtype == 'RFC822') {\n $this->decodePart($email, $subpart, $part_number);\n } else {\n $this->decodePart($email, $subpart, $part_number . '.' . ($subpart_number + 1));\n }\n }\n }\n\n return trim($data);\n }", "protected function fetch() {\n\n $content = $this->part->content;\n\n $this->content_type = $this->part->content_type;\n $this->content = $this->oMessage->decodeString($content, $this->part->encoding);\n\n if (($id = $this->part->id) !== null) {\n $this->id = str_replace(['<', '>'], '', $id);\n }else{\n $this->id = hash(\"sha256\", (string)microtime(true));\n }\n\n $this->size = $this->part->bytes;\n $this->disposition = $this->part->disposition;\n\n if (($filename = $this->part->filename) !== null) {\n $this->setName($filename);\n } elseif (($name = $this->part->name) !== null) {\n $this->setName($name);\n }else {\n $this->setName(\"undefined\");\n }\n\n if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {\n if ($this->part->ifdescription) {\n $this->setName($this->part->description);\n } else {\n $this->setName($this->part->subtype);\n }\n }\n }", "public function getRawContent($id = 1, $part = null)\n {\n if ($this->_content === null)\n {\n $EOL = GFNCore_Helper_String::detectEndOfLine($this->_raw);\n if (strpos($this->_raw, $EOL . $EOL) !== false)\n {\n list (, $this->_content) = explode($EOL . $EOL, $this->_raw, 2);\n }\n else\n {\n $this->_content = '';\n }\n }\n\n return $this->_content;\n }", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "private function fetch_part_lists($physmessage_id, $part = NULL) {\n\n /*\n * Cached content exists?\n */\n// $cache_key = \"RAW_MESSAGE_{$physmessage_id}_{$part}\";\n// $raw_message_cached = $this->get_cache($cache_key);\n// if (is_object($raw_message_cached)) {\n// return $raw_message_cached;\n// }\n\n $query = \" SELECT dbmail_partlists.part_depth, dbmail_partlists.is_header, dbmail_mimeparts.data \"\n . \" FROM dbmail_partlists \"\n . \" INNER JOIN dbmail_mimeparts on dbmail_partlists.part_id = dbmail_mimeparts.id \"\n . \" WHERE dbmail_partlists.physmessage_id = {$this->dbmail->escape($physmessage_id)} \";\n\n if (strlen($part) > 0) {\n $query .= \" AND dbmail_partlists.part_id = {$this->dbmail->escape($part)} \";\n }\n\n $query .= \" ORDER BY dbmail_partlists.part_key, dbmail_partlists.part_order ASC \";\n\n $result = $this->dbmail->query($query);\n\n $mimeParts = array();\n while ($row = $this->dbmail->fetch_assoc($result)) {\n $mimeParts[] = $row;\n }\n\n $depth = 0;\n $prevdepth = 0;\n $finalized = false;\n $is_header = true;\n $prev_header = true;\n $got_boundary = false;\n $prev_boundary = false;\n $prev_is_message = false;\n $is_message = false;\n $boundary = '';\n $blist = array();\n $index = 0;\n $header = '';\n $body = '';\n $newline = \"\\r\\n\";\n\n foreach ($mimeParts as $mimePart) {\n\n $depth = $mimePart['part_depth'];\n $is_header = $mimePart['is_header'];\n $blob = $mimePart['data'];\n\n if ($is_header) {\n $prev_boundary = $got_boundary;\n\n $is_message = preg_match('~content-type:\\s+message/rfc822\\b~i', $blob);\n }\n\n $got_boundary = false;\n\n $matches = array();\n //$pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\\\s]*)\"?~mi';\n $pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\s]*)\"?~mi';\n if ($is_header && preg_match($pattern, $blob, $matches)) {\n list(,, $boundary) = $matches;\n $got_boundary = true;\n $blist[$depth] = trim($boundary);\n }\n\n /*\n * Code to handle the end of a mime part\n * \n * Testing if:\n * - Previous part was initial part\n * - This part is deeper than the previous (otherwise this part is finalized and the boundary is scrapped)\n * - If a Boundary has been found\n */\n while (($prevdepth > 0) && ($prevdepth - 1 >= $depth) && $blist[$prevdepth - 1]) {\n $body .= $newline . \"--\" . $blist[$prevdepth - 1] . \"--\" . $newline;\n unset($blist[$prevdepth - 1]);\n $prevdepth--;\n $finalized = true;\n }\n\n if (($depth > 0) && (!empty($blist[$depth - 1]))) {\n $boundary = $blist[$depth - 1];\n }\n\n\n /*\n * Code to handle the end of the body\n */\n if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && !$prev_is_message))) {\n //if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && $prev_is_message))) {\n if ($prevdepth > 0) {\n $body .= $newline;\n }\n $body .= \"--\" . $boundary . $newline;\n }\n\n /*\n * Let's handle what we have in the BLOB\n * \n */\n if ($is_header && $depth == 0) {\n $header .= $blob;\n } else {\n $body .= $blob;\n }\n\n $body .= $newline;\n\n /*\n * Saving stuff for next iteration\n */\n $prevdepth = $depth;\n $prev_header = $is_header;\n $prev_is_message = $is_message;\n $index++;\n }\n\n if ($index > 2 && $boundary && !$finalized) {\n $body .= $newline . \"--\" . $boundary . \"--\" . $newline;\n }\n\n $response = new stdClass();\n $response->header = $header;\n $response->body = $body;\n\n /*\n * Store cached content\n */\n// $this->update_cache($cache_key, $response);\n\n return $response;\n }", "public function get_raw_body($uid, $fp = null, $part = null) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // extract mime parts\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id'], $part);\n\n return $mime->body;\n }", "public function get_body($uid, $part = 1) {\n\n $rcube_message_header = $this->get_message_headers($uid);\n if (!$rcube_message_header) {\n // not found\n return FALSE;\n }\n\n // ACLs checks within method get_message_part()!!!!\n\n return rcube_charset::convert($this->get_message_part($uid, $part, null), $rcube_message_header->charset ? $rcube_message_header->charset : $rcube_message_header->default_charset);\n }", "private function getpart($mbox,$mid,$p,$partno)\n\t{\n\t\t\n\t\t// DECODE DATA\n\t\t$data = ($partno) ?\n\t\timap_fetchbody($mbox,$mid,$partno): // multipart\n\t\timap_body($mbox,$mid); // simple\n\t\n\t\t// Any part may be encoded, even plain text messages, so check everything.\n\t\tif\t($p->encoding==4)\n\t\t\t$data = quoted_printable_decode($data);\n\t\telseif ($p->encoding==3)\n\t\t$data = base64_decode($data);\n\t\n\t\t// PARAMETERS\n\t\t// get all parameters, like charset, filenames of attachments, etc.\n\t\t$params = array();\n\t\tif ($p->parameters)\n\t\t\tforeach ($p->parameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\tif ($p->dparameters)\n\t\t\tforeach ($p->dparameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\n\t\t// ATTACHMENT\n\t\t// Any part with a filename is an attachment,\n\t\t// so an attached text file (type 0) is not mistaken as the message.\n\t\tif ($params['filename'] || $params['name']) {\n\t\t\t// filename may be given as 'Filename' or 'Name' or both\n\t\t\t$filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t\t\t// filename may be encoded, so see imap_mime_header_decode()\n\t\t\t$fname = tempnam(null,'blog-file-');\n\t\t\t$file = fopen($fname,'w');\n\t\t\tfwrite($file,$data);\n\t\t\tfclose($file);\n\t\t\tchmod($fname,0644);\n\t\n\t\t\t$this->filenames[] = array('filename'=>$fname,'name'=>$filename);\n\t\t}\n\t\n\t\t// TEXT\n\t\tif ($p->type==0 && $data) {\n\t\t\t// Messages may be split in different parts because of inline attachments,\n\t\t\t// so append parts together with blank row.\n\t\t\tif (strtolower($p->subtype)=='plain')\n\t\t\t\t$this->text.= trim($data) .\"\\n\\n\";\n\t\t\telse\n\t\t\t\t$this->html.= $data .\"<br><br>\";\n\t\t\t$charset = $params['charset']; // assume all parts are same charset\n\t\t}\n\t\n\t\t// EMBEDDED MESSAGE\n\t\t// Many bounce notifications embed the original message as type 2,\n\t\t// but AOL uses type 1 (multipart), which is not handled here.\n\t\t// There are no PHP functions to parse embedded messages,\n\t\t// so this just appends the raw source to the main message.\n\t\telseif ($p->type==2 && $data) {\n\t\t\t$this->text.= $data.\"\\n\\n\";\n\t\t}\n\t\n\t\t// SUBPART RECURSION\n\t\tif ($p->parts) {\n\t\t\tforeach ($p->parts as $partno0=>$p2)\n\t\t\t\t$this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t\t}\n\t}", "private static function getPart($connection, $messageNumber, $partNumber, $encoding) {\n \t\n \t$data = imap_fetchbody($connection, $messageNumber, $partNumber);\n\n \tswitch($encoding) {\n \t\tcase 0: return $data; // QUOTED_PRINTABLE\n \t\tcase 1: return quoted_printable_decode($data); // 8BIT\n \t\tcase 2: return self::decodeBinary ($data); // BINARY\n \t\tcase 3: return base64_decode($data); // BASE64\n \t\tcase 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE\n \t\tcase 5: return $data; // OTHER\n \t}\n \t\n \t\n }", "protected function readUUEncodedOrPlainTextMessage($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $part = $partBuilder;\n while (!feof($handle)) {\n $start = ftell($handle);\n $line = trim($this->readLine($handle));\n if (preg_match('/^begin ([0-7]{3}) (.*)$/', $line, $matches)) {\n $part = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getUUEncodedPartFactory()\n );\n $part->setStreamPartStartPos($start);\n // 'begin' line is part of the content\n $part->setStreamContentStartPos($start);\n $part->setProperty('mode', $matches[1]);\n $part->setProperty('filename', $matches[2]);\n $partBuilder->addChild($part);\n }\n $part->setStreamPartAndContentEndPos(ftell($handle));\n }\n $partBuilder->setStreamPartEndPos(ftell($handle));\n }", "public function getpart($mbox,$mid,$p,$partno) \n\t{\n\t global $htmlmsg,$plainmsg,$charset,$attachments;\n\n\t $mbox = $this->connection;\n\n\t // DECODE DATA\n\t $data = ($partno)?\n\t imap_fetchbody($mbox,$mid,$partno,FT_PEEK): // multipart\n\t imap_body($mbox,$mid,FT_PEEK); // simple\n\t // Any part may be encoded, even plain text messages, so check everything.\n\t if ($p->encoding==4)\n\t $data = quoted_printable_decode($data);\n\t elseif ($p->encoding==3)\n\t $data = base64_decode($data);\n\n\t // PARAMETERS\n\t // get all parameters, like charset, filenames of attachments, etc.\n\t $params = array();\n\t if (isset($p->parameters) && $p->parameters)\n\t foreach ($p->parameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\t if (isset($p->dparameters) && $p->dparameters)\n\t foreach ($p->dparameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\n\t // ATTACHMENT\n\t // Any part with a filename is an attachment,\n\t // so an attached text file (type 0) is not mistaken as the message.\n\t /*if ( (isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name']) ) {\n\t // filename may be given as 'Filename' or 'Name' or both\n\t $filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t // filename may be encoded, so see imap_mime_header_decode()\n\t $attachments[$filename] = $data; // this is a problem if two files have same name\n\t }*/\n\n\t // TEXT\n\t if ($p->type==0 && $data) {\n\t // Messages may be split in different parts because of inline attachments,\n\t // so append parts together with blank row.\n\t if (strtolower($p->subtype)=='plain')\n\t $plainmsg .= trim($data) .\"\\n\\n\";\n\t else\n\t $htmlmsg .= $data .\"<br><br>\";\n\t $charset = $params['charset']; // assume all parts are same charset\n\t }\n\n\t // EMBEDDED MESSAGE\n\t // Many bounce notifications embed the original message as type 2,\n\t // but AOL uses type 1 (multipart), which is not handled here.\n\t // There are no PHP functions to parse embedded messages,\n\t // so this just appends the raw source to the main message.\n\t elseif ($p->type==2 && $data) {\n\t $plainmsg .= $data.\"\\n\\n\";\n\t }\n\n\t // SUBPART RECURSION\n\t if (isset($p->parts) && $p->parts) {\n\t foreach ($p->parts as $partno0=>$p2)\n\t $this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t }\n\t}", "private function resolveBody(Message $part)\n {\n $body = $part->getBody();\n foreach ($part->getParameters() as $search => $replace) {\n $body = str_replace($search, $replace, $body);\n }\n\n return $body;\n }", "public function get_message_part_start($uid, $message_part=0, $peek=false) {\n\t\t$this->clean($uid, 'uid');\n\n\t\t$peek_str = $peek ? '.PEEK' : '';\n\n\t\tif (empty($message_part)) {\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[]\\r\\n\";\n\t\t}\n\t\telse {\n\t\t\t//$this->clean($message_part, 'msg_part');\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[$message_part]\\r\\n\";\n\t\t}\n\t\t$this->send_command($command);\n\t\t$result = fgets($this->handle);\n\t\t\n\t\t$size = false;\n\t\tif (preg_match(\"/\\{(\\d+)\\}\\r\\n/\", $result, $matches)) {\n\t\t\t$size = $matches[1];\n\t\t}\n\n//\t\tif(!$size)\n//\t\t\treturn false;\n\n\t\t$this->message_part_size=$size;\n\t\t$this->message_part_read=0;\n\n//\t\t\\GO::debug(\"Part size: \".$size);\n\t\treturn $size;\n\t}", "private function get_data( $part = '' ) {\n\n\t\t$basic = array(\n\t\t\t'id' => $this->id,\n\t\t\t'type' => $this->report_type,\n\t\t\t'recipient' => $this->recipient_id,\n\t\t);\n\t\t$fields = array_merge( $basic, (array) $this->comment, (array) $this->meta );\n\n\t\tif ( empty( $part ) )\n\t\t\treturn $fields;\n\t\telseif ( isset( $fields[ $part ] ) )\n\t\t\treturn $fields[ $part ];\n\t}", "private function findContentBoundary($handle, PartBuilder $partBuilder)\n {\n // last separator before a boundary belongs to the boundary, and is not\n // part of the current part\n while (!feof($handle)) {\n $endPos = ftell($handle) - $this->lastLineSeparatorLength;\n $line = $this->readBoundaryLine($handle, $this->lastLineSeparatorLength);\n if ($line !== '' && $partBuilder->setEndBoundaryFound($line)) {\n $partBuilder->setStreamPartAndContentEndPos($endPos);\n return;\n }\n }\n $partBuilder->setStreamPartAndContentEndPos(ftell($handle));\n $partBuilder->setEof();\n }", "public function content($part='body', $inherit=false)\n\t{\n\t\tif($part == 'body')\n\t\t{ \t\n\t\t\tif($this->result == 'view')\n\t\t\t{\n\t\t\t\t$viewPath = '../../plugins/mbblog/views/viewblog';\n\t\t\t} elseif($this->result == 'list')\n\t\t\t{\n\t\t\t\t$viewPath = '../../plugins/mbblog/views/bloglist';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$viewPath = '../../plugins/mbblog/views/noblog';\n\t\t\t}\t\t\n\t\t\treturn new View($viewPath, $this->mbvars);\n\t\t} else\n\t\t{\n\t\t\treturn $this->parent->content($part, $inherit);\n\t\t} \n\t}", "protected function getAttachmentStream($part)\r\n\t{\r\n\t\t$temp_fp = tmpfile();\r\n\r\n\t\t$encoding = array_key_exists('content-transfer-encoding', $part['headers']) ? $this->pickOne($part['headers']['content-transfer-encoding']) : '';\r\n\r\n\t\tif ($temp_fp) {\r\n\t\t\tif ($this->stream) {\r\n\t\t\t\t$start = $part['starting-pos-body'];\r\n\t\t\t\t$end = $part['ending-pos-body'];\r\n\t\t\t\tfseek($this->stream, $start, SEEK_SET);\r\n\t\t\t\t$len = $end - $start;\r\n\t\t\t\t$written = 0;\r\n\t\t\t\t$write = 2028;\r\n\t\t\t\twhile ($written < $len) {\r\n if (($written + $write < $len)) {\r\n $write = $len - $written;\r\n } else if ($len < $write) {\r\n $write = $len;\r\n }\r\n\t\t\t\t\t$attachment = fread($this->stream, $write);\r\n\t\t\t\t\tfwrite($temp_fp, $this->decode($attachment, $encoding));\r\n\t\t\t\t\t$written += $write;\r\n\t\t\t\t}\r\n\t\t\t} else if ($this->data) {\r\n\t\t\t\t$attachment = $this->decode($this->getPartBody($part), $encoding);\r\n\t\t\t\tfwrite($temp_fp, $attachment, strlen($attachment));\r\n\t\t\t}\r\n\t\t\tfseek($temp_fp, 0, SEEK_SET);\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException('Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP.');\r\n\t\t}\r\n\t\treturn $temp_fp;\r\n\t}", "public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}", "function getBody($connection, $msgnum, $part, $partNo) {\n // get charset by parsing the header\n // we should be able to get it if it is not a multipart message\n // do not look for CHARSET from $de_part->properties because $de_part\n // is from imap_fetchstructure() which uses IMAP command\n // \"a fetch <id> FULL\". The IMAP server usually wrongly returns\n // \"US-ASCII\" for a non-multipart message\n $charset = getHeaderCharset($connection, $msgnum);\n if($charset == \"\") {\n $parameters = $part->parameters;\n for ($i = 0; $i < count($parameters); $i++)\n if ($parameters[$i]->attribute == \"CHARSET\")\n\t$charset = $parameters[$i]->value;\n }\n $charset = strtoupper($charset);\n $charset=ereg_replace('\"',\"\",$charset);\n\n $body = imap_fetchbody($connection, $msgnum, $partNo);\n\n if (get_mime_encoding($part) == \"qprint\")\n $body = imap_qprint($body);\n\n // get mime type\n $mimeType = get_mime_type($part);\n\n // get subtype\n $subtype = strtoupper($part->subtype);\n//LOCALE SPECIFIC\n if ($subtype == \"PLAIN\" && ($charset == \"ISO-2022-JP\"\n || $charset == \"EUC_JP\"\n || $charset == \"EUC-JP\")) {\n $j = new EncodingConv($body, \"japanese\");\n return $j->toSJIS();\n } else {\n return $body;\n }\n}", "public function get_message_part($uid, $message_part=0, $peek=false, $max=false, &$maxReached=false) {\n//\t\t$this->clean($uid, 'uid');\n//\n//\t\t$peek_str = $peek ? '.PEEK' : '';\n//\n//\t\tif (empty($message_part)) {\n//\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[]\\r\\n\";\n//\t\t}\n//\t\telse {\n//\t\t\t//$this->clean($message_part, 'msg_part');\n//\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[$message_part]\\r\\n\";\n//\t\t}\n//\t\t$this->send_command($command);\n//\n//\t\t$result = $this->get_response($max, true);\n//\n//\t\t$status = $this->check_response($result, true, false);\n//\n//\t\t$res = '';\n//\t\tforeach ($result as $vals) {\n//\t\t\tif ($vals[0] != '*') {\n//\t\t\t\tcontinue;\n//\t\t\t}\n//\t\t\t$search = true;\n//\t\t\tforeach ($vals as $v) {\n//\t\t\t\tif ($v != ']' && !$search) {\n//\t\t\t\t\t$res = trim(preg_replace(\"/\\s*\\)$/\", '', $v));\n//\t\t\t\t\tbreak 2;\n//\t\t\t\t}\n//\t\t\t\tif (stristr(strtoupper($v), 'BODY')) {\n//\t\t\t\t\t$search = false;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\treturn $res;\n\n\t\t$str = '';\n\t\t$this->get_message_part_start($uid,$message_part, $peek);\n\t\twhile ($line = $this->get_message_part_line()) {\n\t\t\t$str .= $line;\n\t\t}\n\t\treturn $str;\n\t}", "public function copy(): MessagePart\n {\n\n return new MessagePart(\n $this->getContents(),\n $this->getCharset(),\n $this->getMimeType()\n );\n }", "private function readChunk() {\n\t\t// Handle content length\n\t\tif ($this->contentLength > 0) {\n\t\t\t// End of buffer\n\t\t\tif ($this->contentIndex >= $this->contentLength) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// Calculate chunk size to read\n\t\t\t$size = $this->contentLength - $this->contentIndex;\n\t\t\t$size = $size < $this->bufferSize ? $size : $this->bufferSize;\n\t\t\t$data = $this->fread($size);\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Handle chunked transfer encoding\n\t\tif ($this->transferEncoding === \"chunked\") {\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$line = $this->readLine($this->bufferSize);\n\n\t\t\t\t// Curl can produce empty response if first chunk length is 0\n\t\t\t\tif ($line === '') {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\tif (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Invalid chunk length: \" . $line);\n\t\t\t\t} else {\n\t\t\t\t\t$this->chunkLength = hexdec($matches[1]);\n\t\t\t\t\t$this->chunkedContentLength += $this->chunkLength;\n\n\t\t\t\t\t// Chunk with zero length indicates the end\n\t\t\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t\t\t$this->contentLength = $this->chunkedContentLength;\n\t\t\t\t\t\t$this->readLine();\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data = $this->fread(min($this->chunkLength, $this->bufferSize));\n\t\t\t$this->chunkLength -= strlen($data);\n\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$this->readLine(); // Trailing CRLF\n\t\t\t}\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn \"\";\n\t}", "protected function getPartHeaderRaw($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos'], $part['starting-pos-body']);\r\n\t}", "public function removePart(MessagePart $part)\n {\n $parent = $part->getParent();\n if ($this !== $parent && $parent !== null) {\n return $parent->removePart($part);\n } else {\n $position = array_search($part, $this->children, true);\n if ($position !== false && is_int($position)) {\n array_splice($this->children, $position, 1);\n $this->onChange();\n return $position;\n }\n }\n return null;\n }" ]
[ "0.68305254", "0.6226106", "0.6002683", "0.59607077", "0.5956194", "0.5731449", "0.56998205", "0.56652695", "0.5613142", "0.5565673", "0.54748505", "0.54636914", "0.54083896", "0.53898555", "0.53664786", "0.5361076", "0.53534937", "0.5304462", "0.52955014", "0.5270013", "0.5241143", "0.51450026", "0.5093189", "0.5093134", "0.5064596", "0.50426024", "0.50361246", "0.50159824", "0.49445355", "0.49230805" ]
0.69794357
0
Reads a part and any of its children, into the passed $partBuilder, either by calling readUUEncodedOrPlainTextMessage or readPartContent after reading headers.
protected function readPart($handle, PartBuilder $partBuilder) { $partBuilder->setStreamPartStartPos(ftell($handle)); if ($partBuilder->canHaveHeaders()) { $this->readHeaders($handle, $partBuilder); $this->lastLineSeparatorLength = 0; } if ($partBuilder->getParent() === null && !$partBuilder->isMime()) { $this->readUUEncodedOrPlainTextMessage($handle, $partBuilder); } else { $this->readPartContent($handle, $partBuilder); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function readPartContent($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $this->findContentBoundary($handle, $partBuilder);\n if ($partBuilder->isMultiPart()) {\n while (!$partBuilder->isParentBoundaryFound()) {\n $child = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getMimePartFactory()\n );\n $partBuilder->addChild($child);\n $this->readPart($handle, $child);\n }\n }\n }", "private function _part_decode(&$part)\n {\n //Check for subparts and process them if they exist\n if ( !empty($part->parts)\n && is_array($part->parts))\n {\n foreach ($part->parts as $subPart)\n {\n //We might recurse quite deep so pop here.\n $this->_part_decode($subPart);\n }\n return;\n }\n\n // PONDER: How to handle multiple text bodies better (like in bounce messages)\n\n //Check attachment vs body\n if ( !isset($part->disposition)\n || ( $part->disposition == 'inline'\n && ( isset($part->ctype_primary)\n && strtolower($part->ctype_primary) == 'text')))\n {\n //part is (likely) body\n if ( isset($part->ctype_parameters['charset'])\n && !$this->__orig_encoding)\n {\n $this->__orig_encoding = $part->ctype_parameters['charset'];\n }\n switch (strtolower($part->ctype_secondary))\n {\n default:\n case \"plain\": //Always use plaintext body if found\n // Append *only* if we already have a text body found, otherwise override\n if (!$this->__textBodyFound)\n {\n $this->body = (string)$part->body;\n }\n else\n {\n $this->body .= (string)$part->body;\n }\n $this->__textBodyFound = true;\n break;\n case \"html\":\n if (!$this->__textBodyFound)\n {\n //Try to translate HTML body only if plaintext alternative is not available\n $this->body = $this->html2text($part->body);\n }\n // Append *only* if we already have a HTML body found, otherwise override\n if (!$this->__htmlBodyFound)\n {\n $this->html_body = (string)$part->body;\n }\n else\n {\n $this->html_body .= (string)$part->body;\n }\n $this->__htmlBodyFound = true;\n break;\n }\n }\n else\n {\n //part is (likely) attachment\n /* PONDER: Should we distinguish between attachments and embeds (NOTE: adds complexity to applications\n * using this library since they need the check both arrays and those that actually need to distinguish between\n * the two can also check the attachment['part'] object for details).\n */\n $dataArr = array();\n $dataArr['part'] =& $part;\n $dataArr['mimetype'] = $part->ctype_primary . \"/\" . $part->ctype_secondary;\n $dataArr['content'] =& $dataArr['part']->body;\n if (!empty($part->d_parameters['filename']))\n {\n $dataArr['name'] = $part->d_parameters['filename'];\n }\n else if (!empty($part->ctype_parameters['name']))\n {\n $dataArr['name'] = $part->ctype_parameters['name'];\n }\n else\n {\n $dataArr['name'] = \"unnamed\";\n }\n $this->attachments[] = $dataArr;\n }\n }", "protected function partHandle($part)\n {\n // Separate content from headers\n $part = ltrim($part, \"\\r\\n\");\n\n [$rawHeaders, $content] = explode(\"\\r\\n\\r\\n\", $part, 2);\n\n $content = substr($content, 0, strlen($content) - 2);\n // Parse the headers list\n $rawHeaders = explode(\"\\r\\n\", $rawHeaders);\n\n return compact('rawHeaders', 'content');\n }", "protected function part($part)\n {\n ['rawHeaders' => $rawHeaders, 'content' => $content] = $this->partHandle($part);\n\n return $this->dataHandle(\n $this->headers($rawHeaders),\n $content\n );\n }", "protected function fetch() {\n\n $content = $this->part->content;\n\n $this->content_type = $this->part->content_type;\n $this->content = $this->oMessage->decodeString($content, $this->part->encoding);\n\n if (($id = $this->part->id) !== null) {\n $this->id = str_replace(['<', '>'], '', $id);\n }else{\n $this->id = hash(\"sha256\", (string)microtime(true));\n }\n\n $this->size = $this->part->bytes;\n $this->disposition = $this->part->disposition;\n\n if (($filename = $this->part->filename) !== null) {\n $this->setName($filename);\n } elseif (($name = $this->part->name) !== null) {\n $this->setName($name);\n }else {\n $this->setName(\"undefined\");\n }\n\n if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {\n if ($this->part->ifdescription) {\n $this->setName($this->part->description);\n } else {\n $this->setName($this->part->subtype);\n }\n }\n }", "protected function readUUEncodedOrPlainTextMessage($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $part = $partBuilder;\n while (!feof($handle)) {\n $start = ftell($handle);\n $line = trim($this->readLine($handle));\n if (preg_match('/^begin ([0-7]{3}) (.*)$/', $line, $matches)) {\n $part = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getUUEncodedPartFactory()\n );\n $part->setStreamPartStartPos($start);\n // 'begin' line is part of the content\n $part->setStreamContentStartPos($start);\n $part->setProperty('mode', $matches[1]);\n $part->setProperty('filename', $matches[2]);\n $partBuilder->addChild($part);\n }\n $part->setStreamPartAndContentEndPos(ftell($handle));\n }\n $partBuilder->setStreamPartEndPos(ftell($handle));\n }", "protected function getPartBody($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos-body'], $part['ending-pos-body']);\r\n\t}", "private function fetch_part_lists($physmessage_id, $part = NULL) {\n\n /*\n * Cached content exists?\n */\n// $cache_key = \"RAW_MESSAGE_{$physmessage_id}_{$part}\";\n// $raw_message_cached = $this->get_cache($cache_key);\n// if (is_object($raw_message_cached)) {\n// return $raw_message_cached;\n// }\n\n $query = \" SELECT dbmail_partlists.part_depth, dbmail_partlists.is_header, dbmail_mimeparts.data \"\n . \" FROM dbmail_partlists \"\n . \" INNER JOIN dbmail_mimeparts on dbmail_partlists.part_id = dbmail_mimeparts.id \"\n . \" WHERE dbmail_partlists.physmessage_id = {$this->dbmail->escape($physmessage_id)} \";\n\n if (strlen($part) > 0) {\n $query .= \" AND dbmail_partlists.part_id = {$this->dbmail->escape($part)} \";\n }\n\n $query .= \" ORDER BY dbmail_partlists.part_key, dbmail_partlists.part_order ASC \";\n\n $result = $this->dbmail->query($query);\n\n $mimeParts = array();\n while ($row = $this->dbmail->fetch_assoc($result)) {\n $mimeParts[] = $row;\n }\n\n $depth = 0;\n $prevdepth = 0;\n $finalized = false;\n $is_header = true;\n $prev_header = true;\n $got_boundary = false;\n $prev_boundary = false;\n $prev_is_message = false;\n $is_message = false;\n $boundary = '';\n $blist = array();\n $index = 0;\n $header = '';\n $body = '';\n $newline = \"\\r\\n\";\n\n foreach ($mimeParts as $mimePart) {\n\n $depth = $mimePart['part_depth'];\n $is_header = $mimePart['is_header'];\n $blob = $mimePart['data'];\n\n if ($is_header) {\n $prev_boundary = $got_boundary;\n\n $is_message = preg_match('~content-type:\\s+message/rfc822\\b~i', $blob);\n }\n\n $got_boundary = false;\n\n $matches = array();\n //$pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\\\s]*)\"?~mi';\n $pattern = '~^content-type:\\s+.*;(\\r?\\n\\s.*)*\\s+boundary=\"?([a-z0-9\\'()+_,-./:=\\?\\s]*)\"?~mi';\n if ($is_header && preg_match($pattern, $blob, $matches)) {\n list(,, $boundary) = $matches;\n $got_boundary = true;\n $blist[$depth] = trim($boundary);\n }\n\n /*\n * Code to handle the end of a mime part\n * \n * Testing if:\n * - Previous part was initial part\n * - This part is deeper than the previous (otherwise this part is finalized and the boundary is scrapped)\n * - If a Boundary has been found\n */\n while (($prevdepth > 0) && ($prevdepth - 1 >= $depth) && $blist[$prevdepth - 1]) {\n $body .= $newline . \"--\" . $blist[$prevdepth - 1] . \"--\" . $newline;\n unset($blist[$prevdepth - 1]);\n $prevdepth--;\n $finalized = true;\n }\n\n if (($depth > 0) && (!empty($blist[$depth - 1]))) {\n $boundary = $blist[$depth - 1];\n }\n\n\n /*\n * Code to handle the end of the body\n */\n if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && !$prev_is_message))) {\n //if ($is_header && (!$prev_header || $prev_boundary || ($prev_header && $depth > 0 && $prev_is_message))) {\n if ($prevdepth > 0) {\n $body .= $newline;\n }\n $body .= \"--\" . $boundary . $newline;\n }\n\n /*\n * Let's handle what we have in the BLOB\n * \n */\n if ($is_header && $depth == 0) {\n $header .= $blob;\n } else {\n $body .= $blob;\n }\n\n $body .= $newline;\n\n /*\n * Saving stuff for next iteration\n */\n $prevdepth = $depth;\n $prev_header = $is_header;\n $prev_is_message = $is_message;\n $index++;\n }\n\n if ($index > 2 && $boundary && !$finalized) {\n $body .= $newline . \"--\" . $boundary . \"--\" . $newline;\n }\n\n $response = new stdClass();\n $response->header = $header;\n $response->body = $body;\n\n /*\n * Store cached content\n */\n// $this->update_cache($cache_key, $response);\n\n return $response;\n }", "private function get_data( $part = '' ) {\n\n\t\t$basic = array(\n\t\t\t'id' => $this->id,\n\t\t\t'type' => $this->report_type,\n\t\t\t'recipient' => $this->recipient_id,\n\t\t);\n\t\t$fields = array_merge( $basic, (array) $this->comment, (array) $this->meta );\n\n\t\tif ( empty( $part ) )\n\t\t\treturn $fields;\n\t\telseif ( isset( $fields[ $part ] ) )\n\t\t\treturn $fields[ $part ];\n\t}", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // Get mime content\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id']);\n\n // Decode raw message\n $mime_decoded = $this->decode_raw_message($mime->header . $mime->body);\n if (!$mime_decoded) {\n return FALSE;\n }\n\n // Get message body\n $body = $this->get_message_part_body($mime_decoded, $part);\n\n if ($print) {\n // Print message!\n echo $body;\n }\n return $body;\n }", "private function getpart($mbox,$mid,$p,$partno)\n\t{\n\t\t\n\t\t// DECODE DATA\n\t\t$data = ($partno) ?\n\t\timap_fetchbody($mbox,$mid,$partno): // multipart\n\t\timap_body($mbox,$mid); // simple\n\t\n\t\t// Any part may be encoded, even plain text messages, so check everything.\n\t\tif\t($p->encoding==4)\n\t\t\t$data = quoted_printable_decode($data);\n\t\telseif ($p->encoding==3)\n\t\t$data = base64_decode($data);\n\t\n\t\t// PARAMETERS\n\t\t// get all parameters, like charset, filenames of attachments, etc.\n\t\t$params = array();\n\t\tif ($p->parameters)\n\t\t\tforeach ($p->parameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\tif ($p->dparameters)\n\t\t\tforeach ($p->dparameters as $x)\n\t\t\t$params[strtolower($x->attribute)] = $x->value;\n\t\n\t\t// ATTACHMENT\n\t\t// Any part with a filename is an attachment,\n\t\t// so an attached text file (type 0) is not mistaken as the message.\n\t\tif ($params['filename'] || $params['name']) {\n\t\t\t// filename may be given as 'Filename' or 'Name' or both\n\t\t\t$filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t\t\t// filename may be encoded, so see imap_mime_header_decode()\n\t\t\t$fname = tempnam(null,'blog-file-');\n\t\t\t$file = fopen($fname,'w');\n\t\t\tfwrite($file,$data);\n\t\t\tfclose($file);\n\t\t\tchmod($fname,0644);\n\t\n\t\t\t$this->filenames[] = array('filename'=>$fname,'name'=>$filename);\n\t\t}\n\t\n\t\t// TEXT\n\t\tif ($p->type==0 && $data) {\n\t\t\t// Messages may be split in different parts because of inline attachments,\n\t\t\t// so append parts together with blank row.\n\t\t\tif (strtolower($p->subtype)=='plain')\n\t\t\t\t$this->text.= trim($data) .\"\\n\\n\";\n\t\t\telse\n\t\t\t\t$this->html.= $data .\"<br><br>\";\n\t\t\t$charset = $params['charset']; // assume all parts are same charset\n\t\t}\n\t\n\t\t// EMBEDDED MESSAGE\n\t\t// Many bounce notifications embed the original message as type 2,\n\t\t// but AOL uses type 1 (multipart), which is not handled here.\n\t\t// There are no PHP functions to parse embedded messages,\n\t\t// so this just appends the raw source to the main message.\n\t\telseif ($p->type==2 && $data) {\n\t\t\t$this->text.= $data.\"\\n\\n\";\n\t\t}\n\t\n\t\t// SUBPART RECURSION\n\t\tif ($p->parts) {\n\t\t\tforeach ($p->parts as $partno0=>$p2)\n\t\t\t\t$this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t\t}\n\t}", "public function decodePart(Email $email, $part, $part_number = false)\n {\n $options = ($this->mark_as_read) ? FT_UID : FT_UID | FT_PEEK;\n\n if ($part_number) {\n $data = imap_fetchbody(\n $this->stream(),\n $email->id(),\n $part_number,\n $options\n );\n } else {\n $data = imap_body($this->stream(), $email->id(), $options);\n }\n\n switch ($part->encoding) {\n case 1:\n $data = imap_utf8($data);\n break;\n\n case 2:\n $data = imap_binary($data);\n break;\n\n case 3:\n $data = imap_base64($data);\n break;\n\n case 4:\n $data = quoted_printable_decode($data);\n break;\n }\n\n $params = array();\n if (isset($part->parameters)) {\n foreach ($part->parameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n if (isset($part->dparameters)) {\n foreach ($part->dparameters as $param) {\n $params[strtolower($param->attribute)] = $param->value;\n }\n }\n\n // is this part an attachment\n $attachment_id = false;\n $is_attachment = false;\n\n if (\n isset($part->disposition)\n && in_array(strtolower($part->disposition), array('attachment', 'inline'))\n && $part->subtype != 'PLAIN'\n ) {\n $is_attachment = true;\n $attachment_type = strtolower($part->disposition);\n\n if ($attachment_type == 'inline') {\n $is_inline_attachment = true;\n $attachment_id = isset($part->id) ? trim($part->id, \" <>\") : false;\n } else {\n $is_inline_attachment = false;\n $attachment_id = rand();\n }\n }\n\n // if there is an attachment\n if ($is_attachment) {\n $file_name = false;\n\n if (isset($params['filename'])) {\n $file_name = $params['filename'];\n } elseif (isset($params['name'])) {\n $file_name = $params['name'];\n }\n\n if ($file_name) {\n $file_name = $attachment_id . '-' . $file_name;\n\n $attachment = new EmailAttachment();\n $attachment->setId($attachment_id);\n $attachment->setName($file_name);\n\n if ($is_inline_attachment) {\n $attachment->setType('inline');\n } else {\n $attachment->setType('attachment');\n }\n\n if ($this->save_attachments) {\n $attachment->setFilePath(\n $this->attachment_dir . DIRECTORY_SEPARATOR . $attachment->name()\n );\n\n if ($this->attachment_dir && $attachment->filePath()) {\n if (!file_exists($attachment->filePath())) {\n file_put_contents($attachment->filePath(), $data);\n }\n }\n } else {\n //$attachment->setAttachmentContent($data);\n }\n\n $email->addAttachment($attachment);\n }\n } else {\n // if the charset is set, convert to our encoding UTF-8\n if (!empty($params['charset'])) {\n $data = $this->convertEncoding($data, $params['charset']);\n }\n\n // part->type = 0 is TEXT or TYPETEXT\n if (isset($part->type)) {\n if ($part->type == 0) {\n // subpart is either plain text or html version\n if (strtoupper($part->subtype) == 'PLAIN') {\n $email->setPlain($data);\n } else {\n $email->setHTML($data);\n }\n\n // part->type = 2 is MESSAGE\n } elseif ($part->type == 2) {\n $email->setPlain($data);\n }\n }\n }\n\n // rerun for additional parts\n if (!empty($part->parts)) {\n foreach ($part->parts as $subpart_number => $subpart) {\n if ($part->type == 2 && $part->subtype == 'RFC822') {\n $this->decodePart($email, $subpart, $part_number);\n } else {\n $this->decodePart($email, $subpart, $part_number . '.' . ($subpart_number + 1));\n }\n }\n }\n\n return trim($data);\n }", "public function getRawContent($id = 1, $part = null)\n {\n if ($this->_content === null)\n {\n $EOL = GFNCore_Helper_String::detectEndOfLine($this->_raw);\n if (strpos($this->_raw, $EOL . $EOL) !== false)\n {\n list (, $this->_content) = explode($EOL . $EOL, $this->_raw, 2);\n }\n else\n {\n $this->_content = '';\n }\n }\n\n return $this->_content;\n }", "public function get_body($uid, $part = 1) {\n\n $rcube_message_header = $this->get_message_headers($uid);\n if (!$rcube_message_header) {\n // not found\n return FALSE;\n }\n\n // ACLs checks within method get_message_part()!!!!\n\n return rcube_charset::convert($this->get_message_part($uid, $part, null), $rcube_message_header->charset ? $rcube_message_header->charset : $rcube_message_header->default_charset);\n }", "public function getpart($mbox,$mid,$p,$partno) \n\t{\n\t global $htmlmsg,$plainmsg,$charset,$attachments;\n\n\t $mbox = $this->connection;\n\n\t // DECODE DATA\n\t $data = ($partno)?\n\t imap_fetchbody($mbox,$mid,$partno,FT_PEEK): // multipart\n\t imap_body($mbox,$mid,FT_PEEK); // simple\n\t // Any part may be encoded, even plain text messages, so check everything.\n\t if ($p->encoding==4)\n\t $data = quoted_printable_decode($data);\n\t elseif ($p->encoding==3)\n\t $data = base64_decode($data);\n\n\t // PARAMETERS\n\t // get all parameters, like charset, filenames of attachments, etc.\n\t $params = array();\n\t if (isset($p->parameters) && $p->parameters)\n\t foreach ($p->parameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\t if (isset($p->dparameters) && $p->dparameters)\n\t foreach ($p->dparameters as $x)\n\t $params[strtolower($x->attribute)] = $x->value;\n\n\t // ATTACHMENT\n\t // Any part with a filename is an attachment,\n\t // so an attached text file (type 0) is not mistaken as the message.\n\t /*if ( (isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name']) ) {\n\t // filename may be given as 'Filename' or 'Name' or both\n\t $filename = ($params['filename'])? $params['filename'] : $params['name'];\n\t // filename may be encoded, so see imap_mime_header_decode()\n\t $attachments[$filename] = $data; // this is a problem if two files have same name\n\t }*/\n\n\t // TEXT\n\t if ($p->type==0 && $data) {\n\t // Messages may be split in different parts because of inline attachments,\n\t // so append parts together with blank row.\n\t if (strtolower($p->subtype)=='plain')\n\t $plainmsg .= trim($data) .\"\\n\\n\";\n\t else\n\t $htmlmsg .= $data .\"<br><br>\";\n\t $charset = $params['charset']; // assume all parts are same charset\n\t }\n\n\t // EMBEDDED MESSAGE\n\t // Many bounce notifications embed the original message as type 2,\n\t // but AOL uses type 1 (multipart), which is not handled here.\n\t // There are no PHP functions to parse embedded messages,\n\t // so this just appends the raw source to the main message.\n\t elseif ($p->type==2 && $data) {\n\t $plainmsg .= $data.\"\\n\\n\";\n\t }\n\n\t // SUBPART RECURSION\n\t if (isset($p->parts) && $p->parts) {\n\t foreach ($p->parts as $partno0=>$p2)\n\t $this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.\n\t }\n\t}", "private function resolveBody(Message $part)\n {\n $body = $part->getBody();\n foreach ($part->getParameters() as $search => $replace) {\n $body = str_replace($search, $replace, $body);\n }\n\n return $body;\n }", "protected function getPartHeaderRaw($part)\r\n\t{\r\n\t\treturn $this->getData($part['starting-pos'], $part['starting-pos-body']);\r\n\t}", "private static function getPart($connection, $messageNumber, $partNumber, $encoding) {\n \t\n \t$data = imap_fetchbody($connection, $messageNumber, $partNumber);\n\n \tswitch($encoding) {\n \t\tcase 0: return $data; // QUOTED_PRINTABLE\n \t\tcase 1: return quoted_printable_decode($data); // 8BIT\n \t\tcase 2: return self::decodeBinary ($data); // BINARY\n \t\tcase 3: return base64_decode($data); // BASE64\n \t\tcase 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE\n \t\tcase 5: return $data; // OTHER\n \t}\n \t\n \t\n }", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "public function read()\n {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id'])) {\n call('pages', 'error'); //redirect changes the url, so call is better because we can see the id in the url\n return;\n }\n\n try {\n show_view('views/admin/bodyparts/read.php', ['product' => BodyPart::find($_GET['id'])]);\n } catch (Exception $ex) {\n call('pages', 'error');\n }\n }", "function get_attachments($content, $part = null, $skip_parts = false) {\r\n\tstatic $results;\r\n \r\n\t// First round, emptying results\r\n\tif (is_null($part)) {\r\n\t\t$results = array();\r\n\t}\r\n\telse {\r\n\t\t// Removing first dot (.)\r\n\t\tif (substr($part, 0, 1) == '.') {\r\n\t\t\t$part = substr($part, 1);\r\n\t\t}\r\n\t}\r\n \r\n\t// Saving the current part\r\n\t$actualpart = $part;\r\n\t// Split on the \".\"\r\n\t$split = explode('.', $actualpart);\r\n \r\n\t// Skipping parts\r\n\tif (is_array($skip_parts)) {\r\n\t\tforeach ($skip_parts as $p) {\r\n\t\t\t// Removing a row off the array\r\n\t\t\tarray_splice($split, $p, 1);\r\n\t\t}\r\n\t\t// Rebuilding part string\r\n\t\t$actualpart = implode('.', $split);\r\n\t}\r\n \r\n\t// Each time we get the RFC822 subtype, we skip this part.\r\n\tif (strtolower($content->subtype) == 'rfc822') {\r\n\t\t// Never used before, initializing\r\n\t\tif (!is_array($skip_parts)) {\r\n\t\t\t$skip_parts = array();\r\n\t\t}\r\n\t\t// Adding this part into the skip list\r\n\t\tarray_push($skip_parts, count($split));\r\n\t}\r\n \r\n\t// Checking ifdparameters\r\n\tif (isset($content->ifdparameters) && $content->ifdparameters == 1 && isset($content->dparameters) && is_array($content->dparameters)) {\r\n\t\tforeach ($content->dparameters as $object) {\r\n\t\t\tif (isset($object->attribute) && preg_match('~filename~i', $object->attribute)) {\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t'type' => (isset($content->subtype)) ? $content->subtype : '',\r\n\t\t\t\t'encoding' => $content->encoding,\r\n\t\t\t\t'part' => empty($actualpart) ? 1 : $actualpart,\r\n\t\t\t\t'filename' => $object->value\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Checking ifparameters\r\n\telse if (isset($content->ifparameters) && $content->ifparameters == 1 && isset($content->parameters) && is_array($content->parameters)) {\r\n\t\tforeach ($content->parameters as $object) {\r\n\t\t\tif (isset($object->attribute) && preg_match('~name~i', $object->attribute)) {\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t'type' => (isset($content->subtype)) ? $content->subtype : '',\r\n\t\t\t\t'encoding' => $content->encoding,\r\n\t\t\t\t'part' => empty($actualpart) ? 1 : $actualpart,\r\n\t\t\t\t'filename' => $object->value\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Recursivity\r\n\tif (isset($content->parts) && count($content->parts) > 0) {\r\n\t// Other parts into content\r\n\t\tforeach ($content->parts as $key => $parts) {\r\n\t\t\tget_attachments($parts, ($part.'.'.($key + 1)), $skip_parts);\r\n\t\t}\r\n\t}\r\n\treturn $results;\r\n}", "public function get_raw_body($uid, $fp = null, $part = null) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // extract mime parts\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id'], $part);\n\n return $mime->body;\n }", "protected function readHeaders($handle, PartBuilder $partBuilder)\n {\n $header = '';\n do {\n $line = $this->readLine($handle);\n if (empty($line) || $line[0] !== \"\\t\" && $line[0] !== ' ') {\n $this->addRawHeaderToPart($header, $partBuilder);\n $header = '';\n } else {\n $line = \"\\r\\n\" . $line;\n }\n $header .= rtrim($line, \"\\r\\n\");\n } while ($header !== '');\n }", "public function fetchBodypart($folder, $uid, $id)\n {\n $this->select($folder);\n return Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->getBodyPart($uid, $id, true)\n );\n }", "public function getPart($partNum, $upc) {\n \t// Setup xml\n \t$xml = \"<PartGetRq>\\n\";\n \tif (!is_null($partNum)) {\n \t\t$xml .= \"<Number>{$partNum}</Number>\\n\";\n \t} else {\n \t\t$xml .= \"<Number>{$upc}</Number>\\n\";\n \t}\n \t$xml .= \"</PartGetRq>\\n\";\n\t\t\n // Create request and pack\n\t\t$this->createRequest($xml);\n $len = strlen($this->xmlRequest);\n $packed = pack(\"N\", $len);\n\n // Send and get the response\n fwrite($this->id, $packed, 4);\n fwrite($this->id, $this->xmlRequest);\n $this->getResponse();\n\n // Set the result\n $this->setResult($this->parseXML($this->xmlResponse));\n }", "abstract public function get($part = null);", "private function findContentBoundary($handle, PartBuilder $partBuilder)\n {\n // last separator before a boundary belongs to the boundary, and is not\n // part of the current part\n while (!feof($handle)) {\n $endPos = ftell($handle) - $this->lastLineSeparatorLength;\n $line = $this->readBoundaryLine($handle, $this->lastLineSeparatorLength);\n if ($line !== '' && $partBuilder->setEndBoundaryFound($line)) {\n $partBuilder->setStreamPartAndContentEndPos($endPos);\n return;\n }\n }\n $partBuilder->setStreamPartAndContentEndPos(ftell($handle));\n $partBuilder->setEof();\n }", "public static function getPart($group, $part, $element, $scope, $edit = false)\n {\n $subDir =($edit) ? DS.'data' : '';\n\n $path = ECRPATH_PARTS.$subDir.DS.$group.DS.$part;\n $fileName = $path.DS.'part.php';\n\n if( ! JFile::exists($fileName))\n {\n EcrHtml::message(array(jgettext('File not found'), $fileName), 'error');\n\n return null;\n }\n\n require_once $fileName;\n\n $className = 'part'.ucfirst($group).ucfirst($part);\n\n if( ! class_exists($className))\n {\n EcrHtml::message(array(jgettext('Class not found'), $className), 'error');\n\n return null;\n }\n\n $part = new $className($element, $scope, $path);\n\n return $part;\n }", "public function removePart(MessagePart $part)\n {\n $parent = $part->getParent();\n if ($this !== $parent && $parent !== null) {\n return $parent->removePart($part);\n } else {\n $position = array_search($part, $this->children, true);\n if ($position !== false && is_int($position)) {\n array_splice($this->children, $position, 1);\n $this->onChange();\n return $position;\n }\n }\n return null;\n }" ]
[ "0.6854424", "0.6652539", "0.6095895", "0.6033665", "0.59807307", "0.59359163", "0.57688373", "0.57632256", "0.5592209", "0.55527276", "0.55414104", "0.5446301", "0.54287213", "0.53455627", "0.53203166", "0.5269418", "0.5214278", "0.5210474", "0.5188151", "0.51605445", "0.51554024", "0.5143807", "0.50631386", "0.502811", "0.50082886", "0.4994311", "0.4890802", "0.48841", "0.48675257", "0.48633003" ]
0.7132575
0
Reads the message from the passed stream and returns a PartBuilder representing it.
protected function read(StreamInterface $stream) { $partBuilder = $this->partBuilderFactory->newPartBuilder( $this->partFactoryService->getMessageFactory() ); // the remaining parts use a resource handle for better performance... // it seems fgets does much better than Psr7\readline (not specifically // measured, but difference in running tests is big) $this->readPart(StreamWrapper::getResource($stream), $partBuilder); return $partBuilder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse(StreamInterface $stream)\n {\n $partBuilder = $this->read($stream);\n return $partBuilder->createMessagePart($stream);\n }", "public function withBody(ReadableStream $stream): Message;", "protected function readPart($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamPartStartPos(ftell($handle));\n \n if ($partBuilder->canHaveHeaders()) {\n $this->readHeaders($handle, $partBuilder);\n $this->lastLineSeparatorLength = 0;\n }\n if ($partBuilder->getParent() === null && !$partBuilder->isMime()) {\n $this->readUUEncodedOrPlainTextMessage($handle, $partBuilder);\n } else {\n $this->readPartContent($handle, $partBuilder);\n }\n }", "public function readMessage($stream)\n {\n fseek($stream, 0);\n $contents = stream_get_contents($stream);\n return json_decode($contents);\n }", "function read() {\n\t\t$_this =& AmfStream::getInstance();\n\t\treturn $_this->__stream;\n\t}", "protected function readPart()\n {\n $tmpSize = \"\";\n\n while(($read = (string)$this->read(1)) != \"\\n\") {\n $tmpSize .= $read;\n\n if ($this->eof()) {\n return null;\n }\n }\n\n $size = hexdec(trim($tmpSize));\n\n if ($size > 0) {\n $part = $this->read($size);\n } else {\n $part = \"\";\n }\n\n while($this->read(1) != \"\\n\") {\n if ($this->eof()) {\n return null;\n }\n }\n\n return $part;\n }", "public function copy(): MessagePart\n {\n\n return new MessagePart(\n $this->getContents(),\n $this->getCharset(),\n $this->getMimeType()\n );\n }", "abstract public function read(AbstractStream $stream);", "protected function readUUEncodedOrPlainTextMessage($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $part = $partBuilder;\n while (!feof($handle)) {\n $start = ftell($handle);\n $line = trim($this->readLine($handle));\n if (preg_match('/^begin ([0-7]{3}) (.*)$/', $line, $matches)) {\n $part = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getUUEncodedPartFactory()\n );\n $part->setStreamPartStartPos($start);\n // 'begin' line is part of the content\n $part->setStreamContentStartPos($start);\n $part->setProperty('mode', $matches[1]);\n $part->setProperty('filename', $matches[2]);\n $partBuilder->addChild($part);\n }\n $part->setStreamPartAndContentEndPos(ftell($handle));\n }\n $partBuilder->setStreamPartEndPos(ftell($handle));\n }", "public function get_message_part_line() {\n\n\t\t$line=false;\n\t\t$leftOver = $this->message_part_size-$this->message_part_read;\n\t\tif($leftOver>0){\n\n\t\t\t//reading exact length doesn't work if the last char is just one char somehow.\n\t\t\t//we cut the left over later with substr.\n\t\t\t$blockSize = 1024;//$leftOver>1024 ? 1024 : $leftOver;\n\t\t\t$line = fgets($this->handle,$blockSize);\n\t\t\t$this->message_part_read+=strlen($line);\n\t\t}\n\n\t\tif ($this->message_part_size < $this->message_part_read) {\n\n\t\t\t$line = substr($line, 0, ($this->message_part_read-$this->message_part_size)*-1);\n\t\t}\n\n\t\tif($line===false){\n\n\t\t\t//read and check left over response.\n\t\t\t$response=$this->get_response();\n\t\t\t$this->check_response($response);\n\n\t\t}\n\t\treturn $line;\n\t}", "public function readStream();", "private function readPartContent($handle, PartBuilder $partBuilder)\n {\n $partBuilder->setStreamContentStartPos(ftell($handle));\n $this->findContentBoundary($handle, $partBuilder);\n if ($partBuilder->isMultiPart()) {\n while (!$partBuilder->isParentBoundaryFound()) {\n $child = $this->partBuilderFactory->newPartBuilder(\n $this->partFactoryService->getMimePartFactory()\n );\n $partBuilder->addChild($child);\n $this->readPart($handle, $child);\n }\n }\n }", "protected function fetch() {\n\n $content = $this->part->content;\n\n $this->content_type = $this->part->content_type;\n $this->content = $this->oMessage->decodeString($content, $this->part->encoding);\n\n if (($id = $this->part->id) !== null) {\n $this->id = str_replace(['<', '>'], '', $id);\n }else{\n $this->id = hash(\"sha256\", (string)microtime(true));\n }\n\n $this->size = $this->part->bytes;\n $this->disposition = $this->part->disposition;\n\n if (($filename = $this->part->filename) !== null) {\n $this->setName($filename);\n } elseif (($name = $this->part->name) !== null) {\n $this->setName($name);\n }else {\n $this->setName(\"undefined\");\n }\n\n if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {\n if ($this->part->ifdescription) {\n $this->setName($this->part->description);\n } else {\n $this->setName($this->part->subtype);\n }\n }\n }", "public function parse(AbstractStream $stream)\n {\n $value = $this->format($this->read($stream));\n $this->validate($value);\n return $value;\n }", "public function FromBytes($stream)\r\n\t{\r\n\t\t//file_put_contents(\"/tmp/stream-dump.txt\", $stream);\r\n\t\t$used = 0;\r\n\t\twhile ($used < strlen($stream))\r\n\t\t{\r\n\t\t\t$f = new ProtoBuf_Field();\r\n\t\t\t$used += $parsed = $f->FromBytes($stream, $used);\r\n\t\t\tif ($parsed > 0)\r\n\t\t\t\t$this->fields[] = $f;\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function read($pathorstream);", "public function recv()\n {\n $message_len = $this->stream->read(4);\n\n if (strlen($message_len) < 4) {\n throw new Exception('Message size payload should be 4 bytes');\n }\n\n $message_len = reset(unpack('N', $message_len));\n $this->stream_wrapper->clear();\n $this->stream_wrapper->write($this->stream->read($message_len));\n $message = Util::decode($this->stream_wrapper);\n return $message;\n }", "public function get_message_part($uid, $part = 1, $o_part = null, $print = null, $fp = null, $skip_charset_conv = false) {\n\n // Retrieve message record\n $message_metadata = $this->get_message_record($uid);\n if (!$message_metadata) {\n // not found\n return FALSE;\n }\n\n // ACLs check ('read' grant required )\n $ACLs = $this->_get_acl(NULL, $message_metadata['mailbox_idnr']);\n if (!is_array($ACLs) || !in_array(self::ACL_READ_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // Get mime content\n $mime = $this->fetch_part_lists($message_metadata['physmessage_id']);\n\n // Decode raw message\n $mime_decoded = $this->decode_raw_message($mime->header . $mime->body);\n if (!$mime_decoded) {\n return FALSE;\n }\n\n // Get message body\n $body = $this->get_message_part_body($mime_decoded, $part);\n\n if ($print) {\n // Print message!\n echo $body;\n }\n return $body;\n }", "public function get_message_part_start($uid, $message_part=0, $peek=false) {\n\t\t$this->clean($uid, 'uid');\n\n\t\t$peek_str = $peek ? '.PEEK' : '';\n\n\t\tif (empty($message_part)) {\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[]\\r\\n\";\n\t\t}\n\t\telse {\n\t\t\t//$this->clean($message_part, 'msg_part');\n\t\t\t$command = \"UID FETCH $uid BODY\".$peek_str.\"[$message_part]\\r\\n\";\n\t\t}\n\t\t$this->send_command($command);\n\t\t$result = fgets($this->handle);\n\t\t\n\t\t$size = false;\n\t\tif (preg_match(\"/\\{(\\d+)\\}\\r\\n/\", $result, $matches)) {\n\t\t\t$size = $matches[1];\n\t\t}\n\n//\t\tif(!$size)\n//\t\t\treturn false;\n\n\t\t$this->message_part_size=$size;\n\t\t$this->message_part_read=0;\n\n//\t\t\\GO::debug(\"Part size: \".$size);\n\t\treturn $size;\n\t}", "public function deserialize($stream) {\n throw new FormatUnsupported('Cannot deserialize '.($this->mime ? 'from '.$this->mime : 'without mime type'));\n }", "private function _readInput() {\n $input = fopen('php://stdin', 'r');\n\n $message = fgets($input);\n return $this->_trigerMessage($message);\n }", "public static function createFromString($raw)\n {\n $message = new self(array('raw' => $raw));\n return $message;\n }", "public function readone() {\n\t\t$msg = Core_Ipc_Messages::find(['stream' => md5($this->stream)], ['limit' => 1, 'order' => 'msgid']);\n\t\tif(empty($msg)) {\n\t\t\treturn false;\n\t\t}\n\t\t$msg->delete();\n\t\treturn $msg->instance;\n\t}", "public function decode($buffer, $connection)\n { \n return new Message($buffer);\n }", "public static function parse($stream)\n {\n $parent = new self();\n\n $parent->setIndex(substr($stream, 0, strpos($stream, ' ')));\n $stream = str_replace($parent->getIndex() . ' 0 obj', '[{parent_index}] 0 obj', $stream);\n\n // Determine the kids count.\n $matches = [];\n preg_match('/\\/Count\\s\\d*/', $stream, $matches);\n $count = $matches[0];\n $count = str_replace('/Count ', '', $count);\n $stream = str_replace('Count ' . $count, 'Count [{count}]', $stream);\n\n // Determine the kids object indices.\n $kids = trim(substr($stream, (strpos($stream, '/Kids') + 5)));\n $kids = (substr($kids, 0, 1) == '[') ? substr($kids, 0, strpos($kids, ']') + 1) :\n substr($kids, 0, (strpos($kids, ' R') + 2));\n\n $kidIndices = $parent->getDictionaryReferences(substr($stream, (strpos($stream, '/Kids') + 5)));\n\n $parent->setKids($kidIndices);\n $parent->setData(str_replace($kids, '[[{kids}]]', $stream) . \"\\n\");\n\n return $parent;\n }", "private static function getPart($connection, $messageNumber, $partNumber, $encoding) {\n \t\n \t$data = imap_fetchbody($connection, $messageNumber, $partNumber);\n\n \tswitch($encoding) {\n \t\tcase 0: return $data; // QUOTED_PRINTABLE\n \t\tcase 1: return quoted_printable_decode($data); // 8BIT\n \t\tcase 2: return self::decodeBinary ($data); // BINARY\n \t\tcase 3: return base64_decode($data); // BASE64\n \t\tcase 4: return quoted_printable_decode($data); // QUOTED_PRINTABLE\n \t\tcase 5: return $data; // OTHER\n \t}\n \t\n \t\n }", "function readStream( string $_stream_path, IEntitySet $_transform ): IStreamProperties;", "public function readBlocking($len)\n {\n if ($len > self::READ_MAX_LENGTH) {\n throw new \\Kafka\\Exception('Invalid length given, it should be lesser than or equals to ' . self:: READ_MAX_LENGTH);\n }\n\n $null = null;\n $read = [$this->stream];\n $readable = $this->select($read, $this->recvTimeoutSec, $this->recvTimeoutUsec);\n if ($readable === false) {\n $this->close();\n throw new \\Kafka\\Exception('Could not read ' . $len . ' bytes from stream (not readable)');\n }\n if ($readable === 0) { // select timeout\n $res = $this->getMetaData();\n $this->close();\n if (! empty($res['timed_out'])) {\n throw new \\Kafka\\Exception('Timed out reading ' . $len . ' bytes from stream');\n } else {\n throw new \\Kafka\\Exception('Could not read ' . $len . ' bytes from stream (not readable)');\n }\n }\n\n $remainingBytes = $len;\n $data = $chunk = '';\n while ($remainingBytes > 0) {\n $chunk = fread($this->stream, $remainingBytes);\n if ($chunk === false || strlen($chunk) === 0) {\n // Zero bytes because of EOF?\n if (feof($this->stream)) {\n $this->close();\n throw new \\Kafka\\Exception('Unexpected EOF while reading ' . $len . ' bytes from stream (no data)');\n }\n // Otherwise wait for bytes\n $readable = $this->select($read, $this->recvTimeoutSec, $this->recvTimeoutUsec);\n if ($readable !== 1) {\n throw new \\Kafka\\Exception('Timed out while reading ' . $len . ' bytes from socket, ' . $remainingBytes . ' bytes are still needed');\n }\n continue; // attempt another read\n }\n $data .= $chunk;\n $remainingBytes -= strlen($chunk);\n }\n return $data;\n }", "public function read() {\n\t\t// For head requests\n\t\tif ($this->isEmptyBody) {\n\t\t\t$this->close();\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// Currently we don't support any content encodings like gzip or deflate\n\t\t// TODO: Implement this if needed\n\t\tif ($this->contentEncoding) {\n\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Unsupported content encoding: \" . $this->contentEncoding);\n\t\t}\n\n\t\t// Read uncompressed chunk\n\t\t$data = $this->readChunk();\n\n\t\t// Close connection when there is no more data\n\t\tif ($data === \"\") {\n\t\t\t$this->close();\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function extractStream()\n {\n while (true) {\n $buffer = $this->reader->getBuffer(false);\n $length = \\strpos($buffer, 'endstream');\n if ($length === false) {\n if (!$this->reader->increaseLength(100000)) {\n throw new PdfTypeException('Cannot extract stream.');\n }\n continue;\n }\n break;\n }\n\n $buffer = \\substr($buffer, 0, $length);\n $lastByte = \\substr($buffer, -1);\n\n /* Check for EOL marker =\n * CARRIAGE RETURN (\\r) and a LINE FEED (\\n) or just a LINE FEED (\\n},\n * and not by a CARRIAGE RETURN (\\r) alone\n */\n if ($lastByte === \"\\n\") {\n $buffer = \\substr($buffer, 0, -1);\n\n $lastByte = \\substr($buffer, -1);\n if ($lastByte === \"\\r\") {\n $buffer = \\substr($buffer, 0, -1);\n }\n }\n\n // There are streams in the wild, which have only white signs in them but need to be parsed manually due\n // to a problem encountered before (e.g. Length === 0). We should set them to empty streams to avoid problems\n // in further processing (e.g. applying of filters).\n if (trim($buffer) === '') {\n $buffer = '';\n }\n\n return $buffer;\n }" ]
[ "0.6838183", "0.6439426", "0.60644513", "0.58829796", "0.5512297", "0.5490277", "0.53606826", "0.5352189", "0.5244532", "0.51660824", "0.51504374", "0.5119367", "0.5071991", "0.50172114", "0.50018317", "0.49678028", "0.49638468", "0.492821", "0.4925035", "0.49003345", "0.48851526", "0.48422185", "0.4829174", "0.48263988", "0.47773594", "0.47452614", "0.47136953", "0.47068912", "0.46998003", "0.46920076" ]
0.67655414
1
Initialize existent addresses data
protected function initAddresses() { /** @var $customer \Magento\Customer\Model\Customer */ foreach ($this->customerCollection->create() as $customer) { $email = $customer->getEmail(); if (!isset($this->addresses[$customer->getWebsiteId()][$email])) { $this->addresses[$customer->getWebsiteId()][$email] = $customer->getData('default_billing'); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n\t\t$this->addresses = array();\n\t}", "private function resolveAddressData()\n {\n /** @var \\Magento\\Quote\\Model\\Quote $quote */\n $quote = $this->checkoutSession->getQuote();\n /** @var \\Magento\\Quote\\Model\\Quote\\Address $shippingAddress */\n $shippingAddress = $quote->getShippingAddress();\n\n $customerData = $this->geoIp->getCurrentLocation();\n if ($customerData->getCode() && $this->helper->isCountryAllowed($customerData->getCode())) {\n /** @var \\Magento\\Directory\\Model\\Country $currentCountry */\n $currentCountry = $shippingAddress\n ->getCountryModel()\n ->loadByCode($customerData->getCode());\n\n if (!$currentCountry) {\n return;\n }\n\n $shippingAddress->setCountryId($currentCountry->getId());\n $shippingAddress->setRegion($customerData->getRegion());\n $shippingAddress->setRegionCode($customerData->getRegionCode());\n $shippingAddress->setCity($customerData->getCity());\n $shippingAddress->setPostcode($customerData->getPosttalCode());\n\n $regionModel = $this->regionFactory->create();\n if ($customerData->getRegionCode() && $currentCountry->getId()) {\n $regionModel->loadByCode($customerData->getRegionCode(), $currentCountry->getId());\n $regionId = $regionModel->getRegionId();\n $shippingAddress->setRegionId($regionId);\n }\n }\n }", "protected function _initShippingAddress()\n {\n /**\n *\n * @note Import customer default shipping address\n *\n */\n $this->getQuote()->getShippingAddress()->importCustomerAddressData(\n $this->getCustomerSession()->getCustomer()->getDefaultShippingAddress()->getDataModel()\n );\n }", "public function collectAddressData()\n {\n try {\n $components = collect($this->response->address_components);\n\n $this->address_data = $components->filter(function ($element) {\n $types = collect($element->types);\n\n return $types->search('street_number') !== false ||\n $types->search('route') !== false ||\n $types->search('locality') !== false ||\n $types->search('administrative_area_level_1') !== false || // province, normalement, short et long form\n $types->search('country') !== false ||\n $types->search('postal_code') !== false;\n })->mapWithKeys(function ($item) {\n return [$item->types[0] => $item->long_name];\n });\n } catch (\\Exception $e) {\n $this->address_data = null;\n }\n\n return $this;\n }", "public static function data_addresses() {\n\n\t\t$data = array(\n\t\t\tarray(\n\t\t\t\t'address' => '1175 Stony Park Witch Hazel, Nebraska 69258-4226',\n\t\t\t\t'phone' => '(308) 588-6126',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2854 Burning Pine Route Dog Corner, New Mexico 87313-2329',\n\t\t\t\t'phone' => '(505) 665-5353',\n\t\t\t\t'lat' => '35.76488',\n\t\t\t\t'lng' => '-108.1903059',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Broad Pond Edge Brown Shanty, Colorado 81686-3084',\n\t\t\t\t'phone' => '(303) 410-6031',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8711 Fallen By-pass Free, Arkansas 72968-5919',\n\t\t\t\t'phone' => '(479) 272-1089',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4987 Merry Fox Falls Speedsville, New Mexico 87609-9834',\n\t\t\t\t'phone' => '(505) 523-5318',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4338 Easy Lagoon Mews Finland, North Dakota 58905-5049',\n\t\t\t\t'phone' => '(701) 474-6073',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Cinder View Trace Deloraine, Michigan 48363-3520',\n\t\t\t\t'phone' => '(313) 089-6913',\n\t\t\t\t'lat' => '42.7664746',\n\t\t\t\t'lng' => '-83.1541796',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6613 Golden Corner Polecat Bay, South Carolina 29248-0849',\n\t\t\t\t'phone' => '(843) 922-1045',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '305 Jagged Grounds Estiffanulga, Minnesota 55180-3195',\n\t\t\t\t'phone' => '(320) 498-0046',\n\t\t\t\t'lat' => '46.729553',\n\t\t\t\t'lng' => '-94.6858998',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6860 Crystal Ridge Possum Trot, Tennessee 37454-4951',\n\t\t\t\t'phone' => '(931) 573-5387',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3551 Pleasant Point Glen Raven, District of Columbia 20054-8428',\n\t\t\t\t'phone' => '(202) 389-4349',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7199 Sunny Nook Paydown, Maine 04353-6633',\n\t\t\t\t'phone' => '(207) 674-4096',\n\t\t\t\t'lat' => '44.2238966',\n\t\t\t\t'lng' => '-69.6199357',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2743 Thunder Port Chestermere, Missouri 63937-5966',\n\t\t\t\t'phone' => '(417) 123-9433',\n\t\t\t\t'lat' => '36.9301095',\n\t\t\t\t'lng' => '-90.7722974',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3760 Silver Prairie Townline Tiger Tail, Utah 84609-2369',\n\t\t\t\t'phone' => '(435) 290-2684',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2546 Clear Bear Range Tunnel Hill, Wyoming 83067-1217',\n\t\t\t\t'phone' => '(307) 236-9552',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2758 Cotton Campus Swindleville, Oklahoma 73758-8899',\n\t\t\t\t'phone' => '(580) 622-1215',\n\t\t\t\t'lat' => '36.9587896',\n\t\t\t\t'lng' => '-98.068343',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9000 Indian Embers Trail Little Water, North Dakota 58269-0906',\n\t\t\t\t'phone' => '(701) 719-4564',\n\t\t\t\t'lat' => '48.6914843',\n\t\t\t\t'lng' => '-98.165204',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '544 Noble Mountain Dell Ste. Rose du Lac, Nevada 88962-4758',\n\t\t\t\t'phone' => '(775) 731-8736',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6074 Emerald Gate Passage Waggy, Louisiana 70677-4881',\n\t\t\t\t'phone' => '(225) 476-0583',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9159 Hazy Zephyr Moor Gravesend, Vermont 05333-5210',\n\t\t\t\t'phone' => '(802) 410-3565',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9919 Green Wagon Impasse Manifest, Hawaii 96717-8463',\n\t\t\t\t'phone' => '(808) 083-9986',\n\t\t\t\t'lat' => '21.5707975',\n\t\t\t\t'lng' => '-157.8927472',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1355 Blue Cove Scooba, Maine 04243-6502',\n\t\t\t\t'phone' => '(207) 298-7328',\n\t\t\t\t'lat' => '44.1',\n\t\t\t\t'lng' => '-70.22',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6356 Sleepy Chase Zipperlandville, Illinois 61835-9234',\n\t\t\t\t'phone' => '(815) 108-7735',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2531 Rustic Anchor Acres Hungry Hill, Maryland 20768-4906',\n\t\t\t\t'phone' => '(240) 370-9692',\n\t\t\t\t'lat' => '39',\n\t\t\t\t'lng' => '-76.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9957 Gentle Arbor Irricana, Delaware 19897-5853',\n\t\t\t\t'phone' => '(302) 440-8338',\n\t\t\t\t'lat' => '39.7856696',\n\t\t\t\t'lng' => '-75.5461494',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3187 High Promenade Fairdealing, Nebraska 69508-1675',\n\t\t\t\t'phone' => '(531) 725-6138',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6337 Amber Bend Funny River, Illinois 62817-4327',\n\t\t\t\t'phone' => '(217) 557-9408',\n\t\t\t\t'lat' => '37.9788798',\n\t\t\t\t'lng' => '-88.4500789',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9266 Shady Willow Cape Antlers, Alaska 99623-7664',\n\t\t\t\t'phone' => '(907) 409-4067',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Bright Goose Pike Big Black, Arkansas 71766-8350',\n\t\t\t\t'phone' => '(870) 377-6554',\n\t\t\t\t'lat' => '33.7046265',\n\t\t\t\t'lng' => '-92.4801989',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4111 Dewy Oak Manor Tennis, Massachusetts 02575-2415',\n\t\t\t\t'phone' => '(774) 709-4623',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '847 Rocky Cider Mountain Smoke Tree, North Carolina 28828-1331',\n\t\t\t\t'phone' => '(910) 433-1420',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7617 Wishing Brook Close Red Scaffold, Indiana 46881-1212',\n\t\t\t\t'phone' => '(574) 444-1553',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2480 Foggy Common Ragged Top, Washington 98961-5250',\n\t\t\t\t'phone' => '(360) 421-1646',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3492 Grand Forest Khwunrghunme, Michigan 49756-9037',\n\t\t\t\t'phone' => '(734) 937-3419',\n\t\t\t\t'lat' => '44.8212897',\n\t\t\t\t'lng' => '-84.3121264',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7416 Little Sky Freeway Rockglen, District of Columbia 20019-1929',\n\t\t\t\t'phone' => '(202) 237-8148',\n\t\t\t\t'lat' => '38.8910932',\n\t\t\t\t'lng' => '-76.947022',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9615 Iron Gate Four Locks, Nevada 89913-4822',\n\t\t\t\t'phone' => '(775) 426-4311',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6148 Old Diversion Tuggleville, Massachusetts 02337-2879',\n\t\t\t\t'phone' => '(857) 963-7280',\n\t\t\t\t'lat' => '42.0135823',\n\t\t\t\t'lng' => '-70.9618707',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6296 Quiet Limits Fort Nonsense, Alabama 35677-0818',\n\t\t\t\t'phone' => '(334) 098-7277',\n\t\t\t\t'lat' => '34.9568241',\n\t\t\t\t'lng' => '-88.0314174',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8939 Hidden Shadow Farms Granum, Connecticut 06587-8468',\n\t\t\t\t'phone' => '(475) 803-0416',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9165 Umber Horse Lane Pukwana, Utah 84914-5320',\n\t\t\t\t'phone' => '(801) 644-3244',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8216 Dusty Meadow India, Idaho 83960-6689',\n\t\t\t\t'phone' => '(208) 435-1588',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2405 Velvet Place Rob Roy, Oklahoma 74463-5905',\n\t\t\t\t'phone' => '(580) 100-1857',\n\t\t\t\t'lat' => '35.7558792',\n\t\t\t\t'lng' => '-95.5551652',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2739 Tawny Hills Harbour Kansas City, Minnesota 55068-2994',\n\t\t\t\t'phone' => '(763) 680-7609',\n\t\t\t\t'lat' => '44.7530325',\n\t\t\t\t'lng' => '-93.0776568',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3633 Round Elk Street Lick Fork, Colorado 80247-7628',\n\t\t\t\t'phone' => '(303) 519-5784',\n\t\t\t\t'lat' => '39.6974551',\n\t\t\t\t'lng' => '-104.8746508',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5392 Harvest Log Villas Beantown, Virginia 24261-9429',\n\t\t\t\t'phone' => '(757) 666-1162',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3766 Red Quail Expressway Sopchoppy, Missouri 65567-6848',\n\t\t\t\t'phone' => '(660) 947-1822',\n\t\t\t\t'lat' => '37.8343507',\n\t\t\t\t'lng' => '-92.5495112',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5648 Honey Hill Fair Play, Nevada 89530-3031',\n\t\t\t\t'phone' => '(775) 838-1520',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6422 Fallen Fox Dell Uchi, Rhode Island 02952-2526',\n\t\t\t\t'phone' => '(401) 087-8528',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2316 Cinder Sky Moor Morning View, New Mexico 87980-3617',\n\t\t\t\t'phone' => '(505) 298-8521',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2219 Quiet Embers Thicket Seven Oaks, Louisiana 70773-8954',\n\t\t\t\t'phone' => '(318) 793-9794',\n\t\t\t\t'lat' => '30.6070469',\n\t\t\t\t'lng' => '-91.3710402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9442 Rustic Concession Kidtown, Illinois 61570-6195',\n\t\t\t\t'phone' => '(217) 402-8450',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1909 Cozy Via Hooker Corner, Utah 84719-1105',\n\t\t\t\t'phone' => '(385) 721-9721',\n\t\t\t\t'lat' => '37.6775836',\n\t\t\t\t'lng' => '-112.8343844',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2904 Heather Quail View Ernfold, Florida 34857-4872',\n\t\t\t\t'phone' => '(305) 192-2293',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9839 Harvest Terrace Ohiopyle, Wyoming 82363-8477',\n\t\t\t\t'phone' => '(307) 786-6676',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5298 Gentle Harbour Swamp Fox, Arizona 85258-7476',\n\t\t\t\t'phone' => '(480) 945-9607',\n\t\t\t\t'lat' => '33.5669912',\n\t\t\t\t'lng' => '-111.8985922',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9469 Thunder Port Forget, West Virginia 25796-2759',\n\t\t\t\t'phone' => '(304) 930-4028',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7187 Hazy Private Birtle, Alabama 35219-5488',\n\t\t\t\t'phone' => '(256) 624-0268',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1033 Bright Forest Shin Hollow, New York 12454-5275',\n\t\t\t\t'phone' => '(718) 871-5723',\n\t\t\t\t'lat' => '42.2910991',\n\t\t\t\t'lng' => '-74.1592278',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4634 Old Branch Heath Crumrod, Washington 99353-4257',\n\t\t\t\t'phone' => '(360) 093-9697',\n\t\t\t\t'lat' => '46.4132585',\n\t\t\t\t'lng' => '-119.4197414',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '428 Wishing Park Frostproof, Oregon 97948-9195',\n\t\t\t\t'phone' => '(458) 093-6584',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8095 Silent Autumn Mews Summertime, Oklahoma 73173-9098',\n\t\t\t\t'phone' => '(580) 064-3854',\n\t\t\t\t'lat' => '35.3364517',\n\t\t\t\t'lng' => '-97.6222665',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3838 Cotton Bend Rapture, District of Columbia 20092-1246',\n\t\t\t\t'phone' => '(202) 408-8807',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '136 Green Prairie By-pass Chappaquiddick, Alabama 35143-8644',\n\t\t\t\t'phone' => '(334) 878-7089',\n\t\t\t\t'lat' => '33.0991185',\n\t\t\t\t'lng' => '-86.5602614',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6744 Foggy Panda Hollow Four Bears Village, Massachusetts 01836-1710',\n\t\t\t\t'phone' => '(339) 877-5101',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Pleasant Cloud Corners Bucklesberry, Texas 79634-2471',\n\t\t\t\t'phone' => '(430) 045-9307',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7739 Golden Leaf Highway Sixes, California 94802-8145',\n\t\t\t\t'phone' => '(408) 759-3038',\n\t\t\t\t'lat' => '37.94',\n\t\t\t\t'lng' => '-122.36',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7761 Quaking Cove Waldheim, Alabama 36811-9935',\n\t\t\t\t'phone' => '(256) 439-3656',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2016 Honey Downs Lunenburg, Alabama 36444-4744',\n\t\t\t\t'phone' => '(334) 539-9475',\n\t\t\t\t'lat' => '31.6711853',\n\t\t\t\t'lng' => '-87.4405786',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4862 Jagged Goose Woods Hog Eye, Idaho 83723-2986',\n\t\t\t\t'phone' => '(208) 870-7519',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3085 Blue Hickory Quay Bell Buckle, Massachusetts 01800-4101',\n\t\t\t\t'phone' => '(508) 992-6644',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1970 Round Freeway Frog Town, Washington 98616-3325',\n\t\t\t\t'phone' => '(253) 244-8709',\n\t\t\t\t'lat' => '46.1794789',\n\t\t\t\t'lng' => '-122.1561155',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3350 Emerald Expressway Hardup, Rhode Island 02983-8455',\n\t\t\t\t'phone' => '(401) 829-1654',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4668 Dusty Spring Link Lampadocia, Florida 33678-2548',\n\t\t\t\t'phone' => '(850) 277-3318',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5044 Rocky Falls Scratch Ankle, Massachusetts 02233-6502',\n\t\t\t\t'phone' => '(339) 608-9455',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4990 Indian Run Jumbo Landing, Kansas 66264-6247',\n\t\t\t\t'phone' => '(913) 450-8901',\n\t\t\t\t'lat' => '39.011902',\n\t\t\t\t'lng' => '-98.4842465',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5366 Iron Round Hardmoney, Mississippi 38651-2412',\n\t\t\t\t'phone' => '(228) 415-6114',\n\t\t\t\t'lat' => '34.8955106',\n\t\t\t\t'lng' => '-90.0466559',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9587 Noble Fawn Wood Silton, Utah 84515-3673',\n\t\t\t\t'phone' => '(435) 680-2014',\n\t\t\t\t'lat' => '38.911433',\n\t\t\t\t'lng' => '-109.140438',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7947 Tawny Bank Glen Campbell, New Jersey 08965-3916',\n\t\t\t\t'phone' => '(908) 243-5474',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4086 Shady Swale Symbol, Connecticut 06452-9480',\n\t\t\t\t'phone' => '(860) 816-1261',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5450 Red Point Thankful, District of Columbia 20085-4124',\n\t\t\t\t'phone' => '(202) 097-4695',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8648 Sunny Abbey Poysippi, Arkansas 71807-9239',\n\t\t\t\t'phone' => '(479) 685-9599',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9671 Amber Meadow Bullhead City, Connecticut 06195-6843',\n\t\t\t\t'phone' => '(475) 181-4842',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1003 Velvet Passage Swamproot, Florida 32977-8675',\n\t\t\t\t'phone' => '(305) 352-4895',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1822 Clear Rabbit Heights Hardscrabble Corner, Maryland 21902-5168',\n\t\t\t\t'phone' => '(240) 459-3194',\n\t\t\t\t'lat' => '39.5519225',\n\t\t\t\t'lng' => '-76.0667488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6657 Red Cape Jumbotown, South Dakota 57009-7025',\n\t\t\t\t'phone' => '(605) 051-3665',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1736 Lost Lake Private Apponagansett, Colorado 81664-5410',\n\t\t\t\t'phone' => '(719) 056-7029',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3840 Easy Bend Village Thirteen, North Carolina 28961-7505',\n\t\t\t\t'phone' => '(828) 335-6063',\n\t\t\t\t'lat' => '33.9790349',\n\t\t\t\t'lng' => '-81.0094511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4449 Emerald Goose Corner White Swan, Delaware 19914-5031',\n\t\t\t\t'phone' => '(302) 768-7121',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1726 Iron Pond Key Farewell, Utah 84430-5042',\n\t\t\t\t'phone' => '(801) 997-1471',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7984 Hidden Hills Route Radical, Maryland 21826-2709',\n\t\t\t\t'phone' => '(301) 118-3207',\n\t\t\t\t'lat' => '38.319091',\n\t\t\t\t'lng' => '-75.6237184',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '254 Jagged Grove Towers Skokomish, Michigan 49764-5965',\n\t\t\t\t'phone' => '(810) 808-1222',\n\t\t\t\t'lat' => '45.4227613',\n\t\t\t\t'lng' => '-84.8275195',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7013 Amber Butterfly Carrefour White Iron, Alabama 36391-7622',\n\t\t\t\t'phone' => '(251) 184-2094',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2152 Foggy Brook Turnabout Hangman Crossing, Connecticut 06556-8181',\n\t\t\t\t'phone' => '(203) 471-8901',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3522 Stony Timber Swale Little Black, Nebraska 68531-8030',\n\t\t\t\t'phone' => '(531) 896-6498',\n\t\t\t\t'lat' => '40.8991047',\n\t\t\t\t'lng' => '-96.722641',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5903 Velvet Log Square Tingle, Nevada 89258-0703',\n\t\t\t\t'phone' => '(775) 480-4956',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1666 Tawny Hickory Bay Quoddy, South Carolina 29810-1362',\n\t\t\t\t'phone' => '(864) 760-6510',\n\t\t\t\t'lat' => '32.98209',\n\t\t\t\t'lng' => '-81.3619402',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '549 Golden Cider Moor Changewater, Idaho 83736-4490',\n\t\t\t\t'phone' => '(208) 757-6906',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6342 Sunny Embers Trail Nickajack, Louisiana 71225-2282',\n\t\t\t\t'phone' => '(337) 704-5874',\n\t\t\t\t'lat' => '32.5040767',\n\t\t\t\t'lng' => '-92.3517526',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '870 Round Circuit Crumrod, North Dakota 58569-6155',\n\t\t\t\t'phone' => '(701) 752-7907',\n\t\t\t\t'lat' => '46.2326345',\n\t\t\t\t'lng' => '-101.2387062',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Gentle Run Mudtavern, South Dakota 57420-4755',\n\t\t\t\t'phone' => '(605) 329-6911',\n\t\t\t\t'lat' => '45.2565588',\n\t\t\t\t'lng' => '-100.162177',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7000 Honey Fox Ridge Asphaltum, Oklahoma 74163-8162',\n\t\t\t\t'phone' => '(918) 254-3808',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5404 Thunder Vale Paydown, Utah 84529-9748',\n\t\t\t\t'phone' => '(801) 496-4369',\n\t\t\t\t'lat' => '39.7235022',\n\t\t\t\t'lng' => '-110.7956878',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5715 Harvest Gate Vista Perennial, Massachusetts 01775-4618',\n\t\t\t\t'phone' => '(351) 819-4468',\n\t\t\t\t'lat' => '42.4195323',\n\t\t\t\t'lng' => '-71.5130445',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3792 Misty Forest Loop Nanatlugunyi, Florida 34626-6008',\n\t\t\t\t'phone' => '(561) 250-4253',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8967 Wishing Robin Abbey Delightful, California 91223-0883',\n\t\t\t\t'phone' => '(858) 369-2837',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7881 Clear Deer Orchard Earth City, North Carolina 28790-1923',\n\t\t\t\t'phone' => '(334) 742-0656',\n\t\t\t\t'lat' => '35.2122099',\n\t\t\t\t'lng' => '-82.4861053',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1424 Blue Freeway Calypso, Oregon 97366-8616',\n\t\t\t\t'phone' => '(541) 518-7818',\n\t\t\t\t'lat' => '44.5772172',\n\t\t\t\t'lng' => '-124.053674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6984 Green Crest Comet, Colorado 80879-7122',\n\t\t\t\t'phone' => '(303) 805-7076',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3444 Merry Zephyr Bank St. Anthony, Maryland 21537-8641',\n\t\t\t\t'phone' => '(240) 544-8665',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2369 Noble Link Pilchuck, Mississippi 38792-0814',\n\t\t\t\t'phone' => '(769) 452-9691',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1272 Colonial Woods California, District of Columbia 20026-2848',\n\t\t\t\t'phone' => '(202) 663-3795',\n\t\t\t\t'lat' => '38.88546',\n\t\t\t\t'lng' => '-77.02612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2483 Cinder Blossom Townline Smittle, Michigan 48648-1860',\n\t\t\t\t'phone' => '(586) 711-0904',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4352 Sleepy Acres Turkey Foot Corner, Arizona 85149-8474',\n\t\t\t\t'phone' => '(480) 488-6822',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2334 Broad Centre Quebec, Arkansas 72840-9638',\n\t\t\t\t'phone' => '(870) 138-9435',\n\t\t\t\t'lat' => '35.4784895',\n\t\t\t\t'lng' => '-93.6319131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '926 Silver Rabbit Heath Biggar, Wyoming 82485-7427',\n\t\t\t\t'phone' => '(307) 598-8660',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2095 Dewy Valley Poland, North Carolina 28675-0245',\n\t\t\t\t'phone' => '(828) 268-1449',\n\t\t\t\t'lat' => '36.517185',\n\t\t\t\t'lng' => '-81.1416691',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9664 Heather Apple Lane Rock Run, Ohio 44631-4798',\n\t\t\t\t'phone' => '(567) 477-8961',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4413 Cotton Passage Money Creek, South Dakota 57464-6212',\n\t\t\t\t'phone' => '(605) 769-3389',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '498 Grand Autumn Manor Sinks, Maryland 21080-2555',\n\t\t\t\t'phone' => '(240) 883-6381',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4880 Cozy Bluff Wynd Dime, Wyoming 82623-0557',\n\t\t\t\t'phone' => '(307) 789-9254',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1631 Bright Pointe Atlantic, Montana 59633-0116',\n\t\t\t\t'phone' => '(406) 254-9193',\n\t\t\t\t'lat' => '46.8567824',\n\t\t\t\t'lng' => '-112.3514774',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1882 Amber Quay Stamping Ground, Nevada 89168-3744',\n\t\t\t\t'phone' => '(702) 523-2993',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1184 Honey Rabbit Byway Security, Rhode Island 02976-3161',\n\t\t\t\t'phone' => '(401) 196-3344',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7312 Rustic Shadow Crescent Quispamsis, Missouri 64437-0634',\n\t\t\t\t'phone' => '(573) 055-5313',\n\t\t\t\t'lat' => '40.1640348',\n\t\t\t\t'lng' => '-95.3730176',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4235 Easy Hollow Terramuggus, Massachusetts 01190-1126',\n\t\t\t\t'phone' => '(339) 768-8087',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3275 Bright Rise Tobin Lake, Missouri 63434-6747',\n\t\t\t\t'phone' => '(636) 770-5547',\n\t\t\t\t'lat' => '39.9029582',\n\t\t\t\t'lng' => '-91.9685826',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6974 Lazy Hickory Lookout Bingo Creek Landing, Ohio 43915-4308',\n\t\t\t\t'phone' => '(330) 540-7539',\n\t\t\t\t'lat' => '39.7283144',\n\t\t\t\t'lng' => '-80.9207737',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9571 Iron Impasse Speedway, Kentucky 41048-7538',\n\t\t\t\t'phone' => '(270) 173-4041',\n\t\t\t\t'lat' => '39.0871388',\n\t\t\t\t'lng' => '-84.7211074',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3955 Silent Autumn Port Fairbanks, North Carolina 28288-9288',\n\t\t\t\t'phone' => '(704) 022-2545',\n\t\t\t\t'lat' => '35.2299999',\n\t\t\t\t'lng' => '-80.84',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6612 Rocky Square Wink, New Mexico 88011-7952',\n\t\t\t\t'phone' => '(575) 508-3628',\n\t\t\t\t'lat' => '32.3035838',\n\t\t\t\t'lng' => '-106.6055534',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7468 Merry Glade Wynyard, Oklahoma 74155-6173',\n\t\t\t\t'phone' => '(918) 189-7319',\n\t\t\t\t'lat' => '36.1',\n\t\t\t\t'lng' => '-95.88',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8814 Blue Bank Chickahominy, Rhode Island 02870-2801',\n\t\t\t\t'phone' => '(401) 398-9638',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7805 Misty Estates Orderville, Arizona 85006-4165',\n\t\t\t\t'phone' => '(480) 709-9395',\n\t\t\t\t'lat' => '33.4636012',\n\t\t\t\t'lng' => '-112.0535987',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8128 Colonial View Jetty Ruff, Alaska 99974-7657',\n\t\t\t\t'phone' => '(907) 844-0966',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2915 Quiet Log Run Conquest Beach, Pennsylvania 19688-3627',\n\t\t\t\t'phone' => '(570) 679-4418',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8984 Crystal Village Box Ankle, Arizona 86462-7020',\n\t\t\t\t'phone' => '(602) 319-0178',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6651 Jagged Quail Parade Kaihon Kug, Minnesota 56043-3914',\n\t\t\t\t'phone' => '(320) 120-3165',\n\t\t\t\t'lat' => '43.6400477',\n\t\t\t\t'lng' => '-93.2281983',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2721 Umber Goose Inlet Whipup, California 90450-4108',\n\t\t\t\t'phone' => '(310) 337-3085',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2346 Grand Embers Autoroute Pee Dee, Delaware 19827-5252',\n\t\t\t\t'phone' => '(302) 130-8743',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1014 Tawny Barn Campus Moab, Wisconsin 54395-8609',\n\t\t\t\t'phone' => '(715) 451-7568',\n\t\t\t\t'lat' => '43.7844397',\n\t\t\t\t'lng' => '-88.7878678',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4766 Middle Apple Walk Mctaggart, Georgia 39974-6914',\n\t\t\t\t'phone' => '(770) 180-8724',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1357 Stony Spring Falls Pyro, Minnesota 56430-2366',\n\t\t\t\t'phone' => '(651) 112-8227',\n\t\t\t\t'lat' => '46.24',\n\t\t\t\t'lng' => '-93.27',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '741 Little Road Hotchkissville, South Carolina 29980-2982',\n\t\t\t\t'phone' => '(803) 271-1505',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4800 Indian Abbey Blowing Rocks, Indiana 46110-0404',\n\t\t\t\t'phone' => '(317) 118-3274',\n\t\t\t\t'lat' => '39.5487322',\n\t\t\t\t'lng' => '-85.899783',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7564 Hazy End Quonochontaug, Iowa 50994-1984',\n\t\t\t\t'phone' => '(641) 188-5763',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8297 Green Fox Boulevard Oskaloosa, Delaware 19768-0727',\n\t\t\t\t'phone' => '(302) 991-2140',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3485 High Elk Highlands Alabama, Illinois 60056-5509',\n\t\t\t\t'phone' => '(630) 741-5152',\n\t\t\t\t'lat' => '42.0646736',\n\t\t\t\t'lng' => '-87.9383822',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1086 Sleepy River Highway Deep Tunnel, Nebraska 69944-7258',\n\t\t\t\t'phone' => '(402) 487-2266',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4287 Hidden Pathway Dogs Corners, Texas 77703-3455',\n\t\t\t\t'phone' => '(214) 064-5285',\n\t\t\t\t'lat' => '30.1123243',\n\t\t\t\t'lng' => '-94.1053307',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9353 Broad Lake Green Magic City, Connecticut 06944-8343',\n\t\t\t\t'phone' => '(860) 742-6128',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '837 Pleasant Leaf Mountain Badwater, Michigan 49485-3681',\n\t\t\t\t'phone' => '(989) 918-6526',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '39 Heather Deer Terrace Thumpertown Beach, South Carolina 29522-8274',\n\t\t\t\t'phone' => '(864) 481-1621',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3339 Old Bear Pike Pierceland, South Dakota 57415-3788',\n\t\t\t\t'phone' => '(605) 629-5218',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8761 Red Pines Rice City, Washington 99321-1500',\n\t\t\t\t'phone' => '(206) 943-5709',\n\t\t\t\t'lat' => '46.8302172',\n\t\t\t\t'lng' => '-119.9753806',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7767 Silver Alley Noordeloos, Iowa 51745-0727',\n\t\t\t\t'phone' => '(641) 192-2090',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1435 Fallen Mountain Vale Fond du Lac, Virginia 22856-9291',\n\t\t\t\t'phone' => '(757) 141-8626',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2933 Sunny Lagoon Carrefour Tok, Alabama 36623-1322',\n\t\t\t\t'phone' => '(251) 692-9694',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2269 Green Estates Lancer, Virginia 23433-5801',\n\t\t\t\t'phone' => '(276) 386-1910',\n\t\t\t\t'lat' => '36.9096727',\n\t\t\t\t'lng' => '-76.4736602',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5102 Crystal Campus Africa, Arkansas 72941-1369',\n\t\t\t\t'phone' => '(501) 425-6290',\n\t\t\t\t'lat' => '35.3406757',\n\t\t\t\t'lng' => '-94.1718542',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6263 Dusty Via Westlock, North Carolina 27880-2868',\n\t\t\t\t'phone' => '(252) 729-9770',\n\t\t\t\t'lat' => '35.7274657',\n\t\t\t\t'lng' => '-78.1222336',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '901 Emerald Dale Trail Tropic, Alabama 36195-8065',\n\t\t\t\t'phone' => '(256) 750-0498',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9909 Stony Treasure Run Bowlegs, New York 14280-7238',\n\t\t\t\t'phone' => '(718) 645-5353',\n\t\t\t\t'lat' => '42.88',\n\t\t\t\t'lng' => '-78.83',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '375 Grand Circuit Big Lick, North Dakota 58673-0849',\n\t\t\t\t'phone' => '(701) 249-6415',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6622 Shady Willow Extension Singing Brook, Florida 34850-0832',\n\t\t\t\t'phone' => '(904) 520-9731',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3788 Golden Path Ouzinkie, Nevada 89414-0520',\n\t\t\t\t'phone' => '(702) 834-3786',\n\t\t\t\t'lat' => '41.0357702',\n\t\t\t\t'lng' => '-117.1264753',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2770 Hidden Leaf Autoroute Skin Corner, Wisconsin 53103-7447',\n\t\t\t\t'phone' => '(414) 483-1760',\n\t\t\t\t'lat' => '42.8791805',\n\t\t\t\t'lng' => '-88.2169027',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4453 Cinder Island Stead Oblong, Washington 98115-4132',\n\t\t\t\t'phone' => '(509) 550-3940',\n\t\t\t\t'lat' => '47.6849444',\n\t\t\t\t'lng' => '-122.2982224',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3154 Easy Beacon Grounds Queonemysing, Rhode Island 02899-2050',\n\t\t\t\t'phone' => '(401) 107-0559',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5753 Umber Blossom Close Broomtown, Nebraska 68105-7145',\n\t\t\t\t'phone' => '(531) 625-0429',\n\t\t\t\t'lat' => '41.2418116',\n\t\t\t\t'lng' => '-95.9673967',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5314 Colonial Shadow Green Okahta Talaia, West Virginia 26565-0046',\n\t\t\t\t'phone' => '(304) 871-6111',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7366 Gentle Gate Pines Anaconda, Pennsylvania 17700-1378',\n\t\t\t\t'phone' => '(878) 984-2742',\n\t\t\t\t'lat' => '41.2033216',\n\t\t\t\t'lng' => '-77.1945247',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6390 Amber Hills Range Chiawuli Tak, Alaska 99585-0460',\n\t\t\t\t'phone' => '(907) 482-1567',\n\t\t\t\t'lat' => '61.9319969',\n\t\t\t\t'lng' => '-162.2708169',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9656 Blue Goose Passage Bootjack, District of Columbia 20050-2319',\n\t\t\t\t'phone' => '(202) 047-2431',\n\t\t\t\t'lat' => '38.9',\n\t\t\t\t'lng' => '-77.04',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3292 Dewy Fox Square Gassaway, Mississippi 38750-3303',\n\t\t\t\t'phone' => '(662) 414-3997',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3621 Lost Barn Key Turkey Scratch, Nebraska 68376-3092',\n\t\t\t\t'phone' => '(308) 123-0375',\n\t\t\t\t'lat' => '40.1975037',\n\t\t\t\t'lng' => '-95.940971',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '779 Quaking Bend Pink Arrow, Maine 04229-9316',\n\t\t\t\t'phone' => '(207) 751-1259',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '859 Little Place Prairie Queen, South Carolina 29009-4151',\n\t\t\t\t'phone' => '(864) 042-0986',\n\t\t\t\t'lat' => '34.4614628',\n\t\t\t\t'lng' => '-80.3881333',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5454 Burning Apple Plaza Montmartre, Indiana 47837-8211',\n\t\t\t\t'phone' => '(317) 656-5951',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3019 Tawny Nectar Canyon Twentysix, Rhode Island 02953-3262',\n\t\t\t\t'phone' => '(401) 205-0347',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1693 Heather Park Choccolocco, Nevada 89121-6915',\n\t\t\t\t'phone' => '(702) 497-5280',\n\t\t\t\t'lat' => '36.1165487',\n\t\t\t\t'lng' => '-115.0881146',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4694 Harvest Grove Cape Farmlife, Delaware 19851-7155',\n\t\t\t\t'phone' => '(302) 677-0905',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6793 Noble Prairie Farm Cheesequake, South Carolina 29321-0502',\n\t\t\t\t'phone' => '(843) 039-9935',\n\t\t\t\t'lat' => '34.7346757',\n\t\t\t\t'lng' => '-81.7130522',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7422 Lazy Ridge Possum Bluff, North Dakota 58730-0556',\n\t\t\t\t'phone' => '(701) 951-9221',\n\t\t\t\t'lat' => '48.8755921',\n\t\t\t\t'lng' => '-103.3383503',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9342 Round Rabbit Gate Latexo, Ohio 44353-0469',\n\t\t\t\t'phone' => '(740) 126-5652',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9030 Red Abbey Pointblank, Oregon 97693-1636',\n\t\t\t\t'phone' => '(458) 273-1218',\n\t\t\t\t'lat' => '43.8041334',\n\t\t\t\t'lng' => '-120.5542012',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7 High Mountain Glade Pontiac, Arizona 86330-0582',\n\t\t\t\t'phone' => '(928) 447-4570',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5726 Fallen Embers Thicket Port Protection, Ohio 44035-5738',\n\t\t\t\t'phone' => '(740) 066-8548',\n\t\t\t\t'lat' => '41.3534148',\n\t\t\t\t'lng' => '-82.1496049',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5589 Thunder Point Wawota, Louisiana 71490-1808',\n\t\t\t\t'phone' => '(985) 711-3587',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8346 Silver Limits Battle Mountain, New York 12016-4484',\n\t\t\t\t'phone' => '(347) 919-0371',\n\t\t\t\t'lat' => '42.93',\n\t\t\t\t'lng' => '-74.3199999',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5933 Quiet Valley Ko Ko, Colorado 81549-9872',\n\t\t\t\t'phone' => '(719) 129-0748',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5148 Clear Vale Poor Town, Massachusetts 02575-2791',\n\t\t\t\t'phone' => '(339) 153-3036',\n\t\t\t\t'lat' => '41.3854488',\n\t\t\t\t'lng' => '-70.6828437',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6704 Hazy Lookout Weed, Iowa 50719-6158',\n\t\t\t\t'phone' => '(712) 771-7469',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3575 Middle Drive Koggiung, Maryland 21558-6166',\n\t\t\t\t'phone' => '(443) 915-6824',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9365 Grand Pointe Nanton, New Jersey 07685-8905',\n\t\t\t\t'phone' => '(973) 220-5840',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9796 Cozy Cider Boulevard Weirdale, Rhode Island 02968-5568',\n\t\t\t\t'phone' => '(401) 569-3091',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5297 Merry Woods Mexican Hat, Arizona 86615-1139',\n\t\t\t\t'phone' => '(623) 535-6319',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7427 Jagged Brook Bank Ah Fong Village, South Dakota 57890-7849',\n\t\t\t\t'phone' => '(605) 276-0864',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '754 Tawny Pony Alley Ak-Chin Village, Pennsylvania 17528-2354',\n\t\t\t\t'phone' => '(878) 610-1011',\n\t\t\t\t'lat' => '40.1281362',\n\t\t\t\t'lng' => '-75.998932',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4504 Lost Pine Jetty Ashepoo, Indiana 46332-6909',\n\t\t\t\t'phone' => '(765) 658-9671',\n\t\t\t\t'lat' => '40.5512165',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7349 Wishing Pioneer Carrefour Fearnowville, Nebraska 69992-2859',\n\t\t\t\t'phone' => '(531) 755-7518',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8125 Sleepy Wagon Walk Quails Nest, Washington 98914-0393',\n\t\t\t\t'phone' => '(360) 759-8355',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4848 Rustic Creek Field Extra, Florida 32134-3480',\n\t\t\t\t'phone' => '(772) 410-4020',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9972 Red Island Parade Quinhagak, Arkansas 72321-2240',\n\t\t\t\t'phone' => '(870) 781-2491',\n\t\t\t\t'lat' => '35.8197959',\n\t\t\t\t'lng' => '-89.9323304',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6636 Crystal Chase Skidaway Island, Connecticut 06780-4384',\n\t\t\t\t'phone' => '(475) 727-7385',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6444 Pleasant Bluff Gate Axehandle, Arkansas 72928-3456',\n\t\t\t\t'phone' => '(479) 819-5947',\n\t\t\t\t'lat' => '35.2937406',\n\t\t\t\t'lng' => '-93.9368439',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9235 Blue Villas Half Hell, Washington 98641-6518',\n\t\t\t\t'phone' => '(206) 611-7946',\n\t\t\t\t'lat' => '46.5782535',\n\t\t\t\t'lng' => '-124.0028498',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6226 Cinder Quail Townline Ohoopee, Florida 32498-0673',\n\t\t\t\t'phone' => '(386) 072-5373',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4445 Harvest Timber Autoroute Sugar House, Tennessee 38360-7057',\n\t\t\t\t'phone' => '(931) 262-1016',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1977 Stony Fawn Stead Mervin, Virginia 22113-0967',\n\t\t\t\t'phone' => '(757) 167-5136',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1394 Noble Downs Flickersville, Idaho 83613-3584',\n\t\t\t\t'phone' => '(208) 823-5774',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5874 Hidden Common Ugashik, Delaware 19881-6924',\n\t\t\t\t'phone' => '(302) 305-4954',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9383 Gentle Grove Meadow Normalville, West Virginia 25919-8033',\n\t\t\t\t'phone' => '(681) 917-8401',\n\t\t\t\t'lat' => '37.8131224',\n\t\t\t\t'lng' => '-81.1835839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7371 Honey Sky Link Fort Spunky, Alabama 35100-5594',\n\t\t\t\t'phone' => '(334) 624-5222',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6632 High Lane Twisp, Louisiana 71003-4067',\n\t\t\t\t'phone' => '(985) 211-3060',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2365 Foggy Rise Swale Tribune, District of Columbia 20032-3585',\n\t\t\t\t'phone' => '(202) 865-0334',\n\t\t\t\t'lat' => '38.8372336',\n\t\t\t\t'lng' => '-77.0161436',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '293 Quiet Canyon Pondlick, Oklahoma 74029-6738',\n\t\t\t\t'phone' => '(405) 584-2135',\n\t\t\t\t'lat' => '36.832666',\n\t\t\t\t'lng' => '-95.8353837',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1074 Emerald Mall Archerwill, Maine 04935-6012',\n\t\t\t\t'phone' => '(207) 343-0489',\n\t\t\t\t'lat' => '44.4486337',\n\t\t\t\t'lng' => '-69.6062394',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6450 Little Robin Glade Pothook, Tennessee 38145-7689',\n\t\t\t\t'phone' => '(931) 676-3145',\n\t\t\t\t'lat' => '35.15',\n\t\t\t\t'lng' => '-90.05',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3990 Velvet Shadow Landing Crumpecker, Georgia 39823-3094',\n\t\t\t\t'phone' => '(762) 086-4610',\n\t\t\t\t'lat' => '31.3021309',\n\t\t\t\t'lng' => '-84.981754',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5560 Amber Highway Osoyoos, Colorado 81022-7656',\n\t\t\t\t'phone' => '(719) 296-9040',\n\t\t\t\t'lat' => '38.1345872',\n\t\t\t\t'lng' => '-104.4257533',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4068 Golden Moor High Lonesome Wells, Nevada 89929-1910',\n\t\t\t\t'phone' => '(775) 336-5382',\n\t\t\t\t'lat' => '41.1115888',\n\t\t\t\t'lng' => '-114.96449',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5720 Dewy Valley Tropic, Ohio 45591-1583',\n\t\t\t\t'phone' => '(216) 223-1805',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4649 Indian Oak Trace Cincinnati, Arkansas 72188-8555',\n\t\t\t\t'phone' => '(501) 108-3473',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4571 Dusty Crest Torquay, South Carolina 29071-4011',\n\t\t\t\t'phone' => '(843) 590-3879',\n\t\t\t\t'lat' => '33.9799999',\n\t\t\t\t'lng' => '-81.24',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '338 Rocky Nectar By-pass Slapneck, Idaho 83647-7054',\n\t\t\t\t'phone' => '(208) 458-6847',\n\t\t\t\t'lat' => '43.4969131',\n\t\t\t\t'lng' => '-115.5314511',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9878 Thunder Arbor Kalifornsky, Arizona 86631-5352',\n\t\t\t\t'phone' => '(623) 658-2751',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5226 Shady Goose Impasse Alberton, Colorado 81299-4296',\n\t\t\t\t'phone' => '(970) 381-4534',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9048 Sleepy Dale Maze Lucky, Tennessee 37271-0904',\n\t\t\t\t'phone' => '(865) 587-0661',\n\t\t\t\t'lat' => '35.5174913',\n\t\t\t\t'lng' => '-86.5804473',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8484 Foggy Canyon Delaware, Washington 98893-5880',\n\t\t\t\t'phone' => '(425) 905-3571',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7644 Dusty Lake Lookout Legal, Nevada 89531-1567',\n\t\t\t\t'phone' => '(702) 991-0236',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2965 Colonial Pond Byway Kabetogama, Oklahoma 73592-8085',\n\t\t\t\t'phone' => '(580) 099-9725',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7035 Amber Bank Big Timber, Montana 59099-3359',\n\t\t\t\t'phone' => '(406) 046-1326',\n\t\t\t\t'lat' => '45.8343543',\n\t\t\t\t'lng' => '-109.9540644',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4491 Quiet Port Indialantic, Maryland 21062-4405',\n\t\t\t\t'phone' => '(240) 553-5943',\n\t\t\t\t'lat' => '39.1599999',\n\t\t\t\t'lng' => '-76.63',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2907 Middle Anchor Row Scarce Grease, Delaware 19991-0100',\n\t\t\t\t'phone' => '(302) 649-3078',\n\t\t\t\t'lat' => '38.9108325',\n\t\t\t\t'lng' => '-75.5276699',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3924 Gentle Inlet Suquamish, Arizona 86166-6269',\n\t\t\t\t'phone' => '(623) 883-2017',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9823 Umber Prairie Crossing Teaticket, Montana 59309-4514',\n\t\t\t\t'phone' => '(406) 118-8472',\n\t\t\t\t'lat' => '46.8796822',\n\t\t\t\t'lng' => '-110.3625658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '265 Noble Apple Forest Vermont, Georgia 39813-3675',\n\t\t\t\t'phone' => '(229) 050-5836',\n\t\t\t\t'lat' => '31.4035879',\n\t\t\t\t'lng' => '-84.6688348',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8866 Rocky Trace Four Bears Village, Illinois 60491-6196',\n\t\t\t\t'phone' => '(815) 414-5669',\n\t\t\t\t'lat' => '41.6131315',\n\t\t\t\t'lng' => '-87.962884',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1412 Cotton Bay Star, Oklahoma 74194-3598',\n\t\t\t\t'phone' => '(918) 954-0869',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9766 Clear Pony Hill Handsome Eddy, Arizona 86422-7832',\n\t\t\t\t'phone' => '(623) 376-5382',\n\t\t\t\t'lat' => '34.0489281',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2824 Quaking Cloud Ridge Sun Valley, Virginia 24342-7446',\n\t\t\t\t'phone' => '(804) 394-6011',\n\t\t\t\t'lat' => '33.6496426',\n\t\t\t\t'lng' => '-92.7743809',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6841 Indian Cider Path Welfare, New York 14291-2909',\n\t\t\t\t'phone' => '(646) 281-2945',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5451 Broad Shadow Range Zewapeta, Alabama 36223-8635',\n\t\t\t\t'phone' => '(256) 964-1223',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6326 Little Pines Lake of the Woods, Wyoming 82150-2725',\n\t\t\t\t'phone' => '(307) 203-4687',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5711 Blue Deer Private Bullet Hole, Missouri 65105-1282',\n\t\t\t\t'phone' => '(660) 895-5372',\n\t\t\t\t'lat' => '38.5',\n\t\t\t\t'lng' => '-92.15',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '283 Hidden Spring Wood Boot Jack, District of Columbia 20021-8192',\n\t\t\t\t'phone' => '(202) 730-6835',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2005 Old Towers Ahwatukee, North Dakota 58517-9863',\n\t\t\t\t'phone' => '(701) 623-1368',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '97 Easy Chase Thunder Hawk, Nevada 89426-3672',\n\t\t\t\t'phone' => '(775) 120-7206',\n\t\t\t\t'lat' => '41.5598843',\n\t\t\t\t'lng' => '-117.4086488',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '751 Round Heath Bingo, Wyoming 82547-6473',\n\t\t\t\t'phone' => '(307) 934-0757',\n\t\t\t\t'lat' => '43.0759678',\n\t\t\t\t'lng' => '-107.2902839',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1352 Pleasant Avenue Tinkertown, California 92022-5662',\n\t\t\t\t'phone' => '(562) 143-2770',\n\t\t\t\t'lat' => '36.778261',\n\t\t\t\t'lng' => '-119.4179324',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1681 Silent Corners Ben Arnold, Massachusetts 01528-4491',\n\t\t\t\t'phone' => '(508) 951-3124',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4399 Cinder Key Minnehaha, Oregon 97070-3784',\n\t\t\t\t'phone' => '(971) 108-8608',\n\t\t\t\t'lat' => '45.3018169',\n\t\t\t\t'lng' => '-122.7751561',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4644 Cozy Creek By-pass Telbasta, Iowa 50183-6396',\n\t\t\t\t'phone' => '(563) 119-5041',\n\t\t\t\t'lat' => '41.8780025',\n\t\t\t\t'lng' => '-93.097702',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8328 Jagged Abbey Turkeyfoot, South Dakota 57773-5048',\n\t\t\t\t'phone' => '(605) 557-3188',\n\t\t\t\t'lat' => '43.6076792',\n\t\t\t\t'lng' => '-103.5935897',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2335 Heather Grove Michigan Bar, Minnesota 56333-9494',\n\t\t\t\t'phone' => '(952) 500-4492',\n\t\t\t\t'lat' => '42.2663981',\n\t\t\t\t'lng' => '-83.7081315',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3991 Fallen Brook Cove Chi Chil Tah, Utah 84075-6499',\n\t\t\t\t'phone' => '(801) 958-0611',\n\t\t\t\t'lat' => '41.0541918',\n\t\t\t\t'lng' => '-112.1191757',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1105 Merry Barn Road Yaphank, Mississippi 39434-7368',\n\t\t\t\t'phone' => '(228) 295-0195',\n\t\t\t\t'lat' => '32.3546679',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8420 Stony Wagon Crest Runnymeade, Washington 98237-6997',\n\t\t\t\t'phone' => '(206) 831-6478',\n\t\t\t\t'lat' => '48.57163',\n\t\t\t\t'lng' => '-121.6648381',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9921 Grand Court Piddleville, Louisiana 70297-1882',\n\t\t\t\t'phone' => '(985) 897-9654',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2870 Iron Extension Bermuda, Colorado 80910-6158',\n\t\t\t\t'phone' => '(720) 166-0253',\n\t\t\t\t'lat' => '38.8064287',\n\t\t\t\t'lng' => '-104.7695962',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6803 Wishing View Arbor Cat Square, West Virginia 25027-6576',\n\t\t\t\t'phone' => '(304) 952-4973',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '950 Red Thicket Wickatunk, Washington 99133-1072',\n\t\t\t\t'phone' => '(509) 283-9110',\n\t\t\t\t'lat' => '48.0361158',\n\t\t\t\t'lng' => '-119.0618141',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5401 Misty Robin Crescent Kill Buck, Rhode Island 02808-3785',\n\t\t\t\t'phone' => '(401) 473-6664',\n\t\t\t\t'lat' => '41.4026135',\n\t\t\t\t'lng' => '-71.7503855',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6237 Sleepy Lane Frisbie, Idaho 83214-5294',\n\t\t\t\t'phone' => '(208) 804-9330',\n\t\t\t\t'lat' => '42.5407152',\n\t\t\t\t'lng' => '-112.262246',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4801 Misty Passage Castor, Georgia 39917-9448',\n\t\t\t\t'phone' => '(223) 387-9176',\n\t\t\t\t'lat' => '32.1574351',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4539 Shady Robin Autoroute Albertville, Maryland 21561-3867',\n\t\t\t\t'phone' => '(240) 077-3317',\n\t\t\t\t'lat' => '39.4962475',\n\t\t\t\t'lng' => '-79.1774268',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5696 Clear Anchor Heath Sedgewick, Maine 04746-1418',\n\t\t\t\t'phone' => '(207) 790-0462',\n\t\t\t\t'lat' => '47.2192967',\n\t\t\t\t'lng' => '-68.1272872',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5953 Fallen Gardens Diagonal, Kentucky 40141-1739',\n\t\t\t\t'phone' => '(606) 649-9284',\n\t\t\t\t'lat' => '37.8393332',\n\t\t\t\t'lng' => '-84.2700179',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5039 Sunny Vale Hells Half Acre, Illinois 61429-4296',\n\t\t\t\t'phone' => '(630) 322-6634',\n\t\t\t\t'lat' => '40.6331249',\n\t\t\t\t'lng' => '-89.3985283',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6708 Dewy Boulevard Aylsham, West Virginia 26949-2429',\n\t\t\t\t'phone' => '(681) 442-9535',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1696 Rocky Lagoon Glade Saltcoats, Kansas 66020-4409',\n\t\t\t\t'phone' => '(620) 939-6715',\n\t\t\t\t'lat' => '39.3532738',\n\t\t\t\t'lng' => '-95.1223608',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '351 Quaking Lake Bank Lone Star, Arkansas 72198-3208',\n\t\t\t\t'phone' => '(870) 320-2825',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1194 Emerald Mall Sparkle, South Carolina 29968-2223',\n\t\t\t\t'phone' => '(864) 030-8670',\n\t\t\t\t'lat' => '33.836081',\n\t\t\t\t'lng' => '-81.1637245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4540 Lazy Canyon Texico, Nevada 89065-4845',\n\t\t\t\t'phone' => '(775) 281-6892',\n\t\t\t\t'lat' => '38.8026097',\n\t\t\t\t'lng' => '-116.419389',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '928 Broad Pointe St. Paul, South Dakota 57151-9943',\n\t\t\t\t'phone' => '(605) 506-3672',\n\t\t\t\t'lat' => '43.9695148',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9319 High Hickory Way Whitchurch-Stouffville, Idaho 83396-2356',\n\t\t\t\t'phone' => '(208) 092-9832',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3571 Cotton Pond View Cloudcroft, Washington 99318-3295',\n\t\t\t\t'phone' => '(206) 319-5326',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4832 Velvet Ledge Lick Creek, North Dakota 58132-3790',\n\t\t\t\t'phone' => '(701) 089-2211',\n\t\t\t\t'lat' => '47.5514926',\n\t\t\t\t'lng' => '-101.0020119',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6205 Gentle Pioneer Orchard Nebraska, Utah 84873-7158',\n\t\t\t\t'phone' => '(801) 379-8953',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1507 Dusty Horse Key Stenen, Connecticut 06463-8750',\n\t\t\t\t'phone' => '(475) 436-2630',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7582 Blue Pathway Peoples, District of Columbia 20097-5618',\n\t\t\t\t'phone' => '(202) 414-2722',\n\t\t\t\t'lat' => '38.8951118',\n\t\t\t\t'lng' => '-77.0363658',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9041 Old Parade Swift Current, Wyoming 82321-7674',\n\t\t\t\t'phone' => '(307) 310-9791',\n\t\t\t\t'lat' => '41.2694332',\n\t\t\t\t'lng' => '-107.811',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7006 Cozy Mountain Range Treherne, Ohio 44000-7746',\n\t\t\t\t'phone' => '(937) 218-0393',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2108 Hidden Inlet Blackduck, Michigan 49830-1870',\n\t\t\t\t'phone' => '(517) 014-1990',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4810 Round Berry Ramp Fannie, Michigan 49584-3163',\n\t\t\t\t'phone' => '(616) 917-3110',\n\t\t\t\t'lat' => '44.3148443',\n\t\t\t\t'lng' => '-85.6023643',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1648 Easy Pine Impasse Humboldt, Alaska 99632-0756',\n\t\t\t\t'phone' => '(907) 398-7468',\n\t\t\t\t'lat' => '62.1075171',\n\t\t\t\t'lng' => '-163.6530901',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4535 Foggy Rabbit End Houston, Maryland 21707-7837',\n\t\t\t\t'phone' => '(301) 637-4559',\n\t\t\t\t'lat' => '39.0457549',\n\t\t\t\t'lng' => '-76.6412712',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7673 Pleasant Field Truly, Texas 77079-1885',\n\t\t\t\t'phone' => '(936) 494-0756',\n\t\t\t\t'lat' => '29.7801889',\n\t\t\t\t'lng' => '-95.6090009',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3474 Thunder Dell Owl Hoot, South Carolina 29164-3631',\n\t\t\t\t'phone' => '(843) 611-3991',\n\t\t\t\t'lat' => '33.6536164',\n\t\t\t\t'lng' => '-81.4059186',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9142 Amber Bend Egorkovskoi, New Jersey 08747-9332',\n\t\t\t\t'phone' => '(908) 187-4092',\n\t\t\t\t'lat' => '40.0583238',\n\t\t\t\t'lng' => '-74.4056612',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6565 Cinder View Villas Cathlapotle, Maine 04459-1231',\n\t\t\t\t'phone' => '(207) 831-9138',\n\t\t\t\t'lat' => '45.5738851',\n\t\t\t\t'lng' => '-68.3533229',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '518 Red Mews Zero, New York 10921-2823',\n\t\t\t\t'phone' => '(914) 172-6342',\n\t\t\t\t'lat' => '41.1333442',\n\t\t\t\t'lng' => '-74.0022524',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9170 Honey Quay Smalltown, Idaho 83491-3357',\n\t\t\t\t'phone' => '(208) 768-3359',\n\t\t\t\t'lat' => '44.0682019',\n\t\t\t\t'lng' => '-114.7420408',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2063 Indian Prairie Landing Blackhawk, Missouri 64773-8741',\n\t\t\t\t'phone' => '(573) 448-2155',\n\t\t\t\t'lat' => '37.9642529',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1177 Silent Wynd Prelate, Michigan 49755-2114',\n\t\t\t\t'phone' => '(906) 346-4118',\n\t\t\t\t'lat' => '45.6521002',\n\t\t\t\t'lng' => '-84.7814432',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5550 Harvest Street Yreka, Alabama 35589-7414',\n\t\t\t\t'phone' => '(256) 126-4821',\n\t\t\t\t'lat' => '32.3182314',\n\t\t\t\t'lng' => '-86.902298',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6650 Wishing Rise Ketchikan, Colorado 81727-6300',\n\t\t\t\t'phone' => '(303) 649-9421',\n\t\t\t\t'lat' => '39.5500507',\n\t\t\t\t'lng' => '-105.7820674',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '896 Quiet Shadow Grove Okeewemee, Maine 04888-5600',\n\t\t\t\t'phone' => '(207) 887-6714',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5221 Hazy Cove Pigeon Run, Rhode Island 02844-5518',\n\t\t\t\t'phone' => '(401) 397-0342',\n\t\t\t\t'lat' => '41.5800945',\n\t\t\t\t'lng' => '-71.4774291',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4009 Misty Log Mews Potato Patch, Texas 79949-7016',\n\t\t\t\t'phone' => '(432) 694-5133',\n\t\t\t\t'lat' => '31.76',\n\t\t\t\t'lng' => '-106.49',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '3121 Blue Road Cheektowasa, Ohio 44178-5872',\n\t\t\t\t'phone' => '(614) 541-7135',\n\t\t\t\t'lat' => '40.4172871',\n\t\t\t\t'lng' => '-82.907123',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7745 Quaking Island Private Vamoosa, Florida 33726-8437',\n\t\t\t\t'phone' => '(352) 417-7732',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2964 Round Bend Three V Crossing, New York 12895-6061',\n\t\t\t\t'phone' => '(516) 933-1701',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8929 Wishing Brook Close Mudtown, Arkansas 72307-8524',\n\t\t\t\t'phone' => '(870) 040-5761',\n\t\t\t\t'lat' => '35.20105',\n\t\t\t\t'lng' => '-91.8318334',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9857 Shady Barn Corners Boiling Point, Illinois 62370-8259',\n\t\t\t\t'phone' => '(618) 865-5959',\n\t\t\t\t'lat' => '39.5028435',\n\t\t\t\t'lng' => '-91.0011902',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8122 Foggy By-pass Refuge, Georgia 39825-9760',\n\t\t\t\t'phone' => '(404) 653-2379',\n\t\t\t\t'lat' => '30.9942599',\n\t\t\t\t'lng' => '-84.7106567',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9352 Sleepy Creek Mall Lorida, Connecticut 06685-5331',\n\t\t\t\t'phone' => '(860) 074-9188',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1740 Silent Goose Promenade Gothic, Virginia 23080-3616',\n\t\t\t\t'phone' => '(703) 804-6802',\n\t\t\t\t'lat' => '37.4315734',\n\t\t\t\t'lng' => '-78.6568942',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9748 Gentle Rabbit Canyon Laird, New York 11444-2032',\n\t\t\t\t'phone' => '(518) 987-5742',\n\t\t\t\t'lat' => '40.7143528',\n\t\t\t\t'lng' => '-74.0059731',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '14 Burning Butterfly Impasse Frugality, Utah 84659-3929',\n\t\t\t\t'phone' => '(385) 531-1381',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1002 Red Gate Cape Big Cut, Vermont 05637-0939',\n\t\t\t\t'phone' => '(802) 022-4379',\n\t\t\t\t'lat' => '44.5588028',\n\t\t\t\t'lng' => '-72.5778415',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2826 Velvet Blossom Hill Pearl City, West Virginia 25995-8728',\n\t\t\t\t'phone' => '(681) 707-4520',\n\t\t\t\t'lat' => '38.5976262',\n\t\t\t\t'lng' => '-80.4549026',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6397 Colonial Via Lonesome Prairie, Vermont 05009-4463',\n\t\t\t\t'phone' => '(802) 938-7061',\n\t\t\t\t'lat' => '43.6474348',\n\t\t\t\t'lng' => '-72.342588',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '7824 Umber Fox Parkway Roche Percee, Nebraska 69310-7287',\n\t\t\t\t'phone' => '(308) 868-7311',\n\t\t\t\t'lat' => '41.4925374',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '8786 Iron Grove Ah Fong Village, Colorado 80951-9857',\n\t\t\t\t'phone' => '(720) 743-9084',\n\t\t\t\t'lat' => '38.8622755',\n\t\t\t\t'lng' => '-104.6733584',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1582 Sunny Inlet Mctaggart, New Hampshire 03648-2975',\n\t\t\t\t'phone' => '(603) 770-8206',\n\t\t\t\t'lat' => '43.1938516',\n\t\t\t\t'lng' => '-71.5723953',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4191 Rustic Dale Common Rainbow City, West Virginia 26463-4803',\n\t\t\t\t'phone' => '(304) 618-7564',\n\t\t\t\t'lat' => '39.4349029',\n\t\t\t\t'lng' => '-80.3534899',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6761 Merry Parade Rainbow Bend, Pennsylvania 15102-8551',\n\t\t\t\t'phone' => '(484) 597-9344',\n\t\t\t\t'lat' => '40.3167073',\n\t\t\t\t'lng' => '-80.0423151',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '9422 Middle Berry Street Humboldt, Alaska 99574-3449',\n\t\t\t\t'phone' => '(907) 657-0496',\n\t\t\t\t'lat' => '60.7356503',\n\t\t\t\t'lng' => '-145.5826187',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2415 Silver Lagoon Highlands Saltcoats, Louisiana 70086-3885',\n\t\t\t\t'phone' => '(337) 079-1229',\n\t\t\t\t'lat' => '31.2448234',\n\t\t\t\t'lng' => '-92.1450245',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5293 Honey View Crossing Radical, Connecticut 06000-2541',\n\t\t\t\t'phone' => '(860) 898-9772',\n\t\t\t\t'lat' => '41.6032207',\n\t\t\t\t'lng' => '-73.087749',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2018 Hidden Limits Cockeysville, New Jersey 08526-2387',\n\t\t\t\t'phone' => '(551) 133-0241',\n\t\t\t\t'lat' => '40.17',\n\t\t\t\t'lng' => '-74.51',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1187 Noble River Thicket Tat Momoli, Texas 78085-3232',\n\t\t\t\t'phone' => '(903) 016-0722',\n\t\t\t\t'lat' => '31.9685988',\n\t\t\t\t'lng' => '-99.9018131',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4799 Jagged Robin Beach Weirdale, Minnesota 56231-9007',\n\t\t\t\t'phone' => '(507) 950-8070',\n\t\t\t\t'lat' => '45.2842156',\n\t\t\t\t'lng' => '-95.7948769',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6967 Golden Line Parrots, Alaska 99990-7560',\n\t\t\t\t'phone' => '(907) 102-7536',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5766 Tawny Green Valley of Enchantment, Maryland 20850-1890',\n\t\t\t\t'phone' => '(410) 816-6230',\n\t\t\t\t'lat' => '39.0839994',\n\t\t\t\t'lng' => '-77.1527813',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2690 Lazy Jetty Saxman, Massachusetts 02411-2917',\n\t\t\t\t'phone' => '(339) 206-8396',\n\t\t\t\t'lat' => '42.4072107',\n\t\t\t\t'lng' => '-71.3824374',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '1858 Heather Lake Abbey Enough, Alaska 99700-6940',\n\t\t\t\t'phone' => '(907) 915-5318',\n\t\t\t\t'lat' => '64.2008413',\n\t\t\t\t'lng' => '-149.4936733',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2284 Harvest Sky Edge Bungy, Oklahoma 74224-8696',\n\t\t\t\t'phone' => '(580) 287-3530',\n\t\t\t\t'lat' => '35.0077519',\n\t\t\t\t'lng' => '-97.092877',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2875 Dusty Cloud Centre Happy Valley-Goose Bay, Maine 04130-1318',\n\t\t\t\t'phone' => '(207) 707-6131',\n\t\t\t\t'lat' => '45.253783',\n\t\t\t\t'lng' => '-69.4454689',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '2442 Cotton Campus Arabia, Florida 32543-2413',\n\t\t\t\t'phone' => '(813) 412-6448',\n\t\t\t\t'lat' => '27.6648274',\n\t\t\t\t'lng' => '-81.5157535',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '6054 Thunder Rise Subdivision Buzzards Roost, North Carolina 27577-9290',\n\t\t\t\t'phone' => '(828) 877-4968',\n\t\t\t\t'lat' => '35.7595731',\n\t\t\t\t'lng' => '-79.0192997',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '4442 Old Cider Lookout Alabama Village, Utah 84844-5606',\n\t\t\t\t'phone' => '(435) 733-2606',\n\t\t\t\t'lat' => '39.3209801',\n\t\t\t\t'lng' => '-111.0937311',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'address' => '5484 Bright Willow Pike Sunizona, New Mexico 87149-6244',\n\t\t\t\t'phone' => '(505) 333-5135',\n\t\t\t\t'lat' => '34.5199402',\n\t\t\t\t'lng' => '-105.8700901',\n\t\t\t),\n\t\t);\n\n\t\treturn $data;\n\t}", "public function ClearAddresses()\n {\n $this->addresses = array();\n }", "public function initialize()\n {\n $this->setSchema(\"nidara_private_school\");\n $this->setSource(\"salesman_address\");\n }", "public function clearAddresses()\n {\n }", "public function init()\n {\n $this->shipping_method_data = (new sampleData())->shipping_method_data();\n $this->zone_data = (new sampleData())->zone_data();\n }", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "protected function initialize()\n {\n $this->data = new stdClass();\n $this->data->ownId = null;\n $this->data->amount = new stdClass();\n $this->data->amount->currency = self::AMOUNT_CURRENCY;\n $this->data->amount->subtotals = new stdClass();\n $this->data->items = [];\n $this->data->receivers = [];\n }", "public function validAddresses() {}", "public function invalidAddresses() {}", "public function initData()\n {\n $this->appliedNumberingData = array();\n $this->currHyperlink = null;\n }", "public function init()\n {\n global $domain_info;\n\n $this->appliedLocation();\n\n $this->geo_filter_data['clean_url'] = $this->cleanUrl();\n\n $clean_url = $this->cleanUrl($domain_info['scheme'] . '://' . $domain_info['host'], $domain_info['path']);\n $clean_url = str_replace('[geo_url]/', '', $clean_url);\n $this->geo_filter_data['base_url_with_subdomain'] = $this->buildGeoLink($this->geo_filter_data['applied_location'], $clean_url, true);\n \n $this->appliedLocation2();\n\n // Workaround for old version conditions\n $GLOBALS['geo_filter_data'] = $this->geo_filter_data;\n $GLOBALS['geo_filter_data']['geo_url'] = $this->geo_filter_data['applied_location']['Path'];\n\n $GLOBALS['rlSmarty']->assign_by_ref('geo_filter_data', $this->geo_filter_data);\n }", "public function testAddressSeeder()\n {\n $this->assertEquals(0, Address::all()->count());\n $this->seedAddresses();\n $this->assertEquals(15, Address::all()->count());\n }", "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 }", "public function setMainAddress($data){\n\t\tglobal $dbh;\n\t\t$fields = array(\n\t\t\t\"nombre\",\n\t\t\t\"receptorNombre\",\n\t\t\t\"receptorApellido\",\n\t\t\t\"nombreEmpresa\",\n\t\t\t\"facturacion\",\n\t\t\t\"principal\",\n\t\t\t\"idCliente\",\n\t\t\t\"direccion\",\n\t\t\t\"fono\",\n\t\t\t\"cel\",\n\t\t\t\"idZona\",\n\t\t\t\"id\"\n\t\t);\n\t\t$query = \"UPDATE direccion SET nombre=?,receptorNombre=?,receptorApellido=?,nombreEmpresa=?,facturacion=?,principal=?,idCliente=?,direccion=?,fono=?,cel=?,idZona=? WHERE id=?;\";\n\t\t$update = array();\n\t\t$old = $this->getMainAddress();\n\t\tif( $data!=null && is_array($data) ){\n\t\t\tforeach( $fields as $field ){\n\t\t\t\t$update[$field] = null;\n\t\t\t\tif( isset($data[$field]) && !empty($data[$field]) ){\n\t\t\t\t\t$update[$field] = $data[$field];\n\t\t\t\t} else {\n\t\t\t\t\t$update[$field] = $old[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res = $dbh->query($query,$update);\n\t\t\treturn $res;\n\t\t}\n\t\treturn false;\n\t}", "public function init()\n {\n $sql_dns = \"SELECT * FROM dns\";\n $response = $this->db_access_admin->query($sql_dns);\n if($response){\n $this->datas_dns = $response->fetchAll();\n }\n }", "public function parseAddressesProvider() {}", "private function _setAddressAttributes()\n {\n $addressAttributes = [];\n $addressAttributes = [\n 'NickName' => 'Nickname',\n 'AddressLine1' => 'Address Line1',\n 'AddressLine2' => 'Address Line2',\n 'City' => 'City', 'State' => 'State',\n 'PrimaryPhone' => 'Primary Phone',\n 'SecondaryPhone' => 'Secondary Phone',\n 'PrimaryEmail' => 'Primary Email',\n 'SecondaryEmail' => 'Secondary Email',\n 'Fax' => 'Fax', 'Type' => 'Type',\n 'Zip' => 'Zip', 'CreatedAt' => 'Created At',\n 'Etag' => 'Etag'\n ];\n\n return $addressAttributes;\n }", "public function __construct($addr) {\n $this->addr = $addr;\n }", "private function _getAddresses()\n\t {\n\t\t$hashes = [];\n\t\t$rows = $this->_db->exec(\"SELECT `city`, `address` FROM `addresses` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$address = $row[\"city\"] . \", \" . $row[\"address\"];\n\t\t\t$sliced = new AddressSlicer($address);\n\n\t\t\tif ($sliced->valid() === true && isset($hashes[$sliced->hash]) === false)\n\t\t\t {\n\t\t\t\t$hashes[$sliced->hash] = $address;\n\t\t\t } //end if\n\n\t\t } //end while\n\n\t\treturn count($hashes);\n\t }", "protected function initLocations(){}", "private function fill( array $values ) {\n $this->address = $values[\"address\"];\n $this->city = $values[\"city\"];\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 }", "protected function FixAddress()\n {\n $rows = db::Query(\"SELECT min(id) as id, uid, (SELECT wallet FROM finances.accounts WHERE accounts.uid=quests.uid) FROM finances.quests GROUP BY uid ORDER BY uid ASC;\");\n $wallet = LoadModule('api', 'wallet');\n $bitcoin = LoadModule('api', 'bitcoin');\n $ret = array();\n foreach ($rows as $row)\n {\n if ($row['wallet'] === null)\n {\n array_push($ret, $row['uid']);\n echo \"<hr>{$row['uid']}<br>\";\n echo $tx = $wallet->GetFirstSourceTxid($row['id']);\n echo \"<br>\";\n echo $source = $bitcoin->GetSourceByTransaction($tx);\n if (strlen($source))\n db::Query(\"INSERT INTO finances.accounts(uid, wallet) VALUES ($1, $2)\",\n array($row['uid'], $source));\n }\n }\n return $ret;\n }", "protected function prepareForValidation()\n {\n $address = $this->input('address');\n\n if (!empty($address)) {\n $this->merge([\n 'geocoder' => Geocoder::getCoordinatesForAddress($address),\n ]);\n }\n }", "public function __construct()\n {\n $this->adresse = new Adresse();\n $this->competence = new ArrayCollection();\n $this->lerners = new ArrayCollection();\n }", "public function __construct(TDProject_ERP_Model_Entities_Address $address = null)\n {\n // call the parents constructor\n parent::__construct($address);\n // initialize the ValueObject with the passed data\n $this->_countries = new TechDivision_Collections_ArrayList();\n }" ]
[ "0.7323344", "0.6338378", "0.63093793", "0.6164549", "0.6117641", "0.60958767", "0.6046649", "0.6042263", "0.5918724", "0.59147745", "0.5907255", "0.5865941", "0.5863955", "0.58135927", "0.57992035", "0.5791817", "0.5742916", "0.572695", "0.57209843", "0.56979483", "0.56908685", "0.5680231", "0.5679966", "0.56673026", "0.560774", "0.56042254", "0.5588912", "0.55791205", "0.55239713", "0.5515545" ]
0.64676905
1
Import/Export working directory (source files, result files, lock files etc.).
public function getWorkingDir() { return $this->_varDirectory->getAbsolutePath($this->borntechiesHelper->getCustomerImportDirectory()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function export() {\n $folder = $this->config->get('oxygen.mod-import-export.path');\n if(!file_exists($folder)) {\n mkdir($folder);\n }\n $path = $folder . $this->environment;\n if(!file_exists($path)) {\n mkdir($path);\n }\n\n $this->exportStrategy->create($path);\n\n foreach($this->workers as $worker) {\n $files = $worker->export($this->output);\n foreach($files as $localPath => $path) {\n $this->output->writeln('Adding file: ' . $path);\n $this->exportStrategy->addFile($path, $localPath);\n }\n }\n\n $this->exportStrategy->commit();\n\n foreach($this->workers as $worker) {\n $worker->postExport($this->output);\n }\n }", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "protected function restoreWorkingDirectory()\n {\n if ($this->cwd) {\n chdir($this->savedWorkingDirectory);\n }\n }", "function getImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$import_dir = ilUtil::getDataDir().\"/svy_data\".\n\t\t\t\"/svy_\".$this->getId().\"/import\";\n\t\tif (!is_dir($import_dir))\n\t\t{\n\t\t\tilUtil::makeDirParents($import_dir);\n\t\t}\n\t\tif(@is_dir($import_dir))\n\t\t{\n\t\t\treturn $import_dir;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getImportTempDirectory()\n {\n return $this->loader->getImportLoader()->getTempDirectory();\n }", "public static function getWorkingDir()\n {\n return Mage::getBaseDir('var') . DS . 'storelocator' . DS;\n }", "abstract public function getRelativeDataDir();", "protected function getDefaultImportExportFolder() {}", "protected function getDefaultImportExportFolder() {}", "public function getcwd(): string;", "public function dir_rewinddir() {}", "abstract public function copyLocalDir($from, $to);", "public function currentWorkingDirectory()\n {\n return getcwd();\n }", "public function getCurrentDirectory();", "public function getCurrentDirectory();", "abstract public function directoryLocation();", "public function getDirectorySpool();", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "function getExportDirectory()\n\t{\n\t\t$export_dir = ilUtil::getDataDir().\"/usrf_data/export\";\n\n\t\treturn $export_dir;\n\t}", "public function handleSource()\n {\n if (is_dir($this->source) && file_exists(\"{$this->source}/_build/\")) {\n copy(\"{$this->source}/_build/build.config.sample.php\", \"{$this->source}/_build/build.config.php\");\n copy(\"{$this->source}/_build/build.properties.sample.php\", \"{$this->source}/_build/build.properties.php\");\n // @TODO check pcntl_fork\n passthru(\"php {$this->source}/_build/transport.core.php\");\n } else if (file_exists($this->source)) {\n $isZip = is_resource(zip_open($this->source));\n if ($isZip) {\n $zip = new \\ZipArchive();\n if ($zip->open($this->source) === true) {\n $path = pathinfo($this->source, PATHINFO_DIRNAME);\n $file = pathinfo($this->source, PATHINFO_BASENAME);\n // Extract in same folder\n $extracted = $zip->extractTo($path);\n if ($extracted) {\n // Cleanup file name to get the extracted folder name\n $extractedFolder = str_replace(array(\n '.zip', '-advanced', '-sdk'\n ), '', $file);\n // Make our newly extract folder our source\n $this->source = $path .'/'. $extractedFolder;\n }\n $zip->close();\n }\n }\n }\n }", "function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}", "public function getDir();", "protected static function copySrcIntoPkg()\n {\n $common_files_list = self::getModuleFiles(self::$src_directory);\n if (!empty($common_files_list)) {\n foreach ($common_files_list as $file_relative => $file_realpath) {\n $destination_directory = self::$pkg_directory . DIRECTORY_SEPARATOR . dirname($file_relative) . DIRECTORY_SEPARATOR;\n \n PackageOutput::createDirectory($destination_directory);\n PackageOutput::copyFile($file_realpath, $destination_directory . basename($file_realpath));\n }\n }\n }", "protected function action_getUserMainDir() {}", "protected function local() : void\n {\n File::ensureDirectoryExists(Path::storage('framework/dusk/console'));\n File::ensureDirectoryExists(Path::storage('framework/dusk/screenshots'));\n\n File::ensureDirectoryExists(Path::storage('testing/downloads'));\n File::ensureDirectoryExists(Path::storage('testing/public'));\n File::ensureDirectoryExists(Path::storage('testing/private'));\n }", "public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}", "public function cwd()\n {\n }", "public function cwd()\n {\n }", "function _fillDirectories($importDirectory)\n\t{\n\t\t\n\t\t@set_time_limit(60);\n\t\t\n\t\t$weDirectory = ereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . \"/webEdition\";\n\t\tif ($importDirectory == $weDirectory) { // we do not import stuff from the webEdition home dir\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// go throuh all files of the directory\n\t\t$d = dir($importDirectory);\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif ($entry == '.' || $entry == '..' || ((strlen($entry) >= 2) && substr($entry, 0, 2) == \"._\"))\n\t\t\t\tcontinue;\n\t\t\t\t// now we have to check if the file should be imported\n\t\t\t$PathOfEntry = $importDirectory . $this->_slash . $entry;\n\t\t\tif (!is_dir($PathOfEntry) && ($this->maxSize && (filesize($PathOfEntry) > (abs($this->maxSize) * 1024 * 1024))))\n\t\t\t\tcontinue;\n\t\t\t$contentType = getContentTypeFromFile($PathOfEntry);\n\t\t\t$importIt = false;\n\t\t\t\n\t\t\tswitch ($contentType) {\n\t\t\t\tcase \"image/*\" :\n\t\t\t\t\tif ($this->images) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/html\" :\n\t\t\t\t\tif ($this->htmlPages) {\n\t\t\t\t\t\tif ($this->createWePages) {\n\t\t\t\t\t\t\t$contentType = \"text/webedition\";\n\t\t\t\t\t\t\t// webEdition files needs to be post processed (external links => internal links)\n\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t$this->_postProcess, \n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\t\t\"contentType\" => \"post/process\", \n\t\t\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"application/x-shockwave-flash\" :\n\t\t\t\t\tif ($this->flashmovies) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"video/quicktime\" :\n\t\t\t\t\tif ($this->quicktime) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/js\" :\n\t\t\t\t\tif ($this->js) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/plain\" :\n\t\t\t\t\tif ($this->text) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/css\" :\n\t\t\t\t\tif ($this->css) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"folder\" :\n\t\t\t\t\t$importIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tif ($this->other) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif ($importIt) {\n\t\t\t\tarray_push(\n\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\"thumbs\" => $this->thumbs, \n\t\t\t\t\t\t\t\t\"width\" => $this->width, \n\t\t\t\t\t\t\t\t\"height\" => $this->height, \n\t\t\t\t\t\t\t\t\"widthSelect\" => $this->widthSelect, \n\t\t\t\t\t\t\t\t\"heightSelect\" => $this->heightSelect, \n\t\t\t\t\t\t\t\t\"keepRatio\" => $this->keepRatio, \n\t\t\t\t\t\t\t\t\"quality\" => $this->quality, \n\t\t\t\t\t\t\t\t\"degrees\" => $this->degrees, \n\t\t\t\t\t\t\t\t\"importMetadata\" => $this->importMetadata\n\t\t\t\t\t\t));\n\t\t\t}\n\t\t\tif ($contentType == \"folder\") {\n\t\t\t\tif (($this->depth == -1) || (abs($this->depth) > $this->_depth)) {\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\t\"thumbs\" => \"\", \n\t\t\t\t\t\t\t\t\t\"width\" => \"\", \n\t\t\t\t\t\t\t\t\t\"height\" => \"\", \n\t\t\t\t\t\t\t\t\t\"widthSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"heightSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"keepRatio\" => \"\", \n\t\t\t\t\t\t\t\t\t\"quality\" => \"\", \n\t\t\t\t\t\t\t\t\t\"degrees\" => \"\", \n\t\t\t\t\t\t\t\t\t\"importMetadata\" => 0\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$this->_depth++;\n\t\t\t\t\t$this->_fillDirectories($PathOfEntry);\n\t\t\t\t\t$this->_depth--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t}" ]
[ "0.58702326", "0.5858317", "0.5836753", "0.5756888", "0.55396783", "0.5521105", "0.55190176", "0.54215246", "0.5412002", "0.5412002", "0.5377446", "0.5324235", "0.5315042", "0.529201", "0.5271303", "0.5271303", "0.52620167", "0.5260512", "0.5260477", "0.5214411", "0.52086616", "0.5206797", "0.5188269", "0.5178088", "0.51559526", "0.51518273", "0.5129468", "0.5093465", "0.5093465", "0.5092929" ]
0.5905687
0
Get customers import file name from the configuration
public function getFilename() { $filename = $this->borntechiesHelper->getCustomerImportFilename(); if (!$filename) { throw new LocalizedException(__('Customer filename is not specified.')); } if (substr($this->getWorkingDir(), -1) == DIRECTORY_SEPARATOR) { return $this->getWorkingDir() . $filename; } else { return $this->getWorkingDir() . DIRECTORY_SEPARATOR . $filename; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getBaseName() {\n\t\treturn pathinfo( $this->getImportFilePath(), PATHINFO_FILENAME );\n\t\t;\n\t}", "protected function getConfigFileName() {\n return $this->sourceName.\"-\".$this->_cnfName;\n }", "protected function importSampleFilename()\n {\n return 'export_sample.csv';\n }", "public function getConfigFileName() {\n return realpath(FileHelper::getPrivateFolderLocation()) . EnvatoLicense::EnvatoLicenseFileNameJSON;\n }", "public function getFilePath()\n {\n $value = $this->_config->get('file/path');\n\n if ($value === null) {\n $value = '../var/import/import_all_products.csv';\n }\n\n return $value;\n }", "public function getFilePrefix(){\n return $this->cfg_fileprefix;\n }", "public function getClientFilename()\n {\n return $this->fileInfo['name'];\n }", "public function getClientFilename() {}", "protected function getTemplateFilename() {\n if (isset($this->extra['template-file'])) {\n return $this->extra['template-file'];\n }\n return 'settings.local.php.twig';\n }", "public function getClientFilename() {\n\n return $this->name;\n }", "public function getConfigFileName() {\n return \\Config::get('fontello::config.file');\n }", "protected function filename()\n {\n return 'carrierAgentDomains';\n }", "public function getImportClass()\n {\n $importClass = '';\n\n $modelSNG = singleton($this->modelClass);\n $importClass = $modelSNG->i18n_singular_name();\n\n return $importClass;\n }", "function trpdownload_marker_csv_get_filename($vars) {\n $filename = $vars['download_args']['safe_site_name'] \n . '.sequence_features.' \n . date('YMj-his');\n\n return $filename;\n}", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "public function getExtensionFromName()\n {\n $vars = explode('.', $this->getClientFilename());\n return strtolower(array_pop($vars));\n }", "function getFilename()\n {\n return __FILE__;\n }", "protected function filename () : string {\n return sprintf('%s/%s.csv', $this->instanceDirectory(), $this->guessName());\n }", "protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }", "private function getInstitutionFileName()\n {\n return preg_replace(\"/[^0-9a-zA-Z_\\-öäüßÄÖÜ]/\", \"\", $this->institutionId) . \"_\" . $this->language . \".ini\";\n }", "protected function filename()\n {\n return 'Company_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'frontend\\affiliates\\AffiliateProducts_' . date('YmdHis');\n }", "public static function custom_fields_file()\r\n {\r\n return GSDATAOTHERPATH.ImCategory::$current_category.'.'.IM_CUSTOMFIELDS_FILE;\r\n }", "public function getFilename()\n {\n return __FILE__;\n }", "public function getFilename($objConfig)\n {\n return File::getName($objConfig);\n }", "private static function getFileName()\n {\n return sprintf('Export %s.csv', Carbon::now()->toDateTimeString());\n }", "public function getVersionIniFilename()\n {\n return pathinfo($this->getVersionJsnFullPath(), PATHINFO_FILENAME);\n }", "public function getImportType()\n {\n $value = $this->_config->get('dataprocessing/general/import');\n\n if ($this->_importType !== null) {\n return $this->_importType;\n }\n\n if ($value === null) {\n $value = 'both';\n }\n\n return $value;\n }", "public function myFilename()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return $reflection->getFileName();\r\n }", "function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}" ]
[ "0.6573951", "0.6545612", "0.6473791", "0.6246218", "0.6190624", "0.61583674", "0.61162555", "0.6035487", "0.6027111", "0.5950203", "0.5948639", "0.5920623", "0.5890092", "0.58809394", "0.58772135", "0.58682644", "0.58171046", "0.5811849", "0.581167", "0.5784095", "0.5781468", "0.5766677", "0.5747705", "0.57350194", "0.568855", "0.56843597", "0.5673676", "0.5673279", "0.567327", "0.56619596" ]
0.6885259
0
Convert a Joomla extension name to `__extensions` table query criteria. The following kinds of extensions are supported: `pkg_something` Package type extension `com_something` Component `plg_folder_something` Plugins `mod_something` Site modules `amod_something` Administrator modules. THIS IS CUSTOM. `file_something` File type extension `lib_something` Library type extension
private function extensionNameToCriteria(string $extensionName): array { $parts = explode('_', $extensionName, 3); switch ($parts[0]) { case 'pkg': return [ 'type' => 'package', 'element' => $extensionName, ]; case 'com': return [ 'type' => 'component', 'element' => $extensionName, ]; case 'plg': return [ 'type' => 'plugin', 'folder' => $parts[1], 'element' => $parts[2], ]; case 'mod': return [ 'type' => 'module', 'element' => $extensionName, 'client_id' => 0, ]; // That's how we note admin modules case 'amod': return [ 'type' => 'module', 'element' => substr($extensionName, 1), 'client_id' => 1, ]; case 'file': return [ 'type' => 'file', 'element' => $extensionName, ]; case 'lib': return [ 'type' => 'library', 'element' => $parts[1], ]; } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtension($name) {}", "function getExtension() ;", "public function getExtension(string $name);", "public function getSEOExtensions() {\n\t\t$this->load->model('setting/setting');\n\t\t\t\t\n\t\t$installed_extensions = array();\n\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"extension WHERE type = 'module' ORDER BY code\");\n\t\tforeach ($query->rows as $result) {\n\t\t\t$installed_extensions[] = $result['code'];\n\t\t}\n\t\t\n\t\t$installed_seo_extensions = $this->model_setting_setting->getSetting('d_seo_extension');\n\t\t$installed_seo_extensions = isset($installed_seo_extensions['d_seo_extension_install']) ? $installed_seo_extensions['d_seo_extension_install'] : array();\n\t\t\n\t\t$seo_extensions = array();\n\t\t$files = glob(DIR_APPLICATION . 'controller/extension/module/' . $this->codename . '*.php');\n\t\tif ($files) {\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$seo_extension = basename($file, '.php');\n\t\t\t\tif (in_array($seo_extension, $installed_extensions) && in_array($seo_extension, $installed_seo_extensions)) {\n\t\t\t\t\t$seo_extensions[] = $seo_extension;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $seo_extensions;\n\t}", "abstract public function getExtensionName();", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function extensions();", "public function guessExtension();", "public abstract function getExtension();", "function getExtList() {\n\t\tGLOBAL $LANG;\n\n\t\t$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['llxmltranslate']);\n\n\t\t$extList = array('' => '');\n\t\tforeach($this->extPathList as $path) {\n\t\t\t$dir = PATH_site . $path;\n\t\t\tif (is_dir($dir)) {\n\t\t\t\t$dirs = t3lib_div::get_dirs($dir);\n\t\t\t\tif (is_array($dirs)) {\n\t\t\t\t\tforeach ($dirs as $dirname) {\n\t\t\t\t\t\tif ($dirname{0} != '.') {\n\t\t\t\t\t\t\t$path = $dir . $dirname;\n\t\t\t\t\t\t\t$version = $this->getExtVersion($dirname, $path);\n\t\t\t\t\t\t\tif ($version) {\n\t\t\t\t\t\t\t\t$extTitle = $this->getExtTitle($dirname, $path);\n\t\t\t\t\t\t\t\t$extTitle = str_replace(' ','&nbsp;',$this->mb_str_pad($extTitle, 45));\n\t\t\t\t\t\t\t\t$dirname = str_replace(' ','&nbsp;',$this->mb_str_pad($dirname, 30));\n\t\t\t\t\t\t\t\tif ($confArr['OrderByTitleExtension']) {\n\t\t\t\t\t\t\t\t\t$TitleInFirst = 1;\n\t\t\t\t\t\t\t\t\t$extList[$path] = $extTitle.$dirname.$version;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$TitleInFirst = 0;\n\t\t\t\t\t\t\t\t\t$extList[$path] = $dirname.$extTitle.$version;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($confArr['HideExtensionWithoutFiles']) {\n\t\t\t\t\t\t\t\t\t// Hide extension without files\n\t\t\t\t\t\t\t\t\t$files = $this->getllxmlFiles($path);\n\t\t\t\t\t\t\t\t\tif (empty($files))\t{\n\t\t\t\t\t\t\t\t\t\tunset($extList[$path]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tasort($extList);\n\t\tif ($TitleInFirst) {\n\t\t\t$Select_header = str_replace(' ','&nbsp;',$this->mb_str_pad($LANG->getLL('title_extension'),45)).str_replace(' ','&nbsp;',$this->mb_str_pad($LANG->getLL('key_extension'),30)).$LANG->getLL('version_extension');\n\t\t} else {\n\t\t\t$Select_header = str_replace(' ','&nbsp;',$this->mb_str_pad($LANG->getLL('key_extension'),30)).str_replace(' ','&nbsp;',$this->mb_str_pad($LANG->getLL('title_extension'),45)).$LANG->getLL('version_extension');\n\t\t}\n\t\t// Delete empty line (where do from this line ?)\n\t\tforeach($extList as $key => $value) {\n\t\t\t$temp = trim($key);\n\t\t\tif(empty($temp)){\n\t\t\t\tunset($extList[$key]);\n\t\t\t}\n\t\t}\n\t\t// Add new option for statistic view only\n\t\t$statistic = array();\n\t\tif ($this->MOD_SETTINGS['function'] == 4) {\n\t\t\t$statistic = array('' => $LANG->getLL('view_global_statistic'),'____' => str_replace(' ','&nbsp;',$this->mb_str_pad('',82,'=')));\n\t\t}\n\t\t$extList = array_merge(array('__' => $Select_header, '___' => str_replace(' ','&nbsp;',$this->mb_str_pad('',82,'='))),$statistic,$extList);\n\t\treturn $extList;\n\t}", "public function load_extensions()\n\t{\n\t\t$this->extensions = array();\n\n\t\t// Do not try to load any extensions if the extension table\n\t\t// does not exist or when installing or updating.\n\t\t// Note: database updater invokes this code, and in 3.0\n\t\t// there is no extension table therefore the rest of this function\n\t\t// fails\n\t\tif (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = 'SELECT *\n\t\t\tFROM ' . $this->extension_table;\n\n\t\t$result = $this->db->sql_query($sql);\n\t\t$extensions = $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($extensions as $extension)\n\t\t{\n\t\t\t$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);\n\t\t\t$this->extensions[$extension['ext_name']] = $extension;\n\t\t}\n\n\t\tksort($this->extensions);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->put($this->cache_name, $this->extensions);\n\t\t}\n\t}", "public function getExtensionName() {}", "public function getExttypes(){\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('distinct(type)');\n\t\t\t$query->from('#__extensions');\n\t\t\t$query->where('protected=0');\n\t\t\t$db->setQuery($query);\n\t\t\t$arrDatos = $db->loadRowList();\n\t\t\tif(!$arrDatos){\n\t\t\t\t$arrDatos= array();\n\t\t\t}\n\t\t\treturn $arrDatos;\n\t\t}", "public function getExtension() {}", "public function getExtension() {}", "public function extension()\n\t{\n\t\t$type = $this->type();\n\t\treturn self::getExtension($type);\n\t}", "public function getExtensions($extension = null, $version = null);", "function loadExts($field = \"*\", $condition = \"\"){ \r\n $table = YiiTables::getInstance(TBL_EXTENSIONS);\r\n $items = $table->loads($field, $condition);\r\n return $items;\r\n }", "public function findExtAddon($classname);", "public function getExtension() : string;", "public function getExtensions();", "public static function fromExtension(string $extension):string;", "public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'filter' => array('5.2.0', '', '0.11.0')\n );\n return $extensions;\n }", "public function getValidExtensions();", "public function Extension();", "public function get_extension()\n {\n }", "abstract function getExtension(): string;", "public function getExtensions() {}" ]
[ "0.64701414", "0.63465124", "0.6342535", "0.62396663", "0.614802", "0.60719186", "0.60719186", "0.60719186", "0.6031827", "0.5978338", "0.5958128", "0.59441614", "0.5912782", "0.58894235", "0.5888906", "0.58765143", "0.58736587", "0.5872758", "0.58652353", "0.5847426", "0.578967", "0.5782265", "0.5721486", "0.56856614", "0.5642384", "0.5639272", "0.5639194", "0.56383437", "0.56340325", "0.5628535" ]
0.6885834
0
Get the movie name from subtitle name
public function get_movie_name($file_name){ $this->_set_movie_name($file_name); return $this->movie_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTubeName();", "public static function getFriendlyName() {\r\n\t\treturn 'Movie';\r\n\t}", "static function subtitle(string $pid): string {\r\n return MJKMeta_ACF_Auth::get(MJKMeta_ACF_Subtitle::subtitle, $pid);\r\n }", "private function getATOMSubtitle() {\r\n $subtitle = '';\r\n if (isset($this->description['properties']['totalResults']) && $this->description['properties']['totalResults'] !== -1) {\r\n $subtitle = $this->context->dictionary->translate($this->description['properties']['totalResults'] === 1 ? '_oneResult' : '_multipleResult', $this->description['properties']['totalResults']);\r\n }\r\n $previous = isset($this->description['properties']['links']['previous']) ? '<a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['previous'], 'atom') . '\">' . $this->context->dictionary->translate('_previousPage') . '</a>&nbsp;' : '';\r\n $next = isset($this->description['properties']['links']['next']) ? '&nbsp;<a href=\"' . RestoUtil::updateUrlFormat($this->description['properties']['links']['next'], 'atom') . '\">' . $this->context->dictionary->translate('_nextPage') . '</a>' : '';\r\n $subtitle .= isset($this->description['properties']['startIndex']) ? '&nbsp;|&nbsp;' . $previous . $this->context->dictionary->translate('_pagination', $this->description['properties']['startIndex'], $this->description['properties']['startIndex'] + 1) . $next : '';\r\n return $subtitle;\r\n }", "public function subtitle()\n {\n return $this->resource->getName();\n }", "public function getMovieTitle() {\n\t\treturn ($this->movieTitle);\n\t}", "private function _set_subtitle_details_from_name($file_name){\n\t\tif(preg_match_all('/([0-9]+cds|[0-9]+cd|cd[0-9]+)/i', $file_name, $matches)){\n\t\t\t$this->CI->subtitles->cds = preg_replace('/(cd|cds)/i', '',$matches[0][0]);\n\t\t}\n\t\t\n\t\t//get fps\n\t\tif(preg_match_all('/([0-9]+\\.[0-9]+fps|[0-9]+fps|fps[0-9]+\\.[0-9]+|fps[0-9]+)/i', $file_name, $matches)){\n\t\t\t$this->CI->subtitles->fps = preg_replace('/(fps)/i', '',$matches[0][0]);\n\t\t}\n\t\t\n\t}", "public function get_subtitle() {\n\t\treturn $this->format_string( $this->subtitle );\n\t}", "function get_subtitle() \t{\n \t\treturn $this->subtitle;\t\n \t}", "public function getSubtitle()\n {\n return $this->getCurrentTranslation()->getSubtitle();\n }", "public function get_title() {\n return __( 'Video CTA', 'yx-super-cat' );\n }", "private function _set_movie_name($file_name){\n\t\t\n\t\t$this->movie_name = preg_replace('/(\\_|\\.|\\-|\\[|\\]|\\(|\\)|\\{|\\})/', ' ', $file_name);\n\t\t\n\t\tforeach($this->remove_from_title as $key => $patern){\n\t\t\t$this->remove_from_title[$key] = '/(\\s'.$patern.'\\s)/i';\n\t\t}\n\t\t$this->movie_name = preg_replace($this->remove_from_title, '', ' '.$this->movie_name.' ');\n\t\t$this->movie_name = preg_replace('/([\\s\\s]+)/', ' ', trim($this->movie_name));\n\t\t$this->movie_name = preg_replace_callback('%[0-9]{4}(?!.*[0-9]{4}.*)(.*)%', create_function('$match', 'return substr($match[0], 0, 4);'), $this->movie_name);\n\t}", "public static function pf_subpagetitle( &$parser /* , $title = null */ ) {\n\t\t$t = self::newTitleObject( $parser, func_get_args() );\n\t\tif ( $t === null ) {\n\t\t\treturn ''; // invalid title given\n\t\t}\n\t\treturn wfEscapeWikiText( SubpageInfo::getSubpageTitle( $t ) );\n\t}", "static function get_title($data_title){\r\n\r\n if(empty($data_title)) {\r\n return;\r\n }\r\n\r\n //explode after 'playlist_title'\r\n $explode_playlist_title = explode('playlist_title', $data_title);\r\n\r\n //get the title\r\n preg_match('/\\\"(.*?)\\\\\"/', $explode_playlist_title[1], $maches_title);\r\n\r\n //if the title is empty there will be only an \\ at the end\r\n if(empty($maches_title[1]) or $maches_title[1] == '\\\\') {\r\n return '';\r\n }\r\n\r\n //check the last chart in the title, could be \\\r\n if(substr($maches_title[1], -1, 1) == '\\\\') {\r\n $maches_title[1] = substr($maches_title[1], 0, -1);\r\n }\r\n\r\n //remove spaces\r\n if(!empty($maches_title[1])) {\r\n return trim(str_replace(array('&nbsp;'),array(''), htmlentities($maches_title[1], ENT_QUOTES)));//trim just in case\r\n } else {\r\n return '';\r\n }\r\n\r\n }", "public function getSuffixTitle ();", "function getSubtitleInfo($fileName) {\n\n $subtitleInfo = array();\n\n try {\n $url = \"http://www.opensubtitles.org/sv/search/sublanguageid-swe/moviename-\";\n $urlReadyName = urlencode(str_replace(\".mp4\", \"\", $fileName));\n $return = $this->controller->http->call($url.$urlReadyName, array(), \"GET\", \"\");\n\n preg_match_all(\"/servOC\\(([0-9]+),\\'\\/\\w+\\/\\w+\\/[0-9]+\\/([a-z-]+)\\/[a-z-]+\\',/\", $return['content'], $result);\n foreach ($result[1] as $key => $value) {\n $subtitleInfo[] = array($value, $result[2][$key]);\n }\n } catch (Exception $e) { return $subtitleInfo; }\n return $subtitleInfo;\n }", "public function getSubTitle()\n {\n return $this->_sub_title;\n }", "private function getTitleForYoutube(MultimediaObject $multimediaObject)\n {\n $title = $multimediaObject->getTitle();\n\n if(strlen($title) > 60){\n while(strlen($title) > 55){\n $pos = strrpos($title, \" \", 61);\n if ($pos !== FALSE) \n $title = substr($title, 0, $pos);\n else \n break;\n }\n } \n while (strlen($title) > 55) {\n $title = substr($title, 0, strrpos($title, \" \"));\n }\n if(strlen($multimediaObject->getTitle()) > 55) $title = $title.\"(...)\";\n\n return $title;\n }", "function getSubtitleFile($subtitleId, $subtitleName) {\n\n try {\n $url = \"http://www.opensubtitles.org/sv/subtitles/\".$subtitleId.\"/\".$subtitleName.\"/short-on\";\n $return = $this->controller->http->call($url, array(), \"GET\", \"\");\n preg_match_all('/\\<a class\\=\\\"none\\\" href\\=\"\\/sv\\/subtitleserve\\/file\\/([0-9]+)\\\"\\>/', $return['content'], $result);\n\n $url = \"http://www.opensubtitles.org/sv/subtitleserve/file/\".$result[1][0];\n $return = $this->controller->http->call($url, array(), \"GET\", \"\");\n\n if (mb_detect_encoding($return['content'], \"UTF-8, ISO-8859-1\") == \"ISO-8859-1\") {\n return utf8_encode(\"WEBVTT\\n\\r\\n\\r\".$return['content']);\n } else {\n return \"WEBVTT\\n\\r\\n\\r\".$return['content'];\n }\n } catch (Exception $e) {\n return \"\";\n }\n }", "protected function getTitle() {\n\t\t$result = $this->overlayFile->getProperty('title');\n\t\tif (empty($result)) {\n\t\t\t$result = $this->overlayFile->getName();\n\t\t}\n\t\treturn htmlspecialchars($result);\n\t}", "public function getSubTitle(){\n\t\treturn $this->ol[\"ISBN:\".$this->isbn][\"subtitle\"];\t\n\t}", "public function extractFileName(): string\n {\n $name = $this->extractMeta('name') ?: $this->extractMeta('filename');\n\n if ( ! $this->isValidFilename($name)) {\n return '';\n }\n\n return $name;\n }", "public function getTitle(){\n return $this->film['title'];\n }", "public function getSubtitle() {\n\n return $this->subtitle;\n }", "public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }", "public function getOriginalTitle() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('originalTitle' => array('originalTitleHeader' => 'header', \"originalTitleElement\")));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function subtitle()\n {\n return null;\n }", "function ts_set_custom_title( $title ) {\r\n \r\n\tif (is_single() || is_page())\r\n\t{\r\n\t\t$subtitle = get_post_meta (get_the_ID(), 'subtitle', true);\r\n\t\tif (!empty($subtitle))\r\n\t\t{\r\n\t\t\t$title .= $subtitle.' | ';\r\n\t\t}\r\n\t}\r\n return $title;\r\n}", "public function subtitle()\n {\n return $this->refid;\n }", "public function getTitle()\n {\n $title = $this->getShortTitle();\n $subtitle = $this->getSubtitle();\n $titleSection = $this->getTitleSection();\n if (!empty($subtitle)) {\n if ($title != '') {\n $separator = preg_match(\"/^[\\\\s=]+/\", $subtitle) ? \" \" : \" : \";\n $title .= $separator;\n }\n $title .= $subtitle;\n }\n if (!empty($titleSection)) {\n if ($title != '') {\n $title .= ' / ';\n }\n $title .= $titleSection;\n }\n return $title;\n }" ]
[ "0.673786", "0.6701106", "0.6643273", "0.65630937", "0.64703643", "0.64622486", "0.64335954", "0.64171094", "0.6188299", "0.61438686", "0.6126426", "0.60966086", "0.6090425", "0.60803175", "0.60692436", "0.6031786", "0.59977007", "0.59622955", "0.5949246", "0.5912324", "0.5904836", "0.59024423", "0.58898383", "0.5862654", "0.5841818", "0.5833852", "0.5776398", "0.57700294", "0.57517326", "0.572942" ]
0.6852244
0
Clean file name, to remaining movie file
private function _set_movie_name($file_name){ $this->movie_name = preg_replace('/(\_|\.|\-|\[|\]|\(|\)|\{|\})/', ' ', $file_name); foreach($this->remove_from_title as $key => $patern){ $this->remove_from_title[$key] = '/(\s'.$patern.'\s)/i'; } $this->movie_name = preg_replace($this->remove_from_title, '', ' '.$this->movie_name.' '); $this->movie_name = preg_replace('/([\s\s]+)/', ' ', trim($this->movie_name)); $this->movie_name = preg_replace_callback('%[0-9]{4}(?!.*[0-9]{4}.*)(.*)%', create_function('$match', 'return substr($match[0], 0, 4);'), $this->movie_name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanFileName($fileName)\n {\n // remove all special chars and keep only alphanumeric chars\n $fileName = preg_replace(\"/[^a-zA-Z0-9- .]/\", \"\", trim($fileName));\n // replace multiple white spaces with single white space\n $fileName = preg_replace(\"/\\s+/\", \" \", $fileName);\n // replace multiple dashes with single dash\n $fileName = preg_replace('/-+/', '-', $fileName);\n // again remove special chars from the beginning of the string in case it contains\n // special chars in the beginning after clean-up\n $fileName = preg_replace('/(^([^a-zA-Z0-9])*|([^a-zA-Z0-9])*$)/', '', $fileName);\n return $fileName;\n }", "function cleanFileName($filename) {\n\t\t//$name = preg_replace('/[^a-zA-Z0-9.]/', '', $name);\n\t\t//$name = substr($name,0,9);\n\t\t$filename_raw = $filename;\n\t\t$special_chars = array(\"?\", \"[\", \"]\", \"/\", \"\\\\\", \"=\", \"<\", \">\", \":\", \";\", \",\", \"'\", \"\\\"\", \"&\", \"$\", \"#\", \"*\", \"(\", \")\", \"|\", \"~\", \"`\", \"!\", \"{\", \"}\", chr(0));\n\t\t$filename = preg_replace( \"#\\x{00a0}#siu\", ' ', $filename );\n\t\t$filename = str_replace($special_chars, '', $filename);\n\t\t$filename = preg_replace('/[\\s-]+/', '-', $filename);\n\t\t$filename = trim($filename, '.-_');\n\t\t$filename = str_replace(' ', '-', $filename);\n\t\treturn $filename;\n\t}", "function clean($filename) \n {\n return preg_replace('/[^0-9a-z\\.\\_\\-]/i','', strtolower($filename));\n }", "function clean_filename($filename)\n\t{\n//replaces all characters that are not alphanumeric with the exception of the . for filename usage\n\t\t$realname = preg_replace(\"/[^a-zA-Z0-9\\.]/\", \"\", strtolower($filename));\n\t\treturn $realname;\n\t}", "public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }", "public function cleanFilename($filename = '')\n {\t\n \tif ($filename != '')\n \t{\n\t \t// Add spaces to ending HTMl tags\n\t \t$filename = preg_replace(\"/<\\/([^\\s])>/\", \"</$1> \", $filename);\n\t \t\n\t \t// Strip tags\n\t \t$filename = strip_tags($filename);\n\t \t\n\t \t// Convert all HTML entities\n\t \t$filename = html_entity_decode($filename);\n\t \t\n\t \t// Replace any white space\n\t \t$filename = preg_replace(\"/[\\r\\n\\t\\s]+/s\", \"-\", $filename);\n\t \t\n\t \t// Replace any dashes\n\t \t$filename = preg_replace(\"/[\\-]+/s\", \"-\", $filename);\n\t \t$filename = str_replace('--', '-', $filename);\n\t \t\n\t \t// Convert to lowercase\n\t \t$filename = strtolower($filename);\n\t \t\n\t \t// Remove any unexpected characters\n\t \t$filename = preg_replace(\"/[^a-zA-Z0-9\\-]?/\", \"\", $filename);\n\t }\n \n \treturn $filename;\n }", "public static function cleanFilename($fileName)\r\n {\r\n $fileName = str_replace('../', '', $fileName);\r\n $fileName = str_replace('./', '', $fileName);\r\n $fileName = str_replace(' ', '_', $fileName);\r\n return $fileName;\r\n }", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "function normalize($filename) {\n $maxlength = 20;\n $strippedString = preg_replace(\"/[^A-Za-z0-9_\\-]/\", \"\", $filename);\n return substr($strippedString, 0, min(strlen($strippedString), $maxlength));\n}", "function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}", "public static function sanitize_file_name( $name ) {\n\t\t$name = strtolower( $name );\n\t\t$name = preg_replace('/&.+?;/', '', $name); // kill entities\n\t\t$name = str_replace( '_', '-', $name );\n\t\t$name = preg_replace('/[^a-z0-9\\s-.]/', '', $name);\n\t\t$name = preg_replace('/\\s+/', '-', $name);\n\t\t$name = preg_replace('|-+|', '-', $name);\n\t\t$name = trim($name, '-');\n\t\treturn $name;\n\t}", "private function getPlainFileName(){\r\n return str_replace(\"https://images.pond5.com/\",\"\",$this->fileName); \r\n }", "public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename ?? '');\n\n // Since we use double underscore to delimit variants, eradicate them from filename\n return preg_replace('/_{2,}/', '_', $filename ?? '');\n }", "public function cleanFileName($fileName)\n {\n // Handle UTF-8 characters\n if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {\n // allow \".\", \"-\", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave)\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName));\n } else {\n $fileName = GeneralUtility::makeInstance(CharsetConverter::class)->specCharsToASCII('utf-8', $fileName);\n // Replace unwanted characters by underscores\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\\\xC0-\\\\xFF]/', '_', trim($fileName));\n }\n // Strip trailing dots and return\n return rtrim($cleanFileName, '.');\n }", "function filter_filename($name) {\n $name = str_replace(array_merge(\n array_map('chr', range(0, 31)),\n array('<', '>', ':', '\"', '/', '\\\\', '|', '?', '*','\\'')\n ), '', $name);\n // maximise filename length to 255 bytes http://serverfault.com/a/9548/44086\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $name= mb_strcut(pathinfo($name, PATHINFO_FILENAME), 0, 255 - ($ext ? strlen($ext) + 1 : 0), mb_detect_encoding($name)) . ($ext ? '.' . $ext : '');\n return $name;\n}", "private function cleanFilename($filename)\n\t{\n\t\t$filenameParts = explode('.', $filename);\n\t\t$filenameParts[0] = str_slug($filenameParts[0]);\n\n\t\treturn implode('.', $filenameParts);\n\t}", "function sanitize_filename($filename) {\n\t// Remove any trailing dots, as those aren't ever valid file names.\n\t$filename = rtrim($filename, '.');\n\n\t$regex = array('#(\\.){2,}#', '#[^A-Za-z0-9\\.\\_\\- ]#', '#^\\.#');\n\t$filename = trim(preg_replace($regex, '', $filename));\n\t$filename = str_replace(' ', '-', $filename);\n\n\treturn $filename;\n}", "function cmk_sanitize_filename_on_upload($filename) {\n $ext = end(explode('.',$filename));\n // Reemplazar todos los caracteres extranos.\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/','', substr($filename, 0, -(strlen($ext)+1)));\n // Replace dots inside filename\n $sanitized = str_replace('.','-', $sanitized);\n return strtolower($sanitized.'.'.$ext);\n}", "function strip_File($FileName) {\n\t//$arrItems = array(\" \", \"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"(\",\")\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$arrItems = array(\"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$FileName = str_replace($arrItems, \"_\", $FileName);\n\t$FileName = urldecode($FileName);\n\t$FileName = str_replace(\"%\", \"_\", $FileName);\n\treturn $FileName;\n}", "public function sanitize_filename($filename){\n\t\t\t$filename = preg_replace($this->file_uploading_settings['filename_sanitize'], '', $filename);\n\n\t\t\treturn $filename;\n\t\t}", "function cleanFileName($str) {\n $str = strtolower($str);\n $ext_point = strrpos($str,\".\");\n if ($ext_point===false) return false;\n $ext = substr($str,$ext_point,strlen($str));\n $str = substr($str,0,$ext_point);\n\n return preg_replace(\"/[^a-z0-9-]/\",\"_\",$str).$ext;\n}", "public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}", "public function filter_file($snap_file_name){\n\t\treturn str_replace(array('.','_','-','(',')',' ','&'), '', $snap_file_name);\n\t}", "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "function sanitize_file_name($filename)\n {\n }", "public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename);\n\n // There's not really any relevant cleaning rule for legacy. It's not important any way because we won't be\n // generating legacy URLs, aside from maybe for testing.\n return $filename;\n }", "private function _escape_filename($filename)\n {\n return str_replace('/', '', $filename);\n }", "public static function cleanFilename($file_name, $extension = \"\")\n {\n $clean_filename = preg_replace(\"/[?*:;{}\\\\ \\\"'\\/@#!%^()<>.]+/\", \"_\", $file_name);\n if ($extension) {\n return $clean_filename . \".\" . $extension;\n }\n return $clean_filename;\n }", "function file_ext_strip($filename){\n\t return preg_replace('/.[^.]*$/', '', $filename);\n\t}", "protected function filterFilename($value) {\n $value = str_replace(\" \", \"-\", $value);\n $value = str_replace([\"å\", \"ä\", \"ö\", \"Å\", \"Ä\", \"Ö\"], [\"a\", \"a\", \"o\", \"A\", \"A\", \"O\"], $value);\n $value = preg_replace(\"/[^a-z0-9\\-\\_\\.]/i\", \"\", $value);\n return $value;\n }" ]
[ "0.7119275", "0.702885", "0.6985996", "0.6956013", "0.69269127", "0.688942", "0.6875369", "0.67967", "0.6676304", "0.65985394", "0.65923345", "0.6554721", "0.65469795", "0.651788", "0.6517688", "0.65006334", "0.6454145", "0.64529085", "0.64317894", "0.6407714", "0.63831097", "0.63823605", "0.6370598", "0.63151735", "0.63109916", "0.62779766", "0.6271467", "0.6260845", "0.62206787", "0.6188373" ]
0.75893
0
Checks whether receipt should be sent for Yandex.Checkpoint.
function fn_is_yandex_checkpoint_receipt_required($processor_data) { return !empty($processor_data['processor_params']['send_receipt']) && $processor_data['processor_params']['send_receipt'] == 'Y'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isBackReceiptRequest() {\n return $this->_backReceiptRequest;\n }", "public function hasVerification()\r\n {\r\n // No need for CVN in creating/updating token\r\n return Mage::getModel('ewayrapid/method_notsaved')->hasVerification();\r\n }", "function backorders_require_notification() {\n\t\tif ($this->data['backorders']=='notify') return true;\n\t\treturn false;\n\t}", "protected function _fcpoCheckTxid()\n {\n $blAppointedError = false;\n $sTxid = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoTxid');\n\n $sTestOxid = '';\n if ($sTxid) {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE FCPO_TXACTION = 'appointed' AND fcpo_txid = '\" . $sTxid . \"'\";\n $sTestOxid = $this->_oFcpoDb->getOne($sQuery);\n }\n\n if (!$sTestOxid) {\n $blAppointedError = true;\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $oLang = $this->_oFcpoHelper->fcpoGetLang();\n $sCurrentRemark = $this->oxorder__oxremark->value;\n $sAddErrorRemark = $oLang->translateString('FCPO_REMARK_APPOINTED_MISSING');\n $sNewRemark = $sCurrentRemark.\" \".$sAddErrorRemark;\n $this->oxorder__oxremark = new oxField($sNewRemark, oxField::T_RAW);\n }\n $this->_fcpoSetAppointedError($blAppointedError);\n\n return $blAppointedError;\n }", "public function check() : bool\n { \n foreach($this->caller->numbersCalled as $key => $number)\n {\n \n foreach ($this->card->numbers as $key => $cardLine) \n {\n \n if(in_array($number, $cardLine)){\n $this->confirmations++;\n continue 2;\n }\n\n }\n }\n\n if($this->confirmations<24)\n {\n return false;\n }\n\n return true;\n }", "function isRedeemed() {\n // we get if it wasn't used yet\n return $this->getUsed_at() != '';\n }", "function isProcessed($txn_id, $merchant_reference) {\n $check_email_status = $this->payment_model->check_email_order_status($merchant_reference);\n\n if ($check_email_status) {\n return false;\n } else {\n return true;\n }\n }", "function isDeclined() {\n return $this->getStatus() == UserpointsTransaction::STATUS_DECLINED;\n }", "public function validateStatus() {\n\t\tswitch ($this->request->get('ok_txn_status')) {\n\t\t\tcase 'completed':\n\t\t\t\t$this->invoice->addPayment($this);\n\t\t\t\tif ($this->invoice->first_total <= 0 && $this->invoice->status == Invoice::PENDING) {\n\t\t\t\t\t$this->invoice->addAccessPeriod($this); // add first trial period\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase 'reversed':\n\t\t\t\tif($this->request->get('ok_txn_reversal_reason') == 'refund' || $this->request->get('ok_txn_reversal_reason') == 'chargeback') {\n\t\t\t\t\t$this->invoice->addRefund($this, $this->request->get('ok_txn_id'), $this->request->get('ok_txn_gross'));\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Am_Exception_Paysystem_TransactionInvalid(\"Unknown method\");\n\t\t\t\tbreak;\n\t\t}\n\t\treturn false;\n\t}", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function isDeliveryCheckNeeded()\n {\n $bNeeded = false;\n if (true === $this->fieldPrivate || true === $this->fieldTokenProtected) {\n $bNeeded = true;\n }\n\n return $bNeeded;\n }", "public function canBeDeclined()\n {\n return $this->isAwaitingFee();\n }", "public function isValidForDelivery();", "public function return_verify() {\n\t\treturn true;\n if($_POST['payer_status'] == 'verified')\n {\n // check the payment_status is Completed\n if ($_POST['payment_status'] != 'Completed' && $_POST['payment_status'] != 'Pending')\n {\n return false;\n }\n\n // check that receiver_email is your Primary PayPal email\n if ($_POST['receiver_email'] != $this->payment['paypal_account'])\n {\n return false;\n }\n\n if ($this->order['api_pay_amount'] != $_POST['mc_gross'])\n {\n return false;\n }\n if ($this->payment['paypal_currency'] != $_POST['mc_currency'])\n {\n return false;\n }\n return true;\n }\n else\n {\n // log for manual investigation\n return false;\n }\n }", "function receipt ($bool=true) {\n $this->receipt = ($bool);\n }", "public function check_cointopay_response() {\n\t\t\tglobal $woocommerce;\n\t\t\t$woocommerce->cart->empty_cart();\n\t\t\t$orderid = ( !empty(intval($_REQUEST['CustomerReferenceNr'])) ) ? intval($_REQUEST['CustomerReferenceNr']) : 0;\n\t\t\t$ordstatus = ( !empty(sanitize_text_field($_REQUEST['status'])) ) ? sanitize_text_field($_REQUEST['status']) : '';\n\t\t\t$ordtransactionid = ( !empty(sanitize_text_field($_REQUEST['TransactionID'])) ) ? sanitize_text_field($_REQUEST['TransactionID']) : '';\n\t\t\t$ordconfirmcode = ( !empty(sanitize_text_field($_REQUEST['ConfirmCode'])) ) ? sanitize_text_field($_REQUEST['ConfirmCode']) : '';\n\t\t\t$notenough = ( isset($_REQUEST['notenough']) ) ? intval($_REQUEST['notenough']) : '';\n\n\t\t\t$order = new WC_Order($orderid);\n\t\t\t$data = array(\n\t\t\t\t'mid' => $this->merchantid,\n\t\t\t\t'TransactionID' => $ordtransactionid,\n\t\t\t\t'ConfirmCode' => $ordconfirmcode,\n\t\t\t);\n\t\t\t$transactionData = $this->validate_order($data);\n\t\t\tif(200 !== $transactionData['status_code']){\n\t\t\t\tget_header();\n\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">'.$transactionData['message'] .'</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br></div></div></div>';\n\t\t\t\t get_footer();\n\t\t\t\t\texit;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($transactionData['data']['Security'] != $ordconfirmcode){\n\t\t\t\t\tget_header();\n\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">Data mismatch! ConfirmCode doesn\\'t match</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br></div></div></div>';\n\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telseif($transactionData['data']['CustomerReferenceNr'] != $orderid){\n\t\t\t\t\tget_header();\n\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">Data mismatch! CustomerReferenceNr doesn\\'t match</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br></div></div></div>';\n\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telseif($transactionData['data']['TransactionID'] != $ordtransactionid){\n\t\t\t\t\tget_header();\n\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">Data mismatch! TransactionID doesn\\'t match</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br></div></div></div>';\n\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telseif($transactionData['data']['Status'] != $ordstatus){\n\t\t\t\t\tget_header();\n\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">Data mismatch! status doesn\\'t match. Your order status is '. $transactionData['data']['Status'].'</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br></div></div></div>';\n\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (( 'paid' === $ordstatus ) && ( 0 === $notenough )) {\n\t\t\t\t\t// Do your magic here, and return 200 OK to Cointopay.\n\t\t\t\t\tif ('processing' === $order->status) {\n\t\t\t\t\t\t$order->update_status('processing', sprintf(__('IPN: Payment completed notification from Cointopay', 'woocommerce')));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t$order->update_status('processing', sprintf(__('IPN: Payment completed notification from Cointopay', 'woocommerce')));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$order->save();\n\t\t\t\t\t\n\t\t\t\t\t$order->add_order_note( __( 'IPN: Update status event for Cointopay to status COMPLETED:', 'woocommerce' ) . ' ' . $orderid);\n\n\t\t\t\t\tget_header();\n\t\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#0fad00\">Success!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/check.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">The payment has been received and confirmed successfully.</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #0fad00;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br><br><br></div></div></div>';\n\t\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t} elseif ('failed' === $ordstatus && 1 === $notenough) {\n\t\t\t\t\t$order->update_status('on-hold', sprintf(__('IPN: Payment failed notification from Cointopay because notenough', 'woocommerce')));\n\t\t\t\t\tget_header();\n\t\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">The payment has been failed.</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color: #ff0000;border: none;color: white; padding: 15px 32px; text-align: center;text-decoration: none;display: inline-block; font-size: 16px;\" >Back</a><br><br><br><br></div></div></div>';\n\t\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\t\t\t\t$order->update_status('failed', sprintf(__('IPN: Payment failed notification from Cointopay', 'woocommerce')));\n\t\t\t\t\tget_header();\n\t\t\t\t\techo '<div class=\"container\" style=\"text-align: center;\"><div><div><br><br><h2 style=\"color:#ff0000\">Failure!</h2><img style=\"margin:auto;\" src=\"' . esc_url(plugins_url('images/fail.png', __FILE__)) . '\"><p style=\"font-size:20px;color:#5C5C5C;\">The payment has been failed.</p><a href=\"' . esc_url(site_url()) . '\" style=\"background-color:#ff0000;border:none;color: white;padding:15px 32px;text-align: center;text-decoration:none;display:inline-block;font-size:16px;\">Back</a><br><br><br><br></div></div></div>';\n\t\t\t\t\tget_footer();\n\t\t\t\t\texit;\n\t\t\t\t}//end if\n\t\t\t\n\n\t\t}", "public function isRedelivered();", "public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }", "protected function checkVerification()\n {\n $verificationString = $this->getRequest()->getHeader('X-GCS-Webhooks-Endpoint-Verification');\n if ($verificationString) {\n $this->getResponse()->setHeader('Content-Type', 'text/plain');\n $this->getResponse()->setBody(\n $verificationString\n );\n\n return true;\n }\n\n return false;\n }", "public function isPendingReview() {\n return $this->getStatus() === Status::PENDING_REVIEW;\n }", "protected function _checkSendEmail()\n {\n // get the last shipment time\n $shipment = Mage::getResourceModel('sales/order_shipment_collection')\n ->addAttributeToSelect('created_at')\n ->addAttributeToFilter('store_id', $this->_storeId)\n ->setOrder('created_at', 'DESC')\n ->setPageSize(1)\n ->setCurPage(1);\n\n if ($shipment->count() != 0) {\n $lastShipment = $shipment->getFirstItem();\n $shipmentTime = $lastShipment->getCreatedAt();\n\n if ($shipmentTime) {\n return $this->_helper->checkAddAlert(\n $shipmentTime,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n } else {\n // no records exist check monitor start date in config\n // to determine if an alert should be sent\n $startDate = $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_START_DATE,\n $this->_storeId\n );\n if ($startDate) {\n return $this->_helper->checkAddAlert(\n $startDate,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n }\n\n return false;\n }", "public function checkForOneTimeDemoMessage(): bool\n {\n return $this->getCustomerAttrCreditHold() && $this->configProvider->isOptionCreditHoldEnable() && !$this->getFlag();\n }", "private function isReviewSendingEnabled()\n {\n return $this->_scopeConfig->getValue(\n AntavoConfigInterface::XML_PATH_REVIEW_EVENT_SENDING,\n ScopeInterface::SCOPE_STORES,\n $this->_storeManager->getStore()->getId()\n );\n }", "public function testOrderReceiptDisabled() {\n $order_type = OrderType::load($this->order->bundle());\n $order_type->setSendReceipt(FALSE);\n $order_type->save();\n\n $this->order->getState()->applyTransitionById('place');\n $this->order->save();\n\n $this->assertCount(0, $this->getMails());\n }", "public function isAwaitingConfirmation() {\n if(isset($this->data['charge']))\n return $this->data['charge']['status'] === 'successful' ? false : true;\n else\n return true;\n }", "public function canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }", "public function isDelivered() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->deliveryDate) ? false: true;\r\n\t}", "protected function shouldAddShippingInformation(): bool\r\n {\r\n if (DocumentTypes::requiresDelivery($this->documentType)) {\r\n return true;\r\n }\r\n\r\n return $this->useShipping === Boolean::YES;\r\n }", "public function is_onreview() {\n $order = SalesOrder::load($this->orderno);\n\t\t\treturn $order->is_onreview();\n }", "public function getNeedsExternalInfoInCheckout();" ]
[ "0.60225683", "0.59885013", "0.5933373", "0.5830958", "0.5784357", "0.5744014", "0.5742959", "0.5708734", "0.5655175", "0.5641523", "0.5631752", "0.5631423", "0.5584363", "0.5570641", "0.55419666", "0.5447696", "0.5444135", "0.5430598", "0.5415492", "0.5412099", "0.54048926", "0.5403116", "0.53855884", "0.5363863", "0.536312", "0.5350966", "0.5341772", "0.53401995", "0.532883", "0.53280634" ]
0.7424377
0
Provides price for Yandex.Checkpoint receipt.
function fn_get_yandex_checkpoint_price($price = 0.00, $currency = 'RUB') { return array( 'amount' => (float) fn_format_rate_value((float) $price, 'F', 2, '.', '', ''), 'currency' => $currency ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrice()\n {\n return $this->amount;\n }", "public function getTicketPrice() {\n return $this->get(self::TICKETPRICE);\n }", "public function getDepositPrice()\n {\n $this->checkIfKeyExistsAndIsInteger('price');\n\n return $this->data['price'];\n }", "public function getPrice()\n {\n return 0.2;\n }", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function getOffer_price()\n {\n return $this->offer_price;\n }", "public function getCurrentPrice() : float;", "public function getPrice()\n\t{\n\t\t$item = InvoiceItem::where('description', $this->description)\n\t\t\t->orderBy('updated_at', 'DESC')\n\t\t\t->first();\n\n\t\treturn is_null($item) ? 0 : $item->price;\n\t}", "public function getPrice() {\n $price = 420;\n return $price;\n }", "public function getTicket_price()\n {\n return $this->ticket_price;\n }", "public function getPricePoint() {\n return $this->pricePoint;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n $price = Cache::tags([$this->exchange])->get($this->pair, function () {\n return $this->getPriceFromAPI($this->pair);\n });\n return $price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }" ]
[ "0.65930814", "0.65821064", "0.6572982", "0.6566398", "0.65562785", "0.65538895", "0.6551695", "0.6514119", "0.6512793", "0.65125644", "0.6510935", "0.64574057", "0.64574057", "0.6439965", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221", "0.6433221" ]
0.69570744
0
Converts receipt instance to Yandex.Checkpoint format.
function fn_yandex_checkpoint_convert_receipt(Receipt $receipt, $currency) { $items = array(); foreach ($receipt->getItems() as $item) { $items[] = array( 'quantity' => (int) $item->getQuantity(), 'price' => fn_get_yandex_checkpoint_price($item->getPrice(), $currency), 'tax' => YandexCheckpointVatTypes::getTaxTypeByBaseType($item->getTaxType()), 'text' => fn_get_yandex_checkpoint_description($item->getName()), ); } return array( 'customerContact' => $receipt->getEmail(), 'items' => $items, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateCheckpoint() : ?FeedbackItemResolution\n {\n return null;\n }", "function fn_yandex_checkpoint_get_refund_receipt($refund_data, $order_info, $currency)\n{\n /** @var \\Tygh\\Addons\\RusTaxes\\ReceiptFactory $receipt_factory */\n $receipt_factory = Tygh::$app['addons.rus_taxes.receipt_factory'];\n\n $receipt = $receipt_factory->createReceiptFromOrder($order_info, $currency, false);\n\n if (!$receipt) {\n return null;\n }\n\n foreach ($refund_data['products'] as $cart_id => $product) {\n if ($product['is_returned'] == 'N') {\n $receipt->removeItem($cart_id, ReceiptItem::TYPE_PRODUCT);\n } else {\n $receipt->setItemQuantity($cart_id, ReceiptItem::TYPE_PRODUCT, $product['amount']);\n }\n }\n\n if (isset($refund_data['refund_shipping']) && $refund_data['refund_shipping'] == 'N') {\n $receipt->removeItem(0, ReceiptItem::TYPE_SHIPPING);\n }\n\n if (isset($refund_data['refund_surcharge']) && $refund_data['refund_surcharge'] == 'N') {\n $receipt->removeItem(0, ReceiptItem::TYPE_SURCHARGE);\n }\n\n if (Registry::get('addons.gift_certificates.status') == 'A'\n && !empty($order_info['gift_certificates'])\n && isset($refund_data['certificates'])\n ) {\n foreach ($refund_data['certificates'] as $cart_id => $certificate) {\n if ($certificate['is_returned'] == 'N') {\n $receipt->removeItem($cart_id, ReceiptItem::TYPE_GIFT_CERTIFICATE);\n }\n }\n }\n\n /**\n * Executes after building receipt to refund via Yandex.Checkpoint, allows to modify receipt.\n *\n * @param array $refund_data Refund info (returned products, refunded shipping etc.)\n * @param array $order_info Order info\n * @param string $currency Currency code\n * @param Receipt $receipt Receipt instance\n */\n fn_set_hook('yandex_checkpoint_build_refunded_order_post', $refund_data, $order_info, $currency, $receipt);\n\n $receipt->allocateDiscountByUnit();\n\n return fn_yandex_checkpoint_convert_receipt($receipt, MWSClient::YANDEX_CHECKPOINT_RUB);\n}", "function fn_yandex_checkpoint_get_refunded_order($order_info)\n{\n /** @var \\Tygh\\Addons\\RusTaxes\\ReceiptFactory $receipt_factory */\n $receipt_factory = Tygh::$app['addons.rus_taxes.receipt_factory'];\n\n $receipt = $receipt_factory->createReceiptFromOrder($order_info, CART_PRIMARY_CURRENCY);\n\n if (!$receipt) {\n return $order_info;\n }\n\n foreach ($order_info['products'] as $cart_id => &$product) {\n $receipt_item = $receipt->getItem($cart_id, ReceiptItem::TYPE_PRODUCT);\n\n if ($receipt_item) {\n $product['price'] = $receipt_item->getPrice();\n }\n }\n unset($product);\n\n if (Registry::get('addons.gift_certificates.status') == 'A' && !empty($order_info['gift_certificates'])) {\n foreach ($order_info['certificates'] as $cart_id => &$certificate) {\n $receipt_item = $receipt->getItem($cart_id, ReceiptItem::TYPE_GIFT_CERTIFICATE);\n\n if ($receipt_item) {\n $certificate['amount'] = $receipt_item->getPrice();\n }\n }\n }\n unset($certificate);\n\n $shipping_receipt_item = $receipt->getItem(0, ReceiptItem::TYPE_SHIPPING);\n $surcharge_receipt_item = $receipt->getItem(0, ReceiptItem::TYPE_SURCHARGE);\n\n if ($shipping_receipt_item) {\n $order_info['shipping_cost'] = $shipping_receipt_item->getPrice();\n }\n\n if ($surcharge_receipt_item) {\n $order_info['payment_surcharge'] = $surcharge_receipt_item->getPrice();\n }\n\n /**\n * Executes after prepared order data to refund via Yandex.Checkpoint, allows to modify order content.\n *\n * @param array $order_info Order info\n * @param Receipt $receipt Receipt instance\n */\n fn_set_hook('yandex_checkpoint_get_refunded_order', $order_info, $receipt);\n\n return $order_info;\n}", "public function restored(AppointmentNote $note)\n {\n //\n }", "function fn_yandex_checkpoint_get_receipt($order, $currency)\n{\n /** @var \\Tygh\\Addons\\RusTaxes\\ReceiptFactory $receipt_factory */\n $receipt_factory = Tygh::$app['addons.rus_taxes.receipt_factory'];\n\n $receipt = $receipt_factory->createReceiptFromOrder($order, $currency);\n\n if ($receipt) {\n return fn_yandex_checkpoint_convert_receipt($receipt, $currency);\n }\n\n return null;\n}", "function set_checkpoint()\n\t{\n\t\t$this->guardar();\n\t}", "public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'receipt_number' => 'required',\n 'date' => 'required|date',\n 'amount' => 'required',\n 'student_id' => 'required',\n 'batch_id' => 'required'\n ]);\n\n $receipt = new Receipt;\n\n $receipt->number = $request->receipt_number;\n $receipt->date = $request->date;\n $receipt->amount = $request->amount;\n $receipt->student_id = $request->student_id;\n $receipt->batch_id = $request->batch_id;\n\n if($request->file('image')) {\n $file = $request->file('image');\n $ext = strtolower($file->getClientOriginalExtension());\n $file_name = 'receipt'.time().'.'.$ext;\n $destination = 'uploads/receipts/'.$file_name;\n $file->move('uploads/receipts/', $file_name);\n }\n\n $receipt->image = $destination;\n \n $receipt->save();\n return redirect()->route('courses.index');\n }", "public function getReceipt()\n {\n return $this->receipt;\n }", "protected function registerActivationCheckpoint()\n {\n $this->registerActivations();\n\n $this->app->singleton('sentinel.checkpoint.activation', function ($app) {\n return new ActivationCheckpoint($app['sentinel.activations']);\n });\n }", "public function receiptInfo($value) {\n $this->annotations['receipt_info'] = $value;\n return $this;\n }", "function handle_checkpoint_command($command) {\n $output = \"checkpoint\\n\";\n\n return $output;\n }", "function fn_is_yandex_checkpoint_receipt_required($processor_data)\n{\n return !empty($processor_data['processor_params']['send_receipt'])\n && $processor_data['processor_params']['send_receipt'] == 'Y';\n}", "public function convert()\n {\n //build URI\n $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '?format=' . $this->saveFormat;\n\n //sign URI\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $v_output = Utils::validateOutput($responseStream);\n\n if ($v_output === '') {\n if ($this->saveFormat == 'html') {\n $save_format = 'zip';\n } else {\n $save_format = $this->saveFormat;\n }\n\n $outputPath = AsposeApp::$outPutLocation . Utils::getFileName($this->getFileName()) . '.' . $save_format;\n Utils::saveFile($responseStream, $outputPath);\n return $outputPath;\n } else {\n return $v_output;\n }\n }", "public function getReceipt()\n {\n return $this->basket->receipt()->firstOrFail();\n }", "public function createReceipt()\n {\n $contentBody = \"\";\n $finalProductsCost = 0.00;\n $salesTaxTotal = 0.00;\n $importTaxTotal = 0.00;\n\n $count = 1;\n foreach ($this->getProducts() as $product) {\n $productCount = count($this->getProducts()->where('id', '=', $product->id)->all());\n\n $productDescription = (new ProductFunctions($product))->getDescription();\n $costsTaxInclusive = (new ProductFunctions($product))->finalCost();\n\n $finalProductsCost += ((new ProductFunctions($product))->getPrice() * $productCount);\n $salesTaxTotal += ((new ProductFunctions($product))->getSalesTaxCost() * $productCount);\n $importTaxTotal += ((new ProductFunctions($product))->getImportTaxCost() * $productCount);\n\n $contentBody .= ($productCount) . ' ' . $productDescription . ': ' . money_format('%i', $costsTaxInclusive);\n $count != count($this->getProducts()) ? $contentBody .= \"\\n\" : null;\n $count++;\n }\n\n $totalTaxes = ($salesTaxTotal + $importTaxTotal);\n $contentBody .= \"\\nSales Taxes: \" . money_format('%i', $totalTaxes);\n $contentBody .= \"\\nTotal: \" . money_format('%i', ($finalProductsCost + $totalTaxes));\n\n $receipt = new Receipt(\n [\n 'final_product_cost_total' => money_format('%i', $finalProductsCost),\n 'sales_tax_total' => money_format('%i', $salesTaxTotal),\n 'import_tax_total' => money_format('%i', $importTaxTotal),\n 'final_taxes_total' => money_format('%i', $totalTaxes),\n 'final_receipt_total' => money_format('%i', ($finalProductsCost + $totalTaxes)),\n 'receipt_content' => $contentBody,\n 'basket_id' => $this->basket->id\n ]\n );\n $receipt->save();\n\n if (!empty($receipt)) {\n $this->basket->receipt_id = $receipt->id;\n $this->basket->save();\n }\n\n return $receipt;\n }", "public function getReceipt()\n {\n return array_key_exists('receipt', $this->data) ? $this->data['receipt'] : null;\n }", "public function store(Request $request)\n {\n $trip = Trip::find($request->input('trip'));\n $new_allocated_seat = array_sum($request->input('new_allocated_seats'));\n $this->validate($request, [\n 'trip' => 'required',\n ]);\n $request->validate([\n 'name' => 'required',\n 'phoneNumber' => 'required'\n ]);\n\n $ticket = new Ticket();\n $ticket->trip_id = $request->input('trip');\n $ticket->trip_type = Session::get('key5');\n $ticket->return_date = Session::get('key6');\n $ticket->no_of_passenger = $new_allocated_seat;\n if($ticket->trip_type === 'Round Trip') {\n $ticket->amount = 2 * ($trip->price * $new_allocated_seat);\n }else{\n $ticket->amount = $trip->price * $new_allocated_seat;\n }\n\n $ticket->allocated_seats = $request->input('new_allocated_seats');\n $trip->allocated_seats = $request->input('all_allocated_seats');\n $trip->available_seats = $trip->available_seats - $new_allocated_seat;\n\n\n if (Auth::check()) {\n $id = Auth::user()->id;\n $userDetails = DB::table('users')\n ->select('email','firstName','lastName', 'phoneNumber')\n ->where('id','=', $id)->first();\n $ticket->user_id = $id;\n $ticket->email = $userDetails->email;\n $trip->save();\n $count = count((is_countable($request->name)?$request->name:[]));\n for ($i=0; $i < $count; $i++) {\n $ticket->name = json_encode($request->name);\n $ticket->phoneNumber = json_encode($request->phoneNumber);\n $ticket->save();\n }\n\n $bookMessage = [\n 'title' => 'Booking Confirmation',\n 'body' => 'Your ticket has been booked.'\n ];\n\n\n\n $pdf = PDF::loadView('ticket',['ticket'=>$ticket]);\n $message = new SendMail($bookMessage);\n $message->attachData($pdf->output(), \"ticket.pdf\");\n Mail::to($userDetails->email)->send($message);\n return redirect()->back()->withSuccessMessage(\"Your ticket has been booked. Please check your mail.\");\n }else{\n Session::put('book', $ticket);\n return redirect()->route('login');\n }\n Session::forget('book');\n\n\n }", "function decline() {\n $this->setStatus(UserpointsTransaction::STATUS_DECLINED);\n return $this;\n }", "public function restored(ReservationPayment $ReservationPayment)\n {\n //\n }", "protected function _shippingFromArray($arr)\n\t{\n\t\tswitch ($this->_config['push_orders_as'])\n\t\t{\n\t\t\tcase QUICKBOOKS_OBJECT_SALESRECEIPT:\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase QUICKBOOKS_OBJECT_SALESORDER:\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase QUICKBOOKS_OBJECT_INVOICE:\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t$InvoiceLine = new QuickBooks_Object_Invoice_InvoiceLine();\n\t\t\t\t\n\t\t\t\tif (!empty($arr['Rate']))\n\t\t\t\t{\n\t\t\t\t\t$InvoiceLine->setRate($arr['Rate']);\n\t\t\t\t\t$InvoiceLine->setQuantity(1);\n\t\t\t\t}\n\t\t\t\telse if (!empty($arr['Amount']))\n\t\t\t\t{\n\t\t\t\t\t$InvoiceLine->setAmount((float) $arr['Amount']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$InvoiceLine->setAmount(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$map = array(\n\t\t\t\t\t'Desc' => \t\tarray( 'setDescription', 'Invoice InvoiceLine Desc' ),\n\t\t\t\t\t'ClassID' => \tarray( 'setClassApplicationID', 'ClassRef ' . QUICKBOOKS_API_APPLICATIONID, 'setClassListID' ), \n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$InvoiceLine = $this->_applyBaseMap($arr, $map, $InvoiceLine, 'Invoice InvoiceLine');\t\n\t\t\t\t\n\t\t\t\t$InvoiceLine->setItemApplicationID(QUICKBOOKS_INTEGRATOR_SHIPPING_ID);\n\t\t\t\t\n\t\t\t\treturn $InvoiceLine;\n\t\t}\n\t}", "protected function postProcessUpdateReceipt()\n {\n }", "public function restored(TrainingByTitleDetail $trainingByTitleDetail)\n {\n //\n }", "public function importResponse( $trx ) {\n\t\tif ( isset( $trx->unique_id ) ) {\n\t\t\t$this->unique_id = $trx->unique_id;\n\t\t}\n\t\tif ( isset( $trx->timestamp ) && $trx->timestamp instanceof DateTime ) {\n\t\t\t$this->date_add = $trx->timestamp->getTimestamp();\n\t\t} elseif ( isset( $trx->date_add ) ) {\n\t\t\t$this->date_add = $trx->date_add;\n\t\t} else {\n\t\t\t$this->date_add = time();\n\t\t}\n\t\tif ( isset( $trx->transaction_type ) ) {\n\t\t\t$this->type = $trx->transaction_type;\n\t\t} elseif ( isset( $trx->type ) ) {\n\t\t\t$this->type = $trx->type;\n\t\t} else {\n\t\t\t$this->type = static::TYPE_CHECKOUT;\n\t\t}\n\t\tif ( isset( $trx->status ) ) {\n\t\t\t$this->status = $trx->status;\n\t\t}\n\t\tif ( isset( $trx->message ) ) {\n\t\t\t$this->message = $trx->message;\n\t\t}\n\t\tif ( isset( $trx->currency ) ) {\n\t\t\t$this->currency = $trx->currency;\n\t\t}\n\t\tif ( isset( $trx->amount ) ) {\n\t\t\t$this->amount = $trx->amount;\n\t\t}\n\t\tif ( isset( $trx->terminal_token ) ) {\n\t\t\t$this->terminal = $trx->terminal_token;\n\t\t}\n\t\tif ( isset( $trx->payment_transaction->terminal_token ) ) {\n\t\t\t$this->terminal = $trx->payment_transaction->terminal_token;\n\t\t}\n\t\tif ( isset( $trx->threeds_method_url ) ) {\n\t\t\t$this->threeds_method_url = $trx->threeds_method_url;\n\t\t}\n\t\tif ( isset( $trx->threeds_method_continue_url ) ) {\n\t\t\t$this->threeds_method_continue_url = $trx->threeds_method_continue_url;\n\t\t}\n\t}", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n tray::updateOrCreate([\n// 'agency_id' => $this->agency_id,\n// 'state_id' => $this->state_id,\n 'name' => $this->name,\n 'logo' => $this->logo,\n 'email' => $this->email,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'address' => $this->address,\n 'facebook' => $this->facebook,\n 'instagram' => $this->instagram,\n 'youtube' => $this->youtube,\n 'viber' => $this->viber,\n 'whatsapp' => $this->whatsapp,\n 'url' => $this->url,\n ]);\n $this->exampleModal = false;\n session()->flash('message',\n $this->tray_id ? 'Tray Updated Successfully.' : 'Tray Created Successfully.');\n\n $this->resetInputFields();\n }", "public function store(Request $request)\n {\n $obj=new Payouts; \n $obj->restaurant_id=$request->restaurant_id;\n $obj->restaurant_name=$request->restaurant_name; \n $obj->amount=$request->amount;\n $obj->method=$request->method;\n $obj->remark=$request->remark; \n $is_saved=$obj->save(); \n restaurants::where('name', $request->restaurant_name)\n ->decrement('outstanding_balance', $request->amount);\n if($is_saved)\n { \n session()->flash(\"Message\",\"Fee Add successfully! \"); \n return redirect(\"outstandingpayout\");\n \n } \n }", "public function setReceipt($var)\n {\n GPBUtil::checkString($var, False);\n $this->receipt = $var;\n\n return $this;\n }", "public function restored(Ticket $ticket)\n {\n //\n }", "function createCheckoutPayload() {\n /*\n * Merchant model\n */\n $merchant = new stdClass();\n $merchant->notification_url = 'https://merchant.com/order/step3_checkout_confirm.php'; // url where you will receive Aplazame webhook events as described in https://aplazame.com/en/docs/api/checkout-confirmation/ or https://aplazame.com/integraciones/api/checkout-confirmation/\n $merchant->success_url = \"/success\"; // url that the customer is sent to after confirming their order.\n $merchant->pending_url = \"/pending\"; // url that the customer is sent to if the order status is pending.\n $merchant->error_url = \"/error\"; // url that the customer is sent to if there is an error in the checkout.\n $merchant->dismiss_url = \"/checkout\"; // url that the customer is sent to if the customer chooses to back to the e-commerce, by default is /.\n $merchant->ko_url = \"/ko\"; // url that the customer is sent to if Aplazame refuses the order.\n\n /*\n * Article model\n */\n $article = new stdClass();\n $article->id = '89793238462643383279'; // The article ID.\n $article->name = 'Reloj en oro blanco de 18 quilates y diamantes'; // Article name.\n $article->url = 'http://shop.example.com/product.html'; // Article url.\n $article->image_url = 'http://shop.example.com/product_image.png'; // Article image url.\n $article->quantity = 2; // Article quantity.\n $article->price = Aplazame\\Serializer\\Decimal::fromFloat(4020.00); // Article price (tax is not included). (4,020.00 €)\n $article->description = 'Movimiento de cuarzo de alta precisión'; // Article description.\n $article->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Article tax rate. (21.00%)\n $article->discount = Aplazame\\Serializer\\Decimal::fromFloat(5.00); // The discount amount of the article. (5.00 €)\n\n // ... rest of articles in the shopping cart.\n\n /*\n * Articles collection\n */\n $articles = array( $article, );\n\n /*\n * Order model\n */\n $order = new stdClass();\n $order->id = '28475648233786783165'; // Your order ID.\n $order->currency = 'EUR'; // Currency code of the order.\n $order->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Order tax rate. (21.00%)\n $order->total_amount = Aplazame\\Serializer\\Decimal::fromFloat(4620.00); // Order total amount. (4,620.00 €)\n $order->articles = $articles; // Articles in cart.\n $order->discount = Aplazame\\Serializer\\Decimal::fromFloat(160.00); // The discount amount of the order. (160.00 €)\n $order->cart_discount = Aplazame\\Serializer\\Decimal::fromFloat(0.50); // The discount amount of the cart. (0.50 €)\n\n /*\n * Customer address model\n */\n $customerAddress = new stdClass();\n $customerAddress->first_name = 'John'; // Address first name.\n $customerAddress->last_name = 'Coltrane'; // Address last name.\n $customerAddress->street = 'Plaza del Valle Boreal nº10'; // Address street.\n $customerAddress->city = 'Madrid'; // Address city.\n $customerAddress->state = 'Madrid'; // Address state.\n $customerAddress->country = 'ES'; // Address country code.\n $customerAddress->postcode = '28080'; // Address postcode.\n $customerAddress->phone = '601234567'; // Address phone number.\n $customerAddress->address_addition = 'Cerca de la plaza Pontífice Sulyvahn'; // Address addition.\n\n /*\n * Customer model\n */\n $customer = new stdClass();\n $customer->id = '1618'; // Customer ID.\n $customer->email = '[email protected]'; // The customer email.\n $customer->type = 'e'; // Customer type, the choices are g:guest, n:new, e:existing.\n $customer->gender = 0; // Customer gender, the choices are 0: not known, 1: male, 2:female, 3: not applicable.\n $customer->first_name = 'John'; // Customer first name.\n $customer->last_name = 'Coltrane'; // Customer last name.\n $customer->birthday = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('1990-08-21 13:56:45')); // Customer birthday.\n $customer->language = 'es'; // Customer language preferences.\n $customer->date_joined = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('2014-08-21 13:56:45')); // A datetime designating when the customer account was created.\n $customer->last_login = Aplazame\\Serializer\\Date::fromDateTime(new DateTime('2020-08-27 19:57:56')); // A datetime of the customer last login.\n $customer->address = $customerAddress; // Customer address.\n\n /*\n * Billing address model\n */\n $billingAddress = new stdClass();\n $billingAddress->first_name = 'Bill'; // Billing first name.\n $billingAddress->last_name = 'Evans'; // Billing last name.\n $billingAddress->street = 'Calle Central Yharnam 92'; // Billing street.\n $billingAddress->city = 'Madrid'; // Billing city.\n $billingAddress->state = 'Madrid'; // Billing state.\n $billingAddress->country = 'ES'; // Billing country code.\n $billingAddress->postcode = '28080'; // Billing postcode.\n $billingAddress->phone = '601765432'; // Billing phone number.\n $billingAddress->address_addition = 'Cerca del Gran Puente'; // Billing address addition.\n\n /*\n * Shipping info model\n */\n $shippingInfo = new stdClass();\n $shippingInfo->first_name = 'Django'; // Shipping first name.\n $shippingInfo->last_name = 'Reinhard'; // Shipping last name.\n $shippingInfo->street = 'Plaza del Valle Boreal nº10'; // Shipping street.\n $shippingInfo->city = 'Madrid'; // Shipping city.\n $shippingInfo->state = 'Madrid'; // Shipping state.\n $shippingInfo->country = 'ES'; // Shipping country code.\n $shippingInfo->postcode = '28080'; // Shipping postcode.\n $shippingInfo->name = 'Planet Express'; // Shipping name.\n $shippingInfo->price = Aplazame\\Serializer\\Decimal::fromFloat(5.00); // Shipping price (tax is not included). (5.00 €)\n $shippingInfo->phone = '601234567'; // Shipping phone number.\n $shippingInfo->address_addition = 'Cerca de la plaza Pontífice Sulyvahn'; // Shipping address addition.\n $shippingInfo->tax_rate = Aplazame\\Serializer\\Decimal::fromFloat(21.00); // Shipping tax rate. (21.00%)\n $shippingInfo->discount = Aplazame\\Serializer\\Decimal::fromFloat(1.00); // The discount amount of the shipping. (1.00 €)\n\n /*\n * Checkout model\n */\n $checkout = new stdClass();\n $checkout->toc = true;\n $checkout->merchant = $merchant;\n $checkout->order = $order;\n $checkout->customer = $customer;\n $checkout->billing = $billingAddress;\n $checkout->shipping = $shippingInfo;\n\n return $checkout;\n}", "function viewReceipt(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewReceipt();\r\n }" ]
[ "0.48193642", "0.48064372", "0.47803822", "0.476836", "0.4573021", "0.45189747", "0.43990493", "0.42926326", "0.42697236", "0.42617956", "0.42300433", "0.42271826", "0.42119712", "0.4161698", "0.41578776", "0.4133717", "0.41234213", "0.4071905", "0.40662724", "0.40502757", "0.40463302", "0.40409866", "0.40264833", "0.40175945", "0.401713", "0.40135878", "0.39951015", "0.39653736", "0.39581096", "0.3951824" ]
0.64877534
0
Determines whether a Yandex.Checkpoint refund is partial.
function fn_yandex_checkpoint_is_partial_refund($refund_data, $order_info) { $is_partial_refund = isset($refund_data['refund_shipping']) && $refund_data['refund_shipping'] == 'N' || isset($refund_data['refund_surcharge']) && $refund_data['refund_surcharge'] == 'N'; if (!$is_partial_refund) { foreach ($refund_data['products'] as $cart_id => $product) { if ($product['is_returned'] == 'N' || $product['amount'] != $order_info['products'][$cart_id]['amount']) { $is_partial_refund = true; break; } } } if (Registry::get('addons.gift_certificates.status') == 'A' && !$is_partial_refund && !empty($refund_data['certificates']) ) { foreach ($refund_data['certificates'] as $cart_id => $certificate) { if ($certificate['is_returned'] == 'N') { $is_partial_refund = true; break; } } } /** * Executes after determining whether a Yandex.Checkpoint refund is partial, allows to modify check results. * * @param array $refund_data Refund info (returned products, refunded shipping etc.) * @param array $order_info Order info * @param bool $is_partial_refund Whether refund is partial */ fn_set_hook('yandex_checkpoint_is_partial_refund_post', $refund_data, $order_info, $is_partial_refund); return $is_partial_refund; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canRefundPartialPerInvoice()\n {\n /** @var Mage_Sales_Model_Order $order */\n $order = $this->getInfoInstance()->getOrder();\n\n if ($order && $order->getId()) {\n $canInvoicePartialObject = new Varien_Object(\n array(\n 'can_partial' => $this->_helper->getPartialPaymentSupport($order->getStore())\n )\n );\n\n $checkoutType = $this->_helper->getStoreApiTypeCode($order->getStore());\n $eventData = array(\n 'flag_object' => $canInvoicePartialObject,\n 'order' => $order\n );\n\n Mage::dispatchEvent('klarna_core_payment_can_refund_partial_per_invoice', $eventData);\n Mage::dispatchEvent(\"klarna_core_payment_type_{$checkoutType}_can_refund_partial_per_invoice\", $eventData);\n\n return $canInvoicePartialObject->getCanPartial();\n }\n\n return parent::canRefundPartialPerInvoice();\n }", "public function isPartial()\n {\n return !empty($this->InitialPaymentID);\n }", "public function is_partial_capture( $notification ) {\n\t\treturn 0 < $notification->data->object->amount_refunded;\n\t}", "public function isRefunded()\n {\n $result = false;\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if (\n $transaction->isRefund()\n && $transaction->isSucceed()\n ) {\n $result = true;\n break;\n }\n }\n }\n\n return $result;\n }", "public function shouldRefund()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney < $paidMoney;\n }", "public function isRefundTransactionAllowed()\n {\n return $this->isCaptured() && !$this->isRefunded();\n }", "public function paidInFull()\n {\n $payment = $this->getPayment(1);\n\n return $payment && $payment->total == $this->getTotal();\n }", "public function isPartialRequest(): bool\n {\n return $this->partialRequest;\n }", "public function canCapturePartial()\n {\n /** @var Mage_Sales_Model_Order $order */\n $order = $this->getInfoInstance()->getOrder();\n\n if ($order && $order->getId()) {\n $canCapturePartialObject = new Varien_Object(\n array(\n 'can_partial' => $this->_helper->getPartialPaymentSupport($order->getStore())\n )\n );\n\n $checkoutType = $this->_helper->getStoreApiTypeCode($order->getStore());\n $eventData = array(\n 'flag_object' => $canCapturePartialObject,\n 'order' => $order\n );\n\n Mage::dispatchEvent('klarna_core_payment_can_capture_partial', $eventData);\n Mage::dispatchEvent(\"klarna_core_payment_type_{$checkoutType}_can_capture_partial\", $eventData);\n\n return $canCapturePartialObject->getCanPartial();\n }\n\n return parent::canCapturePartial();\n }", "public function canRefund($member = null, $partial = false)\n {\n if (!(\n $this->Status == 'Captured' &&\n ($partial ? GatewayInfo::allowPartialRefund($this->Gateway) : GatewayInfo::allowRefund($this->Gateway))\n )) {\n return false;\n }\n\n if ($this->isInDB()) {\n // Check if there are partial refunds and deny further refunds if multiple refunds aren't enabled\n $hasPartials = $this->getPartialPayments()\n ->filter('Status', ['Refunded', 'PendingRefund'])\n ->count() > 0;\n if ($hasPartials && GatewayInfo::refundMode($this->Gateway) !== GatewayInfo::MULTIPLE) {\n return false;\n }\n }\n\n $extended = $this->extendedCan('canRefund', $member);\n if ($extended !== null) {\n return $extended;\n }\n\n return Permission::check('REFUND_PAYMENTS', 'any', $member);\n }", "public function isPartial(){\n return $this->isPartial;\n }", "public function isRefunded()\n {\n return $this->getRefundedAmount()->isPositive();\n }", "public function testOrderStatusPartialRefund()\n {\n /** @var \\Magento\\Sales\\Model\\Order $existingOrder */\n $existingOrder = $this->objectManager->create(\\Magento\\Sales\\Model\\Order::class)\n ->loadByIncrementId('100000001');\n\n $items = $this->getOrderItems($existingOrder);\n $items[0]['qty'] -= 1;\n $result = $this->_webApiCall(\n $this->getServiceData($existingOrder),\n [\n 'orderId' => $existingOrder->getEntityId(),\n 'items' => $items,\n ]\n );\n\n $this->assertNotEmpty(\n $result,\n 'Failed asserting that the received response is correct'\n );\n\n /** @var \\Magento\\Sales\\Model\\Order $updatedOrder */\n $updatedOrder = $this->objectManager->create(\\Magento\\Sales\\Model\\Order::class)\n ->loadByIncrementId($existingOrder->getIncrementId());\n\n $this->assertSame('custom_processing', $updatedOrder->getStatus());\n $this->assertSame('processing', $updatedOrder->getState());\n }", "public function isRoundCompleted();", "public function isPartial(): bool\n {\n return Server::UPLOAD_TYPE_PARTIAL === $this->header('Upload-Concat');\n }", "public function isPartialMatch()\n {\n return $this->partialMatch;\n }", "public function canContinue()\n {\n return $this->number_of_rounds >= $this->getRoundsCount();\n }", "public function require_refund_address() {\n\t\treturn $this->show_refund_address() && $this->get_option( 'refund_address_optional', 'yes' ) == 'no';\n\t}", "public function isIncomplete(): bool\n {\n return $this->status === self::INCOMPLETE;\n }", "public function hasRetreatdf(){\r\n return $this->_has(29);\r\n }", "public function supportsRefund() {\n return false;\n }", "public function isRefunded()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_REFUNDED;\n }", "private function refundDetection($ticket)\n {\n $depart_time = strtotime($ticket->booking_for);\n $current_time = strtotime(date('Y-m-d H:m:i'));\n $diff_in_minutes = round(($depart_time - $current_time) / 60);\n\n $amount = $ticket->total_fare - $ticket->discount;\n\n if ($depart_time > $current_time && $diff_in_minutes >= 20) {\n if ($diff_in_minutes >= 60) {\n // 25% deduction\n $per = 25;\n $deduction = round($amount * .25);\n } else if ($diff_in_minutes >= 20) {\n // 40% deduction\n $per = 40;\n $deduction = round($amount * .4);\n }\n\n } else {\n // 50% deduction\n $per = 50;\n $deduction = round($amount * .5);\n }\n\n return $deduction;\n }", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "protected function hasRemainingDiscount()\n {\n return !$this->limited || $this->remaining > 0;\n }", "protected function checkPreConditions($refund)\n {\n $job = $refund->job;\n $account = $refund->financialAccount;\n\n if(!$job->quickbook_id) {\n $this->task->markFailed(\"Dependency Error: Job not synced on Quickbook.\", $this->queueJob->attempts());\n return false;\n }\n\n if($job->quickbook_id) {\n $isExists = QuickBooks::isCustomerExistsOnQuickbooks($job->quickbook_id);\n\n if(!$isExists){\n QuickBooks::unlinkJPEntities($job);\n $this->task->markFailed(\"Dependency Error: Job not found on Quickbook.\", $this->queueJob->attempts());\n $this->resynchCustomerAccount($job->customer_id, $this->task->created_source);\n return false;\n }\n }\n\n if($account && !$account->getQBOId()){\n $task = QBAccount::createTask($account->id, QuickBookTask::CREATE, $this->task->created_source, QuickBookTask::ORIGIN_JP);\n $this->task->parent_id = $task ? $task->id : null;\n $this->task->status = QuickBookTask::STATUS_PENDING;\n $this->task->save();\n return false;\n }\n\n return true;\n }", "public static function isRepairAwaiting($repair)\n {\n\n if ( count($repair->trackings) && $repair->trackings->last()->status == 1 )\n {\n return true;\n } else {\n return false;\n }\n\n }", "public function incomplete() : bool\n {\n return $this->stripe_status === StripeSubscription::STATUS_INCOMPLETE;\n }", "public function isAwaitingConfirmation() {\n if(isset($this->data['charge']))\n return $this->data['charge']['status'] === 'successful' ? false : true;\n else\n return true;\n }", "public function isPartialPaymentSupport($store = null)\n {\n return !$this->getVersionConfig($store)->isPartialPaymentDisabled();\n }" ]
[ "0.6884796", "0.6707256", "0.6615375", "0.63281107", "0.6317549", "0.6009568", "0.59429216", "0.5911595", "0.58684623", "0.5867166", "0.58670056", "0.5789645", "0.5694872", "0.5666817", "0.5653312", "0.55579823", "0.5557851", "0.5530326", "0.5510934", "0.5503578", "0.5428266", "0.54165334", "0.54028225", "0.53906465", "0.5388149", "0.5387718", "0.5360374", "0.5345347", "0.53245604", "0.52921647" ]
0.79273593
0
Returns the payment URL specified in the payment method settings for the current mode (test/live). If the payment URL for the current mode is not specified or it is incorrect, returns URL for the test work with the ASSIST system
function fn_assist_get_payment_url($processor_data) { return filter_var( trim( $processor_data['processor_params']['mode'] === 'L' ? $processor_data['processor_params']['payment_url_live'] : $processor_data['processor_params']['payment_url_test'], " \t\n\r\0\x0B/" ), FILTER_VALIDATE_URL, array('options' => array('default' => 'https://payments.demo.paysecure.ru')) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPayuCheckoutSharedUrl() {\r\r\n $mode = Mage::getStoreConfig('payment/payucheckout_shared/demo_mode');\r\r\n\r\r\n $url = 'https://test.payu.in/_payment.php';\r\r\n\r\r\n if ($mode == '') {\r\r\n $url = 'https://secure.payu.in/_payment.php';\r\r\n }\r\r\n\r\r\n return $url;\r\r\n }", "public function getGatewayUrl() {\n\t\t\tif(Mage::getStoreConfig('payment/acimpro/checkout_mode'))\n\t\t\t{\n\t\t\t\treturn 'https://api.authorize.net/xml/v1/request.api';\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'https://apitest.authorize.net/xml/v1/request.api';\n\t\t\t}\n\t\t}", "abstract public function getPaymentPageUrl();", "public static function checkout_url() {\n\n\t\tif ( self::$_cache['environment'] == 'sandbox' ) {\n\t\t\tif ( self::$_cache['mobile_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=';\n\t\t\t} elseif( self::$_cache['incontext_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/incontext?token=';\n\t\t\t} else {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';\n\t\t\t}\n\t\t} else {\n\t\t\tif ( self::$_cache['mobile_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=';\n\t\t\t} elseif( self::$_cache['incontext_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.paypal.com/incontext?token=';\n\t\t\t} else {\n\t\t\t\t$url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}", "private function getPaymentURL($full = true)\n\t{\n\t\t$sandbox = $this->params->get('sandbox',0);\n\t\tif($full) {\n\t\t\tif($sandbox) {\n\t\t\t\treturn 'https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/';\n\t\t\t} else {\n\t\t\t\treturn 'https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/';\n\t\t\t}\n\t\t} else {\n\t\t\tif($sandbox) {\n\t\t\t\treturn 'https://sandbox.google.com/checkout';\n\t\t\t} else {\n\t\t\t\treturn 'https://checkout.google.com';\n\t\t\t}\n\t\t}\n\t}", "private function getPaypal()\n {\n if($this->isTest == true){\n return 'www.sandbox.paypal.com';\n } else {\n return 'www.paypal.com';\n }\n }", "public function getPaymentUrl(){\n\t\t$order = $this->getOrder();\n\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t$hostedpayment->load($order->getRealOrderId(), 'order_id');\n\t\t\n\t\t$paymentUrl = $hostedpayment->getUrl();\n\t\t\t\t\n\t\tif(!isset($paymentUrl) || trim($paymentUrl) == '' ){\n\t\t\t$paymentUrl = EvoSnapApi::getCheckoutUrl($this->_getOrderCheckout(),\n\t\t\t\t\t$this->getTrigger3ds(), $this->getHostedPaymentsConfiguration());\n\t\t\t\t\n\t\t\t$order->addStatusToHistory($order->getStatus(), Mage::helper('hostedpayments')->__('Customer was redirected to the Snap* Hosted Payments Checkout for payment.'));\n\t\t\t$order->save();\n\t\t\t\n\t\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t\t$hostedpayment->setOrderId($order->getRealOrderId());\n\t\t\t$hostedpayment->setUrl($paymentUrl);\n\t\t\t$hostedpayment->setPrefix($this->getConfigData('order_prefix'));\n\t\t\t$hostedpayment->setDataChanges(true);\n\t\t\t$hostedpayment->save();\n\t\t}\n\t\t\n\t\treturn $paymentUrl;\n\t}", "function get_ipn_url()\n\t{\n\t\treturn ecommerce_test_mode()?'https://www.sandbox.paypal.com/cgi-bin/webscr':'https://www.paypal.com/cgi-bin/webscr';\n\t}", "public function getServiceUrl()\n {\n if($this->testMode) {\n return 'https://www.alipay.com/cooperate/gateway.do';\n }\n\t\treturn 'https://www.alipay.com/cooperate/gateway.do';\n }", "public function getPaymentFormUrl()\r\n {\r\n return self::HPF_URL;\r\n }", "public function getRedirectUrl()\n {\n return $this->request->getTestMode()\n ? 'https://sslpayment.cathaybkdev.com.tw/EPOSService/Payment/OrderInitial.aspx'\n : 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx';\n }", "public function getPaymentGatewayUrl(){\r\n\t\treturn 'index.php?option=com_virtuemart&view=cart&task=checkout';\r\n\t\texit;\r\n\t\t//return JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout', FALSE);\r\n\t}", "public function get_request_url( $order, $testmode = 'testing' ) {\n\n\t\t$worldpay_args = http_build_query( $this->get_worldpay_args( $order ), '', '&' );\n\n\t\tif ( $testmode == 'testing' ) {\n\t\t\treturn 'https://secure-test.worldpay.com/wcc/purchase?testMode=100&' . $worldpay_args;\n\t\t} else {\n\t\t\treturn 'https://secure.worldpay.com/wcc/purchase?' . $worldpay_args;\n\t\t}\n\n\t}", "public function getPaypalUrl() {\n return ($this->sandbox ? $this->_sandboxEndPoint : $this->_endPoint);\n }", "public static function endpoint() {\n\t\treturn ( self::$_cache['environment'] == 'sandbox' ) ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp';\n\t}", "public function paymentUrl(array $options = []): ?string\n {\n if ($this->failed()) {\n $this->throw();\n }\n\n return $this->transactionUrl;\n }", "public function getCheckoutUrl() {\n\t\tif(Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {\n\t\t\tif ($this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('onestepcheckout', array('_secure'=>true));\n\t\t}\n\t\t\n\t\tif(Mage::helper('core')->isModuleEnabled('Ecom_KlarnaCheckout')) {\n\t\t\tif ($this->helper('klarnacheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('klarnacheckout', array('_secure'=>true));\n\t\t}\n\t\treturn parent::getCheckoutUrl();\n }", "public function createURL($action) {\r\n\t\tvar mode = 'payment'\r\n $host = $this->is_local_test ? self::WMMERCHANT_HOST_TEST : self::WMMERCHANT_HOST;\r\n\t\tif ($this->is_local_test) mode = \"sandbox\";\r\n \r\n return $host .'/'. mode. '/' . $action;\r\n }", "function _getHellaspayUrl($method) {\r\n\r\n\t\t$url = $method->hellaspay_production == '1' ? $method->hellaspay_production_url : $method->hellaspay_test_url;\r\n\r\n\t\treturn $url;\r\n\t}", "public function getEvoBaseUrl()\n\t{\n\t\tMage::log(\" --- Snap* Hosted Payments API : getEvoBaseUrl --- \");\n\t\t$bTestMode = $this->getConfigData('test_mode');\n\t\treturn ($bTestMode ? $this->_merchantCheckoutURLTest : $this->_merchantCheckoutURL);\n\t}", "function setServerMode($servermode = 'live'){\n\t\t$this->PAYU_BASE_URL = $servermode == 'test' ? 'https://test.payu.in/_payment' : 'https://secure.payu.in/_payment';\n\t}", "private function getCallbackURL()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'ssl://sandbox.payfast.co.za';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'ssl://www.payfast.co.za';\n\t\t}\n\t}", "public function needsRedirectToPayment() {\n $haPagado = $this->hasPaid();\n $renewTime = $this->timeFreameToRenewLicense();\n $mustPay = $this->mustPay();\n $optPayment = $this->hasOptionalPayment();\n $url = false;\n $temporary = $this->isTemporary() || $this->hasTemporaryPayment();\n $invoice = $this->hasInvoicesNotPayedFrameTime(true);\n\n if ($temporary && $this->isPremium()) {\n $url = \"/app/payment/temporary\";\n } elseif ($haPagado && $mustPay && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice && $invoice->getDaysToClose() < 0) {\n $url = \"/app/payment/invoice\";\n } elseif ($haPagado && $renewTime && !$optPayment) {\n $url = \"/app/payment/license\";\n } elseif ($invoice instanceof invoice) {\n $url = \"/app/payment/invoice\";\n }\n\n return $url;\n }", "protected function getSubmitUrl($sandbox = false){\n return $sandbox ? PagoFacil::GATEWAY_SANDBOX_URL : PagoFacil::GATEWAY_URL;\n }", "public function getModeUrl($mode)\n {\n return request()->fullUrlWithQuery([\n 'mode' => $mode\n ]);\n }", "public function getPaymentFormActionUrl()\n {\n $keys = self::getKeysInfo();\n if ($keys) {\n return $keys['formUrl'];\n }\n return false;\n }", "public function getOneClickUrl()\n {\n $store = Mage::getSingleton('adminhtml/session_quote')->getStore();\n\n return Zend_Json::encode($this->escapeUrl(Mage::getStoreConfig('oyst/oneclick/payment_url', $store->getId())));\n }", "public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }", "function get_checkout_url() {\n\t\t\t$checkout_page_id = get_option('cmdeals_checkout_page_id');\n\t\t\tif ($checkout_page_id) :\n\t\t\t\tif (is_ssl()) return str_replace('http:', 'https:', get_permalink($checkout_page_id));\n\t\t\t\treturn get_permalink($checkout_page_id);\n\t\t\tendif;\n\t\t}", "public function getPayMode()\n {\n return $this->is_sandbox;\n }" ]
[ "0.70994157", "0.6913184", "0.6889448", "0.68834037", "0.672753", "0.6646833", "0.65409946", "0.6513263", "0.64664674", "0.64523566", "0.64340544", "0.6392202", "0.63919157", "0.6391573", "0.63543457", "0.6300787", "0.6198549", "0.6156943", "0.60907423", "0.60652167", "0.6060344", "0.6060131", "0.6055976", "0.603475", "0.5999776", "0.5985672", "0.5926074", "0.5908165", "0.59028125", "0.58956516" ]
0.7155246
0
Tests to see if the test type mapping exists when calling $index>getMapping().
public function testIndexGetMapping(): void { $index = $this->_createIndex(); $mappings = new Mapping([ 'id' => ['type' => 'integer', 'store' => true], 'email' => ['type' => 'text'], 'username' => ['type' => 'text'], 'test' => ['type' => 'integer'], ]); $index->setMapping($mappings); $index->refresh(); $indexMappings = $index->getMapping(); $this->assertEquals('integer', $indexMappings['properties']['id']['type']); $this->assertEquals(true, $indexMappings['properties']['id']['store']); $this->assertEquals('text', $indexMappings['properties']['email']['type']); $this->assertEquals('text', $indexMappings['properties']['username']['type']); $this->assertEquals('integer', $indexMappings['properties']['test']['type']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasMapping();", "public function isMappingSetUp()\r\n\t{\t\r\n\t\t// Return boolean\r\n\t\treturn ($this->getMappedIdFieldExternal() !== false);\r\n\t}", "protected function hasMappingErrorOccurred() {}", "public function test_add_and_get_mapping_work_as_expected()\n {\n $expected = Web::class;\n\n SourceFactory::addMapping('unknown', Web::class);\n $actual = SourceFactory::getMapping('unknown');\n\n $this->assertEquals($expected, $actual);\n }", "public function testAccessMappings(): void\n {\n $helper = new AccessTokenMappingHelper();\n\n $handler = new TransformableHandlerStub();\n\n $expectedMappings = [\n 'doc' => [\n 'dynamic' => 'strict',\n 'properties' => [\n 'createdAt' => [\n 'type' => 'date',\n ],\n '_access_tokens' => [\n 'type' => 'keyword',\n ],\n ],\n ],\n ];\n\n $mappings = $helper->buildIndexMappings($handler);\n\n self::assertSame($expectedMappings, $mappings);\n }", "public function hasType(){\r\n return $this->_has(1);\r\n }", "public function testUseMapping()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $cfg->setMapping(\"item\", ANAX_INSTALL_PATH . \"/test/config/test1.php\");\n $config = $cfg->load(\"item\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayHasKey(\"key1\", $config[\"config\"]);\n $this->assertContains(\"value1\", $config[\"config\"]);\n }", "public function testMappingStructure()\n {\n $instance = $this->getInstance();\n $this->assertProtectedMethod('getMappingConfiguration');\n $method = $this->getClassMethod('getMappingConfiguration', true);\n\n $result = $method->invoke($instance);\n\n $this->assertEquals($this->getMapping(), $result);\n }", "function has ( $index )\n\t{\n\t\treturn !is_null($this->getAt($index)) ;\n\t}", "public function hasType(){\n return $this->_has(9);\n }", "public function hasIndex(): bool\n {\n return true;\n }", "protected function getElasticsearchTypeExists(SearchApiIndex $index) {\n $params = $this->getIndexParam($index, TRUE);\n try {\n return $this->elasticsearchClient->indices()->existsType($params);\n }\n catch (Exception $e) {\n drupal_set_message($e->getMessage(), 'error');\n return FALSE;\n }\n }", "protected function checkExtbaseMappings(): void\n {\n $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n\n $mappings = [\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Image' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\AttributeFile' => 'sys_file_reference',\n 'Pixelant\\PxaProductManager\\Domain\\Model\\Category' => 'sys_category',\n ];\n\n foreach ($mappings as $class => $mapping) {\n if (empty($configuration['persistence']['classes'][$class]['mapping']['tableName'])) {\n $configuration['persistence']['classes'][$class]['mapping']['tableName'] = $mapping;\n $configurationManager->setConfiguration($configuration);\n }\n }\n\n $configuration = $configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK\n );\n }", "public function testHasMappingForType($abstractType)\n {\n $this->assertSame(\n $abstractType === self::KNOWN_TYPE,\n $this->payloadMap->hasMappingForType($abstractType)\n );\n }", "public function testIndexMappingDump()\n {\n $commandTester = $this->getCommandTester();\n $index = $this->getIndex(DummyDocument::class);\n $index->dropIndex();\n\n $this->assertFalse($index->indexExists());\n $commandTester->execute(\n [\n 'command' => IndexCreateCommand::NAME,\n '--dump' => null,\n ]\n );\n\n $this->assertContains(\n json_encode(\n $index->getIndexSettings()->getIndexMetadata(),\n JSON_PRETTY_PRINT\n ),\n $commandTester->getDisplay()\n );\n $this->assertFalse($index->indexExists());\n }", "public function getMapped(): bool;", "protected function hasRdfFieldMapping() {\n /** @var \\Drupal\\field\\FieldStorageConfigInterface $unchanged_entity */\n $unchanged_entity = $this->entityTypeManager->getStorage('field_storage_config')\n ->loadUnchanged($this->entity->id());\n return !empty($unchanged_entity->getThirdPartySetting('rdf_entity', 'mapping', [])['value']);\n }", "public function hasIndex(){\n return $this->_has(1);\n }", "public function testSupportsIndexUnsupported() {\n $index = $this->getMock('Drupal\\search_api\\Index\\IndexInterface');\n $index->expects($this->any())\n ->method('getDatasources')\n ->will($this->returnValue(array()));\n /** @var \\Drupal\\search_api\\Index\\IndexInterface $index */\n $support = NodeStatus::supportsIndex($index);\n $this->assertFalse($support, 'Index containing no node datasource is not supported.');\n }", "public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }", "public function hasType()\n {\n return isset($this->type);\n }", "public function testMappingFallback()\n {\n $this\n ->client\n ->request(\n 'GET',\n '/fake/entity/mapped/fallback/1'\n );\n }", "public function isMappedToExistingTable()\n {\n if (!empty($this->mapToTable)) {\n return true;\n } else {\n return false;\n }\n }", "public function hasType(){\n return !empty($this->type);\n }", "public function hasType(){\n return $this->_has(2);\n }", "public function hasType() {\n return $this->_has(2);\n }", "public function testIfReturnsMapBag()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertInstanceOf('\\SyncFS\\Map\\MapBag', $result);\n }", "public function testMap2()\n\t{\n\t\tTestReflection::invoke($this->_state, 'set', 'content.type', 'tag');\n\t\t$a = TestReflection::invoke($this->_instance, 'map', 1, array(5), true);\n\t\t$this->assertEquals(true, $a);\n\n\t\tTestReflection::invoke($this->_state, 'set', 'tags.content_id', '1');\n\t\t$actual = TestReflection::invoke($this->_instance, 'getList');\n\n\t\t$this->assertEquals(1, count($actual));\n\t}", "function testPostTypeNotExistsCheckPostTypeExpectsPostTypeNameReturned() {\n\t\t// Arrange\n\t\t\\WP_Mock::wpFunction('sanitize_key', array(\n\t\t\t'times' => 0,\n\t\t\t)\n\t\t);\n\t\t\\WP_Mock::wpFunction('post_type_exists', array(\n\t\t\t'times' => 1,\n\t\t\t'return' => false\n\t\t\t)\n\t\t);\n\t\t$form = new TestValidBox();\n\t\t$expected = false;\n\t\t// act\n\t\t$actual = $form->check_post_type($form->post_type);\n\t\t// Assert\n\t\t$this->assertEquals($expected, $actual, 'Post type did not verify correctly');\n\t}", "public function testSupportsIndexSupported() {\n $support = NodeStatus::supportsIndex(reset($this->items)->getIndex());\n $this->assertTrue($support, 'Index containing a node datasource is supported.');\n }" ]
[ "0.70059276", "0.63732606", "0.6348095", "0.6195489", "0.5756654", "0.57247555", "0.5679112", "0.5643431", "0.5634962", "0.5606758", "0.5530658", "0.5516111", "0.5510009", "0.5508741", "0.54928875", "0.54917866", "0.54801506", "0.5459627", "0.545908", "0.5456691", "0.5447218", "0.54262954", "0.5423033", "0.5416383", "0.54075146", "0.5401019", "0.539978", "0.5398515", "0.5398097", "0.5379091" ]
0.7102806
0
Get temporary order from cache
protected static function getTemporaryOrderFromCache($orderId) { $result = null; if (!isset(static::$tmpOrders)) { // Initialize $tmpOrders static::$tmpOrders = array(); } if (isset(static::$tmpOrders[$orderId])) { // Get order from cache if (!(static::$tmpOrders[$orderId]['order'] instanceof \XLite\Model\Order)) { static::$tmpOrders[$orderId]['order'] = \XLite\Core\Database::getRepo('XLite\Model\Order') ->find(intval(static::$tmpOrders[$orderId]['order'])); } $result = static::$tmpOrders[$orderId]['order']; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFromCache() {}", "public static function getTemporaryOrderData($orderId = null)\n {\n $result = null;\n\n if (!isset(static::$tmpOrders)) {\n // Initialize $tmpOrders\n static::$tmpOrders = array();\n }\n\n if ($orderId && isset(static::$tmpOrders[$orderId])) {\n // Get specific temporary order data from cache\n $result = static::$tmpOrders[$orderId];\n\n } else {\n $result = static::$tmpOrders;\n }\n\n return $result;\n }", "protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}", "function getOrder();", "public function cache() {\n\t\treturn $this->_cache;\n\t}", "protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getCache();", "public function cacheGet() {\n }", "function getTariffPlans()\n{\n return cache()->remember('i.tariffPlans', getCacheILifetime('tariffPlans'), function () {\n return \\App\\Models\\Rate::with([\n 'currency'\n ])\n ->get()\n ->map(function($item) {\n return $item->toArray();\n });\n });\n}", "public function cache()\n {\n return $this->cache;\n }", "function getFile() {\n return IMMOTOOL_BASE_PATH . 'cache/order.' . $this->getName();\n }", "public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }", "function getOrder()\n{\n\n}", "public function getCachedResult() {\n $cachePath = $this->_getCachePath();\n if (is_file($cachePath)) {\n $cacheModifiedTime = filemtime($cachePath);\n if ($cacheModifiedTime < time() - CACHE_EXPIRED_DELAY) {\n $result = $this->getLiveResult();\n if ($result)\n return $result;\n else\n touch($cachePath);\n }\n\n return file_get_contents($cachePath);\n }\n\n return $this->getLiveResult();\n }", "function get_order()\n{\n\n}", "public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }", "function Cart() {\n\t\t$order = self::get_current_order();\n\t\t$order->Items();\n\t\t$order->Total;\n\n\t\t//HTTP::set_cache_age(0);\n\t\treturn $order;\n\t}", "private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }", "private static function getFromCache()\n\t{\n\t\t$return = null;\n\n\t\t$aeDebug = \\MarkNotes\\Debug::getInstance();\n\n\n\t\treturn $arr;\n\t}", "abstract public function getCache( $cacheID = '', $unserialize = true );", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "function getOrder()\n {\n return 0;\n }", "function getOrder()\n {\n return 0;\n }", "function cache();" ]
[ "0.65208596", "0.64072406", "0.6277436", "0.59369165", "0.58398384", "0.58391076", "0.5753197", "0.5753197", "0.5753197", "0.5753197", "0.5753197", "0.5753197", "0.5719353", "0.5697971", "0.56950873", "0.5681492", "0.5678367", "0.5593726", "0.5580606", "0.55719584", "0.5568619", "0.55548394", "0.55328083", "0.5518396", "0.5494084", "0.5490387", "0.54661167", "0.5461236", "0.5461236", "0.5458032" ]
0.70234615
0
Get human readable field names
protected static function getFieldHumanReadableNames() { return array( 'billingAddress' => 'Billing address', 'shippingAddress' => 'Shipping address', 'shippingId' => 'Shipping method', 'paymentMethod' => 'Payment method', 'adminNote' => 'Staff note', 'SHIPPING' => 'Shipping cost', 'firstname' => 'First name', 'lastname' => 'Last name', 'street' => 'Address', 'city' => 'City', 'zipcode' => 'Zip code', 'phone' => 'Phone', ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_fields_name()\n\t{\n\t\treturn $this->db->list_fields( $this->table );\n\t}", "public function get_field_name();", "public function field_names()\n\t{\n\t\t// All the fields that are being validated\n\t\t$fields = array_keys(array_merge\n\t\t(\n\t\t\t$this->pre_filters,\n\t\t\t$this->rules,\n\t\t\t$this->callbacks,\n\t\t\t$this->post_filters\n\t\t));\n\n\t\t// Remove wildcard fields\n\t\t$fields = array_diff($fields, array('*'));\n\n\t\treturn $fields;\n\t}", "function _get_field_names()\n {\n return array();\n }", "function getFieldNames();", "public function getFieldNames() {}", "function get_field_names()\n{\n\t#currently 27 fields\n\treturn $t_arr = array (\t\tlang_get( 'id' ),\n\t\t\t\t\t\t\t lang_get( 'category' ),\n\t\t\t\t\t\t\t lang_get( 'severity' ),\n\t\t\t\t\t\t\t lang_get( 'reproducibility' ),\n\t\t\t\t\t\t\t\tlang_get( 'date_submitted' ),\n\t\t\t\t\t\t\t\tlang_get( 'last_update' ),\n\t\t\t\t\t\t\t\tlang_get( 'reporter' ),\n\t\t\t\t\t\t\t\tlang_get( 'assigned_to' ),\n\t\t\t\t\t\t\t\tlang_get( 'priority' ),\n\t\t\t\t\t\t\t\tlang_get( 'status' ),\n\t\t\t\t\t\t\t\tlang_get( 'build' ),\n\t\t\t\t\t\t\t\tlang_get( 'projection' ),\n\t\t\t\t\t\t\t\tlang_get( 'eta' ),\n\t\t\t\t\t\t\t\tlang_get( 'platform' ),\n\t\t\t\t\t\t\t\tlang_get( 'os' ),\n\t\t\t\t\t\t\t\tlang_get( 'os_version' ),\n\t\t\t\t\t\t\t\tlang_get( 'product_version' ),\n\t\t\t\t\t\t\t\tlang_get( 'resolution' ),\n\t\t\t\t\t\t\t\tlang_get( 'duplicate_id' ),\n\t\t\t\t\t\t\t\tlang_get( 'summary' ),\n\t\t\t\t\t\t\t\tlang_get( 'description' ),\n\t\t\t\t\t\t\t\tlang_get( 'steps_to_reproduce' ),\n\t\t\t\t\t\t\t\tlang_get( 'additional' ).'_'.lang_get( 'information' ),\n\t\t\t\t\t\t\t\tlang_get( 'attached_files' ),\n\t\t\t\t\t\t\t\tlang_get( 'bugnote_title' ),\n\t\t\t\t\t\t\t\tlang_get( 'bugnote_date' ),\n\t\t\t\t\t\t\t\tlang_get( 'bugnote_description' )) ;\n}", "public function getFieldNames() {\n return array_keys($this->_fields);\n }", "abstract public function getAllFieldsRealNames(): array;", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public function getFieldNames(){\n $names=[];\n if (!empty($this->dbFields)){\n foreach($this->dbFields as $dbField){\n $names[$dbField->id]=$dbField->name;\n }\n }\n return $names;\n }", "public function getFieldNames() {\n $fields = array();\n foreach ($this->getFields() as $field) {\n $fields[] = $this->getFieldName($field);\n }\n return $fields;\n }", "public function getFieldsNames(): array\n {\n return array_keys($this->fields);\n }", "public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}", "public function getFieldNames()\n {\n return array_keys($this->fieldMappings);\n }", "public static function get_field_name($record)\n {\n return array_keys($record->getAttributes());\n }", "public function getFieldName() {}", "public static function field_names($model){\n\t $fields = self::fields($model);\n\t return array_keys($fields);\n\t}", "public function get_field_names(): array {\n\t\treturn array_keys( $this->data );\n\t}", "private function _getPureModelNameField()\n {\n $name = explode('Mapper_', get_class($this));\n $name = explode('_', $name[1]);\n $out = '';\n foreach($name as $k => $part)\n {\n if($k == 0)\n {\n $out .= strtolower($part);\n }\n else\n {\n $out .= ucfirst($part);\n }\n }\n return $out;\n }", "function hc_field_name($field){\n\t\techo hc_get_field_name($field);\n\t}", "public function getFieldNames(): array\n {\n return array_keys($this->fieldDefinitions);\n }", "function getLocaleFieldNames() {\n\t\treturn array('name', 'description', \"applicationForm\", \"survey\");\n\t}", "function GetFieldNames($fields) {\r\n \t$names = array();\r\n for ($i = 0; $i < count($fields); $i++) {\r\n \t$names[] = $fields[$i]['name'];\r\n }\r\n\r\n return $names;\r\n }", "public function fields_names(){\n $table_meta = array();\n // get fields in the database table\n\n foreach ($this->_meta() as $meta) {\n array_push($table_meta, $meta->name);\n }\n\n return $table_meta;\n }", "function getLocaleFieldNames() {\n\t\treturn array('name', 'possibleOptions');\n\t}", "public function getFieldName($field) {\n return $field['name'];\n }", "public function getFieldNames() {\n\t\treturn array (\"codedaddr\");\n\t}" ]
[ "0.7733014", "0.7729311", "0.7505376", "0.749531", "0.74863255", "0.74810976", "0.74624634", "0.7460911", "0.741345", "0.7405654", "0.7405654", "0.7405654", "0.7376888", "0.73454535", "0.7152905", "0.7082035", "0.70511246", "0.7039239", "0.7037519", "0.6916952", "0.68929803", "0.6881581", "0.6873627", "0.68642545", "0.6861886", "0.6831374", "0.68002045", "0.6736049", "0.6727907", "0.6696893" ]
0.7870241
0
}}} Check ACL permissions
public function checkACL() { return parent::checkACL() || \XLite\Core\Auth::getInstance()->isPermissionAllowed('manage orders'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkPermissions();", "public function isAclEnabled(): bool;", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess()\n {\n // need to be modified for security\n }", "public function checkAccess() {\n // if the user is not allowed access to the ACL, then redirect him\n if (!$this->user->isAllowed(ACL_RESOURCE, ACL_PRIVILEGE)) {\n // @todo change redirect to login page\n $this->redirect('Denied:');\n }\n }", "function checkAccess() ;", "public function canSetControllableAcl();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('permission_modify_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "abstract protected function getAcl();", "public function acl($method) {\n\t\t// more rights have to be checked at this place\n\t\t//if($method == 'xmllist') return true;\n\t\treturn false;\n\t}", "function check_permission()\n\t{\n\t\t$CFG = $this->config->item('language_configure');\n\t\tif( ! addPermission( $CFG[\"sector\"][\"add\"] ) )\n\t\t{\n\t\t\t$this->form_validation->set_message('check_permission', _e('access denied'));\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t}", "function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}", "function acl( $check )\n{\n global $current_user_acl;\n \n $acl = $current_user_acl;\n if ($acl[ 'p' ][ 'ForbiddenAccess' ])\n {\n return false;\n }\n if ($acl[ 'p' ][ 'System' ])\n {\n return true;\n }\n \n $result = false;\n $match = substr($check, 0, 2);\n switch ($match)\n {\n case 'u:':\n case 'g:':\n case 'p:':\n $type = substr($check, 0, 1);\n $target = substr($check, 2);\n $result = check($acl[ $type ], $target);\n break;\n default:\n $args = array_slice(func_get_args(), 1);\n if (is_callable(array( 'Granted', $check )))\n {\n $result = call_user_func_array(array( 'Granted', $check ), $args);\n }\n }\n return $result;\n}", "function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = \"\")\n\t{\n\t\tglobal $ilUser, $ilAccess;\n\n\t\tif ($a_user_id == \"\")\n\t\t{\n\t\t\t$a_user_id = $ilUser->getId();\n\t\t}\n\n\t\t// add no access info item and return false if access is not granted\n\t\t// $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = \"\");\n\t\t//\n\t\t// for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:\n\t\t// $ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)\n\n\t\treturn true;\n\t}", "public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "protected function isPermissionCorrect() {}" ]
[ "0.79804915", "0.7617611", "0.759867", "0.759867", "0.75986546", "0.75986546", "0.75986546", "0.759735", "0.759735", "0.759735", "0.749672", "0.7418123", "0.72340137", "0.7157207", "0.7117054", "0.7117054", "0.7117054", "0.7117054", "0.7117054", "0.71011376", "0.70344", "0.7019278", "0.69863474", "0.6972926", "0.6968347", "0.69475543", "0.693155", "0.6884077", "0.68498313", "0.6841922" ]
0.772622
1
Check surcharge is controlled automatically or not
public function isAutoSurcharge(array $surcharge) { $data = \XLite\Core\Request::getInstance()->auto; return !empty($data) && !empty($data['surcharges']) && !empty($data['surcharges'][$surcharge['code']]) && !empty($data['surcharges'][$surcharge['code']]['value']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkForOneTimeDemoMessage(): bool\n {\n return $this->getCustomerAttrCreditHold() && $this->configProvider->isOptionCreditHoldEnable() && !$this->getFlag();\n }", "public function isIndependentCreditSupported();", "public function isDue(): bool;", "public function is_surveillant() {\n return $this->session->get(\"niveau_acces\") >= 1;\n }", "function needs_payment() {\n\t\t\tif ( $this->total > 0 ) return true; else return false;\n\t\t}", "abstract function is_paying();", "private function isCapture()\n {\n return $this->openCart->config->get('payment_mundipagg_credit_card_operation') != 'Auth';\n }", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function isAcquired() {}", "public function isSetCharge()\n {\n return !is_null($this->_fields['Charge']['FieldValue']);\n }", "public function shouldGoToPenalty()\n {\n if( $this -> charger_connector_type -> isChargerFast() )\n {\n return false;\n }\n\n if( ! $this -> carHasAlreadyStoppedCharging() )\n {\n return false;\n }\n\n if( ! $this -> getCharger() -> penalty_enabled ) \n {\n return false;\n }\n\n $config = Config :: first();\n $penaltyReliefMinutes = $config -> penalty_relief_minutes;\n\n $chargedTime = Timestamp :: build( $this ) -> getStopChargingTimestamp();\n\n if( ! $chargedTime )\n {\n return false;\n }\n\n $elapsedTime = $chargedTime -> diffInMinutes( now() );\n\n return $elapsedTime >= $penaltyReliefMinutes;\n }", "function isAcquired() ;", "private function getStatus(){\n\t\t$this->valid=$this->checkDatesValidity();\n\t\tif($this->usage==\"once\" && $this->usageCount) $this->valid = false;\n\t\tif($this->usage==\"count\" && $this->usageCount>=$this->maxUsage) $this->valid = false;\n\t\tif($this->type==\"fixed\" && $this->value<=0) $this->valid = false;\n\t\tif($this->type==\"grid\" && !count($this->grid)) $this->valid = false;\n\t}", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "public function validateByGracePeriod() : void\n {\n if (!is_null($this->grace_period_ends)) {\n if (($this->charge_date == $this->grace_period_ends) && !$this->paid) {\n $this->is_active = 0;\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n } else {\n $this->grace_period_ends = Carbon::now()->addDays(Subscription::DEFAULT_GRACE_PERIOD_DAYS)->toDateTimeString();\n }\n }", "protected function needsRenewal(): bool\n {\n return $this->renewable() === true && $this->expiryTime() - time() < $this->duration() / 2;\n }", "public function isCreditCardPurchase()\n {\n return $this->payment_method->id != 1;\n }", "public function canPayment()\n {\n return true;\n }", "public function needsToCreateInstallments()\n\t{\n\t\tif ($this->recurringChargeStatusId != Recurring_Charge_Status::getIdForSystemName('ACTIVE'))\n\t\t{\n\t\t\tthrow new Exception('Recurring Charge is not ACTIVE');\n\t\t}\n \t\t\n\t\tif (!$this->isAccountEligibleForChargeGeneration())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->service != null)\n\t\t{\n\t\t\tif (!$this->isServiceEligibleForChargeGeneration())\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$intNextInstallment\t= $this->totalRecursions + 1;\n\t\t$intTimesToCharge\t= $this->getTimesToCharge();\n\t\t$strTodaysDate\t\t= GetCurrentISODate();\n\t\t\n\t\tif ($intNextInstallment > $intTimesToCharge)\n\t\t{\n\t\t\t// All obligated installments have been created\n\t\t\t// Considering the RecurringCharge is still ACTIVE, then it must be continuable, otherwise it would have been set to COMPLETED\n\t\t\tif ($this->continuable == 0)\n\t\t\t{\n\t\t\t\t// This should never happen\n\t\t\t\tthrow new Exception_Assertion(\"All obligated charges have been produced and this recurring charge is not continuable, but still ACTIVE. It should be set to COMPLETED\", \"Method: \". __METHOD__ .\"\\nRecurringCharge object: \\n\". print_r($this, true), \"RecurringCharge Record Data Integrity Breach\");\n\t\t\t}\n\t\t}\n\n\t\t// Get the ChargedOn timestamp for the next installment\n\t\t$strChargedOnForNextInstallment = $this->getChargedOnDateForInstallment($intNextInstallment);\n\t\t\n\t\t// Don't bother checking the $strChargedOnForNextInstallment > $this->lastChargedOn\n\t\t\n\t\treturn ($strChargedOnForNextInstallment <= $strTodaysDate)? true : false;\n\t}", "public function isServiceEligibleForChargeGeneration()\n\t{\n\t\tif ($this->service == null)\n\t\t{\n\t\t\tthrow new Exception_Assertion(\"RecurringCharge is not associated with a service, yet the 'isServiceEligibleForChargeGeneration' test was called\", \"RecurringCharge:\\n\". print_r($this, true));\n\t\t}\n\t\t\n\t\t// Get the most recent service object modelling this service on this account\n\t\t$objService = Service::getForId($this->service, false, true);\n\t\t\n\t\t// RecurringCharges only get generated if their associated service is active\n\t\tif ($objService->status == SERVICE_ACTIVE)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isFacilityInCharge()\n {\n if($this->hasRole('Facility Incharge'))\n return true;\n else\n return false;\n }", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "function timeconditions_chk($post){\n\treturn true;\n}", "public function checkForAnuallyRecurring()\n {\n // not supported\n }", "function checkBankOptions(){\n $resultId = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n if (!$aResult ){\n $resultId = tep_db_query(\"INSERT INTO \". TABLE_CONFIGURATION .\"(configuration_title, configuration_key, configuration_value) \n VALUES ( 'Issuer Refresh', 'MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH',0)\");\n }\n $resultId = tep_db_query(\"SELECT configuration_value FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_IDEAL_ISSUER_REFRESH'\");\n $aResult = tep_db_fetch_array($resultId);\n $iIssuerRefresh = (int) $aResult['configuration_value'];\n if ($iIssuerRefresh < time()) {\n $this->cacheBankOptions();\n }\n \n }", "public function getCarStatusSoldExpire(){\r\n\t\tif($this->getCarStatusValue()==2){\r\n\t\t\tif($this->getCarStatusInterval()>30){\r\n\t\t\t\treturn true;\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t}", "public static function isBalanced()\n {\n return (self::$open === 0);\n }" ]
[ "0.6294541", "0.6247246", "0.61485136", "0.6125137", "0.61007947", "0.6047661", "0.6043472", "0.5916338", "0.59162533", "0.59162533", "0.59162533", "0.5914871", "0.5883862", "0.5858906", "0.5820477", "0.5770711", "0.5763853", "0.57465297", "0.57339245", "0.5725546", "0.57158524", "0.57069045", "0.5701606", "0.5697229", "0.5686442", "0.5679496", "0.5678304", "0.56640697", "0.5653344", "0.56410664" ]
0.65257496
0
Return true if order can be edited
public function isOrderEditable() { return !\XLite::isFreeLicense(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function can_edit() {\n return true;\n }", "public function canEdit()\n {\n return true;\n }", "function can_editorder($sessionID, $ordn, $debug) {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT editord FROM ordrhed WHERE sessionid = :sessionID AND orderno = :ordn LIMIT 1\");\n\t\t$switching = array(':sessionID' => $sessionID, ':ordn' => $ordn); $withquotes = array(true, true);\n\t\tif ($debug) {\n\t\t\treturn returnsqlquery($sql->queryString, $switching, $withquotes);\n\t\t} else {\n\t\t\t$sql->execute($switching);\n\t\t\t$column = $sql->fetchColumn();\n\t\t\tif ($column != 'Y') { return false; } else { return true; }\n\t\t}\n\t}", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "protected function isValidOrder()\n {\n return true;\n }", "public function canBeEdited() {}", "protected function canEdit() {}", "public function canStoreOrder();", "public function CanProcessOrders()\n {\n if ($this->owner->IsShopAdmin()) {\n return true;\n }\n\n return Permission::checkMember($this->owner, EcommerceConfig::get(EcommerceRole::class, 'process_orders_permission_code'));\n }", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "public function canBeEdited()\n {\n return false;\n }", "public function editable()\n {\n if ($this->getMode() == \"only_external\") {\n return false;\n }\n if ($this->hasScript()) {\n // can't edit calculated fields\n return false;\n }\n if (!isset($this->data[\"editable\"])) {\n return true;\n }\n return (true == $this->data[\"editable\"]);\n }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function isEditOnlyMode();", "public function isEditable($operation = OperationTypes::OP_UPDATE, $ignore_op = FALSE);", "public function checkACL()\n {\n return parent::checkACL() || \\XLite\\Core\\Auth::getInstance()->isPermissionAllowed('manage orders');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order');\n }", "public static function isAllowedWrite(): bool\n {\n if (!isset(self::$definition)) {\n self::$definition = Splash::object(\"Order\")->description();\n }\n if (is_array(self::$definition) && !empty(self::$definition[\"allow_push_updated\"])) {\n return true;\n }\n\n return false;\n }", "public function is_editable() {\n\t\treturn false;\n\t}", "private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function _isAllowed()\n {\n return $this->_authorization->isAllowed('Aitoc_OrdersExportImport::save');\n }", "public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function canChangeOrderWarehouse();", "public function isEditable()\n {\n // Need to be able to save the DataObject if this is being called during PublishTargetJob.\n if ($this->owner->getIsPublishJobRunning()) {\n return true;\n }\n\n // Need to be able to save the DataObject if this is being called during UnPublishTargetJob.\n if ($this->owner->getIsUnPublishJobRunning()) {\n return true;\n }\n\n if ($this->owner->config()->get('allow_embargoed_editing')) {\n return true;\n }\n\n if ($this->owner->getIsPublishScheduled()) {\n return false;\n }\n\n $embargoRecordIsEditable = $this->owner->invokeWithExtensions('embargoRecordIsEditable');\n if (in_array(false, $embargoRecordIsEditable)) {\n return false;\n }\n\n return true;\n }", "public function isValidEditingStatus()\n {\n return ($this->ID == 0 || $this->Status == self::STATUS_NEW || $this->Status == self::STATUS_FAILED);\n }", "public function can_edit($userID = '') {\n\t\t\t$order = SalesOrder::load($this->orderno);\n\t\t\treturn $order->can_edit($userID);\n\t\t}" ]
[ "0.74815583", "0.72471565", "0.71752214", "0.71580994", "0.7140332", "0.706235", "0.7052849", "0.70442003", "0.7042249", "0.7031722", "0.7014027", "0.6993747", "0.69290686", "0.6898653", "0.6837206", "0.6812711", "0.6798781", "0.6795296", "0.6743024", "0.67295295", "0.67286325", "0.67104715", "0.6672003", "0.6658138", "0.6653708", "0.6632111", "0.6631246", "0.6622279", "0.66037816", "0.66022396" ]
0.79627556
0
Recalculate shipping rates of the source order
protected function doActionRecalculateShipping() { if ($this->isOrderEditable()) { // Set ignoreLongCalculations mode for shipping rates gathering \XLite\Model\Shipping::setIgnoreLongCalculationsMode(false); // Get source order $order = $this->getOrder(); if (\XLite\Core\Request::getInstance()->isAJAX()) { $this->displayRecalculateShippingData($order); $this->restoreFormId(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }", "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 recalc_totals()\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\t// Set customer location to order location\n\t\tif ( $this->billing_country )\n\t\t\tWC()->customer->set_country( $this->billing_country );\n\t\tif ( $this->billing_state )\n\t\t\tWC()->customer->set_state( $this->billing_state );\n\t\tif ( $this->billing_postcode )\n\t\t\tWC()->customer->set_postcode( $this->billing_postcode );\n\n\t\t\t//\tget info for taxes \n\t\t$country = WC()->countries->get_base_country();\n\t\t$state = isset(WC()->countries->get_base_state) ? WC()->countries->get_base_state : '';\n\t\t$postcode = '';\n\t\t$city = '';\n\t\t\n\t\t$shipping_address = $this->get_shipping_address();\n\t\t$billing_address = $this->get_billing_address ();\n\t\t\n\t\tif(! empty($shipping_address))\n\t\t{\n\t\t\t$country = $this->shipping_country;\n\t\t\t$state = $this->shipping_state;\n\t\t\t$postcode = $this->shipping_postcode;\n\t\t\t$city = $this->shipping_city;\n\t\t}\n\t\telse if( ! empty($billing_address))\n\t\t{\n\t\t\t$country = $this->billing_country;\n\t\t\t$state = $this->billing_state;\n\t\t\t$postcode = $this->billing_postcode;\n\t\t\t$city = $this->billing_city;\n\t\t}\n\t\t\n\t\t$line_item_total = $line_item_subtotal = (float) 0.0;\n\t\t$line_item_total_tax_sum = $line_item_subtotal_tax_sum = (float) 0.0;\n\t\t$line_item_total_tax = $line_item_subtotal_tax = array();\n\t\t\n\t\t$shipping_total = (float) 0.0;\n\t\t$order_discounts_before_tax = $order_discount_after_tax = (float) 0.0;\n\t\t$cart_discounts_before_tax = $cart_discount_after_tax = (float) 0.0;\n\t\t\n\t\t$shipping_tax = $discount_tax = array();\n\t\t$taxes = $shipping_taxes = array();\n\t\t\n\t\t\t//\tGet all defined linetypes for this order\n\t\t$line_types_obj = $wpdb->get_results( $wpdb->prepare( \n\t\t\t\t\t\"SELECT DISTINCT order_item_type FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\tWHERE order_id = %d\", $this->id\n\t\t\t\t), OBJECT);\n\t\t\n\t\t$line_types = array();\t\t\t\n\t\tforeach ($line_types_obj as $line_type) \n\t\t{\n\t\t\t$line_types[] = $line_type->order_item_type;\n\t\t}\t\t\t\n\t\t\n\t\t$tax = new WC_Tax();\t\t\n\t\t\t\n\t\t$items = $this->get_items($line_types);\n\t\tforeach ( $items as $item_key => $item ) \n\t\t{\n\t\t\tswitch(strtolower($item['type']))\n\t\t\t{\n\t\t\t\tcase 'line_item':\t\t\t\t\n\t\t\t\t\t$line_item_subtotal += $item['line_subtotal'];\n\t\t\t\t\t$line_item_total += $item['line_total'];\n\t\t\t\t\t$line_item_subtotal_tax_sum += $item['line_subtotal_tax'];\n\t\t\t\t\t$line_item_total_tax_sum += $item['line_tax'];\n\t\t\t\t\t$line_tax = $item['line_tax'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fee':\n\t\t\t\t\t$line_item_subtotal += $item['line_total'];\t\t// '_order_discount' = $line_item_total - $line_item_subtotal !!!!!\n\t\t\t\t\t$line_item_total += $item['line_total'];\n\t\t\t\t\t$line_tax = $item['line_tax'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'shipping':\n\t\t\t\t\t$shipping_total += $item['cost'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'tax':\n\t\t\t\t\tif(!empty($item['shipping_tax_amount']))\t\t//\tvalues are not stored with shipment\n\t\t\t\t\t{\n\t\t\t\t\t\t$shipping_tax[$item['rate_id']] = $item['shipping_tax_amount'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'coupon':\n\t\t\t\t\t$coupon = new WC_Coupon($item['name']);\n\t\t\t\t\tif(in_array( $coupon->type, array( 'percent_product', 'fixed_product')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($coupon->apply_before_tax())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$order_discounts_before_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$order_discount_after_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($coupon->apply_before_tax())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cart_discounts_before_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cart_discount_after_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\t//\t'line_item' and 'fee'\n\t\t\tif(isset($item['tax_class']))\n\t\t\t{\n\t\t\t\t$tax_rates = $tax->find_rates( array(\n\t\t\t\t\t\t\t'country' \t=> $country,\n\t\t\t\t\t\t\t'state' \t=> $state,\n\t\t\t\t\t\t\t'postcode' \t=> $postcode,\n\t\t\t\t\t\t\t'city'\t\t=> $city,\n\t\t\t\t\t\t\t'tax_class' => $item['tax_class']\n\t\t\t\t\t\t) );\n\t\t\t\t\n\t\t\t\t$key = '';\n\t\t\t\tif(count($tax_rates) > 0)\n\t\t\t\t{\n\t\t\t\t\t$keys = array_keys($tax_rates);\n\t\t\t\t\t$key = $keys[0];\n\t\t\t\t}\n\n\t\t\t\t$line_item_total_tax[$key] = $line_tax;\n\t\t\t}\n\t\t\t\t// Sum the taxes\n\t\t\tforeach ( array_keys( $taxes + $line_item_total_tax ) as $key )\n\t\t\t\t $taxes[ $key ] = ( isset( $line_item_total_tax[ $key ] ) ? $line_item_total_tax[ $key ] : 0 ) + ( isset( $taxes[ $key ] ) ? $taxes[ $key ] : 0 );\n\n\t\t\tforeach ( array_keys( $shipping_taxes + $shipping_tax ) as $key )\n\t\t\t\t $shipping_taxes[ $key ] = ( isset( $shipping_tax[ $key ] ) ? $shipping_tax[ $key ] : 0 ) + ( isset( $shipping_taxes[ $key ] ) ? $shipping_taxes[ $key ] : 0 );\n\n\t\t\t$line_item_total_tax = $shipping_tax = array();\n\t\t}\n\t\t\t\n\t\t$total_tax = array_sum($taxes) + array_sum($shipping_taxes);\n\t\t\n\t\t\n\t\tif($this->round_at_subtotal)\n\t\t{\n\t\t\t$line_item_total = round($line_item_total, $this->dp);\n\t\t\t$shipping_total = round($shipping_total, $this->dp);\n\t\t\t$total_tax = round($total_tax, $this->dp);\n\t\t\t$cart_discounts_before_tax = round($cart_discounts_before_tax, $this->dp);\n\t\t\t$order_discounts_before_tax = round($order_discounts_before_tax, $this->dp);\n\t\t\t$order_discount_after_tax = round($order_discount_after_tax, $this->dp);\n\t\t\t$cart_discount_after_tax = round($cart_discount_after_tax, $this->dp);\n\t\t}\n\t\t\n\t\t$cart_discount = $cart_discounts_before_tax + $order_discounts_before_tax;\n\t\t$order_discount = $order_discount_after_tax + $cart_discount_after_tax;\n\t\t\n\t\t$total = round($line_item_total + $shipping_total + $total_tax - $order_discount, $this->dp) ;\n\t\t\n\t\t\t// Remove old tax rows\n\t\t$wpdb->query( $wpdb->prepare( \n\t\t\t\t\"DELETE FROM {$wpdb->prefix}woocommerce_order_itemmeta \n\t\t\t\t\tWHERE order_item_id IN ( \n\t\t\t\t\t\tSELECT order_item_id FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\t\t\tWHERE order_id = %d AND order_item_type = 'tax' )\", \n\t\t\t\t$this->id ) );\n\t\t\t\t\t\t\n\t\t$wpdb->query( $wpdb->prepare( \n\t\t\t\t\"DELETE FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\tWHERE order_id = %d AND order_item_type = 'tax'\", \n\t\t\t\t$this->id) );\n\n\t\t\t\n\t\t\t// Get tax rates\n\t\t$rates = $wpdb->get_results( \n\t\t\t\t\"SELECT tax_rate_id, tax_rate_country, tax_rate_state, tax_rate_name, tax_rate_priority \n\t\t\t\t\tFROM {$wpdb->prefix}woocommerce_tax_rates ORDER BY tax_rate_name\" \n\t\t\t\t);\n\t\t\n\t\t$tax_codes = array();\n\n\t\tforeach( $rates as $rate ) \n\t\t{\n\t\t\t$code = array();\n\n\t\t\t$code[] = $rate->tax_rate_country;\n\t\t\t$code[] = $rate->tax_rate_state;\n\t\t\t$code[] = $rate->tax_rate_name ? sanitize_title( $rate->tax_rate_name ) : 'TAX';\n\t\t\t$code[] = absint( $rate->tax_rate_priority );\n\n\t\t\t$tax_codes[ $rate->tax_rate_id ] = strtoupper( implode( '-', array_filter( $code ) ) );\n\t\t}\n\n\t\t// Now merge to keep tax rows\n\t\tforeach ( array_keys( $taxes + $shipping_taxes ) as $key ) \n\t\t{\n\n\t\t \t$item \t\t\t\t\t\t\t= array();\n\t\t \t$item['rate_id']\t\t\t \t= $key;\n\t\t\t$item['name'] \t\t\t\t\t= isset($tax_codes[ $key ]) ? $tax_codes[ $key ] : '';\n\t\t\t$item['label'] \t\t\t\t\t= $tax->get_rate_label( $key );\n\t\t\t$item['compound'] \t\t\t\t= $tax->is_compound( $key ) ? 1 : 0;\n\t\t\t$item['tax_amount'] \t\t\t= wc_format_decimal( isset( $taxes[ $key ] ) ? $taxes[ $key ] : 0 );\n\t\t\t$item['shipping_tax_amount'] \t= wc_format_decimal( isset( $shipping_taxes[ $key ] ) ? $shipping_taxes[ $key ] : 0 );\n\n\t\t\tif ( ! $item['label'] )\n\t\t\t\t$item['label'] = WC()->countries->tax_or_vat();\n\n\t\t\t// Add line item\n\t\t \t$item_id = wc_add_order_item( $this->id, array(\n\t\t \t\t'order_item_name' \t\t=> $item['name'],\n\t\t \t\t'order_item_type' \t\t=> 'tax'\n\t\t \t) );\n\n\t\t \t// Add line item meta\n\t\t \tif ( $item_id ) {\n\t\t \t\twc_add_order_item_meta( $item_id, 'rate_id', $item['rate_id'] );\n\t\t \t\twc_add_order_item_meta( $item_id, 'label', $item['label'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'compound', $item['compound'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'tax_amount', $item['tax_amount'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'shipping_tax_amount', $item['shipping_tax_amount'] );\n\t\t \t}\n\t\t}\n\t\t\n\t\tupdate_post_meta( $this->id, '_order_total', \t\twc_format_decimal($total));\n\t\tupdate_post_meta( $this->id, '_order_tax',\t\t\twc_format_decimal(array_sum($taxes)));\n\t\tupdate_post_meta( $this->id, '_order_shipping', \twc_format_decimal($shipping_total));\n\t\tupdate_post_meta( $this->id, '_order_shipping_tax', wc_format_decimal(array_sum($shipping_taxes)));\n\t\tupdate_post_meta( $this->id, '_order_discount', \twc_format_decimal($order_discount));\n\t\tupdate_post_meta( $this->id, '_cart_discount', \t\twc_format_decimal($cart_discount));\n\t}", "public function collectRates(Mage_Shipping_Model_Rate_Request $request) {\n\t\t// skip if not enabled\n\t\tif (!$this->__getConfigData('active')) {\n\t\t\treturn false;\n\t\t}\n\n $helper = Mage::helper('chronorelais');\n\n\t\t$process = array(\n\t\t\t'request' => $request,\n\t\t\t'result' => Mage::getModel('shipping/rate_result'),\n\t\t\t'cart.items' => array(),\n\t\t\t'products' => array(),\n\t\t\t'data' => array(\n\t\t\t\t'module.version' => null,\n\t\t\t\t'carrier.code' => $this->_code,\n\t\t\t\t'cart.price_excluding_tax' => $request->_data['package_value_with_discount'],\n\t\t\t\t'cart.price_including_tax' => null,\n\t\t\t\t'cart.weight' => $request->_data['package_weight'],\n\t\t\t\t'cart.weight.unit' => $helper->getConfigWeightUnit(),\n\t\t\t\t'cart.quantity' => $request->_data['package_qty'],\n\t\t\t\t'destination.country.code' => $request->_data['dest_country_id'],\n\t\t\t\t'destination.country.name' => null,\n\t\t\t\t'destination.region.code' => $request->_data['dest_region_code'],\n\t\t\t\t'destination.postcode' => $request->_data['dest_postcode'],\n\t\t\t\t'origin.country.code' => $request->_data['country_id'],\n\t\t\t\t'origin.country.name' => null,\n\t\t\t\t'origin.region.code' => $request->_data['region_id'],\n\t\t\t\t'origin.postcode' => $request->_data['postcode'],\n\t\t\t\t'customer.group.id' => null,\n\t\t\t\t'customer.group.code' => null,\n\t\t\t\t'free_shipping' => $request->getFreeShipping(),\n\t\t\t\t'store.id' => $request->_data['store_id'],\n\t\t\t\t'store.code' => null,\n\t\t\t\t'store.name' => null,\n\t\t\t\t'store.address' => null,\n\t\t\t\t'store.phone' => null,\n\t\t\t\t'date.timestamp' => null,\n\t\t\t\t'date.year' => null,\n\t\t\t\t'date.month' => null,\n\t\t\t\t'date.day' => null,\n\t\t\t\t'date.hour' => null,\n\t\t\t\t'date.minute' => null,\n\t\t\t\t'date.second' => null,\n\t\t\t),\n\t\t\t'stop_to_first_match' => null,\n\t\t\t'config' => null,\n\t\t);\n\n\t\t$items = $request->getAllItems();\n\t\tfor ($i=0, $n=count($items); $i<$n; $i++) {\n\t\t\t$item = $items[$i];\n\t\t\tif ($item->getProduct() instanceof Mage_Catalog_Model_Product) {\n\t\t\t\t$process['cart.items'][$item->getId()] = $item;\n\t\t\t}\n\t\t}\n\n\t\t$this->_process($process);\n\n\t\treturn $process['result'];\n\t}", "public function calculate_shipping( $package = array() ) {\n\n\t\t// country required for all shipments\n\t\tif ( ! $package['destination']['country'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// postal code required for US shipments only\n\t\tif ( 'US' === $package['destination']['country'] && ! $package['destination']['postcode'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\t$response = wc_shipwire()->get_api()->get_shipping_rates( $package );\n\n\t\t\t// add rates\n\t\t\t$this->add_rates( $response->get_rates(), $package );\n\n\t\t} catch( Exception $e ) {\n\n\t\t\twc_shipwire()->log( $e->getMessage() );\n\t\t}\n\t}", "public function applyDefaults()\n {\n $addressInfo = $this->_getDefaultAddress();\n $this->saveBilling(\n $addressInfo['billing'],\n $addressInfo['billing']['customer_address_id'],\n false\n );\n if (!$addressInfo['billing']['use_for_shipping']) {\n $this->saveShipping(\n $addressInfo['shipping'],\n $addressInfo['shipping']['customer_address_id'],\n false\n );\n }\n\n /**\n * @var Mage_Sales_Model_Quote\n */\n $quote = $this->getQuote();\n $shippingAddress = $quote->getShippingAddress();\n\n // weight vs destination fix\n $weight = 0;\n foreach($quote->getAllItems() as $item) {\n $weight += ($item->getWeight() * $item->getQty()) ;\n }\n $shippingAddress->setFreeMethodWeight($weight)->setWeight($weight);\n\n $shippingAddress->collectTotals()->collectShippingRates()->save();\n $this->applyShippingMethod();\n // shipping method may affect the total in both sides (discount on using shipping address)\n $quote->collectTotals();\n\n $ajaxHelper = Mage::helper('firecheckout/ajax');\n if ($ajaxHelper->getIsShippingMethodDependsOn('total')) {\n // changing total by shipping price may affect the shipping prices theoretically\n // (free shipping may be canceled or added)\n $shippingAddress->setCollectShippingRates(true)->collectShippingRates();\n // if shipping price was changed, we need to recalculate totals again.\n // Example: SELECTED SHIPPING METHOD NOW BECOMES FREE\n // previous method added a discount and selected shipping method wasn't free\n // but removing the previous shipping method removes the discount also\n // and selected shipping method is now free\n $quote->setTotalsCollectedFlag(false)->collectTotals();\n }\n\n $this->applyPaymentMethod();\n if ($ajaxHelper->getIsTotalDependsOn('payment-method')) { // @todo && method is changed\n // recollect totals again because adding/removing payment\n // method may add/remove some discounts in the order\n\n // to recollect discount rules need to clear previous discount\n // descriptions and mark address as modified\n // see _canProcessRule in Mage_SalesRule_Model_Validator\n $shippingAddress->setDiscountDescriptionArray(array())->isObjectNew(true);\n\n $quote->setTotalsCollectedFlag(false)->collectTotals();\n }\n\n $quote->save();\n\n return $this;\n }", "public function recalculate_totals() {\n\n\t\t$this->get_handler()->log( 'Recalculating totals' );\n\n\t\tcheck_ajax_referer( 'wc_' . $this->get_handler()->get_processing_gateway()->get_id() . '_apple_pay_recalculate_totals', 'nonce' );\n\n\t\ttry {\n\n\t\t\t// if a contact is passed, set the customer address data\n\t\t\tif ( isset( $_REQUEST['contact'] ) && is_array( $_REQUEST['contact'] ) ) {\n\n\t\t\t\t$contact = wp_parse_args( $_REQUEST['contact'], array(\n\t\t\t\t\t'administrativeArea' => null,\n\t\t\t\t\t'countryCode' => null,\n\t\t\t\t\t'locality' => null,\n\t\t\t\t\t'postalCode' => null,\n\t\t\t\t) );\n\n\t\t\t\t$state = $contact['administrativeArea'];\n\t\t\t\t$country = strtoupper( $contact['countryCode'] );\n\t\t\t\t$city = $contact['locality'];\n\t\t\t\t$postcode = $contact['postalCode'];\n\n\t\t\t\tWC()->customer->set_shipping_city( $city );\n\t\t\t\tWC()->customer->set_shipping_state( $state );\n\t\t\t\tWC()->customer->set_shipping_country( $country );\n\t\t\t\tWC()->customer->set_shipping_postcode( $postcode );\n\n\t\t\t\tif ( $country ) {\n\n\t\t\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t\t\t\tWC()->customer->set_calculated_shipping( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWC()->customer->calculated_shipping( true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$chosen_shipping_methods = ( $method = SV_WC_Helper::get_request( 'method' ) ) ? array( wc_clean( $method ) ) : array();\n\n\t\t\tWC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );\n\n\t\t\t$payment_request = $this->get_handler()->recalculate_totals();\n\n\t\t\t$data = array(\n\t\t\t\t'shipping_methods' => $payment_request['shippingMethods'],\n\t\t\t\t'line_items' => array_values( $payment_request['lineItems'] ),\n\t\t\t\t'total' => $payment_request['total'],\n\t\t\t);\n\n\t\t\t$this->get_handler()->log( \"New totals:\\n\" . print_r( $data, true ) );\n\n\t\t\twp_send_json_success( $data );\n\n\t\t} catch ( SV_WC_Payment_Gateway_Exception $e ) {\n\n\t\t\t$this->get_handler()->log( $e->getMessage() );\n\n\t\t\twp_send_json_error( array(\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'code' => $e->getCode(),\n\t\t\t) );\n\t\t}\n\t}", "public function getShippingRate();", "private function calculateShipping( )\n\t{\n\t\t\n\t\t// For this application, we are simply charging a flat fee for shipping\n\t\t// We could interface with web services provided by UPS, Fed Ex, USPS, etc. to get actual shipping fees\n\t\t// based on from address, to address, weight, size, etc.\n\t\t\n\t\t// For purposes of this school project, we are applying a flat rate of $4.50 for all shipments\n\t\treturn Configuration::getConfigValue(\"shippingRate\");\n\t\t\n\t\t\n\t}", "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 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 calculate_shipping( $package = array() ) {\n global $woocommerce;\n \n $shipping_total = 0;\n\n $country = $woocommerce->customer->get_shipping_country();\n $state = $woocommerce->customer->get_shipping_state();\n $applicable_configurations = $this->get_destination_configurations( $country, $state ); \n\n // If there is no configuration that can be applied to this shipping destination, \n // this method is not available\n if ( count( $applicable_configurations ) == 0 ) {\n return;\n }\n\n $rates = array();\n\n // Check whether each item in the cart has an applicable configuration\n foreach ($woocommerce->cart->get_cart() as $item ) {\n\n // Don't count virtual products\n if ( $item['data']->is_virtual() === false ) {\n \n $item_configurations = $this->get_item_configurations( $item, $applicable_configurations );\n\n if ( count( $item_configurations ) == 0 ) {\n return;\n }\n\n $configuration_id = $this->get_pricing_configuration_id( $item, $item_configurations, $country, $state );\n\n if ( array_key_exists( $configuration_id, $rates ) ) {\n $rates[$configuration_id] += $item['quantity'];\n }\n else {\n $rates[$configuration_id] = $item['quantity'];\n } \n }\n }\n\n // Get applicable configurations\n $configurations = array();\n \n foreach ( $rates as $configuration_id => $quantity ) {\n $configuration = $applicable_configurations[$configuration_id];\n $configuration['quantity'] = $quantity;\n $configurations[] = $configuration;\n }\n\n // If we are only applying the base rate once, sort configurations by base rate\n if ( $this->apply_base_rate_once ) {\n usort( $configurations, array( &$this, 'sort_configurations_by_price' ) );\n } \n\n // Allow themes/plugins to override the default configurations setup\n $configurations = apply_filters( 'woocommerce_brs_shipping_configurations', $configurations ); \n\n // Start adding together cost of shipping, one configuration at a time\n $first = true;\n foreach ( $configurations as $configuration ) {\n\n if ( $first === true || $this->apply_base_rate_once === false ) {\n $shipping_total += $this->get_configuration_subtotal( $configuration['rates'], $configuration['quantity'] );\n $first = false;\n } \n else {\n $shipping_total += $this->get_configuration_subtotal( $configuration['rates'], $configuration['quantity'], 1 );\n }\n } \n\n // Add handling fee\n if ($this->fee > 0) {\n $shipping_total += $this->get_fee( $this->fee, $woocommerce->cart->cart_contents_total );\n }\n\n // Allow themes/plugins to override the plugin's calculated shipping rates \n $shipping_total = apply_filters( 'woocommerce_brs_shipping_total', $shipping_total, $this, $configurations );\n \n $args = array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $shipping_total\n );\n\n $this->add_rate($args);\n }", "function adjust_shipping_rate($rates)\n{\n foreach ($rates as $rate) {\n if ($rate->id === 'cdek_shipping_method') {\n if (isset($_COOKIE['shipping_city_cost'])) {\n $rate->cost = $_COOKIE['shipping_city_cost'];\n $rate->label = $_COOKIE['shipping_name'];\n }\n }\n }\n return $rates;\n}", "protected function calculate_shipping_totals() {\n\t\t$this->get_shipping_from_cart();\n\t\t$this->set_total( 'shipping_total', array_sum( wp_list_pluck( $this->shipping, 'total' ) ) );\n\t\t$this->set_total( 'shipping_tax_total', array_sum( wp_list_pluck( $this->shipping, 'total_tax' ) ) );\n\n\t\t$this->cart->set_shipping_total( $this->get_total( 'shipping_total' ) );\n\t\t$this->cart->set_shipping_tax( $this->get_total( 'shipping_tax_total' ) );\n\t\t$this->cart->set_shipping_taxes( wc_remove_number_precision_deep( $this->combine_item_taxes( wp_list_pluck( $this->shipping, 'taxes' ) ) ) );\n\t}", "public function getShippingRates()\n {\n if (empty($this->_rates)) {\n $this->getShippingAddress()->collectShippingRates()->save();\n $groups = $this->getShippingAddress()->getGroupedAllShippingRates();\n\n return $this->_rates = $groups;\n }\n /* Don't show collect in store rate as an available option. */\n if (!Mage::getStoreConfig('carriers/collectinstore/onestep') && Mage::getStoreConfig('carriers/collectinstore/active') && array_key_exists('collectinstore', $this->_rates)) {\n unset($this->_rates['collectinstore']);\n }\n\n return $this->_rates;\n }", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\n {\n $storeId = $request->getStoreId();\n if (!$request->getOrig()) {\n $request\n ->setCountryId(Mage::getStoreConfig(self::XML_PATH_STORE_COUNTRY_ID, $request->getStore()))\n ->setRegionId(Mage::getStoreConfig(self::XML_PATH_STORE_REGION_ID, $request->getStore()))\n ->setCity(Mage::getStoreConfig(self::XML_PATH_STORE_CITY, $request->getStore()))\n ->setPostcode(Mage::getStoreConfig(self::XML_PATH_STORE_ZIP, $request->getStore()));\n }\n\n $limitCarrier = $request->getLimitCarrier();\n if (!$limitCarrier) {\n $carriers = Mage::getStoreConfig('carriers', $storeId);\n\n /*\n For UPS Saturday Shipping, add an additional carrier that will will have the saturday delivery\n option added in Shipping/Carrier/Ups.php\n Saturday delivery is an option in the API request and applies to ALL shipping rates in that result.\n So we make 2 requests to UPS - once for non-saturday and once for Saturday.\n */\n if( Mage::getStoreConfig('shipping/saturday_delivery_ups/enabled') && in_array( date('w'), explode( \",\", Mage::getStoreConfig('shipping/saturday_delivery_ups/days_enabled') ) ) ) {\n $carriers['upssaturday'] = $carriers['ups'];\n }\n\n foreach ($carriers as $carrierCode => $carrierConfig) {\n $this->collectCarrierRates($carrierCode, $request);\n }\n } else {\n if (!is_array($limitCarrier)) {\n $limitCarrier = array($limitCarrier);\n }\n foreach ($limitCarrier as $carrierCode) {\n $carrierConfig = Mage::getStoreConfig('carriers/' . $carrierCode, $storeId);\n if (!$carrierConfig) {\n continue;\n }\n $this->collectCarrierRates($carrierCode, $request);\n }\n }\n\n return $this;\n }", "function sundaysea_update_shipping()\n {\n if (is_null(WC()->cart)) {\n return;\n }\n\n // Constants\n if (!defined('WOOCOMMERCE_CART')) {\n define('WOOCOMMERCE_CART', true);\n }\n\n // Update Shipping\n if (!empty($_POST['calc_shipping'])) {\n\n try {\n WC()->shipping->reset_shipping();\n\n $country = wc_clean($_POST['calc_shipping_country']);\n $state = isset($_POST['calc_shipping_state']) ? wc_clean($_POST['calc_shipping_state']) : '';\n $postcode = apply_filters('woocommerce_shipping_calculator_enable_postcode', true) ? wc_clean($_POST['calc_shipping_postcode']) : '';\n $city = apply_filters('woocommerce_shipping_calculator_enable_city', false) ? wc_clean($_POST['calc_shipping_city']) : '';\n\n if ($postcode && !WC_Validation::is_postcode($postcode, $country)) {\n throw new Exception(__('Please enter a valid postcode/ZIP.', 'woocommerce'));\n } elseif ($postcode) {\n $postcode = wc_format_postcode($postcode, $country);\n }\n\n if ($country) {\n WC()->customer->set_location($country, $state, $postcode, $city);\n WC()->customer->set_shipping_location($country, $state, $postcode, $city);\n } else {\n WC()->customer->set_to_base();\n WC()->customer->set_shipping_to_base();\n }\n\n WC()->customer->calculated_shipping(true);\n\n wc_add_notice(__('Shipping costs updated.', 'woocommerce'), 'notice');\n\n do_action('woocommerce_calculated_shipping');\n\n } catch (Exception $e) {\n\n if (!empty($e))\n wc_add_notice($e->getMessage(), 'error');\n }\n }\n\n // Check cart items are valid\n do_action('woocommerce_check_cart_items');\n\n // Calc totals\n WC()->cart->calculate_totals();\n }", "public function getShippingrate()\n\t{\n\t\tinclude_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';\n\t\t$shipping = new shipping;\n\t\techo $shipping->getShippingrate_calc();\n\t\texit;\n\t}", "public function calculateRates(ShipmentInterface $shipment);", "public function calculate_shipping() {\n\t\t$this->shipping_methods = $this->needs_shipping() ? $this->get_chosen_shipping_methods( WC()->shipping->calculate_shipping( $this->get_shipping_packages() ) ) : array();\n\n\t\t$shipping_taxes = wp_list_pluck( $this->shipping_methods, 'taxes' );\n\t\t$merged_taxes = array();\n\t\tforeach ( $shipping_taxes as $taxes ) {\n\t\t\tforeach ( $taxes as $tax_id => $tax_amount ) {\n\t\t\t\tif ( ! isset( $merged_taxes[ $tax_id ] ) ) {\n\t\t\t\t\t$merged_taxes[ $tax_id ] = 0;\n\t\t\t\t}\n\t\t\t\t$merged_taxes[ $tax_id ] += $tax_amount;\n\t\t\t}\n\t\t}\n\n\t\t$this->set_shipping_total( array_sum( wp_list_pluck( $this->shipping_methods, 'cost' ) ) );\n\t\t$this->set_shipping_tax( array_sum( $merged_taxes ) );\n\t\t$this->set_shipping_taxes( $merged_taxes );\n\n\t\treturn $this->shipping_methods;\n\t}", "function calcTotals(){\n\t\t\n\t\tif($this->Review == true){/*\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_percent` FROM `billship_tax_states` WHERE `tax_state` = '\".$this->CustBill['State'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_percent FROM billship_tax_states WHERE tax_state = '\".$this->CustBill['State'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_percent']/100);\n\t\t\t}\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_count_percent` FROM `billship_tax_county` WHERE `tax_count_zip` = '\".$this->CustBill['Zip'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_count_percent FROM billship_tax_county WHERE tax_count_zip = '\".$this->CustBill['Zip'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_count_percent']/100);\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Totals['Ship2'] > 0){\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_price` >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_price >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t\t\t\t\n\t\t\t\tif($getRate->TotalRows() == 0){\n\t\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_upper` = 'y';\");\n\t\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_upper = 'y';\");\n\t\t\t\t}\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t$test_1 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_2 = $this->Totals['Total']*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_weight` >= '$weight';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_weight >= '$weight';\");\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t\n\t\t\t\t$test_3 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_4 = $total*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$this->Totals['Ship2'] = ($test_1 < $test_2) ? $test_2 : $test_1;\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_3) ? $test_3 : $this->Totals['Ship2'];\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_4) ? $test_4 : $this->Totals['Ship2'];\n\t\t\t\tif(strlen(trim($this->Totals['Ship2'])) > 0) $this->Totals['Ship'] = $this->Totals['Ship2'];\n\t\t\t}\n\t\t*/\n\t\t}\n\t\t$this->Totals['Grand'] = $this->Totals['Total']+$this->Totals['Ship']+$this->Totals['Tax']-$this->Totals['Disc']+$this->Totals['Ext']+$this->Totals['Freight'];\n\t}", "protected function _initTotals()\n {\n $this->_totals = array();\n\n //overridden store ship\n $storeship = Bm_Cmon::getWholesalerShipping($this->getOrder()->getRealOrderId());\n\n\n $_subtotal = 0;\n foreach ($this->getOrder()->getAllItems() as $orderItem) {\n\n \tif(Bm_Cmon::checkSkuOwner($orderItem->getSku())){\n \t\t$_subtotal+= $orderItem->getQtyOrdered()*$orderItem->getOriginalPrice();\n\n \t}\n \n \n\n }\n\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $_subtotal,\n 'base_value'=> $this->getSource()->getBaseSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * overridden ship value\n */\n if (!$this->getSource()->getIsVirtual() && ((float) $this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription()))\n {\n \n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $storeship['value'], //$this->getSource()->getShippingAmount(),\n 'base_value'=> $this->getSource()->getBaseShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n\n /*\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value'=> $this->getSource()->getBaseDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\t\t*/\n\n\t\t//FIXME: implements discount logic\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $_subtotal+$this->getSource()->getDiscountAmount()*(-1)+$storeship['value'],\n 'base_value'=> $this->getSource()->getBaseGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n return $this;\n }", "public function calculate()\n {\n if (! $this->isAvailable())\n return false;\n\n $cart = Cart::getCart();\n\n $object = new CartShippingRate;\n\n $object->carrier = 'flatrate';\n $object->carrier_title = $this->getConfigData('title');\n $object->method = 'flatrate_flatrate';\n $object->method_title = $this->getConfigData('title');\n $object->method_description = $this->getConfigData('description');\n\n if ($this->getConfigData('type') == 'per_unit') {\n $object->price = core()->convertPrice($this->getConfigData('default_rate')) * $cart->items_qty;\n $object->base_price = $this->getConfigData('default_rate') * $cart->items_qty;\n } else {\n $object->price = core()->convertPrice($this->getConfigData('default_rate'));\n $object->base_price = $this->getConfigData('default_rate');\n }\n\n\n return $object;\n }", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\n { \t\n \tif (Mage::helper('wsacommon')->isModuleEnabled('Webshopapps_Freightrate')) {\n\t\t\tif($_SERVER[\"REMOTE_ADDR\"] == '72.239.158.50'){\n\t\t\t\tMage::log('collectFreightRates1: ', null, 'aaron_dropship_error.log');\n\t\t\t}\n \t\treturn $this->collectFreightRates($request);\n \t} else {\n\t\t\tif($_SERVER[\"REMOTE_ADDR\"] == '72.239.158.50'){\n\t\t\t\tMage::log('collectDropshipRates: ', null, 'aaron_dropship_error.log');\n\t\t\t\t//Mage::log($this->getErrorResult(), null, 'aaron_dropship_error.log');\n\t\t\t\t//Mage::log($this->debug(), null, 'aaron_dropship_error.log');\n\t\t\t}\n\t\t\t// This runs\n \t\treturn $this->collectDropshipRates($request);\n \t}\n }", "public function reCalculateOrderTotals ( \\Maven\\Core\\Domain\\Order $order ) {\n\n\t\t\\Maven\\Loggers\\Logger::log()->message( 'Maven/OrderManager/reCalculateOrderTotals' );\n\n\t\t// Recalculate the promotions\n\t\t//$promotionManager = new PromotionManager( );\n\n\t\t$order->recalculateSubtotal();\n\n\t\t// First we need to reset the total amount \n\t\t$order->setTotal( $order->getSubtotal() );\n\n\t\t//$promotionManager->reCalculatePromotions( $order );\n\n\t\t$taxesManager = new TaxManager( );\n\n\t\t//Calculate taxes\n\t\t$taxesManager->applyTaxes( $order );\n\n\t\t// Recalculate the total amount\n\t\t$order->calculateTotal();\n\n\t\t// We need to verify if there is a shipping method available\n\t\t$this->applyShipping( $order );\n\n\t\treturn $order;\n\t}", "public function calculate()\r\n {\r\n if (! $this->isAvailable()) {\r\n return false;\r\n }\r\n\r\n $object = new CartShippingRate;\r\n\r\n $object->carrier = 'pickup';\r\n $object->carrier_title = $this->getConfigData('title');\r\n $object->method = 'pickup_pickup';\r\n $object->method_title = $this->getConfigData('title');\r\n $object->method_description = $this->getConfigData('description');\r\n $object->price = 0;\r\n $object->base_price = 0;\r\n\r\n return $object;\r\n }", "public function collectRates(RateRequest $request)\n {\n if (!$this->getConfigFlag('active')) {\n return false;\n }\n \n /** @var \\Magento\\Shipping\\Model\\Rate\\Result $result */\n $result = $this->_rateResultFactory->create();\n\t\t\n\t\t\n\t\t $zone = $this->helper->getShippingZoneByZipcode($request->getDestPostcode());\n if (!$zone) {\n return false;\n }\n\t\t$storeScope = \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE;\n $matressAttributeSetId = $this->scopeConfig->getValue('carriers/zonerate/matress_attribute_set', $storeScope);\n $furnitureAttributeSetId = $this->scopeConfig->getValue('carriers/zonerate/furniture_attribute_set', $storeScope);\n $matressGreaterAmount = (int)$this->scopeConfig->getValue('carriers/zonerate/matress_greater_amount', $storeScope);\n $bedInBoxCategory = $this->scopeConfig->getValue('carriers/zonerate/bed_in_box_cateid', $storeScope);\n $beddingCategory = $this->scopeConfig->getValue('carriers/zonerate/bedding_cateid', $storeScope);\n\n if ($request->getAllItems()) {\n $rule=array();\n foreach ($request->getAllItems() as $item) {\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\n continue;\n }\n $item->setData('product', null);\n $product = $item->getProduct();\n $productAttributeId = $product->getAttributeSetId();\n $price = $product->getPrice();\n $productCategoryIds = $product->getCategoryIds();\n\n\n if ($productAttributeId == $matressAttributeSetId && $price >= $matressGreaterAmount && !in_array($bedInBoxCategory,$productCategoryIds) && !in_array($beddingCategory,$productCategoryIds) && $zone['id'] == 1) {\n if(!in_array('Rule1', $rule, true)){\n $rule['rule1'] = 'Rule1';\n }\n } elseif ($productAttributeId == $furnitureAttributeSetId && !in_array($bedInBoxCategory,$productCategoryIds) && !in_array($beddingCategory,$productCategoryIds) && $zone['id'] == 1) {\n if(!in_array('Rule2', $rule, true)){\n $rule['rule2'] = 'Rule2';\n }\n //return false;\n } elseif (($productAttributeId == $matressAttributeSetId || $productAttributeId == $furnitureAttributeSetId) && !in_array($bedInBoxCategory,$productCategoryIds) && !in_array($beddingCategory,$productCategoryIds) && $zone['id'] == 2 ) {\n if(!in_array('Rule3', $rule, true)){\n $rule['rule3'] = 'Rule3';\n }\n //return false;\n } elseif (in_array($bedInBoxCategory,$productCategoryIds) && ( $zone['id'] == 1 || $zone['id'] == 2)) {\n if(!in_array('Rule4', $rule, true)){\n $rule['rule4'] = 'Rule4';\n }\n } elseif (in_array($beddingCategory,$productCategoryIds)) {\n if(!in_array('Rule5', $rule, true)){\n $rule['rule5'] = 'Rule5';\n }\n } else{\n \n }\n \n\n } \n if(!in_array('Rule1', $rule, true) && (in_array('Rule2', $rule, true) || in_array('Rule3', $rule, true)) ){\n return false;\n }\n }\n \n $this->_updateFreeMethodQuote($request);\n\n if ($request->getFreeShipping() || $this->isFreeShippingRequired($request)) {\n /** @var \\Magento\\Quote\\Model\\Quote\\Address\\RateResult\\Method $method */\n $method = $this->_rateMethodFactory->create();\n\n $method->setCarrier('freeshipping');\n $method->setCarrierTitle($this->getConfigData('title'));\n\n $method->setMethod('freeshipping');\n $method->setMethodTitle($this->getConfigData('name'));\n\n $method->setPrice('0.00');\n $method->setCost('0.00');\n\n $result->append($method);\n } elseif ($this->getConfigData('showmethod')) {\n $error = $this->_rateErrorFactory->create();\n $error->setCarrier($this->_code);\n $error->setCarrierTitle($this->getConfigData('title'));\n $errorMsg = $this->getConfigData('specificerrmsg');\n $error->setErrorMessage(\n $errorMsg ? $errorMsg : __(\n 'Sorry, but we can\\'t deliver to the destination country with this shipping module.'\n )\n );\n return $error;\n }\n return $result;\n }", "public function getShippingCost();", "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 }" ]
[ "0.69149065", "0.6744018", "0.6646637", "0.66089463", "0.6599986", "0.6494408", "0.6451403", "0.6447961", "0.6440501", "0.64311314", "0.6267195", "0.62293667", "0.6224513", "0.61586916", "0.6155493", "0.6133148", "0.6116184", "0.60592425", "0.6029987", "0.60281354", "0.6000783", "0.5959855", "0.5948646", "0.59338003", "0.591986", "0.58705837", "0.58701974", "0.58463675", "0.58440655", "0.5843677" ]
0.68211037
1
Display recalculate shipping data
protected function displayRecalculateShippingData(\XLite\Model\Order $order) { \XLite\Core\Event::recalculateShipping($this->assembleRecalculateShippingEvent($order)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function doActionRecalculateShipping()\n {\n if ($this->isOrderEditable()) {\n // Set ignoreLongCalculations mode for shipping rates gathering\n \\XLite\\Model\\Shipping::setIgnoreLongCalculationsMode(false);\n\n // Get source order\n $order = $this->getOrder();\n\n if (\\XLite\\Core\\Request::getInstance()->isAJAX()) {\n $this->displayRecalculateShippingData($order);\n $this->restoreFormId();\n }\n }\n }", "public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }", "public function getShippingCostsAction()\n {\n $builder = Shopware()->Models()->createQueryBuilder();\n\n $builder->select(['dispatch', 'shipping'])\n ->from('Shopware\\Models\\Dispatch\\ShippingCost', 'shipping')\n ->innerJoin('shipping.dispatch', 'dispatch')\n ->groupBy('dispatch.id');\n $shippingCosts = $builder->getQuery()->getArrayResult();\n\n $languageId = $this->getBackendLanguage();\n\n foreach ($shippingCosts as &$shippingCost) {\n $shippingCost['dispatch'] = $this->translateDispatch($shippingCost['dispatch'], $languageId);\n }\n\n $total = count($shippingCosts);\n\n $this->view->assign(\n [\n 'data' => $shippingCosts,\n 'total' => $total,\n 'success' => true\n ]\n );\n }", "public function actionUkrainepostShipping()\n {\n echo 20.14;\n }", "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 getShippingInfo();", "public function actionNovaPostaShipping()\n {\n echo 35.46;\n }", "public function getShippingDetails();", "public function getShippingCost();", "public function shippingCosts(): string\n {\n return $this->rate->price;\n }", "private function _collectShippingInfo(){\n\t\tif(!empty($this->_shippingPriceCache)) return $this->_shippingPriceCache;\n\t\t$return = Mage::getSingleton(\"ultracart/cart\")->_collectShippingInfo();\n\t\t$this->_shippingPriceCache = $return;\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "private function get_shipping_item_totals()\r\n\t{\r\n\t\t$separate_value = $this->flexi->cart_contents['settings']['shipping']['data']['separate_value'];\r\n\t\t$separate_weight = $this->flexi->cart_contents['settings']['shipping']['data']['separate_weight'];\r\n\t\t\r\n\t\t$free_value = $this->flexi->cart_contents['settings']['shipping']['data']['free_value'];\r\n\t\t$free_weight = $this->flexi->cart_contents['settings']['shipping']['data']['free_weight'];\r\n\t\r\n\t\t$item_summary_total = $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$total_weight = $this->flexi->cart_contents['summary']['total_weight'];\r\n\t\t\r\n\t\t$shipping_item_data['value'] = $this->format_calculation($item_summary_total - $separate_value - $free_value);\r\n\t\t$shipping_item_data['weight'] = $this->format_calculation($total_weight - $separate_weight - $free_weight);\r\n\r\n\t\treturn $shipping_item_data;\r\n\t}", "function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }", "public function shippingPaymentAction()\r\n {\r\n // Load payment options, select option and details\r\n $this->View()->sPayments = $this->getPayments();\r\n $this->View()->sFormData = array('payment' => $this->View()->sUserData['additional']['user']['paymentID']);\r\n $getPaymentDetails = $this->admin->sGetPaymentMeanById($this->View()->sFormData['payment']);\r\n\r\n $paymentClass = $this->admin->sInitiatePaymentClass($getPaymentDetails);\r\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\r\n $data = $paymentClass->getCurrentPaymentDataAsArray(Shopware()->Session()->sUserId);\r\n if (!empty($data)) {\r\n $this->View()->sFormData += $data;\r\n }\r\n }\r\n if ($this->Request()->isPost()) {\r\n $values = $this->Request()->getPost();\r\n $values['payment'] = $this->Request()->getPost('payment');\r\n $values['isPost'] = true;\r\n $this->View()->sFormData = $values;\r\n }\r\n\r\n $this->View()->sBasket = $this->getBasket();\r\n\r\n // Load current and all shipping methods\r\n $this->View()->sDispatch = $this->getSelectedDispatch();\r\n $this->View()->sDispatches = $this->getDispatches($this->View()->sFormData['payment']);\r\n\r\n $this->View()->sLaststock = $this->basket->sCheckBasketQuantities();\r\n $this->View()->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $this->View()->sShippingcostsDifference = $this->View()->sBasket['sShippingcostsDifference'];\r\n $this->View()->sAmount = $this->View()->sBasket['sAmount'];\r\n $this->View()->sAmountWithTax = $this->View()->sBasket['sAmountWithTax'];\r\n $this->View()->sAmountTax = $this->View()->sBasket['sAmountTax'];\r\n $this->View()->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $this->View()->sRegisterFinished = !empty($this->session['sRegisterFinished']);\r\n $this->View()->sTargetAction = 'shippingPayment';\r\n $this->View()->sKUZOOffer = true;\r\n if ($this->Request()->getParam('isXHR')) {\r\n return $this->View()->loadTemplate('frontend/s_k_u_z_o_offer/shipping_payment_core.tpl');\r\n }\r\n }", "public function show(Shippingcost $shippingcost)\n {\n //\n }", "public function getShippingrate()\n\t{\n\t\tinclude_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';\n\t\t$shipping = new shipping;\n\t\techo $shipping->getShippingrate_calc();\n\t\texit;\n\t}", "function cart_shipping_calc() {\n\n\t\tglobal $woocommerce;\n\n\t\tif ( get_option( 'woocommerce_enable_shipping_calc' ) === 'no' || ! WC()->cart->needs_shipping() ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\n\t\t<?php do_action( 'woocommerce_before_shipping_calculator' ); ?>\n\n\t\t<div class=\"woocommerce-shipping-calculator\" action=\"<?php echo esc_url( WC()->cart->get_cart_url() ); ?>\" method=\"post\">\n\n\t\t\t<h2><a href=\"#\" class=\"shipping-calculator-button\"><?php _e( 'Calculate Shipping', 'woocommerce' ); ?></a>\n\t\t\t</h2>\n\n\t\t\t<div class=\"aione-shipping-calculator-form\">\n\n\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t<select name=\"calc_shipping_country\" id=\"calc_shipping_country\" class=\"country_to_state\" rel=\"calc_shipping_state\">\n\t\t\t\t\t\t<option value=\"\"><?php _e( 'Select a country&hellip;', 'woocommerce' ); ?></option>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach( WC()->countries->get_shipping_countries() as $key => $value )\n\t\t\t\t\t\t\t\techo '<option value=\"' . esc_attr( $key ) . '\"' . selected( WC()->customer->get_shipping_country(), esc_attr( $key ), false ) . '>' . esc_html( $value ) . '</option>';\n\t\t\t\t\t\t?>\n\t\t\t\t\t</select>\n\t\t\t\t</p>\n\n\t\t\t\t<div class=\"<?php if ( ! Aione()->settings->get( 'aione_styles_dropdowns' ) ): ?>aione-select-parent oxo-layout-column oxo-one-half oxo-spacing-yes<?php endif; ?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\t$current_cc = WC()->customer->get_shipping_country();\n\t\t\t\t\t\t$current_r = WC()->customer->get_shipping_state();\n\t\t\t\t\t\t$states = WC()->countries->get_states( $current_cc );\n\n\t\t\t\t\t\t// Hidden Input\n\t\t\t\t\t\tif ( is_array( $states ) && empty( $states ) ) {\n\n\t\t\t\t\t\t\t?><input type=\"hidden\" name=\"calc_shipping_state\" id=\"calc_shipping_state\" placeholder=\"<?php esc_attr_e( 'State / county', 'woocommerce' ); ?>\" /><?php\n\n\t\t\t\t\t\t\t// Dropdown Input\n\t\t\t\t\t\t} elseif ( is_array( $states ) ) {\n\n\t\t\t\t\t\t\t?><span>\n\t\t\t\t\t\t\t\t<select name=\"calc_shipping_state\" id=\"calc_shipping_state\" placeholder=\"<?php esc_attr_e( 'State / county', 'woocommerce' ); ?>\">\n\t\t\t\t\t\t\t\t\t<option value=\"\"><?php _e( 'Select a state&hellip;', 'woocommerce' ); ?></option>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tforeach ( $states as $ckey => $cvalue )\n\t\t\t\t\t\t\t\t\t\t\techo '<option value=\"' . esc_attr( $ckey ) . '\" ' . selected( $current_r, $ckey, false ) . '>' . __( esc_html( $cvalue ), 'woocommerce' ) .'</option>';\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</span><?php\n\n\t\t\t\t\t\t\t// Standard Input\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t?><input type=\"text\" class=\"input-text\" value=\"<?php echo esc_attr( $current_r ); ?>\" placeholder=\"<?php esc_attr_e( 'State / county', 'woocommerce' ); ?>\" name=\"calc_shipping_state\" id=\"calc_shipping_state\" /><?php\n\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\n\t\t\t\t<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_city', false ) ) : ?>\n\n\t\t\t\t\t<p class=\"form-row form-row-wide\">\n\t\t\t\t\t\t<input type=\"text\" class=\"input-text\" value=\"<?php echo esc_attr( WC()->customer->get_shipping_city() ); ?>\" placeholder=\"<?php esc_attr_e( 'City', 'woocommerce' ); ?>\" name=\"calc_shipping_city\" id=\"calc_shipping_city\" />\n\t\t\t\t\t</p>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true ) ) : ?>\n\n\t\t\t\t\t<div class=\"form-row form-row-wide oxo-layout-column oxo-one-half oxo-spacing-yes oxo-column-last\">\n\t\t\t\t\t\t<input type=\"text\" class=\"input-text\" value=\"<?php echo esc_attr( WC()->customer->get_shipping_postcode() ); ?>\" placeholder=\"<?php esc_attr_e( 'Postcode / Zip', 'woocommerce' ); ?>\" name=\"calc_shipping_postcode\" id=\"calc_shipping_postcode\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<p>\n\t\t\t\t\t<button type=\"submit\" name=\"calc_shipping\" value=\"1\" class=\"oxo-button button-default button-small button small default\"><?php _e( 'Update Totals', 'woocommerce' ); ?></button>\n\t\t\t\t</p>\n\n\t\t\t\t<?php wp_nonce_field( 'woocommerce-cart' ); ?>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php do_action( 'woocommerce_after_shipping_calculator' ); ?>\n\n\t<?php\n\t}", "public function getShippingAmount();", "public function shipping()\n\t{\n\t\t\n\t\t$this->templateFileName = 'shipping.tpl';\n\t\t\n\t\t// Make sure there is something in the user's cart.\n\t\t$cartID = $this->session->cartID;\n\t\t\n\t\t$cart = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_cart WHERE cart_id = ? AND record_status = 'A'\", $cartID);\n\t\t\n\t\tif ( !$cart )\n\t\t{\n\t\t\t// There is nothing in the cart, so display an error message\n\t\t\t$errormessage = urlencode('There is nothing in your cart');\n\t\t\theader(\"Location: /cart?emsg={$errormessage}\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t// Get the list of shipping addresses to display on the page\n\t\t\t$addresses = $this->getAddresses();\n\t\t\t$this->set('addresses', $addresses);\n\t\t\t\n\t\t\t// Determine what to do based on user input\n\t\t\tif ( count($_POST) > 0 && isset($_POST['submit_shipping_address']) )\n\t\t\t{\n\t\t\t\t// A form was submitted, so handle the form input\n\t\t\t\t\n\t\t\t\tif (!isset($_POST['addressSelect']) || empty($_POST['addressSelect']))\n\t\t\t\t{\n\t\t\t\t\t$errors[] = 'Please select an address or create a new one.';\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['addressSelect'] == 'new' )\n\t\t\t\t{\n\t\t\t\t\t// The user has selected to enter a new address\n\t\t\t\t\t// Make sure the address is complete\n\t\t\t\t\t\n\t\t\t\t\t$formComplete = true;\n\t\t\t\t\t\n\t\t\t\t\tif ( ! isset($_POST['address_name']) || empty($_POST['address_name']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['address_name'] = 'Address Name is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['address_1']) || empty($_POST['address_1']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['address_1'] = 'Address Line 1 is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['city']) || empty($_POST['city']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['city'] = 'City is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['state']) || empty($_POST['state']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['state'] = 'State is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['zip']) || empty($_POST['zip']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['zip'] = 'Zip is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sanitized_zip = preg_replace('/\\D/', '', (string)$_POST['zip']);\n\t\t\t\t\t\t$zip_length = strlen($sanitized_zip);\n\t\t\t\t\t\tif ( $zip_length != 5 && $zip_length != 9 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t$fieldErrors['zip'] = 'Zip must be 5 or 9 digits.';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($zip_length == 9)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_POST['zip'] = substr($sanitized_zip, 0, 5) . '-' . substr($sanitized_zip, 5, 4);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_POST['zip'] = $sanitized_zip;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($formComplete)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t// The form is complete, so create the record\n\t\t\t\t\t\t$insertSQL = \"INSERT INTO b_user_address (user_id, address_name, address_1, address_2, city, state, zip, record_status) \"\n\t\t\t\t\t\t . \"VALUES(?, ?, ?, ?, ?, ?, ?, 'A')\";\n\t\t\t\t\t\tif ( ! $this->dbConnection->prepareCommand($insertSQL, $this->session->userID, $_POST['address_name'], $_POST['address_1'], $_POST['address_2'], $_POST['city'], $_POST['state'], $_POST['zip']) )\n\t\t\t\t\t\t\t$errors[] = 'Error creating record. Please try again.';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// The record was successfully created, so set the shipping address ID and move on to the next step\n\t\t\t\t\t\t\t$this->session->shippingAddressID = $this->dbConnection->insert_id;\n\t\t\t\t\t\t\t// Have the address be automatically selected in the billing page\n\t\t\t\t\t\t\t$_POST['addressSelect'] = $this->dbConnection->insert_id;\n\t\t\t\t\t\t\t$this->__default();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->set('fieldErrors', $fieldErrors);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// The user selected an existing address for shipping\n\t\t\t\t\t// Verify it is a valid record ID\n\t\t\t\t\t$address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $_POST['addressSelect']);\n\t\t\t\t\tif (!$address)\n\t\t\t\t\t\t$errors[] = 'Error selecting address. This address does not exist.';\n\t\t\t\t\telseif ( $address['user_id'] != $this->session->userID )\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is for a different user.';\n\t\t\t\t\telseif ( $address['record_status'] != 'A')\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is not active.';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// The address is valid, so use it.\n\t\t\t\t\t\t// set the shipping address and move on to the next step\n\t\t\t\t\t\t$this->session->shippingAddressID = $_POST['addressSelect'];\n\t\t\t\t\t\t$this->__default();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\n\t\t\t// Set address ID for output, so the field is pre-selected\n\t\t\tif ( $this->session->shippingAddressID )\n\t\t\t\t$this->set('addressSelect', $this->session->shippingAddressID);\n\n\n\t\t\t// Set all of the view data for post data so the form will be reloaded\n\t\t\tforeach ($_POST as $id => $val)\n\t\t\t{\n\t\t\t\t$this->set($id, $val);\n\t\t\t}\n\n\t\t\t// Set the error list for output\n\t\t\t$this->set('errors', $errors);\n\t\t\t\n\t\t\t\n\t\t\t// Get the list of state codes to output\n\t\t\t$states = $this->dbConnection->recordSet(\"SELECT short_description AS code, long_description AS name FROM b_value WHERE data_member = 'STATE' ORDER BY short_description\");\n\t\t\t$this->set('states', $states);\n\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function shippingDetails()\n {\n \tif(Yii::$app->request->isAjax){\n \t\t\n\t \t/*Model Dev*/\n\t \t$account = new ymoAccountSettings;\n\t \t\n\t \t$shipping = new $account->shipping;\n\t $shipping->scenario = 'updateShipping';\n\t \t\n\t \t\\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\t \t\n\t \tif ($shipping->load(Yii::$app->request->post())) {\n\t \t\n\t \t\t$shipping->attributes = $shipping->load(Yii::$app->request->post());\n\t \t\n\t\t \tif($shipping->updateShipping())\n\t\t \t{\n\t\t \t\n\t\t\t \treturn [\n\t\t\t \t\t'name' => 'success',\n\t\t\t \t\t'message' => 'Successfull.',\n\t\t\t \t\t'content' => Yii::$app->controller->render('@common/errors/popup',[\n\t\t\t\t\t\t\t'custom' => Yii::$app->controller->renderPartial('@popups/shipping-details-done'),\n\t\t\t \t\t]),\n\t\t\t \t\t'status' => 200,\n\t\t\t \t];\n\t\t \t\n\t\t \t}else{\n\t\t \t\treturn [\n\t\t \t\t\t'name' => 'validationError',\n\t\t \t\t\t'message' => 'Validation fix errors.',\n\t\t \t\t\t'errors' => $shipping->getErrors(),\n\t\t \t\t\t'content' => Yii::$app->controller->render('@common/errors/popup',[\n\t\t \t\t\t\t'id' => 'form-company-details',\n\t\t \t\t\t\t'header' => Yii::t('app','Validation errors!'),\n\t\t \t\t\t\t'body' => Html::errorSummary($shipping,['class'=>'error-summary']),\n\t\t \t\t\t]),\n\t\t \t\t\t'status' => 500,\n\t\t \t\t];\n\t\t \t}\n\t \t}\n\t }else{\n \tthrow new NotFoundHttpException(Yii::t('yii', 'You are not allowed to perform this action.'));\n }\n }", "public function actionRevisedratesreport()\n {\n $res = AllocationManager::getRevisedRatesData();\n return $this->render('revised-rates-report',['res' => $res]);\n\n }", "function calcTotals(){\n\t\t\n\t\tif($this->Review == true){/*\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_percent` FROM `billship_tax_states` WHERE `tax_state` = '\".$this->CustBill['State'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_percent FROM billship_tax_states WHERE tax_state = '\".$this->CustBill['State'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_percent']/100);\n\t\t\t}\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_count_percent` FROM `billship_tax_county` WHERE `tax_count_zip` = '\".$this->CustBill['Zip'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_count_percent FROM billship_tax_county WHERE tax_count_zip = '\".$this->CustBill['Zip'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_count_percent']/100);\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Totals['Ship2'] > 0){\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_price` >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_price >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t\t\t\t\n\t\t\t\tif($getRate->TotalRows() == 0){\n\t\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_upper` = 'y';\");\n\t\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_upper = 'y';\");\n\t\t\t\t}\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t$test_1 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_2 = $this->Totals['Total']*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_weight` >= '$weight';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_weight >= '$weight';\");\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t\n\t\t\t\t$test_3 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_4 = $total*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$this->Totals['Ship2'] = ($test_1 < $test_2) ? $test_2 : $test_1;\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_3) ? $test_3 : $this->Totals['Ship2'];\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_4) ? $test_4 : $this->Totals['Ship2'];\n\t\t\t\tif(strlen(trim($this->Totals['Ship2'])) > 0) $this->Totals['Ship'] = $this->Totals['Ship2'];\n\t\t\t}\n\t\t*/\n\t\t}\n\t\t$this->Totals['Grand'] = $this->Totals['Total']+$this->Totals['Ship']+$this->Totals['Tax']-$this->Totals['Disc']+$this->Totals['Ext']+$this->Totals['Freight'];\n\t}", "public function show_shipping() {\n\t\tif ( ! wc_shipping_enabled() || ! $this->get_cart_contents() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'yes' === get_option( 'woocommerce_shipping_cost_requires_address' ) ) {\n\t\t\tif ( ! $this->get_customer()->has_calculated_shipping() ) {\n\t\t\t\tif ( ! $this->get_customer()->get_shipping_country() || ( ! $this->get_customer()->get_shipping_state() && ! $this->get_customer()->get_shipping_postcode() ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_ready_to_calc_shipping', true );\n\t}", "public function getShipping();", "function getShipping()\n {\n return array('name'=>'test','cost'=>4.5);\n }", "public function calculateshipping(Request $request)\n {\n $pickUp = $request->pickup;\n $pickupState = $request->pickupState;\n $dropOff = $request->dropoff;\n $dropoffState = $request->dropoffState;\n $totalShipping = 0;\n $finalShipping = 0;\n if (!empty($pickUp)) {\n $PickUpresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $pickupState],['shp.postcode', '=', $pickUp]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($PickUpresult) > 0) {\n $totalShipping = $totalShipping + $PickUpresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n if (!empty($dropOff)) {\n $DropOffresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $dropoffState],['shp.postcode', '=', $dropOff]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($DropOffresult) > 0) {\n $totalShipping = $totalShipping + $DropOffresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n $freightPrice = Config::get('constants.FreightPrice');\n if ($totalShipping > $freightPrice) {\n $finalShipping = $totalShipping - $freightPrice;\n }\n return $finalShipping;\n }", "function sundaysea_update_shipping()\n {\n if (is_null(WC()->cart)) {\n return;\n }\n\n // Constants\n if (!defined('WOOCOMMERCE_CART')) {\n define('WOOCOMMERCE_CART', true);\n }\n\n // Update Shipping\n if (!empty($_POST['calc_shipping'])) {\n\n try {\n WC()->shipping->reset_shipping();\n\n $country = wc_clean($_POST['calc_shipping_country']);\n $state = isset($_POST['calc_shipping_state']) ? wc_clean($_POST['calc_shipping_state']) : '';\n $postcode = apply_filters('woocommerce_shipping_calculator_enable_postcode', true) ? wc_clean($_POST['calc_shipping_postcode']) : '';\n $city = apply_filters('woocommerce_shipping_calculator_enable_city', false) ? wc_clean($_POST['calc_shipping_city']) : '';\n\n if ($postcode && !WC_Validation::is_postcode($postcode, $country)) {\n throw new Exception(__('Please enter a valid postcode/ZIP.', 'woocommerce'));\n } elseif ($postcode) {\n $postcode = wc_format_postcode($postcode, $country);\n }\n\n if ($country) {\n WC()->customer->set_location($country, $state, $postcode, $city);\n WC()->customer->set_shipping_location($country, $state, $postcode, $city);\n } else {\n WC()->customer->set_to_base();\n WC()->customer->set_shipping_to_base();\n }\n\n WC()->customer->calculated_shipping(true);\n\n wc_add_notice(__('Shipping costs updated.', 'woocommerce'), 'notice');\n\n do_action('woocommerce_calculated_shipping');\n\n } catch (Exception $e) {\n\n if (!empty($e))\n wc_add_notice($e->getMessage(), 'error');\n }\n }\n\n // Check cart items are valid\n do_action('woocommerce_check_cart_items');\n\n // Calc totals\n WC()->cart->calculate_totals();\n }", "public function index()\n {\n $zones=ShippingZones::all();\n foreach($zones as $zone) {\n $zone->classes=ShippingClasses::where('zone',$zone->id)->paginate(50);\n }\n $rates=ShippingTableRates::all();\n\n if(!empty($rates)) {\n foreach($rates as $rate){\n $class=ShippingClasses::find($rate->shipping_class);\n if(!empty($class->name)) {\n $rate->shipping_class_name=$class->name;\n }\n }\n return view('backend.shipping.rates.index')\n ->with([\n 'zones' => $zones,\n 'rates' => $rates\n ]);\n }\n }", "public function shippingCost()\n {\n return $this->shippingCalculator->run($this);\n }", "public function index()\n {\n $shippingcosts = Shippingcost::orderBy('amount', 'asc')->get();\n \n return view('backend.pages.shippingcost.shippingcost', compact('shippingcosts'));\n \n }" ]
[ "0.66954976", "0.65213865", "0.64654034", "0.642928", "0.6362043", "0.62424856", "0.6201578", "0.61881053", "0.6184997", "0.61217153", "0.61162", "0.61027414", "0.60715574", "0.60700554", "0.6062297", "0.6022593", "0.6014603", "0.60055894", "0.6001099", "0.59873646", "0.59839934", "0.59716153", "0.59662795", "0.5951078", "0.5945544", "0.59100807", "0.5904565", "0.5899063", "0.5889732", "0.5872282" ]
0.6556056
1
Update order items list
protected function updateOrderItems($order) { $list = new \XLite\View\ItemsList\Model\OrderItem( array( 'order' => $order, ) ); $list->processQuick(); $order->calculateInitialValues(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateItems()\n {\n if (count($this->items)) {\n foreach ($this->items as $item) {\n $item->setQuote($this);\n }\n }\n }", "public function entry_order_update()\n {\n $ids = explode(',', $this->input->post('order'));\n\n // Set the count by the offset for\n // paginated lists\n $order_count = $this->input->post('offset')+1;\n\n foreach ($ids as $id)\n {\n $this->db\n ->where('choice_id', $id)\n ->update('choices', array('ordering_count' => $order_count));\n\n ++$order_count;\n }\n }", "public function updateItems()\n {\n if (count($this->items)) {\n foreach ($this->items as $item) {\n $item->setInvoice($this);\n }\n }\n }", "public function testUpdateOrder()\n {\n }", "protected function updateItems()\n {\n $this->log(\"Loading items...\");\n\n /** @var Item[] $items */\n $items = Item::find()->all();\n\n foreach ($items as $item) {\n if (!$this->hasItemSavedValue($item->id)) {\n $this->saveItemValue($item->id, $item->getDefaultNAValue(), $item->type, false);\n }\n }\n\n $this->log(\"Done\");\n }", "public function save_items_order() {\n\t\n\t\t\tparse_str( $_REQUEST[ 'order' ], $order );\n\t\n\t\t\techo update_post_meta( intval( $_REQUEST[ 'gallery_id' ] ), 'items_order', $order );\n\t\n\t\t\texit;\n\t\t}", "public function readdItems($input) {\n $orderItems = \\App\\OrderItem::where('order_id', $input['order_id'])->get();\n foreach ($orderItems as $orderItem) {\n \\App\\Product::where('id', $orderItem->product_id)->increment('qty', $orderItem->qty);\n }\n }", "public function update_sort(){\n\n \tforeach ($_GET['listItem'] as $position => $item)\n {\n\n $this->model->findOrFail($item)->UPDATE([\n\n 'position' => $position\n\n ]);\n\n }\n\n return Lang::get($this->modName.'.Order_Update');\n\n \t}", "public function update_items($order_id, $update, $act = 'update')\n {\n\n $order_info = $this->get($order_id);\n if ($order_info == FALSE)\n return FALSE;\n\n $found_item = FALSE;\n $item_string = '';\n $place = 0;\n\n // Process items already on the order.\n foreach ($order_info['items'] as $item) {\n if ($item['hash'] == $update['item_hash']) {\n $found_item = TRUE;\n $quantity = ($act == 'update') ? ($item['quantity'] + $update['quantity']) : ($update['quantity']);\n } else {\n $quantity = $item['quantity'];\n }\n\n if ($quantity > 0) {\n if ($place++ !== 0) $item_string .= \":\";\n\n $item_string .= $item['hash'] . \"-\" . $quantity . \"-\" . $update['fx'].\"-\".$update['price'];\n }\n }\n // If we haven't encountered the item on the list, add it now.\n if ($found_item == FALSE) {\n if ($update['quantity'] > 0)\n $item_string .= ((strlen($item_string)>0)?':':'') . $update['item_hash'] . \"-\" . $update['quantity'] . \"-\". $update['fx'].\"-\".$update['price'];\n }\n\n // Delete order if the item_string is empty.\n if (empty($item_string)) {\n $this->delete($order_id);\n return TRUE;\n }\n\n $order = array('items' => $item_string,\n 'price' => $this->calculate_price($item_string),\n 'time' => time());\n\n $this->db->where('id', $order_id)\n ->where('progress', '0');\n return $this->db->update('orders', $order) == TRUE;\n\n }", "public function update_todo_items_order($data)\r\n {\r\n for ($i = 0; $i < count($data['data']); $i++) {\r\n $update = array(\r\n 'item_order' => $data['data'][$i][1],\r\n 'finished' => $data['data'][$i][2]\r\n );\r\n if ($data['data'][$i][2] == 1) {\r\n $update['datefinished'] = date('Y-m-d H:i:s');\r\n }\r\n $this->db->where('todoid', $data['data'][$i][0]);\r\n $this->db->update('tbltodoitems', $update);\r\n }\r\n }", "public function updateOrderAction() {\n //CHECK POST\n if ($this->getRequest()->isPost()) {\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n $values = $_POST;\n try {\n foreach ($values['order'] as $key => $value) {\n $row = Engine_Api::_()->getItem('sitemember_compliment_category', (int) $value);\n if (!empty($row)) {\n $row->order = $key + 1;\n $row->save();\n }\n }\n $db->commit();\n $this->_redirect('admin/sitemember/compliment');\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }", "public function updateToDoList(){\n\t\t$db = $this->db;\n\t\tif(count($this->errors)<1 && is_array($this->toDoList)){ //no error, to do list is an array\n\t\t\t\n\t\t\tforeach($this->toDoList as $item){\n\t\t\t\t$itemUUID = $item[\"itemUUID\"];\n\t\t\t\t$where = array();\n\t\t\t\t$where[] = \"itemUUID = '$itemUUID' \";\n\t\t\t\t$data = array('solr_indexed' => 1);\n\t\t\t\t$db->update('noid_bindings', $data, $where);\n\t\t\t}\n\t\t\t\n\t\t\t$this->totalIndexed = count($this->toDoList);\n\t\t}\n }", "public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function updateItemHashes()\n {\n foreach ($this->getItems() as $itemHash => $item) {\n $this->updateItemHash($itemHash);\n }\n }", "public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' => serialize($this->_items)\n );\n //udpate order table\n if ($order_id) {\n $order_data['date_modified'] = date(\"Y-m-d H:i:s\");\n $this->_order->update($order_data, $order_id);\n } else {\n $order_data['date_added'] = date(\"Y-m-d H:i:s\");\n $order_id = $this->_order->save($order_data);\n }\n // echo $order_id; \n }", "public function updateordersAction()\n {\n $this->getResponse()->setBody(self::getHelper()->updateorders());\n\n }", "public function updateOrderStatusForSellerItems($itemsArr, $orderId)\r\n {\r\n foreach ($itemsArr as $item) {\r\n /**\r\n * Get status based on order item\r\n */\r\n $status = Mage::helper('marketplace/vieworder')->getOrderStatusForSellerItemsBased($item);\r\n\r\n /**\r\n * Inilize product id\r\n */\r\n $itemProductId = $item->getProductId();\r\n\r\n /**\r\n * Load commission collection\r\n */\r\n $products = Mage::getModel('marketplace/commission')->getCollection();\r\n $products->addFieldToSelect('*');\r\n\r\n /**\r\n * Filter by order id and product id\r\n */\r\n $products->addFieldToFilter('order_id', $orderId);\r\n $products->addFieldToFilter('product_id', $itemProductId);\r\n $collectionId = $products->getFirstItem()->getId();\r\n\r\n /**\r\n * Checking for collection id exist or not\r\n */\r\n if (!empty($collectionId)) {\r\n /**\r\n * Initilize order item status\r\n */\r\n $data = array('item_order_status' => $status);\r\n $model = Mage::getModel('marketplace/commission')->load($collectionId)->addData($data);\r\n\r\n /**\r\n * Save model\r\n */\r\n $model->setId($collectionId)->save();\r\n }\r\n }\r\n }", "function uc_order_pane_line_items_update($form, &$form_state) {\n $commands[] = ajax_command_replace('#order-line-items', trim(drupal_render($form['line_items'])));\n $commands[] = ajax_command_prepend('#order-line-items', theme('status_messages'));\n\n return array('#type' => 'ajax', '#commands' => $commands);\n}", "public function updateExtList() {}", "public function updateAdapterOrder($order)\n {\n $dba = $this->getAdapter();\n \n $dba->beginTransaction();\n\n $i = 1;\n foreach ($order as $o) {\n\n $data = array(\"displayOrder\" => $i);\n\n $where = $dba->quoteInto('adapterKey = ?', $o);\n\n try {\n $this->update($data, $where);\n } catch(Exception $e) {\n $dba->rollBack();\n throw $e;\n }\n $i++;\n }\n \n $dba->commit();\n }", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "public function updateOrder()\n\t{\n\t\tApp::error(function(ModelNotFoundException $e)\n\t\t{\n\t\t\tApp::abort(404);\n\t\t});\n\t\t\n\t\t$objectarray = Input::get('objectarray');\n\t\t// rsort($objectarray);\n\t\t// print_r($objectarray[0]->id); exit;\n\n\t\t$counter = sizeof($objectarray);\n\t\tforeach ($objectarray as $object) {\n\t\t\tDB::update('UPDATE estimate_entries SET sortorder = '.$counter.' WHERE id='.$object['id']);\n\t\t\t$counter--;\n\t\t}\n\t\t//UPDATE comments SET post_id = 10 WHERE id IN (3,6,23,56)\n\n\t\t// $entry = EstimateEntry::findOrFail($id);\n\n\t\t// $get = Input::get();\n\t\t// $entry->title = $get['title'];\n\t\t// $entry->hours = isset($get['hours']) ? $get['hours'] : $entry->hours;\n\n\t\t// $entry->save();\n\n\t\treturn $objectarray;\n\t}", "public function updateItems($products)\n {\n }", "public function orderUpdate()\n {\n $this->helper->logOrder('Beginning Order Update.');\n $stores = $this->storeManager->getStores();\n\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = null;\n\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_RECEIVED,\n $this->helper::ORDER_STATUS_PLANNING,\n $this->helper::ORDER_STATUS_PROCESSING,\n ],\n ]\n );\n\n if (!empty($ordersToProcess) && $ordersToProcess->count()) {\n $this->helper->logOrder('Beginning Order Update for ' . $ordersToProcess->count() . ' orders.');\n\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Updating order #' . $order->getIncrementId());\n\n $result = $this->outbound->getFulfillmentOrder($order);\n if ($result) {\n $fulfillmentOrderResult = $result->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING / CANCELLED / COMPLETE\n // / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $amazonOrderId = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getDisplayableOrderId();\n\n $id = $order->getIncrementId();\n if ($order->getIncrementId() == $amazonOrderId) {\n $this->helper->logOrder(\n 'Status of order #' . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if ($amazonStatus) {\n switch ($amazonStatus) {\n case 'COMPLETE':\n case 'COMPLETE_PARTIALLED':\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n break;\n case 'INVALID':\n case 'CANCELLED':\n case 'UNFULFILLABLE':\n $this->cancelFBAShipment($order, $fulfillmentOrderResult);\n break;\n }\n }\n }\n }\n }\n\n $this->helper->logOrder(__('Get Order status called. Orders to process: ') . $ordersToProcess->count());\n } else {\n $this->helper->logOrder(__('Get Order status called. No orders to process'));\n }\n }\n }", "public function updateOrder() {\n\n echo \"ok\";\n }", "public function reloadItems();", "public function update_order($data)\n\t{\n\t\t$this->EE->cartthrob->cart->update_order($data);\n\t}", "public function testUpdateOrderCustomFields()\n {\n }", "public function Admin_Action_UpdateBlocksOrder() {\n $blockIds = $this->_getPOSTRequest ( 'blockid', array() );\n foreach ($blockIds as $order => $blockid) {\n $query = \"UPDATE\" . \" [|PREFIX|]dynamic_content_block \" . \" SET sortorder = '$order' WHERE blockid = '\" . intval($blockid) . \"'\";\n $this->db->Query ( $query );\n }\n return;\n }" ]
[ "0.7627306", "0.72032374", "0.7074875", "0.6977802", "0.6823428", "0.6756578", "0.6735706", "0.6704058", "0.6536095", "0.6531182", "0.6529352", "0.6511041", "0.63936687", "0.634916", "0.6324935", "0.630947", "0.6256919", "0.62137276", "0.6193889", "0.6186034", "0.6157657", "0.61411405", "0.6135484", "0.61139673", "0.6102548", "0.60972387", "0.6082108", "0.60749876", "0.6061648", "0.604396" ]
0.76473844
0
Check need send recalculate event or not
protected function needSendRecalculateEvent(\XLite\Model\Order $order) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function needs_calculation() {\n\n\t\t$needs_calculation = (\n\t\t\tdoing_action( 'wc_ajax_update_order_review' ) ||\n\t\t\tdoing_action( 'wp_ajax_woocommerce_update_order_review' ) ||\n\t\t\tdoing_action( 'wp_ajax_nopriv_woocommerce_update_order_review' ) ||\n\t\t\tWC()->session->get( 'reload_checkout' ) ||\n\t\t\tisset( $_POST['woocommerce_checkout_update_totals'] )\n\t\t);\n\n\t\t/**\n\t\t * Filter whether the cart needs new taxes calculated.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param $needs_calculation Whether the cart needs new taxes calculated.\n\t\t */\n\t\treturn (bool) apply_filters( 'wc_avatax_cart_needs_calculation', $needs_calculation );\n\t}", "public function calculateValuation(): bool\n {\n return 0;\n }", "public function calculateProfit(): bool\n {\n return true;\n }", "public function hasUpdate();", "public function runUpdate($recalculate = true)\n {\n //order is important!\n $this->checkField('DefaultCountry', $recalculate);\n $this->checkField('Country', $recalculate);\n $this->checkField('DefaultRate', $recalculate);\n $this->checkField('CurrentRate', $recalculate);\n $this->checkField('TaxType', $recalculate);\n $this->checkField('RawTableValue', $recalculate);\n $this->checkField('DebugString', $recalculate);\n parent::runUpdate($recalculate);\n }", "function validate_on_update() {}", "public function is_update(){\n\t\tglobal $_wt_options;\n\t\tif($this->is_init() && $_wt_options->options(\"eventbrite_auto_update\") ==1) return 1;\n\t\treturn 0;\n\t}", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "function isChanged(): bool;", "private function ready_for_calculation() {\n\n if ( ! WC()->customer->get_shipping_country() || ! WC()->customer->get_shipping_state() || ! WC()->customer->get_shipping_postcode() ) {\n return false;\n }\n\n\t\t// first check that we're on the checkout page\n\t\t$ready_for_calculation = ( defined( 'WOOCOMMERCE_CHECKOUT' ) && WOOCOMMERCE_CHECKOUT ) || isset( $_POST['woocommerce_checkout_update_totals'] );\n\n\t\t// next check that the basic minimum address info is available\n\t\t$ready_for_calculation = ( $ready_for_calculation && WC()->customer->get_shipping_country() && $this->is_taxable() );\n\n\t\t// check the locale for required region & postcode fields\n\t\t$locale_fields = WC()->countries->get_address_fields( WC()->customer->get_shipping_country(), 'shipping_' );\n\n\t\tif ( $locale_fields['shipping_state']['required'] && ! WC()->customer->get_shipping_state() ) {\n\t\t\t$ready_for_calculation = false;\n\t\t}\n\n\t\tif ( $locale_fields['shipping_postcode']['required'] && ! WC()->customer->get_shipping_postcode() ) {\n\t\t\t$ready_for_calculation = false;\n\t\t}\n\n\t\t/**\n\t\t * Filter whether the front-end is ready for tax calculation.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param $ready_for_calculation Whether the front-end is ready for tax calculation.\n\t\t */\n\t\treturn (bool) apply_filters( 'wc_avatax_checkout_ready_for_calculation', $ready_for_calculation );\n\t}", "public static function event_method()\n {\n return true;\n }", "public function getRevalidate() : bool {\n return $this->revalidate;\n }", "public function hasChanged(): bool;", "public function hasChanged(): bool;", "public function calculate();", "public function calculate();", "public function hasChanged();", "public function hasChanged();", "public function isValueChanged();", "private function fireEvent() {\n $random = rand(0, 100);\n if ($random < $this->probablity) {\n return true;\n }\n return false;\n }", "protected function _expireAjax()\n {\n $quote = $this->getOnepage()->getQuote();\n if (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n return true;\n }\n $action = $this->getRequest()->getActionName();\n if ($this->_objectManager->get(\\Magento\\Checkout\\Model\\Session::class)->getCartWasUpdated(true)\n &&\n !in_array($action, ['index', 'progress'])\n ) {\n return true;\n }\n\n return false;\n }", "public function recalc() {\n $this->_recalcBanner();\n $this->_recalcAdv();\n $this->_recalcAdvGroup();\n $this->_recalcCampaign();\n $this->_recalcProject();\n $this->_recalcSite();\n }", "public function isNeedUpdate()\n {\n if (is_null($this['episode_update_date'])){\n return true;\n }\n if (Carbon::now()->diffInDays(new Carbon($this['episode_update_date'])) > 3){\n return true;\n }\n return false;\n }", "public function isDispatched() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->dispatchDate) ? false: true;\r\n\t}", "public function ensureTotals($Event, $Event_type){\n\t\t# Check\n\t\tif ( !in_array($Event_type,array('preSave')) ) {\n\t\t\t# Not designed for these events\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t# Fetch\n\t\t$InvoiceItem = $Event->getInvoker();\n\t\t\n\t\t# --------------------------\n\t\t# Ensure\n\t\t\n\t\t# Apply Totals\n\t\t$InvoiceItem->applyTotals();\n\t\t\n\t\t# --------------------------\n\t\t\n\t\t# Return true\n\t\treturn true;\n\t}", "public function getShouldUpdate() {\n if (!$this->isReady()) {\n return false;\n }\n\n switch ($this->class) {\n case Source::CLASS_DATA:\n return (time() - $this->lastUpdated) > $this->source->getFrequency();\n break;\n case Source::CLASS_SENSOR:\n return false;\n break;\n }\n }", "protected static function checkIfRebuildStarted()\n {\n if (static::isRebuildBlock() && static::checkRebuildIndicatorState()) {\n static::triggerMaintenanceModeError();\n }\n }", "function process() // OK\n { \n if(! $this->validate()) {\n\t $this->_errors->addError('Failed at event validation.');\n\t return false;\n }\n \n $this->_getTransactions();\n \n// -- added\n if(! $this->validate()) {\n\t $this->_errors->addError('Failed after dynamic validations.');\n\t return false;\n }\n// --\n if (! $this->_executeTransactions()) return false;\n else return $this->storeEventDetail();\n }", "public function needUpdate()\n\t{\n\t\treturn ($this->getLastUpdate() == null || time() - $this->getLastUpdate()->format('U') > 1 * 60);\n\t}", "public function needsRefreshing()\n {\n return $this->isExpired() || ! $this->isLoaded();\n }" ]
[ "0.61382705", "0.5806574", "0.5702546", "0.5677533", "0.56045693", "0.55900747", "0.55342865", "0.54995674", "0.54970926", "0.5463817", "0.5463466", "0.5438772", "0.5418894", "0.5418894", "0.54172957", "0.54172957", "0.53776896", "0.53776896", "0.5369412", "0.5292795", "0.5289232", "0.5285263", "0.527253", "0.5260012", "0.5251717", "0.52358544", "0.52248955", "0.52156544", "0.5212858", "0.52113485" ]
0.65978974
0