query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Generated from protobuf field string definition = 7;
public function setDefinition($var) { GPBUtil::checkString($var, True); $this->definition = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefinition(): string {\n return \"`{$this->name}` {$this->type}\";\n }", "public function getDefinition()\n {\n return \"\";\n }", "function get_field_name( $str ){\n\t\treturn 'field-'.$this->id_base.'['.$this->number.']['.$str.']';\n\t}", "public function toString() {\n return nameof($this).'<'.$this->marker.'>('.strlen($this->bytes).' bytes)';\n }", "protected function createString() {\n\t\tswitch ( $this->columnSchema[ self::COLUMN_DEFINITION_TYPE ] ) {\n\t\t\tcase self::COLUMN_TYPE_CHAR:\n\t\t\tcase self::COLUMN_TYPE_VARCHAR:\n\t\t\t\t$maxLen = $this->columnSchema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ];\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_TEXT:\n\t\t\tcase self::COLUMN_TYPE_MEDIUMTEXT:\n\t\t\tcase self::COLUMN_TYPE_LONGTEXT:\n\t\t\t\t$maxLen = NULL;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$string =\n\t\t\t\t$this->columnSchema[ self::COLUMN_DEFINITION_TYPE ]\n\t\t\t\t. ( !empty( $maxLen ) ? '(' . $maxLen . ')' : '' )\n\t\t\t\t. ( isset( $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] ) && $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] !== NULL\n\t\t\t\t\t\t? ' DEFAULT \"' . $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] . '\"'\n\t\t\t\t\t\t: '' )\n\t\t\t\t. ( isset( $this->columnSchema[ self::COLUMN_DEFINITION_IS_NULLABLE ] )\n\t\t\t\t\t\t? ( strtolower( $this->columnSchema[ self::COLUMN_DEFINITION_IS_NULLABLE ] ) == 'no' ? ' NOT NULL' : '' )\n\t\t\t\t\t\t: '' );\n\n\t\treturn $string;\n\t}", "function descriptor_def()\n {\n // @todo: replace this with proper descriptor fields.\n return \"[id]\";\n }", "function get_field_id( $str ){\n\t\treturn 'field-'.$this->id_base.'-'.$this->number.'-'.$str;\n\t}", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function Create ( )\r\n\t {\r\n\t\t$default\t= '' ;\r\n\t\t\r\n\t\tif ( $this -> StringSize < 16384 )\t\t// Not really the maximum size of a VARCHAR, but we have to fix a limit\r\n\t\t {\r\n\t\t\t$value_type\t= \"VARCHAR( {$this -> StringSize} )\" ;\r\n\t\t\t$default\t= \"DEFAULT ''\" ;\r\n\t\t }\r\n\t\telse if ( $this -> StringSize < 65536 )\r\n\t\t\t$value_type\t= \"TEXT\" ;\r\n\t\telse if ( $this -> StringSize < 16 * 1024 * 1024 )\r\n\t\t\t$value_type\t= \"MEDIUMTEXT\" ;\r\n\t\telse\r\n\t\t\t$value_type\t= \"LONGTEXT\" ;\r\n\t\t\r\n\t\tif ( $this -> StringIndexSize )\r\n\t\t\t$value_index\t= \"KEY\t\t( value( {$this -> StringIndexSize} ) ),\" ;\r\n\t\telse\r\n\t\t\t$value_index\t= '' ;\r\n\t\t\r\n\t\t$sql\t= <<<END\r\nCREATE TABLE IF NOT EXISTS {$this -> Name}\r\n (\r\n\tid\t\tBIGINT UNSIGNED\t\tNOT NULL AUTO_INCREMENT\r\n\t\t\t\t\t\tCOMMENT 'Unique id for this string entry',\r\n\ttype\t\tINT\t\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'Value type ; can be used to differentiate between value groups',\r\n\tchecksum\tINT UNSIGNED\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'CRC32 hash of the string value',\r\n\t\r\n\tvalue\t\t$value_type \t\tNOT NULL $default\r\n\t\t\t\t\t\tCOMMENT 'String value',\r\n\t\t\t\t\t\t\r\n\tPRIMARY KEY\t( id ),\r\n\t$value_index\r\n\tKEY\t\t( type, checksum )\r\n ) ENGINE = MyISAM CHARSET latin1 COMMENT '{$this -> Comment}' ;\r\nEND;\r\n\t\t\r\n\t\tmysqli_query ( $this -> Database, $sql ) ;\r\n\t }", "public function definition()\n {\n $str = 'भौतिकशास्त्रमा प्राप्त उपलब्धिहरूले प्रविधि विकास र अर्थतन्त्रमा पुर्‍याउने योगदान त छँदै छ, भौतिक विज्ञानका खासखास सिद्धान्तहरू अर्थशास्त्रको व्याख्यामा पनि उपयोगी देखिएकाले अर्थशास्त्र र भौतिकशास्त्रलाई मिलाएर नयाँ शब्दावली प्रयोगमा ल्याइएको छ— ‘इकोनोफिजिक्स’ भौतिकशास्त्री युजिन स्ट्यान्लीले सन् १९९५ मा जटिल प्रणालीहरूको गतिशीलतासम्बन्धी कोलकाता सम्मेलनमा यो शब्द पहिलो पटक प्रयोग गरेका थिए बजारको गतिशीलता र सम्पत्ति–आम्दानीको वितरण पद्धतिको अध्ययनमा इकोनोफिजिक्स निकै उपयोगी पाइएको सम्बद्ध अर्थशास्त्री र भौतिकशास्त्रीहरूको दाबी छ डिसेम्बर २०१७ मा अमेरिकन इकोनोमिक एसोसिएसन (एईए) ले इकोनोफिजिक्सबारे आयोजना गरेको सम्मेलनलाई एउटा महत्त्वपूर्ण कदमका रूपमा लिँदै यी दुवै विधा मिलाएर गरिएका अध्ययनहरू वित्तीय संकट हल गर्न उपयोगी हुने बताइएको थियो इकोनोफिजिक्स अवधारणा त्यति पुरानो नभए पनि युरोप र अमेरिकाका केही विश्वविद्यालयमा यसको पढाइ हुँदै आएको छ नेपालमा पनि सन् २०१५ देखि त्रिभुवन विश्वविद्यालयमा पढाउन थालिएको छ अर्थशास्त्रलाई समाज विज्ञानको भौतिकशास्त्र पनि भन्ने गरिन्छ जसरी सूक्ष्म कणदेखि ब्रह्माण्डका ठूलठूला पिण्डसम्मलाई गति दिन ऊर्जाको प्रयोग भएको हुन्छ भन्दै भौतिकशास्त्रमा ऊर्जालाई नै आधार मानेर प्राकृतिक प्रक्रियाहरूको व्याख्या गरिन्छ, त्यसरी नै पुँजीले सामाजिक गतिविधिहरू पैदा गराउँछ भन्ने मान्यताअनुसार अर्थशास्त्रमा सामाजिक प्रक्रियाहरूको व्याख्या हुने गर्छ भौतिक विज्ञानका थुप्रै समीकरण अर्थशास्त्रका क्षेत्रमा पनि उस्तै किसिमले लागू हुन सक्ने देखिन्छ, भलै भौतिक विज्ञानमा प्रयोग हुने भौतिक परिमाण र अर्थशास्त्रमा प्रयोग हुने परिमाण बुझाउने शब्द र सूचक फरक हुन सक्छन्';\n $nepaliWord = explode(\" \",$str);\n $nepaliWord = array_unique($nepaliWord);\n $tag = $nepaliWord[array_rand($nepaliWord)];\n return [\n 'name' => $tag,\n 'slug' => $tag,\n ];\n }", "public static function generateSchemaForTypeString( array $fieldConf ) {\n\t\t$schema = array();\n\n\t\t// determine type and maxLen\n\t\tif ( empty( $fieldConf[ 'maxLen' ] ) || intval( $fieldConf[ 'maxLen' ] ) < 0 ) {\n\t\t\t$fieldConf[ 'maxLen' ] = 65535;\n\t\t}\n\n\t\tif ( $fieldConf[ 'maxLen' ] > 255 ) { // no maximum length or greater than 255 forces a \"text\" typ\n\n\t\t\tif ( $fieldConf[ 'maxLen' ] <= 65535 ) {\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = self::COLUMN_TYPE_TEXT;\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = 65535; // TEXT\n\t\t\t} else if ( $fieldConf[ 'maxLen' ] <= 16777215 ) {\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = self::COLUMN_TYPE_MEDIUMTEXT;\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = 16777215; // MEDIUMTEXT\n\t\t\t} else {\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = self::COLUMN_TYPE_LONGTEXT;\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = 4294967295; // LONGTEXT\n\t\t\t}\n\n\t\t} else if ( $fieldConf[ 'maxLen' ] < 256 ) {\n\t\t\tif ( empty( $fieldConf[ 'fixedLen' ] ) ) { // fixedLen == true means it's a char, otherwise it's a varchar\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = self::COLUMN_TYPE_VARCHAR;\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = $fieldConf[ 'maxLen' ];\n\t\t\t} else {\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_TYPE ] = self::COLUMN_TYPE_CHAR;\n\t\t\t\t$schema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ] = $fieldConf[ 'maxLen' ];\n\t\t\t}\n\t\t}\n\n\t\t//set default\n\t\t$schema[ self::COLUMN_DEFINITION_DEFAULT ] = $fieldConf[ 'default' ];\n\n\t\t//set nullable\n\t\t$schema[ self::COLUMN_DEFINITION_IS_NULLABLE ] = ( !empty( $fieldConf[ 'nullable' ] ) ? 'YES' : 'NO' );\n\n\t\t//set character set\n\t\t$schema[ self::COLUMN_DEFINITION_CHARSET ] = ( !empty( $fieldConf[ 'charset' ] ) ? $fieldConf[ 'charset' ] : 'utf8' );\n\n\t\t//set collation\n\t\t$schema[ self::COLUMN_DEFINITION_COLLATION ] = ( !empty( $fieldConf[ 'collation' ] ) ? $fieldConf[ 'collation' ] : 'utf8_general_ci' );\n\n\t\t//set auto increment\n\t\t$schema[ self::COLUMN_DEFINITION_EXTRA ] = NULL; // string types can't have auto_increment\n\n\t\t//set precision\n\t\t$schema[ self::COLUMN_DEFINITION_PRECISION ] = NULL; // only applicable for numeric types\n\n\t\t//set scale\n\t\t$schema[ self::COLUMN_DEFINITION_SCALE ] = NULL; // only applicable for numeric types\n\n\t\treturn $schema;\n\t}", "public function toString() {\n return nameof($this).'('.str_repeat('*', strlen($this->bytes)).')';\n }", "static function writeStringLength(?string $str): string {\n if($str === null) {\n // \\xFB (251)\n return \"\\xFB\";\n }\n \n $length = \\strlen($str);\n if($length <= 250) {\n return static::writeInt1($length).$str;\n }\n \n if($length <= 0xFFFF) { // max 2^16: \\xFC (252)\n return \"\\xFC\".static::writeInt2($length).$str;\n }\n \n if($length <= 0xFFFFFF) { // max 2^24: \\xFD (253)\n return \"\\xFD\".static::writeInt3($length).$str;\n }\n \n return \"\\xFE\".static::writeInt8($length).$str; // max 2^64: \\xFE (254)\n }", "function Definition($string)\n{\n [$definition, $substr] = ExecutableDefinition($string);\n if ($definition !== null) {\n $definition['__Definition'] = 'ExecutableDefinition';\n return [$definition, $substr];\n }\n\n [$definition, $substr] = TypeSystemDefinition($string);\n if ($definition !== null) {\n $definition['__Definition'] = 'TypeSystemDefinition';\n return [$definition, $substr];\n }\n\n [$definition, $substr] = TypeSystemExtension($string);\n if ($definition !== null) {\n $definition['__Definition'] = 'TypeSystemExtension';\n return [$definition, $substr];\n }\n\n Parser::throwSyntax('Definition', $string);\n}", "public static function key_field($str) {\n\t\treturn 'field_' . self::key($str);\n\t}", "public static function getDescriptor()\n {\n \tstatic $descriptor;\n if (!isset($descriptor)) {\n $desc = new ProtocolBuffersDescriptorBuilder();\n\t\t\t$desc->addField(1, new ProtocolBuffersFieldDescriptor(array(\n\t\t\t\t\"type\" => ProtocolBuffers::TYPE_STRING,\n\t\t\t\t\"name\" => \"regPlace\",\n\t\t\t\t\"required\" => true,\n\t\t\t\t\"optional\" => false,\n\t\t\t\t\"repeated\" => false,\n\t\t\t\t\"packable\" => false,\n\t\t\t\t\"default\" => \"\",\n\t\t\t)));\n $descriptor = $desc->build();\n }\n\n return $descriptor;\n }", "public function testLengthIs191ByDefault()\n {\n $this->assertEquals(191, (new StringField('some_string'))->getLength());\n }", "public function createPayload(): string\n {\n return '';\n }", "public static function constant($str)\n {\n return self::scream($str);\n }", "public function build()\n {\n # Fixed Header\n # Control Packet Type\n $cmd = $this->getMessageType() << 4;\n\n $cmd |= ($this->reserved_flags & 0x0F);\n\n $header = chr($cmd) . $this->remaining_length_bytes;\n\n $header .= $this->buildVariableHeader();\n\n return $header;\n }", "public function build(): string;", "public function build(): string;", "public function getType(): string\n {\n return self::TYPE_STRING;\n }", "public function getType(): string\n {\n return self::TYPE_STRING;\n }", "public function __toString()\n {\n return $this->string(6);\n }", "public function structure()\n\t{\n\t\t$structure=\"\";\n\t\tfor ($i=0;$i<count($this->tokens);++$i)\n\t\t{\n\t\t\t$c=$this->tokens[$i]['type'][0];\n\t\t\tif ($this->tokens[$i]['type']=='symbol')\n\t\t\t\t$c=\"@\";\n\t\t\tif ($this->tokens[$i]['type']==self::TYPE_STRING)\n\t\t\t\t$structure.=\"'str'\";\n\t\t\telseif ($this->tokens[$i]['type']==self::TYPE_NUMBER)\n\t\t\t\t$structure.=\"1\";\n\t\t\telse\n\t\t\t\t$structure.=$this->tokens[$i]['clean'];\n\t\t\t$structure.=\" \";\n\t\t\tif ($c=='c') //single line comment\n\t\t\t\t$structure=substr($structure,0,-1).\"\\n \";\n\t\t}\n\t\treturn $structure;\n\t}", "public function getStringOffset() {}", "function build(): string\n {\n return 'filled';\n }", "public function get_definition_tuple($parent, $string_def) { \n\n\t// Extract child numbers\n\t$address_definition = explode(\"/\", $string_def);\n\t\t\n\t// Load the depth of the parent key.\n\t$import = $this->import($parent);\n\t$depth = $import['depth']; \n\t\t\n\t// Start building the address bytes tuple\n\tforeach ($address_definition as &$def) {\n\n\t\t// Check if we want the prime derivation\n\t\t$want_prime = 0;\n\t\tif(strpos($def, \"'\") !== false) {\n\t\t\t// Remove ' from the number, and set $want_prime\n\t\t\tstr_replace(\"'\", '', $def);\n\t\t\t$want_prime = 1;\n\t\t}\n\n\t\t// Calculate address byres\n\t\t$and_result = ($want_prime == 1) ? $def | 0x80000000 : $def;\n\t\t$hex = unpack(\"H*\", pack(\"N\", $and_result)); \n\t\t$def = $hex[1];\n\t\t$depth++;\n\t}\n\t\n\t// Reverse the array (to allow array_pop to work) and return.\n\treturn array_reverse($address_definition);\n\n}", "function descriptor_def()\n {\n return \"[description]\";\n }", "public function definition()\n {\n return [\n 'name' => 'ارسال کل کلمه',\n 'descriptor' => 'ALL_WORD',\n 'enable' => true\n ];\n }", "public function getStringValue()\n {\n return $this->readOneof(3);\n }", "public function getStringRepresentation(): string;", "public function testStringFields()\n {\n $field = $this->table->getField('stringone');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertTrue($field->isNullOk());\n $this->assertEquals(50, $field->getMaxCharacters());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('stringtwo');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertFalse($field->isNullOk());\n $this->assertEquals(\"'ABCDE'::bpchar\", $field->getDefaultValue());\n $this->assertEquals(5, $field->getMaxCharacters());\n\n $field = $this->table->getField('stringthree');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertTrue($field->isNullOk());\n $this->assertEquals(\"'blah blah'::text\", $field->getDefaultValue());\n $this->assertNull($field->getMaxCharacters());\n }", "public function getRepeatedStringFieldCount()\n {\n return $this->count(self::REPEATED_STRING_FIELD);\n }", "protected function get_schema() {\n\t\treturn [\n\t\t\t'description' => __( 'Content of the reminder.' ),\n\t\t\t'type' => Type::STRING,\n\t\t];\n\t}", "private static function stringField($type, $size)\n {\n $obj = new StringField();\n $obj->type = $type;\n $obj->size = $size;\n $obj->encoding = 'utf8_general_ci';\n\n return $obj;\n }", "protected function buildSchemaField() {\n if (!empty($this->entityPropertyInfo['key'])) {\n return $this->processValueTemplate('%property_schemas_fields_name_base%');\n }\n }", "function string_get_field_name( $p_string ) {\r\n\r\n\t$t_map = array(\r\n\t\t\t'last_updated' => 'last_update',\r\n\t\t\t'id' => 'email_bug'\r\n\t\t\t);\r\n\r\n\t$t_string = $p_string;\r\n\tif ( isset( $t_map[ $p_string ] ) ) {\r\n\t\t$t_string = $t_map[ $p_string ];\r\n\t}\r\n\treturn lang_get_defaulted( $t_string );\r\n}", "public function getXsiTypeName() {\n return \"ReportDefinitionField\";\n }", "public function getSQLDefinition()\n {\n // Index columns are always of the same type\n if ($this->columnName == IESDataColumnType::INDEX_COLUMN_NAME) {\n return \"{$this->columnName} INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY\";\n }\n\n $type = \"\";\n $nullSuffix = $this->nullable ? \"NULL\" : \"NOT NULL\";\n\n if ($this->dataType == IESDataColumnType::STRING) {\n $type = \"VARCHAR({$this->getColumnLength()})\";\n } else if ($this->dataType == IESDataColumnType::BOOLEAN) {\n $type = \"BIT\";\n } else if ($this->dataType == IESDataColumnType::FLOAT) {\n $type = \"DECIMAL(13,4)\";\n } else if ($this->dataType == IESDataColumnType::INTEGER) {\n $subType = $this->getIntegerSubType();\n\n if ($subType == IESDataColumnIntegerTypes::SIGNED_BYTE)\n $type = \"TINYINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_SHORT)\n $type = \"SMALLINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_INTEGER)\n $type = \"INTEGER SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::SIGNED_LONG)\n $type = \"BIGINT SIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_BYTE)\n $type = \"TINYINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_SHORT)\n $type = \"SMALLINT UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_INTEGER)\n $type = \"INTEGER UNSIGNED\";\n else if ($subType == IESDataColumnIntegerTypes::UNSIGNED_LONG)\n $type = \"BIGINT UNSIGNED\";\n }\n\n return \"`{$this->columnName}` {$type} {$nullSuffix}\";\n }", "public function getMessageType(int $position = 9): string\n {\n $typeField = $this->getField($position);\n if (!empty($typeField) && is_array($typeField)) {\n return (string) $typeField[0];\n }\n return (string) $typeField;\n }", "public function __toString()\n {\n $type = $this->typeAsString();\n $str = \"'{$this->name}' {$type}\";\n $str .= ($this->_length > 0) ? \"({$this->_length})\" : \"\";\n $str .= \" {$this->size}\";\n $str .= ($this->isPrimaryKey()) ? \" PRIMARY KEY\" : \"\";\n $str .= ($this->isNotNull()) ? \" NOT NULL\" : \" NULL\";\n $str .= ($this->isUnsigned()) ? \" UNSIGNED\" : \"\";\n $str .= ($this->isAutoIncrement()) ? \" AUTO INCREMENT\" : \"\";\n $str .= (!is_null($this->default)) ?\n \" DEFAULT '{$this->default}'\" : \"\";\n $str .= (!is_null($this->description)) ?\n \" DESCRIPTION '{$this->description}'\" : \"\";\n return $str;\n }", "public function getTypeString(){\n\t\t$typeStr=\"\";\n\t\tswitch($this->type){\n\t\t\tcase \"fixed\": $typeStr=_(\"Montant fixe\");break;\n\t\t\tcase \"percentage\": $typeStr=_(\"Pourcentage\");break;\n\t\t\tcase \"percentage_no_transport\": $typeStr=_(\"Pourcentage sans transport\");break;\n\t\t\tcase \"transport\": $typeStr=_(\"Frais de port\");break;\n\t\t\tcase \"grid\": $typeStr=_(\"Variable\");break;\n\t\t}\n\t\treturn $typeStr;\n\t}", "public function getCellphone7Attribute()\n {\n return substr($this->cellphone, -7);\n }", "function __toString() {\n return 'Invalid Field';\n }", "function read_string(&$payload) {\n $length = read_uint32($payload);\n $string = \\substr($payload, 0, $length);\n $payload = \\substr($payload, $length);\n\n return $string;\n}", "public function getStringId()\n\t{\n\t\treturn 'id_' . $this->getId();\n\t}", "private function getSendTransferRequest(): string\n {\n // may be changed by linters and other tools, and because it contains line breaks, which are different depending\n // the platform where this test runs.\n return 'HKCCS:3:1+DExxABCDEFGH1234567890:BYLADEM1001:1234567890::280:12030000+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.003.03+@'\n . strlen(self::PAIN_MESSAGE) . '@' . self::PAIN_MESSAGE . \"'HKTAN:4:6+4+HKCCS+++++++++SomePhone1'\";\n }", "public function getDefaultDefinition(): string;", "function getEncodedMessage(): string {\n return \\chr(static::COMMAND_ID).$this->rewrittenQuery;\n }", "public function withStringSampleSize(UnsignedInteger $stringSampleSize): static;", "public function testStringTooLong()\n {\n $this->expectException(UnexpectedValueException::class);\n\n $maxDescription = str_repeat('x', 101);\n\n $createPaymentAccountRequest = new CreatePaymentAccountRequest(\n $maxDescription,\n 'PAYMENT_BUSINESS'\n );\n }", "public function getText()\n {\n return $this->readOneof(4);\n }", "public function getValidatorSetUp(): string\n {\n return '\n $properties = $value;\n $invalidProperties = [];\n ';\n }", "public function generate()\n {\n return $this->_string;\n }", "public function getStringSampleSize(): UnsignedInteger;", "public function build(): string\n {\n $this->verifyBom($this->encoding, $this->description);\n $this->_handleDefaultValues();\n\n $frame = $this->encoding->getCode();\n $frame .= $this->mimeType;\n $frame .= \"\\x00\";\n $frame .= $this->pictureType;\n $frame .= $this->description;\n $frame .= $this->encoding->getDelimiter();\n $frame .= $this->pictureData;\n\n return $frame;\n }", "public function createVariableHeader(): string\n {\n return $this->getPacketIdentifierBinaryRepresentation();\n }", "public function __construct()\n {\n $this->maxWordLength = 13;\n $this->minWordLength = 4;\n }", "public function testOnPacketToString()\n {\n $payload = \"\\x01\\x38\" . // transaction id: 0138 (2 bytes)\n \"\\x00\\x00\" . // protocol id: 0000 (2 bytes)\n \"\\x00\\x08\" . // length: 0008 (2 bytes) (8 bytes after this field)\n \"\\x11\" . // unit id: 11 (1 byte)\n \"\\x16\" . // function code: 16 (1 byte)\n \"\\x04\\x10\" . // start address: 0410 (2 bytes)\n \"\\x00\\x01\" . // AND mask: 0x01 (2 bytes)\n \"\\x00\\x02\" . // OR mask: 0x02 (2 bytes)\n '';\n $this->assertEquals(\n $payload,\n (new MaskWriteRegisterRequest(\n 0x0410,\n 0x1,\n 0x2,\n 0x11,\n 0x0138\n ))->__toString()\n );\n }", "private function writeStringRecord($stringValue): void\n {\n $record = 0x0207; // Record identifier\n $data = StringHelper::UTF8toBIFF8UnicodeLong($stringValue);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }", "public function __toString()\n\t{\n\t\t$string = '[line]: ' . $this->line . \"\\n\";\n\t\t$string .= '[type]: ' . $this->typeToString($this->type) . \"\\n\";\n\t\t$string .= '[value]: ' . $this->value . \"\\n\";\n\t\treturn $string;\n\t}", "public static function getDescriptor()\n {\n static $descriptor;\n\n if (!isset($descriptor)) {\n $desc = new ProtocolBuffersDescriptorBuilder();\n $desc->addField(1, new ProtocolBuffersFieldDescriptor(array(\n \"type\" => ProtocolBuffers::TYPE_STRING,\n \"name\" => \"number\",\n \"required\" => true,\n \"optional\" => false,\n \"repeated\" => false,\n \"packable\" => false,\n \"default\" => \"\",\n )));\n $desc->addField(2, new ProtocolBuffersFieldDescriptor(array(\n \"type\" => ProtocolBuffers::TYPE_ENUM,\n \"name\" => \"type\",\n \"required\" => false,\n \"optional\" => true,\n \"repeated\" => false,\n \"packable\" => false,\n \"default\" => Tutorial_Person_PhoneType::HOME,\n )));\n $phpoptions = $desc->getOptions()->getExtension(ProtocolBuffers::PHP_MESSAGE_OPTION);\n $phpoptions->setUseSingleProperty(true);\n $phpoptions->setSinglePropertyName(\"_properties\");\n\n $descriptor = $desc->build();\n }\n\n return $descriptor;\n }", "public function value(): string\n {\n return uniqid(prefix: 'dsafsdaf-');\n }", "public function testValidationByKeynameConstruct()\n {\n $init = 'test';\n $str = new \\Pv\\PString($init, array('test1' => 'length[1]'));\n\n $valid = $str->getValidation();\n $this->assertTrue(isset($valid['test1']));\n }", "public function message()\n {\n return __('el :attribute debe tener 8 caracteres, un numero,una letra mayuscula y una letra minuscula');\n }", "public function getPO107(){\n\t\treturn $this->getPO1IndexOf(7);\n\t}", "public static function string(): Type\n {\n return new Type(null, 'string');\n }", "public function fromDefinition(\n $definition\n ) {\n Assert::stringNotEmpty($definition);\n\n $array = explode('|', $definition);\n\n $name = array_key_exists(0, $array)\n ? $array[0]\n : null;\n\n $label = array_key_exists(1, $array)\n ? $array[1]\n : null;\n\n $type = array_key_exists(3, $array)\n ? $array[3]\n : null;\n\n $linked = array_key_exists(6, $array)\n ? (bool) $array[6]\n : false;\n\n if (!$name || !$label || !$type)\n throw new \\InvalidArgumentException(\n 'Определение дополнительного поля имеет неизвестный формат.'\n );\n\n $extraField = new ExtraField();\n $extraField->name = $name;\n $extraField->label = $label;\n $extraField->type = $type;\n $extraField->linked = $linked;\n\n return $extraField;\n }", "public static function dumpDefinition(Definition $definition)\n {\n return (string) $definition;\n }", "public function hello_world():string\n {\n return self::HELLO_WORLD_STR;\n }", "function _vaxia_dice_roller_small_label($string) {\n $small_label = strtolower($string);\n $small_label = substr($small_label, 0, 3);\n if ($small_label == 'ref') {\n $small_label = 'fin';\n }\n return $small_label;\n}", "function __toString(): string\n {\n return $this->wordSpace->toString() . \" Tw\\n\";\n }", "public function message()\n {\n return 'The :attribute field type requires a Label and Value';\n }", "public function getVerbalString();", "public function getDescription()\n {\n $message = 'Value must be a valid string';\n\n if ($this->length) {\n $message .= ' and no longer than ' . $this->length . ' chars';\n }\n return $message;\n }", "public function message()\n {\n return 'The fields [Team ID, Phone and Sticky Phone Number ID] are required';\n }", "public function toString(): string\n {\n return $this->type->typeName() . '=' . $this->value->rfc2253String();\n }", "public function getStrId();", "public function testReferenceTooShortNotInteger()\n {\n ProtocolHelper::calculateReference('');\n }", "function generate_field($field)\r\n {\r\n fwrite($this->file_h, \" $field[2] $field[1] ; \\n\" );\r\n }", "public function definition()\n {\n return [\n 'name' => substr($this->faker->unique()->sentence(3, true), 0, 50),\n 'color' => $this->faker->hexColor,\n ];\n }", "public function message(): string\n {\n return $this->getValidationMessage(Str::snake(class_basename($this)), __('The :attribute size cannot exceed :max_size.', ['max_size' => $this->bytesToHuman($this->max_size)]));\n }", "public function __construct($str)\n {\n $this->str_value = (string) $str;\n $this->int_length = strlen($str);\n }", "public function testParseShouldReturnErrorResponseForTooShortPacket()\n {\n $payload = \"\\x01\\x38\" . // transaction id: 0138 (2 bytes)\n \"\\x00\\x00\" . // protocol id: 0000 (2 bytes)\n \"\\x00\\x07\" . // length: 0007 (2 bytes) (7 bytes after this field)\n \"\\x11\" . // unit id: 11 (1 byte)\n \"\\x16\" . // function code: 16 (1 byte)\n \"\\x04\\x10\" . // start address: 0410 (2 bytes)\n \"\\x00\\x01\" . // AND mask: 0x01 (2 bytes)\n \"\\x00\" . // OR mask: 0x02 (1 bytes) <-- should be 2 but is 1\n '';\n $packet = MaskWriteRegisterRequest::parse($payload);\n self::assertInstanceOf(ErrorResponse::class, $packet);\n $toString = $packet->__toString();\n // transaction id is random\n $toString[0] = \"\\x00\";\n $toString[1] = \"\\x00\";\n self::assertEquals(\"\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x96\\x04\", $toString);\n }", "abstract protected function get_typestring();", "public function definition()\n {\n return [\n\n 'rnc' => Str::random(9),\n 'uuid' => uniqid(),\n 'name' => 'Test name'\n ];\n }", "public function string();", "function getStringID() {\n\t\treturn '[#'.$this->data_array['artifact_id'].']';\n\t}", "abstract protected function getDataTypeString(): string;", "public function getStringAlgorithm() {}", "public function _strings_for_pot()\n {\n }", "public function testParse()\n {\n $payload = \"\\x01\\x38\" . // transaction id: 0138 (2 bytes)\n \"\\x00\\x00\" . // protocol id: 0000 (2 bytes)\n \"\\x00\\x08\" . // length: 0008 (2 bytes) (8 bytes after this field)\n \"\\x11\" . // unit id: 11 (1 byte)\n \"\\x16\" . // function code: 16 (1 byte)\n \"\\x04\\x10\" . // start address: 0410 (2 bytes)\n \"\\x00\\x01\" . // AND mask: 0x01 (2 bytes)\n \"\\x00\\x02\" . // OR mask: 0x02 (2 bytes)\n '';\n $packet = MaskWriteRegisterRequest::parse($payload);\n $this->assertEquals($packet, (new MaskWriteRegisterRequest(\n 0x0410,\n 0x1,\n 0x2,\n 0x11,\n 0x0138\n ))->__toString());\n $this->assertEquals(ModbusPacket::MASK_WRITE_REGISTER, $packet->getFunctionCode());\n $this->assertEquals(0x0410, $packet->getStartAddress());\n\n $this->assertEquals(0x1, $packet->getANDMask());\n $this->assertEquals(0x2, $packet->getORMask());\n\n $this->assertEquals(new Word(\"\\x00\\x01\"), $packet->getANDMaskAsWord());\n $this->assertEquals(new Word(\"\\x00\\x02\"), $packet->getORMaskAsWord());\n\n $header = $packet->getHeader();\n $this->assertEquals(0x0138, $header->getTransactionId());\n $this->assertEquals(0, $header->getProtocolId());\n $this->assertEquals(8, $header->getLength());\n $this->assertEquals(0x11, $header->getUnitId());\n }", "public function getBytesField()\n {\n $value = $this->get(self::BYTES_FIELD);\n return $value === null ? (string)$value : $value;\n }", "public function definition()\n {\n return [\n 'status' => $this->faker->sentence,\n ];\n }", "public function message()\n {\n return 'Address Must be end with \"Street\".';\n }", "public function testValidationByKeynameAddl()\n {\n $init = 'test';\n $str = new \\Pv\\PString($init);\n $str->addValidation('length[1]', 'test1');\n\n $valid = $str->getValidation();\n $this->assertTrue(isset($valid['test1']));\n }", "public function getDescription()\n {\n return 'A numerical field';\n }", "public function message()\n {\n return ':attribute 10 haneli olmalıdır ve 0 ile başlamamalıdır';\n }" ]
[ "0.5623249", "0.5564602", "0.52095574", "0.5201477", "0.51185346", "0.5055083", "0.5047299", "0.503771", "0.50083566", "0.5005499", "0.4986761", "0.49650216", "0.49616835", "0.48984745", "0.48906916", "0.48851314", "0.48671302", "0.4865965", "0.48441464", "0.48306686", "0.48214218", "0.48214218", "0.48144266", "0.48144266", "0.48111784", "0.47918677", "0.4785082", "0.47844768", "0.4774188", "0.47685456", "0.4741154", "0.47389734", "0.4736908", "0.47356784", "0.47167346", "0.47085375", "0.4708023", "0.46714827", "0.46685392", "0.46576262", "0.46549782", "0.46492133", "0.4645827", "0.46454874", "0.46450755", "0.4642668", "0.46420932", "0.46306756", "0.46264", "0.46255562", "0.4614211", "0.46015248", "0.4600629", "0.45971814", "0.45925364", "0.45761448", "0.45608", "0.4557263", "0.4556101", "0.45488104", "0.45468363", "0.45440242", "0.45341736", "0.45268917", "0.4522365", "0.45161948", "0.45134383", "0.45109588", "0.45088395", "0.45007804", "0.44968396", "0.44949564", "0.44880953", "0.44801128", "0.44790065", "0.44788507", "0.4474645", "0.44732258", "0.44723105", "0.44717583", "0.44695163", "0.4469037", "0.44611585", "0.4460123", "0.4458999", "0.4456307", "0.4455517", "0.44543675", "0.44481432", "0.44450212", "0.44309098", "0.44288197", "0.44285953", "0.44276485", "0.4422416", "0.44220793", "0.44176728", "0.44139385", "0.44128725", "0.44110954" ]
0.45682725
56
Delete hook by name
public function delete(HookName $name): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeHook(string $name)\n {\n foreach ($this->hooks as $idx => $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n # Remove it\n unset( $this->hooks[$idx] );\n\n return $this;\n }\n }\n\n return $this;\n }", "static public function del($name) {}", "public function remove_hooks()\n {\n }", "public function remove_hooks()\n {\n }", "private function _deleteHooks()\n\t{\n\t\t$EE =& get_instance();\n\t\t$EE->db->where('class', __CLASS__);\n\t\t$EE->db->delete('exp_extensions'); \n\t}", "protected function delete($name){\r\n $this->file->{\"$this->command\"}([$this->handler, $name]);\r\n }", "function remove_action($hook_name, $callback, $priority = 10)\n {\n }", "public function delete($name);", "public function delete($name);", "public function delete($name);", "function unregister_plugin_hook($hook, $entity_type, $function) {\n\tglobal $CONFIG;\n\tforeach($CONFIG->hooks[$hook][$entity_type] as $key => $hook_function) {\n\t\tif ($hook_function == $function) {\n\t\t\tunset($CONFIG->hooks[$hook][$entity_type][$key]);\n\t\t}\n\t}\n}", "public function deleteWebhook(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function processDelete(ProcessHook $hook)\n {\n $repository = $this->entityManager\n ->getRepository(HookedObjectEntity::class);\n $hookedObject = $repository->getByHookOrCreate($hook);\n\n $this->entityManager->remove($hookedObject);\n $this->entityManager->flush();\n }", "public function __unset($name);", "public function remove() {\n\t\tremove_action($this->controller->getHookName(),array($this,'handle'),$this->priority);\n }", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function delete($name) {\r\n\r\n $this->del($name);\r\n $this->loadSesionVars();\r\n }", "public function delete($name)\n {\n unset($this->data[$name]);\n }", "public function hookRemove(): void\n {\n $this->say(\"Executing the Plugin's remove hook...\");\n $this->_exec(\"php ./src/hook_remove.php\");\n }", "public function delete($bundle, $name)\n\t{\n\t\t$this->table()->where_bundle_and_name($bundle, $name)->delete();\n\t}", "public function unsetFunc($name){\n $statement = $this->db->prepare('DELETE FROM storage WHERE name = :name;');\n $statement->bindValue(':name', $name);\n $statement->execute();\n }", "function delete($name) {\n @unlink($this->path . \"/$name\");\n }", "function removeAction($name){\n\t\tunset( $this->actions[$name] );\n\t}", "function remove_theme_mod($name)\n {\n }", "public function remove(string $name);", "public function delDBHandler($name = null) {\n $this->db[$name] = null;\n }", "private function delete()\n {\n $webhookId = $this->ask('Please enter Webhook ID');\n\n try {\n $response = $this->messageBirdClient->conversationWebhooks->delete($webhookId);\n\n if ($response) {\n $this->info(\"WebhookId {$webhookId} is deleted successfully\");\n }\n\n } catch (\\Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function variable_del($name) {\n // TODO\n variable_del($name);\n }", "public function delete(string $name): static;", "function ft_hook_destroy() {}", "public function deleteJob($name);", "function deleteJournalById($hookName, $params) {\n\t\t$journalId = $params[1];\n\t\t$reviewObjectTypeDao =& DAORegistry::getDAO('ReviewObjectTypeDAO');\n\t\t$reviewObjectTypeDao->deleteByContextId($journalId);\n\t\t$objectForReviewDao =& DAORegistry::getDAO('ObjectForReviewDAO');\n\t\t$objectForReviewDao->deleteByContextId($journalId);\n\t\treturn false;\n\t}", "public static function Remove($name);", "function gallery2_adminapi_deletehook($args)\n{\n // switch delete / purge roles and removemember hook calls\n if (isset($args['extrainfo']['uid'])) {\n // removemember hook call\n return _gallery2_adminapi_removememberhook($args);\n } else {\n // delete/purge role hook call\n return _gallery2_adminapi_deleterolehook($args);\n }\n}", "function fuzzloc_unload() {\n\n\tunregister_hook('post_local', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_post_hook');\n\tunregister_hook('feature_settings', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings');\n\tunregister_hook('feature_settings_post', 'addon/fuzzloc/fuzzloc.php', 'fuzzloc_settings_post');\n\n\n\tlogger(\"removed fuzzloc\");\n}", "public function delete($name) {\n if ($this->has($name)) {\n $this->set($name, null, 0);\n unset($this->cookies_array[$name]); // remove the cookie from cookie array\n }\n }", "public function uninstallHook()\n\t{\n\t\t$ok =\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_PUB_KEY) &&\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_PUB_KEY_HASH);\n\t\t\tdelete_option(CommentsEncryptMain::OPTION_STORE_AVATAR_HASHES)\n\t\t;\n\t}", "public function __unset($_name);", "public function delete($name = false);", "public function remove(string $name): void;", "public function delete($cache_name);", "public function removeHook($project_id, $hook_id)\n {\n return $this->delete($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id)));\n }", "public function delete_builder_template($name = \"%\")\n\t\t{\n\t\t check_ajax_referer('avia_nonce_save','avia-save-nonce');\n\t\t\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : $name;\n $id = AviaStoragePost::get_custom_post('template_builder_snippets');\n\n \n $key = $this->generate_key($name);\n $result = delete_post_meta($id, $key);\n echo 'avia_template_deleted';\n die();\n\t\t}", "function remove_all_actions($hook_name, $priority = \\false)\n {\n }", "public function delDBHandler(string $name = null): void\n {\n $this->db[$name] = null;\n }", "public function remove($name)\n {\n if (!isset($this->dumpers[$name])) {\n throw new \\RuntimeException(sprintf('The dumper \"%s\" does not exist', $name));\n }\n\n unset($this->dumpers[$name]);\n }", "public function ajaxProcessremoveModuleHook(){\n $result = array();\n $hookname = Tools::getValue('hookname');\n $id_option = (int)Tools::getValue('id_option');\n $option = new Options($id_option);\n $hookexec_name = Tools::getValue('hookexec_name');\n $module_name = Tools::getValue('module_name');\n if ($option && Validate::isLoadedObject($option) && $module_name && Validate::isModuleName($module_name) && $hookname && Validate::isHookName($hookname) && $hookexec_name && Validate::isHookName($hookexec_name)){\n $HookedModulesArr = OvicLayoutControl::getModulesHook($option->theme,$option->alias, $hookname);\n $HookedModulesArr = Tools::jsonDecode($HookedModulesArr['modules'],true);\n $HookedModulesArr = array_values($HookedModulesArr);\n $moduleHook = array();\n $moduleHook[] = $module_name;\n $moduleHook[] = $hookexec_name;\n if ($HookedModulesArr && is_array($HookedModulesArr) && sizeof($HookedModulesArr)){\n $key = array_search($moduleHook,$HookedModulesArr);\n unset($HookedModulesArr[$key]);\n }\n $HookedModulesArr = array_values($HookedModulesArr);\n $result['status'] = OvicLayoutControl::registerHookModule($option, $hookname, Tools::jsonEncode($HookedModulesArr),$this->context->shop->id);\n $result['msg'] = $this->l('Successful deletion');\n //$this->displayError\n }\n Tools::clearCache();\n die(Tools::jsonEncode($result));\n }", "public static function delete($name) {\n self::put($name, '', time() - 1);\n }", "public function hook_after_delete($id) {\n\n }", "public function uiDelete(DisplayHook $hook)\n {\n $topic = $this->_em->getRepository('Zikula\\Module\\DizkusModule\\Entity\\TopicEntity')->getHookedTopic($hook);\n if (isset($topic)) {\n $this->view->assign('forum', $topic->getForum()->getName());\n $deleteHookAction = ModUtil::getVar(self::MODULENAME, 'deletehookaction');\n // lock or remove\n $actionWord = $deleteHookAction == 'lock' ? $this->__('locked', $this->domain) : $this->__('deleted', $this->domain);\n $this->view->assign('actionWord', $actionWord);\n $hook->setResponse(new DisplayHookResponse(DizkusModuleVersion::PROVIDER_UIAREANAME, $this->view, 'Hook/delete.tpl'));\n }\n }", "public function get(HookName $name): Hook;", "public function removeModule($name);", "public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }", "public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "function uninstall_hook()\n\t\t{\n\t\t\t// Delete plugin options\t\t\t\n\t\t\tdelete_option('verify-meta-tags');\n\t\t}", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "public function __unset($name)\n {\n }", "function runkit_function_remove($funcname)\n{\n}", "public function deleteP($name) {\n foreach($this->words[$this->wordsIndex]->needUpdateParts as $part) {\n $func = $part['func'];\n $partName = $part['partName'];\n /**\n * @var Document $documentEdit\n */\n $documentEdit = $this->$func($partName);\n $documentEdit->setValue($name, 'p',MDWORD_DELETE);\n }\n }", "public function deleteData($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }", "public function unregister($name)\n {\n }", "public function unset(string $name): void;", "public function unset(string $name): void;", "public function deleteControl($name);", "public function removeAction(string $name)\n {\n // some logic\n }", "abstract protected function handle_unset($name);", "function my_hook_monitor_unregister_callback_function($keyword)\n{\n // drop your table here, etc., and...\n return true; \n}", "public function rm($name)\r\n\t{\r\n\t\treturn apc_delete($name);\r\n\t}", "public function forceDeleteByName($name);", "function hook_menu_delete($menu) {\n // Delete the record from our variable.\n $my_menus = variable_get('my_module_menus', array());\n unset($my_menus[$menu['menu_name']]);\n variable_set('my_module_menus', $my_menus);\n}", "public static function delete($name){\n\t\tself::put($name, '', time() - 1);\t\t\t\t\t\t\t// Relace the cookie with an empty string.\n\t}", "function doing_action($hook_name = \\null)\n {\n }", "function hook_path_delete($path) {\n db_delete('mytable')\n ->condition('pid', $path['pid'])\n ->execute();\n}", "private function __unset($name)\n {\n if (method_exists($this, ($method = 'unset_'.$name)))\n {\n $this->$method();\n }\n }", "function did_action($hook_name)\n {\n }", "function _delete_attachment_theme_mod($id)\n {\n }", "function uninstall(){}", "public function __unset($name)\n\t{\n\t\tunset($this->getInstance()->$name);\n\t}", "public function destroy(name $name)\n {\n //\n }", "static function hookUninstall() {\n\t \t// Remove all options\n\t \tforeach(self::$plugin_options as $k => $v) {\n\t \t\tdelete_option($k);\n\t \t}\n\t }", "function remove($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }", "function cleanupPlugin($name)\n\t{\n\t\t$die = function($error, $code = 1) {\n\t\t\t\\cli\\out(\"%1{$error}%n\\n\");\n\t\t\texit($code);\n\t\t};\n\n\t\t$name = Str::slug($name);\n\n\t\t\\cli\\out(\"Cleaning up {$name}...\\n\");\n\n\t\t$composer = $this->path(\"/workbench/plugins/{$name}/composer.json\");\n\t\tif (!$this->files->exists($composer)) {\n\t \t\t$die(\"Coudn't find {$composer} for {$name}\", 1);\n\t \t}\n\n\t \t$package = json_decode( $this->files->get( $composer ) );\n\t \tif (false === $package) {\n\t \t\t$die(\"Coudn't read {$composer} for {$name}\", 2);\n\t \t}\n\n\t \t// remove from composer\n\t \t$process = $this->composer(\"remove {$package->name}\");\n\t\tif (!$process->isSuccessful()) {\n\t\t\t$die(\"Failed to remove {$package->name} from workbench\", 4);\n\t\t}\n\n\t \t// remove from studio\n\t \t$workbench_path = $this->path(\"/workbench/plugins/{$name}\");\n\t \t$process = $this->studio(\"unload {$workbench_path}\");\n\t \tif (!$process->isSuccessful()) {\n\t \t\t$die(\"Failed to unload {$package->name} from your workbench\", 8);\n\t \t}\n\n\t \t// delete the project\n\t \t$this->files->deleteDirectory($workbench_path);\n\t}", "function delete_post_type_event(){\n\tunregister_post_type( 'event' );\n}", "public function actionDelete($name)\n\t{\n\t\treturn parent::actionDelete($name);\n\t}", "private function deleteObject($name){\n $this->cache->delete($name);\n }", "public function remove($name)\n {\n foreach ((array) $name as $n) {\n unset($this->methods[$n]);\n }\n }" ]
[ "0.68087876", "0.68027836", "0.6635217", "0.6635217", "0.6486505", "0.6346596", "0.62922895", "0.62806505", "0.62806505", "0.62806505", "0.6188208", "0.6097205", "0.60942996", "0.6086043", "0.6073622", "0.60649055", "0.60649055", "0.60649055", "0.60649055", "0.60649055", "0.60649055", "0.60290504", "0.59902596", "0.59836364", "0.5982389", "0.59799546", "0.59756935", "0.59557843", "0.5945512", "0.5929369", "0.5924253", "0.5920044", "0.5919406", "0.5896136", "0.5876943", "0.5876356", "0.5870169", "0.5860134", "0.58560973", "0.58386755", "0.57967985", "0.5796491", "0.5791579", "0.57883567", "0.5784148", "0.5784086", "0.5779172", "0.5777344", "0.5767605", "0.57524014", "0.5750276", "0.5738033", "0.5726078", "0.5721706", "0.5700833", "0.56823635", "0.5673039", "0.5656671", "0.5656671", "0.56495136", "0.56495136", "0.56495136", "0.56491315", "0.56491315", "0.5648822", "0.5648651", "0.5648651", "0.5648651", "0.56422335", "0.5640465", "0.5630969", "0.5628976", "0.5628976", "0.5628976", "0.56033707", "0.56032264", "0.56032264", "0.5593426", "0.55865216", "0.558639", "0.55818605", "0.55624163", "0.55455106", "0.5531889", "0.5522331", "0.55116117", "0.55072635", "0.55063725", "0.54928553", "0.54819703", "0.54813594", "0.54794633", "0.54791576", "0.54775", "0.547215", "0.54716116", "0.5466423", "0.545713", "0.5454092", "0.5449935" ]
0.79035133
0
Get hook information by name
public function get(HookName $name): Hook;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get($hook_name = '')\n {\n }", "protected function getHook($name, $hook)\n {\n if (isset($this->hooks[$name][$hook])) {\n return $this->hooks[$name][$hook];\n }\n return [];\n }", "public function getHookName(): string\n {\n return $this->hook_name;\n }", "public function getHookPath(?string $name = null): string;", "public function getHook(string $name): ?Hook\n {\n # Find hook in list\n foreach ($this->hooks as $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n return $hook;\n }\n }\n\n return null;\n }", "final public function getHookName() {\n return $this->hookName;\n }", "function ft_hook_info() {}", "function sa_get_hook_id(){\n $bt = debug_backtrace();\n foreach($bt as $func){\n if($func['function'] == 'exec_action'){\n return $func['args'][0];\n }\n }\n}", "function hook(){\n\t\tglobal $listeners;\n\n\t\t$num_args = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif($num_args < 2)\n\t\t\ttrigger_error(\"Insufficient arguments\", E_USER_ERROR);\n\n\t\t// Hook name should always be first argument\n\t\t$hook_name = array_shift($args);\n\t\t// Default return\n\t\t$hook_result = array_shift($args);\n\t\t\n\t\tif(!isset($listeners[$hook_name])) {\n\t\t\treturn $hook_result; // No plugins have registered this hook\n\t\t}\n\t\t\n\t\t$result = NULL;\n\t\tforeach($listeners[$hook_name] as $func){\n\t\t\t$result = call_user_func_array($func, $args);\n\t\t\tif ($result===NULL) {\n\t\t\t\t$result = $hook_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getHook($id)\n {\n return parent::getHook(strtolower($id));\n }", "public function getInfo($name) {}", "private function getHookNames()\n {\n $container = $this->getContainer();\n\n $gridServiceIds = $container->getParameter('prestashop.core.grid.definition.service_ids');\n $optionsFormHookNames = $container->getParameter('prestashop.hook.option_form_hook_names');\n $identifiableObjectFormTypes = $container->getParameter('prestashop.core.form.identifiable_object.form_types');\n\n $gridDefinitionHooksProvider = $container->get(\n 'prestashop.core.hook.provider.grid_definition_hook_by_service_ids_provider'\n );\n\n $identifiableObjectFormTypeProvider = $container->get(\n 'prestashop.core.hook.provider.identifiable_object_hook_by_form_type_provider'\n );\n\n $gridDefinitionHookNames = $gridDefinitionHooksProvider->getHookNames($gridServiceIds);\n\n $identifiableObjectHookNames = $identifiableObjectFormTypeProvider->getHookNames($identifiableObjectFormTypes);\n\n return array_merge(\n $identifiableObjectHookNames,\n $optionsFormHookNames,\n $gridDefinitionHookNames\n );\n }", "function get_specific_plugin_hook_output($pluginName, $hookName, $args = array())\n{\n // Get the specific hook.\n $pluginBroker = get_plugin_broker();\n $hookNameSpecific = $pluginBroker->getHook($pluginName, $hookName);\n\n // Return null if the specific hook doesn't exist.\n if (!$hookNameSpecific) {\n return null;\n }\n\n // Buffer and return any output originating from the hook.\n ob_start();\n foreach ($hookNameSpecific as $cb) {\n call_user_func($cb, $args);\n }\n $content = ob_get_contents();\n ob_end_clean();\n\n return $content;\n}", "public function findHook($sName, $iVersion) {\n try {\n $aFile = $this->findFile('hook_'.$sName.'_'.$iVersion, 'class');\n return $aFile['path'];\n } catch (Exception $oEx) {\n return false;\n }\n }", "public function getWebhookInfo(){\n return $this->make_http_request(__FUNCTION__);\n }", "public static function CallHook($name,$data=null){\r\n\t\tself::Debug('Call hook '.$name);\r\n\t\tif(!self::HasHookHandler($name))\r\n\t\t\treturn true;\r\n\t\t$keys=array_keys(self::$Config['extensions'][$name]);\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($keys);\r\n\t\twhile(++$i<$len){\r\n\t\t\tself::Debug('Call '.self::$Config['extensions'][$name][$keys[$i]]);\r\n\t\t\tif(!call_user_func(self::$Config['extensions'][$name][$keys[$i]],$data)){\r\n\t\t\t\tself::Debug('Handler stopped hook execution');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static function get_hook_name(){\r\n\t\treturn \"blog\";\r\n\t}", "public function log($hook_name, $point = '')\n {\n $this->backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n unset($this->backtrace[0], $this->backtrace[1]);\n $caller = $this->registerHook($hook_name, $point);\n return ['hook_name' => $hook_name, 'point' => $point, 'caller' => $caller, 'time' => microtime(true)];\n }", "public function getCode(string $hook): string;", "public static function availableHooks() {\n\t\t$data = array(\n\t\t\t'form',\n\t\t\t'input',\n\t\t\t'fieldset',\n\t\t\t'legen',\n\t\t\t'label',\n\t\t\t'select',\n\t\t\t'_token',\n\t\t\t'_edit',\n\t\t\t'_create',\n\t\t\t'_email',\n\t\t\t'extension',\n\t\t\t'_instance'\n\t\t);\n\n\t\treturn $data;\n\t}", "public function getHookCode($name, $object_var = false, $param_list = '')\n\t{\n\t\tif(isset($this->hooks[$name]))\n\t\t{\n\t\t\tif(is_array($this->hooks[$name]) && ! empty($this->hooks[$name]))\n\t\t\t{\n\t\t\t\tif(count($this->hooks[$name]) > 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the array has too many values.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( ! (isset($this->hooks[$name][0]) && is_string($this->hooks[$name][0])))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the first value in the array is not a string.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(isset($this->hooks[$name][1]) && ! is_string($this->hooks[$name][1]))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the first value in the array is not a string.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif( ! is_string($this->hooks[$name]))\n\t\t\t{\n\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the callable must be either a string or an array containing one or two strings.');\n\t\t\t}\n\t\t\t\n\t\t\t$hook = array();\n\t\t\tforeach((Array) $this->hooks[$name] as $c)\n\t\t\t{\n\t\t\t\t// remove potential troublemakers\n\t\t\t\t$hook[] = trim((String) $c, \" ();=\\t\\n\\r\");\n\t\t\t}\n\t\t\t\n\t\t\tif(count($hook) == 1)\n\t\t\t{\n\t\t\t\t$hook = array_shift($hook);\n\t\t\t}\n\t\t\t\n\t\t\tif($object_var === false)\n\t\t\t{\n\t\t\t\t// check if the hooks is a static method on the attached object\n\t\t\t\t// also take the __callStatic into account\n\t\t\t\tif(is_string($hook) && (is_callable(array($this->getClass(), $hook)) OR\n\t\t\t\t\tmethod_exists($this->getClass(), '__callStatic')))\n\t\t\t\t{\n\t\t\t\t\treturn $this->getClass().'::'.$hook.'('.$param_list.');';\n\t\t\t\t}\n\t\t\t\t// check if it is a static method or a function\n\t\t\t\telseif(is_callable($hook))\n\t\t\t\t{\n\t\t\t\t\treturn implode('::', (Array)$hook).'('.$param_list.');';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Callable supplied for hook \"'.$name.'\", callable \"'.$hook.'\".');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// we need a string\n\t\t\t\tif(is_array($hook))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The hook \"'.$name.'\" requires a method placed on the described class, not a static method placed on some other class.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check if it is a method on the object\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// fetch a reflection\n\t\t\t\t\t$ref = new ReflectionClass($this->getClass());\n\t\t\t\t\t\n\t\t\t\t\tif($ref->hasMethod($hook))\n\t\t\t\t\t{\n\t\t\t\t\t\t$m = $ref->getMethod($hook);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// we need to be able to invoke it outside the class\n\t\t\t\t\t\tif( ! $m->isPublic())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The \"'.$this->getClass().'::'.$hook.'\" method is not public, it cannot be used as a hook.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($m->isStatic())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The \"'.$this->getClass().'::'.$hook.'\" method is static but a non-static method is required.');\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\treturn $object_var.'->'.$hook.'('.$param_list.');';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// __call works too\n\t\t\t\t\telseif($ref->hasMethod('__call'))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $object_var.'->'.$hook.'('.$param_list.');';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'A method with the name \"'.$hook.'\" is required by a hook to be placed in the class \"'.$this->getClass().'\".');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(ReflectionException $e)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Proper error handling code, convert to a Db_Exception\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No hook for this point\n\t\t\treturn '';\n\t\t}\n\t}", "public function getHooks($names, $hooks, $annotationData = null)\n {\n return $this->get($this->addWildcardHooksToNames($names, $annotationData), $hooks);\n }", "public function getHooks() { return $this->_hooks; }", "public function getWebhookInfo()\n {\n return current($this->sendRequest('GET', 'getWebhookInfo'));\n }", "public function hook();", "function did_action($hook_name)\n {\n }", "public function getIdHookByName($hookName) {\n\t\t$model = new Hook;\n\t\t$result = $model->find(array(\n\t\t\t'condition' => 'LOWER(nama) = :nama',\n\t\t\t'params' => array(\n\t\t\t\t':nama' => strtolower($hookName),\n\t\t\t),\n\t\t));\n\n\t\tif(!$result)\n\t\t\treturn false;\n\t\telse {\n\t\t\treturn $result->id_hook;\n\t\t}\n\t}", "public static function getNameById($hook_id)\n {\n $cache_id = 'hook_namebyid_'.$hook_id;\n if (!Cache::isStored($cache_id)) {\n Cache::store($cache_id, Db::getInstance()->getValue('\n\t\t\t\tSELECT `name`\n\t\t\t\tFROM `' ._DB_PREFIX_.'hook`\n\t\t\t\tWHERE `id_hook` = ' .(int) $hook_id));\n }\n return Cache::retrieve($cache_id);\n }", "function latto_get_info($theme_name) {\n $info = drupal_static(__FUNCTION__, array());\n if (empty($info)) {\n $lt = list_themes();\n foreach ($lt as $key => $value) {\n if ($theme_name == $key) {\n $info = $lt[$theme_name]->info;\n }\n }\n }\n\n return $info;\n}", "function did_filter($hook_name)\n {\n }", "private function registerHook($hook_name, $point)\n {\n if (!isset(self::$hook_statistics[$hook_name])) {\n self::$hook_statistics[$hook_name] = [\n 'count' => 0,\n 'time' => 0,\n 'caller' => [],\n 'points' => [],\n 'points_count' => []\n ];\n }\n // Общее количество вызовов хука\n self::$hook_statistics[$hook_name]['count']++;\n\n // Источник, вызвавший хук\n $caller = $this->getCaller();\n $caller['call_id'] = $this->registerCaller($caller, $hook_name, $point);\n\n // Вызовы хука для некоторой точки в коде\n $this->registerPoint($point, self::$hook_statistics[$hook_name]);\n\n return $caller;\n }", "public function get($name)\n {\n if (isset($this->calls[$name])) {\n return $this->calls[$name];\n } else {\n return null;\n };\n }", "public function getPluginHook($hook_name, $parameters = array(), $default = '')\n\t{\n\t\t$hook_name = strtolower($hook_name);\n\t\t\n\t\tif(empty($this->plugin_hooks[$hook_name]))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t\t\n\t\t$str = '';\n\t\tforeach($this->plugin_hooks[$hook_name] as $callable)\n\t\t{\n\t\t\t$str .= call_user_func_array($callable, $parameters);\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "function bootscore_wc_capture_hook_output($hookName) {\n ob_start();\n do_action($hookName);\n $hookContent = ob_get_contents();\n ob_end_clean();\n\n return $hookContent;\n}", "public function getPostHookName() { return $this->_postHookName; }", "public function getFailedHookStats();", "function qa_get_module_info($type, $name)\n{\n\t$modules = qa_list_modules_info();\n\treturn @$modules[$type][$name];\n}", "function run_hook($hook_name, $args) {\n\n // Run a hook\n md_run_hook($hook_name, $args);\n \n }", "public function getHooks() {\n return $this->hooks;\n }", "public function lookup($name) {\n return $this->_handler->lookup($name);\n }", "public function get($names, $hooks)\n {\n $result = [];\n foreach ((array)$hooks as $hook) {\n foreach ((array)$names as $name) {\n $result = array_merge($result, $this->getHook($name, $hook));\n }\n }\n return $result;\n }", "public function getAllHooks() {\n\t\t$this->hooks = $this->getConfig('hooks');\n\t\tif (empty($this->hooks)) {\n\t\t\t$this->hooks = $this->updateBMOHooks();\n\t\t}\n\t\treturn $this->hooks;\n\t}", "public function getLBInfo( $name = null ) {\n\t\tif ( is_null( $name ) ) {\n\t\t\treturn $this->mLBInfo;\n\t\t} else {\n\t\t\tif ( array_key_exists( $name, $this->mLBInfo ) ) {\n\t\t\t\treturn $this->mLBInfo[$name];\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "function get_tool($name)\n {\n }", "public function getLocalHooks() {\n\t\treturn $this->localHooks;\n\t}", "public function processHooks() {\n\t\t//get hooks from level \"2\" backtrace\n\t\t$sortedHooks = $this->returnHooks(2);\n\t\t$return = array();\n\t\tif(!empty($sortedHooks)) {\n\t\t\tforeach($sortedHooks as $hook) {\n\t\t\t\t$module = $hook['module'];\n\t\t\t\t$namespace = $hook['namespace'];\n\t\t\t\tif(!class_exists($namespace.$hook['class'])) {\n\t\t\t\t\t//its active so lets get BMO to load it\n\t\t\t\t\t//basically we are hoping the module itself will load the right class\n\t\t\t\t\t//follow FreePBX BMO naming Schema\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$this->FreePBX->$module;\n\t\t\t\t\t\tif(!class_exists($namespace.$hook['class'])) {\n\t\t\t\t\t\t\t//Ok we really couln't find it. Give up\n\t\t\t\t\t\t\tthrow new \\Exception('Cant find '.$namespace.$hook['class']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\tif($e->getCode() != 404) {\n\t\t\t\t\t\t\tthrow new \\Exception('Error From Module '.$namespace.$hook['class'].\": '\".$e->getMessage().\"'\".$e->getCode);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->updateBMOHooks();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$meth = $hook['method'];\n\t\t\t\t//now send the method from that class the data!\n\t\t\t\t\\modgettext::push_textdomain(strtolower($module));\n\t\t\t\ttry {\n\t\t\t\t\t$return[$module] = call_user_func_array(array($this->FreePBX->$module, $meth), func_get_args());\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t//module does not exist, try to resolve right now\n\t\t\t\t\tif($e->getCode() != 404) {\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->updateBMOHooks();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\\modgettext::pop_textdomain();\n\t\t\t}\n\t\t}\n\t\t//return the data from that class\n\t\treturn $return;\n\t}", "private function getHooksFromFile( $file ) {\n\t\t$content = file_get_contents( $file );\n\t\t$m = array();\n\t\tpreg_match_all( '/(?:wfRunHooks|Hooks\\:\\:run|ContentHandler\\:\\:runLegacyHooks)\\(\\s*([\\'\"])(.*?)\\1/', $content, $m );\n\t\treturn $m[2];\n\t}", "function sa_dumpLiveHooks(){\n // sorted, and grouped\n debugLog(sa_dumpHooks('sidebar')); // sidemenus\n debugLog(sa_dumpHooks('nav-tab')); // nav tabs\n debugLog(sa_dumpHooks(NULL,false,true)); // other\n debugLog(sa_dumpFilters(NULL,false)); // filters \n}", "public function hook($hookName, $args = [])\n {\n $args['_viewname'] = $this->getParam('view_name');\n $result = '';\n\n $debug = $this->BDebug->is('DEBUG');\n if ($debug) {\n $result .= \"<!-- START HOOK: {$hookName} -->\\n\";\n }\n\n $result .= implode('', $this->BEvents->fire('BView::hook:before', ['view' => $this, 'name' => $hookName]));\n\n $result .= implode('', $this->BEvents->fire('BLayout::hook:' . $hookName, $args));\n\n $result .= implode('', $this->BEvents->fire('BView::hook:after', ['view' => $this, 'name' => $hookName]));\n\n if ($debug) {\n $result .= \"<!-- END HOOK: {$hookName} -->\\n\";\n }\n\n return $result;\n }", "function sa_dumpHooks($hookname = NULL,$exclude = false,$actions = false){\n\tglobal $plugins;\n $sa_plugins = $plugins;\n $collapsestr= '<span class=\"sa_expand sa_icon_open\"></span><span class=\"sa_collapse\">'; \n\t$bmark_str = bmark_line();\n $hookdump = '<span class=\"titlebar\">Dumping live hooks: ' . (isset($hookname) ? $hookname : 'All') .$bmark_str.'</span>'.$collapsestr;\n \n asort($sa_plugins);\n \n foreach ($sa_plugins as $hook)\t{\n\t\tif(substr($hook['hook'],-8,9) == '-sidebar'){\n\t\t\t$thishook = 'sidebar';\n\t\t}else\n\t\t{\n\t\t\t$thishook = $hook['hook'];\n\t\t}\n\t\n # _debugLog($hook);\n if(isset($hookname) and $thishook != $hookname and $exclude==false) continue; \n if(isset($hookname) and $thishook == $hookname and $exclude==true) continue; \n if($actions == true and ( $thishook == 'sidebar' or $thishook == 'nav-tab')) continue; \n \n if($hook['file']=='sa_development.php') continue; // remove noisy debug hooks\n\t\t\t\t\t\n # debugPair($hook['hook'],implode(', ',$hook['args'])); \n\n $return = '<span class=\"cm-default\"><span><b>'.$hook['hook'] .'</b><span class=\"cm-tag\"> &rarr; </span></span>'\n .'<span class=\"cm-variable\">' . $hook['function'] . '</span>'\n .'<span class=\"cm-bracket\">(</span>'\n .'<span class=\"\">' . arr_to_csv_line($hook['args']) .'</span>'\n .'<span class=\"cm-bracket\">)</span>'\n .'<span class=\"cm-comment\"> File </span>'\n .'<span class=\"cm-bracket\">[</span>'\n .'<span class=\"cm-atom\" title=\"'.$hook['file'].'\">'. sa_get_path_rel($hook['file']) .'</span>'\n .':'\n .'<span class=\"cm-string\">'. $hook['line'] .'</span>'\n .'<span class=\"cm-bracket\">]</span>' . '</span>';\n \n $hookdump.=$return.'<br/>';\n }\n return $hookdump.'</span>';\n}", "public function _before_addon_load($name = NULL) {\n $this->before_addon_load($name);\n App::Module('Hook')->getHandler('Callback', 'before_addon_load', $name);\n }", "private function getCoreHokkCallbacks() {\n\n\t\tglobal $wp_filter;\n\t\tif (isset($wp_filter[$this->hookName]))\n\t\t\treturn $wp_filter[$this->hookName];\n\t\telse {\n\t\t\t\treturn array();\n\t\t}\n\t}", "public function hook($hookName, $args = array())\n {\n $args['_viewname'] = $this->param('view_name');\n $result = '';\n\n $debug = BDebug::is('DEBUG');\n if ($debug) {\n $result .= \"<!-- START HOOK: {$hookName} -->\\n\";\n }\n\n $result .= join('', BEvents::i()->fire('BView::hook:before', array('view' => $this, 'name' => $hookName)));\n\n $result .= join('', BEvents::i()->fire('BLayout::hook:' . $hookName, $args));\n\n $result .= join('', BEvents::i()->fire('BView::hook:after', array('view' => $this, 'name' => $hookName)));\n\n if ($debug) {\n $result .= \"<!-- END HOOK: {$hookName} -->\\n\";\n }\n\n return $result;\n }", "public function getHookDebugInfo()\n\t{\n\t\t$parts = array();\n\t\tforeach($this->_hook_templates as $position => $hook)\n\t\t\t$parts[] = '<strong>' . $position . ':</strong> ' . implode(', ', $hook);\n\n\t\treturn !empty($parts) ? ('<span style=\"font-size:1.1em;color:red;\"><strong>Hook templates:</strong></span><br>' . implode('<br>', $parts)) : '';\n\t}", "public function info($id)\n {\n $_params = array(\"id\" => $id);\n return $this->master->call('webhooks/info', $_params);\n }", "public function postHook(){\n\t\treturn $this->getPostHookString();\n\t}", "public static function get_hook_type(){\r\n\t\treturn \"likes\";\r\n\t}", "function hook_credit_info() {\n $results = array();\n $results['foo_bundle'] = array (\n 'bundle' => 'foo',\n // callback function must return value between 0 and 1.\n 'callback' => 'foo_result_calculate',\n \n );\n return $results;\n}", "function getParam( $name ) {\n\t\t$db = JFactory::getDbo();\n\t\t$db->setQuery('SELECT manifest_cache FROM #__extensions WHERE name = \"com_mapyandex\"');\n\t\t$manifest = json_decode( $db->loadResult(), true );\n\t\treturn $manifest[ $name ];\n\t}", "function getAdditionalFieldNames($hookName, $args) {\n\t\tassert(count($args) == 2);\n\t\t$additionalFields =& $args[1];\n\t\tassert(is_array($additionalFields));\n\t\t$additionalFields[] = $this->getDepositStatusSettingName();\n\t}", "private function _hook($hook='', $data=array())\n\t{\n\t\tif ($hook AND $this->EE->extensions->active_hook('open_api_'.$hook) === TRUE)\n\t\t{\n\t\t\t$data = $this->EE->extensions->call('open_api_'.$hook, $data);\n\t\t\tif ($this->EE->extensions->end_script === TRUE) return;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function getHooks($method = '', $type = 0) {\n\t\treturn $this->wire('hooks')->getHooks($this, $method, $type); \n\t}", "public function getState($name) {\r\n\t\treturn $this->context->getState($name);\r\n\t}", "private function extractHookId($hookName, $prefix, $suffix)\n {\n return str_replace([$prefix, $suffix], '', $hookName);\n }", "public function getStat($name)\n\t{\n\t\treturn $this->_stat[$name];\n\t}", "public function _after_addon_load($name = NULL) {\n $this->after_addon_load($name);\n App::Module('Hook')->getHandler('Callback', 'after_addon_load', $name);\n }", "public function hook($name, $fn, $args = array()) {\n if (strpos($name, '-') === false) {\n $name = $this->tab() . '-' . $name;\n }\n\n if ($this->isPHPScript($fn)) {\n $scriptId = count($this->hookScripts);\n $this->hookScripts[] = $fn;\n $fn = array($this, 'hookScript_' . $scriptId);\n }\n\n $this->hooks[] = array($name, $fn, $args);\n }", "public function getInfo()\n {\n return $this->addAction(Flag::getInfo());\n }", "function s2_hook($hook_id)\n{\n if (defined('S2_DISABLE_HOOKS')) {\n return false;\n }\n\n static $hookNames = null;\n\n if ($hookNames === null) {\n if (!defined('S2_DISABLE_CACHE') && file_exists(S2Cache::CACHE_HOOK_NAMES_FILENAME)) {\n $hookNames = include S2Cache::CACHE_HOOK_NAMES_FILENAME;\n }\n if (!is_array($hookNames)) {\n $hookNames = S2Cache::generate_hooks();\n }\n }\n\n if (!isset($hookNames[$hook_id])) {\n return false;\n }\n\n $code = implode(\"\\n\", array_map(static fn(string $filename) => \"\\$_include_result = include S2_ROOT.'$filename'; if (\\$_include_result !== 1) { return \\$_include_result; }\", $hookNames[$hook_id]));\n\n return $code;\n}", "public function getHookConfig(string $hook) : Config\\Hook\n {\n if (!Hook\\Util::isValid($hook)) {\n throw new InvalidArgumentException('Invalid hook name: ' . $hook);\n }\n return $this->hooks[$hook];\n }", "function get_plugin_page_hookname($plugin_page, $parent_page)\n {\n }", "public function handle($hookName,$datas = null) {\n $handles = [\n 'homepage' => setting('homepage'),\n 'blogpage' => setting('blogpage')\n ];\n\n $modelHook = $datas;\n\n if($modelHook != null) {\n $m = null;\n if($modelHook->type == 'homepage') {\n $m = Url::where('from_model', 'App\\Adminify\\Models\\Page')->where('model_id', (int) $handles['homepage'])->get()->first();\n $key = 'is_homepage';\n $val = $handles['homepage'] != null ? (boolean) $handles['homepage'] : false;\n }\n if($modelHook->type == 'blogpage') {\n $m = Url::where('from_model', 'App\\Adminify\\Models\\Page')->where('model_id', (int) $handles['blogpage'])->get()->first();\n $key = 'is_blogpage';\n $val = $handles['blogpage'] != null ? (boolean) $handles['blogpage'] : false;\n }\n\n if($m != null) {\n\n $m->{$key} = $val;\n \n $m->save();\n\n // if(is_urlable_model($m)) {\n $this->hookManager->run('updated', $m);\n // }\n }\n }\n\n }", "function doing_action($hook_name = \\null)\n {\n }", "function getParam( $name ) {\n $db = JFactory::getDbo();\n $db->setQuery('SELECT manifest_cache FROM #__extensions WHERE name = \"joomleague\" and type = \"component\" ');\n $manifest = json_decode( $db->loadResult(), true );\n return $manifest[ $name ];\n }", "function convert_to_screen($hook_name)\n {\n }", "function getParam($name)\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$db->setQuery('SELECT manifest_cache FROM #__extensions WHERE name = \"com_sermonspeaker\"');\n\t\t$manifest = json_decode($db->loadResult(), true);\n\t\treturn $manifest[$name];\n\t}", "public function hook($project_id, $hook_id)\n {\n return $this->get($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id)));\n }", "public function __get($name)\n\t{\n\t\treturn $this->_ci->_module_get($name);\n\t}", "protected function getHookLines($hook)\n {\n $hookLines = [\n 'pre-commit' => [\n './vendor/bin/run qa:update-sniff-list',\n ],\n ];\n \n return array_key_exists($hook, $hookLines) ? $hookLines[$hook] : [];\n }", "public function getArgument(string $name);", "function doing_filter($hook_name = \\null)\n {\n }", "function drush_module_builder_callback_data_list() {\n $commands = func_get_args();\n\n // Get our task handler, which checks hook data is ready.\n try {\n $mb_task_handler_report = \\DrupalCodeBuilder\\Factory::getTask('ReportHookData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $time = $mb_task_handler_report->lastUpdatedDate();\n $data = $mb_task_handler_report->listHookData();\n\n if (drush_get_option('raw')) {\n drush_print_r($data);\n return;\n }\n\n if (count($commands)) {\n // Put the requested filenames into the keys of an array, and intersect them\n // with the hook data.\n $files_requested = array_fill_keys($commands, TRUE);\n $data_requested = array_intersect_key($data, $files_requested);\n }\n else {\n $data_requested = $data;\n }\n\n if (!count($data_requested) && count($files_requested)) {\n drush_print(t(\"No hooks found for the specified files.\"));\n }\n\n drush_print(\"Hooks:\");\n foreach ($data_requested as $file => $hooks) {\n drush_print(\"Group $file:\", 2);\n foreach ($hooks as $key => $hook) {\n drush_print($hook['name'] . ': ' . $hook['description'], 4);\n }\n }\n\n // List presets.\n try {\n $mb_task_handler_report_presets = \\DrupalCodeBuilder\\Factory::getTask('ReportHookPresets');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $hook_presets = $mb_task_handler_report_presets->getHookPresets();\n foreach ($hook_presets as $hook_preset_name => $hook_preset_data) {\n drush_print(\"Preset $hook_preset_name: \" . $hook_preset_data['label'], 2);\n foreach ($hook_preset_data['hooks'] as $hook) {\n drush_print($hook, 4);\n }\n }\n\n if (drush_drupal_major_version() == 8) {\n try {\n $mb_task_handler_report_plugins = \\DrupalCodeBuilder\\Factory::getTask('ReportPluginData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_plugins->listPluginData();\n\n drush_print(\"Plugins types:\");\n foreach ($data as $plugin_type_id => $plugin_type_data) {\n drush_print($plugin_type_id, 2);\n }\n\n try {\n $mb_task_handler_report_services = \\DrupalCodeBuilder\\Factory::getTask('ReportServiceData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_services->listServiceData();\n\n drush_print(\"Services:\");\n foreach ($data as $service_id => $service_info) {\n drush_print($service_id, 2);\n }\n }\n\n $hooks_directory = \\DrupalCodeBuilder\\Factory::getEnvironment()->getHooksDirectory();\n drush_print(t(\"Component data retrieved from @dir.\", array('@dir' => $hooks_directory)));\n drush_print(t(\"Component data was processed on @time.\", array(\n '@time' => date(DATE_RFC822, $time),\n )));\n}", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "public function getStep($name)\n {\n return $this->steps[$name];\n }", "public function getModInfo($modName) {\n $getModInfo = Engine_Api::_()->getApi('modInfo', 'suggestion')->getPluginInfos($modName);\n return $getModInfo;\n }", "public function latestFailedDeploymentHook()\n {\n return $this->request('get', '/api/latest-failed-hook')['hook'];\n }", "public function hookHandler(Request $request)\n {\n $clientIp = !empty($request->header('X-Forwarded-For')) ?: $request->ip();\n Log::debug('hook received from ' . $clientIp);\n\n if ($this->isVerbose()) {\n dump($request);\n }\n\n $eventType = $request->headers->get('X-Gitlab-Event') ;\n if (is_null($eventType))\n $eventType = 'Push Hook';\n\n // for debugging purpose.\n \\Storage::put(str_replace(' ', '-', $eventType) . \".json\",\n json_encode($request->json()->all(), JSON_PRETTY_PRINT));\n\n Log::info('eventType : ' . $eventType);\n\n if ($eventType == 'Push Hook')\n {\n return $this->pushHook($request);\n }\n elseif ($eventType == 'Merge Request Hook'){\n return $this->mergeRequestHook($request);\n }\n\n abort(500, 'Unknown Hook type : ' . $eventType);\n }", "function getPlugin($name);", "public function getLayer($name);", "protected function get_deprecated_hooks() {\n\n\t\t$hooks = array(\n\t\t\t'woocommerce_elavon_vm_icon' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_icon',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'woocommerce_elavon_card_types' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_available_card_types',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'wc_payment_gateway_elavon_vm_request_xml' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_request_data',\n\t\t\t),\n\t\t);\n\n\t\treturn $hooks;\n\t}", "function ft_hook_filename($file) {}", "private function getHooksFromLocalDoc( $doc ) {\n\t\t\t$m = array();\n\t\t\t$content = file_get_contents( $doc );\n\t\t\tpreg_match_all( \"/\\n'(.*?)':/\", $content, $m );\n\t\t\treturn array_unique( $m[1] );\n\t}", "public function getHandlerName();", "public function getHandlerName();", "private function getHooksFromDoc( $doc ) {\n\t\tif ( $this->hasOption( 'online' ) ) {\n\t\t\treturn $this->getHooksFromOnlineDoc();\n\t\t} else {\n\t\t\treturn $this->getHooksFromLocalDoc( $doc );\n\t\t}\n\t}", "public function getBundle($name);", "public function getPostCommitHookList() {}", "public function getFromRegistry($name) {\n return Registry::get($name);\n }", "private function get_caller_info($dbt = array()) {\n\n $this->cresolved = true;\n\n // object call\n if(count($dbt)>=2 && array_key_exists(\"class\",$dbt[1])) {\n return basename($dbt[1][\"class\"]).\"::\".$dbt[1][\"function\"].\n \"(\".$dbt[0][\"line\"].\"): \";\n\n // function call\n } else if(count($dbt)>=2 && !array_key_exists(\"class\",$dbt[1])) {\n return basename($dbt[0][\"file\"]).\"::\".$dbt[1][\"function\"].\n \"(\".$dbt[0][\"line\"].\"): \";\n\n // direct call\n } else if(count($dbt)===1) {\n return basename($dbt[0][\"file\"]).\"(\".$dbt[0][\"line\"].\")Y: \";\n\n // otherwise be able to recognize non regarded caller scenarios\n } else {\n return \"Unknown::function(-1): \";\n\n } \n\n }" ]
[ "0.73576957", "0.72153944", "0.6762951", "0.6481722", "0.64741415", "0.64688927", "0.63985234", "0.627197", "0.6227921", "0.6198603", "0.6155766", "0.61042845", "0.6062111", "0.5864664", "0.5838323", "0.5826888", "0.5819178", "0.5811547", "0.57937676", "0.5779008", "0.57553256", "0.5722274", "0.5703962", "0.5684761", "0.5664431", "0.5654565", "0.5587822", "0.55744225", "0.55738956", "0.55629176", "0.5548677", "0.5538453", "0.5533179", "0.55185425", "0.55083376", "0.5446501", "0.5438685", "0.54328823", "0.5421814", "0.5416041", "0.540839", "0.53971314", "0.539121", "0.5364538", "0.5320999", "0.53190744", "0.53101355", "0.52918816", "0.5288455", "0.5286359", "0.52736795", "0.5270191", "0.52636814", "0.52450234", "0.52409476", "0.5217774", "0.5204886", "0.52022886", "0.5199836", "0.51846784", "0.51627284", "0.5148433", "0.51434916", "0.5137225", "0.51363426", "0.5120865", "0.5110042", "0.50962174", "0.5094615", "0.50685453", "0.50672525", "0.50605154", "0.5059783", "0.50522465", "0.50506413", "0.502375", "0.5010618", "0.50093096", "0.49963903", "0.4982428", "0.49729815", "0.4952193", "0.4944965", "0.4944965", "0.4942781", "0.4920215", "0.49086475", "0.49009985", "0.48941365", "0.48906144", "0.48810944", "0.48798063", "0.4860758", "0.4854347", "0.4854347", "0.48538315", "0.48488635", "0.48461094", "0.4839233", "0.48374763" ]
0.786757
0
Get path to hooks storage
public function getHookPath(?string $name = null): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHooksDir(): string\n {\n return $this->dotGitDir . DIRECTORY_SEPARATOR . 'hooks';\n }", "public function getStoragePath(){\n return $this->storageEngine->getStoragePath();\n }", "function storage_path()\n {\n return base_path() . '/storage';\n }", "public function storagePath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'storage';\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "public function storagePath()\n {\n return $this->storagePath ?: $this->basePath . DIRECTORY_SEPARATOR . 'storage';\n }", "public function storage_path();", "protected function getGitHooksPath()\n {\n $gitDir = exec('git rev-parse --git-dir');\n if (!preg_match('/\\.git$/i', $gitDir)) {\n $gitDir .= DIRECTORY_SEPARATOR . '.git';\n }\n\n return $gitDir . DIRECTORY_SEPARATOR . 'hooks';\n }", "function charrestore_getstorepath()\n{\n\t$path = get_module_setting('snapshot_dir');\n\tif( substr($path,-1) != \"/\" && substr($path,-1) != \"\\\\\" )\n\t{\n\t\t$path = $path.\"/\";\n\t}\n\treturn $path;\n}", "public function getStoragePath(): string;", "public function getStoragePath()\n {\n return $this->storagePath;\n }", "public function getStoragePath()\n {\n return $this->storagePath;\n }", "public function getCachedServicesPath();", "public static function storagePath(){\n return \\Illuminate\\Foundation\\Application::storagePath();\n }", "public function getCachedConfigPath()\n {\n return $this['path.storage'].'/framework/config.php';\n }", "public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }", "public function getScanFileStorageBasePath(): string\n {\n return storage_path('scans') . DIRECTORY_SEPARATOR;\n }", "abstract protected function getListStorePath(): string;", "private function keysPath()\n {\n return storage_path(implode(DIRECTORY_SEPARATOR, ['framework', 'cache', 'keys.json']));\n }", "public function getCachePath()\n {\n return $this->getSettingArray()[\"cache_path\"];\n }", "protected function getStorageFile()\n\t{\n\t\t$this->createDirectory();\n\t\treturn $this->storagePath.$this->storageFileName;\n\t}", "public function getStorageDir() : string\n {\n return $this->storageDir;\n }", "function getGlobalFilePath($path,$name)\n{\n return Storage::url($path.$name);\n}", "protected function getConfigPath() {\n\t\treturn config_path('cachetags.php');\n\t}", "protected function storagePath()\n {\n if (\\Yii::$app->controller != $this) {\n return false;\n }\n return $this->_storagePath\n ? $this->_storagePath\n : $this->_storagePath \n = str_replace('@app/web', '', $this->findModel(Yii::$app->request->get('id'))->getStoragePath());\n }", "function elgg_get_filepath_cache() {\n\tglobal $CONFIG;\n\tstatic $FILE_PATH_CACHE;\n\tif (!$FILE_PATH_CACHE) {\n\t\t$FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);\n\t}\n\n\treturn $FILE_PATH_CACHE;\n}", "public static function getTemporaryPath()\n {\n if (is_gae_std() || env('GAE_CACHEFS')) {\n return 'cachefs://'.gae_project().'/'.gae_service().'/'.gae_version();\n } else {\n return '/tmp/laravel/storage';\n }\n }", "protected function getStoragePath()\n {\n return Command::getDataDir() . self::STORAGE_DIR . DIRECTORY_SEPARATOR . self::CSV_DATASTORE;\n }", "public function getPath()\n {\n return 'bundles/jobhub/'.$this->getUploadDir().'/'.$this->path;\n }", "function get_theme_path(){\n\tglobal $theme;\n\treturn $theme->get_theme_path();\n}", "private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }", "public function getExtensionInstallStorage() {}", "public function getCachedConfigPath();", "function storage_path($path = '')\n {\n return phanda()->storagePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "function storage_path($path = '')\n\t{\n\t\treturn app('path.storage').($path ? '/'.$path : $path);\n\t}", "public static function getStorage() {}", "function gutenberg_dir_path() {\n\treturn plugin_dir_path( dirname( __FILE__ ) );\n}", "public function path()\n {\n return \"/storage/{$this->picture}\";\n }", "function getStorage() ;", "protected function _getCliLockDir()\n {\n return HaloBase::getInstance()->getScriptLockPath();\n }", "public function getThemePath(): string;", "function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }", "public function getCachePath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_CACHE);\r\n\t}", "public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }", "public function getCachedServicesPath()\n {\n return $this->normalizeCachePath('APP_SERVICES_CACHE', 'cache/services.php');\n }", "static public function getKekuleDir()\n {\n return kekulejs_configs::getScriptDir();\n }", "public function getPath(): string\n {\n $root = null;\n $currentDirectory = __DIR__;\n\n do {\n $currentDirectory = dirname($currentDirectory);\n $config = $currentDirectory . '/.refresh-database.yml';\n\n if (file_exists($config)) {\n $root = $currentDirectory;\n }\n } while (is_null($root) && $currentDirectory != '/');\n\n return $config;\n }", "public function storagePath($path = '')\n\t{\n\t\treturn $this['path.storage'].ltrim($path, '/');\n\t}", "public function getSavePath(): string\n {\n return session_save_path();\n }", "public function getCacheFolder()\n {\n\n return dirname(__FILE__) . '/../../store/cache/';\n }", "public function getSavePath(): string;", "public function getStorage() {}", "public function getStorage() {}", "public function getStorage() {}", "public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }", "public function getPath()\n {\n return __DIR__ . '/settings';\n }", "public static function getOldJsonFilePath()\n {\n $menusetConfig = self::getMenusetConfig();\n //return Globals::getWorkFolder() . $menusetConfig->setting->fileName;\n return Globals::getDataFilePath($menusetConfig->setting->fileName);\n }", "public function getLogPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_LOG);\r\n\t}", "public function getExtensionInstallStorage() {\n\t\treturn $this->extensionInstallStorage;\n\t}", "public function plugin_path()\n {\n return plugin_dir_path(__FILE__);\n }", "protected static function getPathThisScript() {}", "protected function getStorageInfo() {\n\t\t$dirInfo = \\OC\\Files\\Filesystem::getFileInfo('/', false);\n\t\treturn \\OC_Helper::getStorageInfo('/', $dirInfo);\n\t}", "function config_path()\n {\n $paths = getPaths();\n\n return $paths['config'];\n }", "private function _getStorageName() {\n\t\tif($this->_rememberMe) {\n\t\t\treturn self::TOKEN_COOKIE_STORAGE;\n\t\t}\n\n\t\treturn self::TOKEN_SESSION_STORAGE;\n\t}", "public function getCacheDir(){\r\n return $this->_cache->getDir();\r\n }", "function kval_fsstore_path()\n{\n return filesystem_files_path() . 'kval';\n}", "public function getStoragePath($path = null)\n {\n return $this->getBasePath().'/storage'.($path ? '/'.$path : $path);\n }", "function osdi_log_dir()\n {\n $log_dir = ABSPATH . '/wp-content/osdi';\n return $log_dir;\n }", "public function get_path_hashed()\n\t\t{\n\t\t\treturn $this->get_path_hashed_dir().'/'.$this->get_path_hashed_name();\n\t\t}", "protected function _getThemesPath()\n {\n $pathElements = array(\n dirname(__FILE__),\n '..',\n '..',\n 'public',\n 'themes'\n );\n return realpath(implode(DIRECTORY_SEPARATOR, $pathElements));\n }", "public function getCacheDir();", "function getStorage();", "public function get_plugin_path() {\n\t\t$this->plugin_path = untrailingslashit( plugin_dir_path( dirname( __FILE__ ) ) );\n\t\treturn $this->plugin_path;\n\t}", "public static function getLanguageThumbDir() {\n return public_path(self::LANGUAGE_THUMB_DIR);\n }", "public function getEntrypointsPath(): string;", "public function getExtensionCopyStorage() {}", "static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }", "public function get_theme_path(){\n\t\treturn $this->theme_path;\n\t}", "public function getStorage();", "public function getStorage();", "public function getExtrasPath()\n {\n // get options from configuration\n $options = Config::inst()->get('FAQSearchIndex', 'options');\n\n $globalOptions = Solr::solr_options();\n if (isset($options['extraspath']) && file_exists($options['extraspath'])) {\n $globalOptions['extraspath'] = $options['extraspath'];\n }\n return $this->extrasPath ? $this->extrasPath : $globalOptions['extraspath'];\n }", "public static function getPath() {\n\t\treturn NINJA_ROOT . '/snapshot';\n\t}", "function wc_product_addons_custom_plugin_path() {\n return untrailingslashit( plugin_dir_path( __FILE__ ) );\n}", "public function getFilePath() {\n return base_path() . '/lam.json';\n }", "function custom_get_available_tools_paths_base(){\n\t$paths_base = array();\n\t$paths_base[] = CUSTOM_PLUGIN_PATH.CUSTOM_PLUGIN_TOOLS_FOLDER;\n\t$paths_base = apply_filters(\"custom_get_available_tools_paths_base\", $paths_base);\n\treturn $paths_base;\n}", "public function getLocalPath();", "public static function getLookupPath() {\n return self::$lookup_path;\n }", "public function path(): string\n\t{\n\t\treturn $this->configPath;\n\t}", "public function getCachePath()\r\n\t{\r\n\t\t$path = AD.$this->getConfig()->getChildren(\"cache\")->getString(\"path\");\r\n\t\tif(!is_dir($path))\r\n\t\t{\r\n\t\t\tmkdir($path, 0777, true);\r\n\t\t}\r\n\t\treturn $path;\r\n\t}", "public static function getPath()\n {\n return rex_path::coreData('system.log');\n }", "public function getCachePath()\n {\n return $this->cachePath;\n }", "public function getServicesPath() {\n return __DIR__ . '/../../services.yml';\n }", "public static function getCachedServicesPath(){\n return \\Illuminate\\Foundation\\Application::getCachedServicesPath();\n }", "function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}", "private function &get_directory_ref() {\r\n\t\treturn WP_Test_Stream::$data[ $this->bucket ][ rtrim( $this->file, '/' ) . '/' ];\r\n\t}", "public function getCacheDirectoryPath()\n {\n return $this->cacheDirectoryPath;\n }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}" ]
[ "0.6960539", "0.67930615", "0.67847514", "0.6598684", "0.6570017", "0.6570017", "0.6570017", "0.6570017", "0.6567734", "0.65210617", "0.64358497", "0.6354079", "0.6296733", "0.6214714", "0.6214714", "0.61545396", "0.6077186", "0.60617465", "0.6045778", "0.60280603", "0.5993072", "0.59716815", "0.59681505", "0.59649473", "0.59433496", "0.5915648", "0.5909688", "0.5893409", "0.58925456", "0.5891678", "0.58806235", "0.5879207", "0.585733", "0.5853551", "0.58507454", "0.5840415", "0.58362556", "0.5828691", "0.5826594", "0.58259505", "0.58142954", "0.57765967", "0.57750064", "0.57667387", "0.5761773", "0.5760991", "0.5744049", "0.5742923", "0.57345796", "0.5724355", "0.570879", "0.5703842", "0.5701964", "0.5698442", "0.5673805", "0.56733894", "0.5673284", "0.56658286", "0.56569403", "0.56510615", "0.56500465", "0.56489754", "0.56470513", "0.56468356", "0.56415105", "0.56138706", "0.5613506", "0.56124544", "0.5609353", "0.5608692", "0.55989176", "0.55984783", "0.5594496", "0.5589236", "0.55849", "0.55820984", "0.55738187", "0.5571982", "0.5569758", "0.55678797", "0.55676365", "0.55673057", "0.55673057", "0.5567192", "0.5561586", "0.5552749", "0.5548427", "0.55474657", "0.5545973", "0.5543744", "0.55402774", "0.5539135", "0.5536169", "0.553597", "0.55253863", "0.55204356", "0.55201775", "0.55183315", "0.551455", "0.55131763" ]
0.6673023
3
You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels. The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A".
function solution(string $J, string $S) { $j = str_split($J); $s = str_split($S); $count = 0; foreach ($j as $value) { foreach ($s as $value2) { if ($value2 == $value) { $count++; } } } return $count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numJewelsInStones($J,$S){\n $jArr = str_split($J,1);\n $jArr = array_flip($jArr);\n $len = strlen($S);\n $r = 0;\n for($i=0;$i<$len;$i++){\n $key = $S[$i];\n if(isset($jArr[$key])){\n $r++;\n }\n }\n return $r;\n}", "function countHoles ($MyStr) {\n\n $letters = array (\n 'A' => 1,\n 'B' => 2,\n 'D' => 1,\n 'G' => 0\n );\n $count = 0;\n $count2 =0;\n $count3 =0;\n $characters = str_split ($MyStr, 1);\n\n foreach( $characters as $thisChar) {\n if ($letters[$thisChar] > 0){\n $count += $letters[$thisChar];\n }\n\n\n // Alternative short form for the if statement\n // $charVal is assigned the value found at the index or 0\n // depending if the key at the index matches the character\n // we are currently looking at.\n // Then we just add the value returned by the comparison\n // $charVal = $letters[$thisChar] || 0;\n // $count += $charVal;\n\n\n $charVal = $letters[$thisChar];\n if ($charVal)\n $count2 += $charVal;\n\n // To shorten this even more we could have said\n $charVal = $letters[$thisChar] || 0;\n $count3 += $charVal;\n }\n echo \"<br /> If statement counted \" . $count . \" holes.\";\n echo \"<br /> Short statement counted \". $count2 . \" holes.\";\n echo \"<br /> Ultra short form counted \". $count3 . \" holes\";\n return ($count);\n}", "function count_vowels($string){\r\n $kata = strtolower($string);\r\n $pecah = str_split($kata); \r\n $count=0;\r\n for ($i=0;$i<sizeof($pecah);$i++){\r\n if ($pecah[$i]== \"a\" || $pecah[$i]== \"i\" || $pecah[$i]== \"u\" || $pecah[$i]== \"e\"|| $pecah[$i] == \"o\"){\r\n $count++;\r\n }\r\n }\r\n \r\n echo $count;\r\n }", "function stringConstruction($s) {\n $split_s = str_split($s);\n $us = array_unique($split_s);\n return count($us);\n}", "function sherlockAndAnagrams($s) {\n $stringSize=strlen($s);\n $data=[];\nfor($i=0;$i<$stringSize;$i++){\n\n for($j=$i;$j<$stringSize;$j++){\n for($t=$i;$t<=$j;$t++){\n $data[$t][]=countchars($s[$t]);\n }\n\n\n }\n\n\n}\necho '<pre>';\nprint_r($data);\n\n}", "private function countVowelsAndConsonants()\n {\n $lower_driver = strtolower($this->completed_name);\n\n foreach(str_split($lower_driver) as $chart) {\n $consonant_or_vowel = $this->isVowelOrConsonant($chart);\n if($consonant_or_vowel === 'vowel') {\n $this->vowels++;\n }\n\n if($consonant_or_vowel === 'consonant') {\n $this->consonants++;\n }\n }\n }", "function countOnes($n){\r\n $count = 0;\r\n for($i=0;$i<strlen($n); $i++){\r\n if($n[$i]=='1') $count++;\r\n elseif($n[$i]=='0') {\r\n $count-1;\r\n }else return;\r\n }return \"Number of 1s:\".$count;\r\n }", "public function calculate_number_of_equal_first_characters(){\n $counter = 0;\n for ($key=0; $key<strlen($this->initial_word); $key++) {\n if($this->initial_word[$key] == $this->final_word[$key]){\n $counter += 1;\n }else{\n $this->number_of_equal_first_characters = $counter;\n return;\n }\n }\n $this->number_of_equal_first_characters = $counter;\n }", "public function countPossibilities()\n {\n $count = 0;\n foreach($this->dictionary as $charGroup) {\n if($count === 0) {\n $count = count($charGroup);\n } else {\n $count = $count * count($charGroup);\n }\n }\n return $count;\n }", "function camelcase($s) {\n \n $count=1;\n\n for($i=0; $i<strlen($s); $i++){\n if(preg_match('/[A-Z]$/',$s[$i])==true)\n {\n $count++;\n }\n }\n\n return $count;\n\n}", "function GetSJISStringWidth($s)\r\n {\r\n $l=0;\r\n $cw=&$this->CurrentFont['cw'];\r\n $nb=strlen($s);\r\n $i=0;\r\n while($i<$nb)\r\n {\r\n $o=ord($s{$i});\r\n if($o<128)\r\n {\r\n //ASCII\r\n $l+=$cw[$s{$i}];\r\n $i++;\r\n }\r\n elseif($o>=161 and $o<=223)\r\n {\r\n //Half-width katakana\r\n $l+=500;\r\n $i++;\r\n }\r\n else\r\n {\r\n //Full-width character\r\n $l+=1000;\r\n $i+=2;\r\n }\r\n }\r\n return $l*$this->FontSize/1000;\r\n }", "function count_vowel($str)\n{\n\t$vowels = 0;\n\t$j = strlen($str);\n\tfor($i=0;$i<$j;$i++)\n\t{\n\t\tif(strstr('aeiouAEIOU',$str[$i]))\n\t\t{\n\t\t\t$vowels++;\n\t\t}\t\n\t}\n\treturn $vowels;\n}", "function countUniqChars($s)\n{\n return count(array_unique(str_split($s)));\n}", "private function validate_3($s)\n\t{\n\t\t$n = 0;\n\t\tforeach ($s as $v) {\n\t\t\t$n += $v;\n\t\t}\n\t\treturn $n;\n\t}", "function frequentLetters($string)\n{\n $hash1 = [];\n $frequentLetters = [];\n for ($index = 0; $index < strlen($string); $index++) {\n $char = $string[$index];\n if (!array_key_exists($char, $hash1)) {\n $hash1[$char] = 0;\n }\n $hash1[$char] += 1;\n if ($hash1[$char] > 2 && !in_array($char, $frequentLetters)) {\n $frequentLetters[] = $char;\n }\n }\n // print_r($hash1);\n return $frequentLetters;\n}", "function repeatedString($s, $n)\n{\n\n $a = 0;\n $aTotal = 0;\n $contador = floor($n/strlen($s));\n $resto = $n%strlen($s);\n\n for($i=0 ; $i <strlen($s) ; $i++) if($s[$i] == \"a\" ) $a++;\n\n $aTotal = $contador*$a;\n\n for( $i = 0 ; $i < $resto ; $i++) if($s[$i] == \"a\") $aTotal++;\n\n return $aTotal;\n}", "function countUniqChars($str)\n{\n if (strlen($str) === 0) {\n return 0;\n }\n $result = 0;\n $arrChar = [];\n $chars = str_split(mb_strtolower($str));\n foreach ($chars as $index => $char) {\n if (!in_array($chars[$index], $arrChar)) {\n $arrChar[$index] = $chars[$index];\n }\n } return count($arrChar);\n}", "function getOcurrencesLetters($book) {\n $count = array();\n $strlen = strlen($book); // O(1)\n for ($i = 0; $i <= $strlen; $i++) {\n $char = substr($book, $i, 1);\n if ($char) {\n if (!isset($count[$char])) {\n $count[$char] = 0;\n }\n $count[$char] += 1;\n }\n }\n return $count;\n}", "function count_symbols($string){\r\n\t//Regex \\w is any non-letter, non-number: too broad\r\n\t//Better to list the ones that count\r\n\t//Escape regex symbols to gety their literal value\r\n\t$regex = '/['. preg_quote('!@#$%^&*-_+=?') . ']/';\r\n\treturn preg_match_all($regex, $string);\r\n}", "public function countStones()\n {\n $stoneCount = 0;\n foreach ($this->board as $x => $row) {\n /** @var array $row */\n foreach ($row as $y => $stone) {\n if (self::STONE === $stone) {\n $stoneCount++;\n }\n }\n }\n\n return $stoneCount;\n }", "function findNumbers($nums) {\n $count = 0;\n foreach ($nums as $key => $num) {\n $len = strlen($num);\n if($len % 2 == 0) {\n $count++;\n }\n }\n return $count;\n}", "function tep_word_count($string, $needle) {\n\t$temp_array = split($needle, $string);\n\treturn sizeof($temp_array);\n}", "function mb_count_chars($input) {\r\n\t\t$l = mb_strlen($input);\r\n\t\t$unique = array();\r\n\t\tfor($i = 0; $i < $l; $i++) {\r\n\t\t\t$char = mb_substr($input, $i, 1);\r\n\t\t\tif(!array_key_exists($char, $unique))\r\n\t\t\t\t$unique[$char] = 0;\r\n\t\t\t$unique[$char]++;\r\n\t\t}\r\n\t\treturn $unique;\r\n\t}", "function occurrences_func($str, $array) {\r\n\tif (!valid_string($str)) {\r\n\t\treturn;\r\n\t} else if (!valid_array($array)) {\r\n\t\treturn 0;\r\n\t}\r\n\t// case insensitive\r\n\t$str_lower = strtolower($str);\r\n\r\n\t$occurrences = 0;\t\r\n\t// for each item in array\r\n\tforeach ($array as $item) {\r\n\t\t$item = strtolower($item);\r\n\t\t$occurrences += substr_count($str_lower, $item);\r\n\t}\r\n\treturn $occurrences;\r\n}", "function returnCharacterCount(string $character, string $string): int\n {\n $counter = 0;\n\n for ($i = 0; $i < strlen($string); $i++) {\n if ($character == $string[$i]) {\n $counter++;\n }\n }\n return $counter;\n }", "private static function syllables_count_word( $word ) {\n\t\t$word = trim( $word );\n\t\t$unacceptable = (boolean) self::preg_match_all( '/[^a-zA-Z]/', $word );\n\t\tif ( $unacceptable ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$length = strlen( $word );\n\t\tif ( $length < 3 ) {\n\t\t\t// e.g. we, to, a\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Count the number of vowels (A, E, I, O, U) in the word.\n\t\t// Add 1 every time the letter 'y' makes the sound of a vowel\n\t\t$syllables = self::preg_match_all( '/[aeiouy]/', $word );\n\n\t\t// Subtract 1 for each silent vowel (like the silent 'e' at the end of a word).\n\t\t$ends_with_e = self::ends_with( $word, 'e' );\n\t\t$syllables -= $ends_with_e ? 1 : 0;\n\n\t\tif ( $ends_with_e && 3 === $length ) {\n\t\t\t// e.g. the, eve, axe\n\t\t\treturn 1;\n\t\t}\n\n\t\t// Subtract 1 for each diphthong\n\t\t$diphthongs = self::preg_match_all( '/[aeiouy]{2}/', $word );\n\t\t$syllables -= $diphthongs;\n\n\t\t// Subtract 1 for each triphthong\n\t\t$triphthongs = self::preg_match_all( '/[aeiouy]{3}/', $word );\n\t\t$syllables -= $triphthongs;\n\n\t\t// Does the word end with \"le\" or \"les?\" Add 1 only if the letter before the \"le\" is a consonant.\n\t\t$ends_with_le = (boolean) self::preg_match_all( '/[^aeiouy]le|les$/', $word );\n\t\t$syllables += $ends_with_le ? 1 : 0;\n\n\t\treturn $syllables <= 0\n\t\t\t? 0\n\t\t\t: $syllables;\n\t}", "function passwordLength($wachtwoordbevestiging) {\n\t$count = 0;\n\n\tfor($i = 0; $i < strlen($wachtwoordbevestiging); $i++) { \n\t\tif($wachtwoordbevestiging[$i] != ' ') \n\t\t\t$count++; \n\t}\n\n\tif ($count < 6) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "function same($s1, $s2) {\n\t$s1len = strlen($s1);\n\t$s2len = strlen($s2);\n\tif($s1len != $s2len) return false;\n\n\tfor($i = 0; $i < $s1len; $i++) {\n\t\t$count = 0;\n\t\tfor($j = 0; $j < $s1len; $j++) {\n\t\t\tif($s1[$i] == $s2[$j]) $count++;\n\t\t}\n\t\tif($count != 1) return false;\n\t}\n\treturn true;\n}", "function charCounter($c, array $grid): int {\n $total = 0;\n $h = count($grid);\n $w = count($grid[array_keys($grid)[0]]);\n $y0 = min(array_keys($grid));\n $x0 = min(array_keys($grid[array_keys($grid)[0]]));\n for ($y = $y0; $y < $y0 + $h; $y++) {\n for ($x = $x0; $x < $x0 + $w; $x++) {\n if ($grid[$y][$x] === $c) {\n $total++;\n }\n }\n }\n return $total;\n }", "function compressString($input_string)\n{\t\n $count = 0;\n $temp_str = '';\n \n for($i=0;$i<strlen($input_string);$i++)\n {\n //comparing current character with the next character\n if($input_string[$i] == $input_string[$i + 1])\n {\n $count++;\n }\n else {\n $cnt = $count + 1;\n if($cnt != 1)\n {\n $temp_str .= $input_string[$i].$cnt; \n }\n else{\n $temp_str .= $input_string[$i];\n }\n \n $count = 0;\n }\n }\n \n return $temp_str;\n}", "function numeroFjalet($Fjalia) {\n\t$fjalt = explode(\" \", $Fjalia);\n\tforeach ($fjalt as $key => $value) {\n\t\tif(ctype_alpha($value)) {\n\t\t\t$fjaltVetemShkronja[] = strtolower($value);\n\t\t}\n\t}\n\t\n\tfor($i = 0; $i < count($fjaltVetemShkronja) - 1; $i++) {\n\t\t$a = 0;\n\t\tfor($j = 0; $j < count($fjaltVetemShkronja); $j++) {\n\t\t\tif($fjaltVetemShkronja[$i] == $fjaltVetemShkronja[$j]) {\n\t\t\t\t$a ++;\n\t\t\t}\n\t\t}\n\t\t$perseritjaEFjaleve[$fjaltVetemShkronja[$i]] = $a;\n\t}\n\tasort($perseritjaEFjaleve);\n\treturn $perseritjaEFjaleve;\n}", "function nSmFromIp($sm) {\n\n $count = 0;\n\n for($i=0;$i<32;$i++) {\n\n if($sm[$i]==\"1\") {\n $count++;\n }\n }\n \n return $count;\n}", "public function countGroupedByFirstLetter()\n {\n $series = array();\n foreach ($this->getRepository()->countGroupedByFirstLetter() as $serie) {\n // Force non alpha to #\n if (!preg_match('/[A-Z]/', $serie['first_letter'])) {\n $serie['first_letter'] = '#';\n }\n if (!array_key_exists($serie['first_letter'], $series)) {\n $series[$serie['first_letter']] = 0;\n }\n $series[$serie['first_letter']] += $serie['nb_serie'];\n }\n\n return $series;\n }", "function test_countRepeats_multiLetter()\n {\n $test_Repeat = new RepeatCounter;\n $input1 = 'and';\n $input2 = 'and';\n\n $result = $test_Repeat->countRepeats($input1, $input2);\n\n $this->assertEquals(1, $result);\n }", "function CompterNombreDeM($chaine) {\n$nb=0;\n\nfor ($i=0; $i <CompteNombreCaractere($chaine); $i++) { \n\tif (($chaine[$i]=='m') or ($chaine[$i]=='M') ) {\n\t\t$nb=$nb+1;\n}\n\n}\nreturn $nb;\n\n}", "function getTries(& $word) {\r\n //Remember you want 2x the number of letters in the word\r\n $tries = strlen($word) * 2;\r\n return $tries;\r\n}", "function subs($s,$s1,$s2,$s3){\n$ss='';\n$i1=0;$i2=0;$i3=0;\nfor ($i=0;$i<strlen($s);$i++)\n switch($s[$i]){\n case '@':\n if ($i1>=strlen($s1)) continue; \n $ss=$ss.$s1[$i1];$i1++;\n break;\n case '#':\n if ($i2>=strlen($s2)) continue; \n $ss=$ss.$s2[$i2];$i2++;\n break;\n case '$':\n if ($i3>=strlen($s3)) continue;\n $ss=$ss.$s3[$i3];$i3++;\n break;\n default: $ss=$ss.$s[$i];\n }\nreturn $ss;\n}", "function contains($c, $s){\r\n for ($i = 0; $i < strlen($s); $i++){\r\n if ($s[$i] == $c){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function allCharactersAreUnique($str)\n{\n $inputLength = strlen($str);\n for ($i = 0; $i < $inputLength; ++$i)\n {\n for ($j = 0; $j < $inputLength; ++$j)\n {\n if (($i != $j) && ($str[$i] == $str[$j]))\n {\n return false;\n }\n }\n }\n return true;\n}", "function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }", "function tratar_jogada($jogada){\n\n\t$i = 0;\n\t$j = 0;\n\t$k = 0;\n\t$a = 0;\n\t$b = 0;\n\n\t$flagTexto = true;\n\t$flagJogada = true;\n\n\t//Cria arrays que guardarão individualmente cada texto e cada jogada \n\t$texto = array();\t\t\t//Guarda as substrings de texto, p recriar a string principal\n\t$rolagem = array();\t\t\t//Guarda as substrings de jogada, p recriar a string principal\n\t$controle = array();\t\t//Guarda a ordem das substrings de texto e jogada, p recriar a string principal na ordem certa \"T = texto\" \"J = jogada\" \n\n\t$nova_frase = \"\";\n\t$nova_jogada = \"\";\n\t$jogadaTratada = \"\";\n\t$resultado = 0;\n\n\t//echo \"Quantidade de caracteres: \".strlen($jogada);\n\t//echo \"<br />\";\n\n\t$i = 0; $j = 0;\n\n\twhile($i < strlen($jogada)){\n\n\t\t//Captura o texto ate chegar em uma jogada\n\t\tif($jogada[$i] != \"[\" && $flagTexto && $i < strlen($jogada)){\n\t\t\t$nova_frase = $nova_frase.$jogada[$i];\n\n\t\t\t//Testa para ver se é fim de cadeia\n\t\t\tif($i == (strlen($jogada) -1)){\n\t\t\t\t//Captura uma frase identificada e habilita a capura de uma jogada\n\t\t\t\tarray_push($texto, $nova_frase);\n\t\t\t\tarray_push($controle, \"T\");\n\t\t\t}\n\t\t}\n\t\telse{\n\n\t\t\tif($flagTexto){\n\t\t\t\tif($nova_frase != \"\"){\n\t\t\t\t\t//Captura uma frase identificada e habilita a capura de uma jogada\n\t\t\t\t\tarray_push($texto, $nova_frase);\n\t\t\t\t\tarray_push($controle, \"T\");\t\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Guarda o ponto de leitura da entrada a partir do aractere \"[\"\n\t\t\t\t$j = $i;\n\n\t\t\t\t//Muda o controle para ler rolagens\n\t\t\t\t$flagTexto = false;\n\t\t\t\t$flagJogada = true;\n\t\t\t\t\n\n\t\t\t\t// Verifica se o abre colchete é o ultimo caratere, se não for, pega ele\n\t\t\t\tif($j != (strlen($jogada) -1)){\n\t\t\t\t\t//Captura o abre colchete atual\n\t\t\t\t\t$nova_jogada = $nova_jogada.$jogada[$j];\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\n\t\t\t\t//Guarda o ultimo abre colchete como texto\n\t\t\t\tif($j == (strlen($jogada) -1)){\n\t\t\t\t\t//Texto detectado\n\n\t\t\t\t\t//limpa a variavel\n\t\t\t\t\t$nova_frase = \"\";\n\t\t\t\t\t\n\t\t\t\t\t$nova_frase = $nova_frase.$jogada[$i];\n\n\t\t\t\t\tarray_push($texto, $nova_frase);\n\t\t\t\t\tarray_push($controle, \"T\");\n\n\t\t\t\t\t//Muda o controle para ler rolagens\n\t\t\t\t\t$flagTexto = false;\n\t\t\t\t\t$flagJogada = true;\n\t\t\t\t}\n\n\t\t\t\t$j++;\n\n\t\t\t\t//prepara a variavel para pegar novo texto\n\t\t\t\t$nova_frase = \"\";\n\t\t\t}\n\n\t\t\t//Le a substring que pode representar uma jogada\n\t\t\twhile($flagJogada && $j < strlen($jogada)){\n\n\t\t\t\tif($jogada[$j] != \"]\"){\t\t\t\t\n\n\t\t\t\t\t//Se ler outro \"[\" sai do while e continua lendo texto\n\t\t\t\t\tif($jogada[$j] == \"[\"){\n\t\t\t\t\t\t//Texto detectado\n\t\t\t\t\t\t$nova_frase = $nova_jogada;\n\t\t\t\t\t\tarray_push($texto, $nova_frase);\n\t\t\t\t\t\tarray_push($controle, \"T\");\n\n\t\t\t\t\t\t//Muda o controle para ler rolagens e sai do while para continuar lendo texto\n\t\t\t\t\t\t$flagTexto = true;\n\t\t\t\t\t\t$flagJogada = false;\n\n\t\t\t\t\t\t// limpa a variável\n\t\t\t\t\t\t$nova_jogada = \"\";\n\t\t\t\t\t\t$nova_frase = \"\";\n\n\t\t\t\t\t\t//Corrige o indice\n\t\t\t\t\t\t$j--;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t//Armazena a nova jogada a medida que os caracteres sao lidos\n\t\t\t\t\t\t$nova_jogada = $nova_jogada.$jogada[$j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Armazena o \"]\"\n\t\t\t\t\t$nova_jogada = $nova_jogada.$jogada[$j];\n\n\t\t\t\t\t//Muda o controle para ler rolagens e sai do while para continuar lendo texto\n\t\t\t\t\t$flagTexto = true;\n\t\t\t\t\t$flagJogada = false;\n\t\t\t\t}\n\n\t\t\t\t$j++;\n\t\t\t}\n\n\n\t\t\t//Armazena a nova jogada a medida que os caracteres sao lidos\n\t\t\tif($nova_jogada != \"\"){\n\n\t\t\t\t//Captura uma jogada completa e salva\n\t\t\t\tarray_push($rolagem, $nova_jogada);\n\t\t\t\tarray_push($controle, \"J\");\n\n\t\t\t\t//Avança na leitura da cadeia de entrada\n\t\t\t\t$i = $j - 1;\n\n\t\t\t\t// limpa a variável\n\t\t\t\t$nova_jogada = \"\";\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Avança na leitura da cadeia de entrada\n\t\t\t\t$i = $j - 1;\n\t\t\t}\n\t\t}\n\n\t\t$i++;\n\t\t\n\t}\n\n\t// ################################# INICIO - echo apenas para verificação. Não apagar!!! #################################\n\t$i = 0;\n\twhile($i < count($texto)){\n\t\techo \"Texto: \" . $i . \": \" . $texto[$i] . \"<br/>\";\n\t\t$i++;\n\t}\n\n\t$i = 0;\n\twhile($i < count($rolagem)){\n\t\techo \"Rolagem: \" . $i. \": \" . $rolagem[$i] . \"<br/>\";\n\t\t$i++;\n\t}\n\n\t//Trata as rolagens de dados\n\t$b = 0; \n\twhile($b < count($rolagem)){\n\t\t//echo \"Resultado da rolagem Antes: \" . $rolagem[$b] . \"<br/>\";\n\t\t$rolagem[$b] = calcula_resultado_jogada($rolagem[$b]);\n\n\t\t//echo \"Resultado da rolagem Depois: \" . $rolagem[$b] . \"<br/>\";\n\t\t$b++;\n\t}\n\n\t// ################################# FIM - echo apenas para verificação. Não apagar!!! #################################\n\n\t//Reconstroi a entrada com o tratamento das jogadas\n\t$a = 0; $b = 0; $k = 0;\n\twhile($k < count($controle)){\n\t\tif($controle[$k] == \"T\"){\n\t\t\t$jogadaTratada = $jogadaTratada.$texto[$a];\n\t\t\t$a++;\n\t\t}\n\n\t\tif($controle[$k] == \"J\"){\n\n\t\t\t$temp = $rolagem[$b];\n\t\t\t//Verifica se o resultado da jogada é um numero\n\t\t\tif($temp[0] != \"[\"){\n\t\t\t\t//Se for número, coloca-o entre colchetes\n\t\t\t\t$jogadaTratada = $jogadaTratada.\"[ \";\n\t\t\t\t$jogadaTratada = $jogadaTratada.$rolagem[$b];\n\t\t\t\t$jogadaTratada = $jogadaTratada.\" ]\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Se não for número, o texto já está entre colchetes\n\t\t\t\t$jogadaTratada = $jogadaTratada.$rolagem[$b];\n\t\t\t}\n\t\t\t\n\t\t\t$b++;\n\t\t}\n\t\t$k++;\n\t}\n\treturn $jogadaTratada;\n}", "function count_x($string) {\n if (empty($string)) {\n return 0;\n }\n $index = 0;\n return _count_x($string, $index);\n}", "function repeatedString($s, $n) {\n $repeatCount = floor($n/strlen($s));\n $carryoverStr = substr($s, 0, $n%strlen($s));\n $aCount = 0;\n $aCarryoverCount = 0;\n for ($i = 0; $i < strlen($s); $i++) {\n if ($s[$i] === 'a') {\n $aCount++;\n }\n if ($i < strlen($carryoverStr) && $carryoverStr[$i] === 'a') {\n $aCarryoverCount++;\n }\n }\n return ($aCount * $repeatCount) + $aCarryoverCount;\n}", "function judge($str) {\r\n\t\tforeach ($this->allergicWord as $key) {\r\n\t\t\tif (is_int(strpos($str, $key))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function hasPairs($pass)\n{\n\t\n\t// count pairs\n\t$pairs = 0;\n\n\t// hold last char \n\t$lastChar = null;\n\t\n\t// loop through letters\n\tfor($i = 0; $i < strlen($pass); $i++)\n\t{\n\t\t$char = substr($pass, $i, 1);\n\t\t\n\t\t// if pair, count it and reset $lastChar\n\t\tif($char == $lastChar)\n\t\t{\n\t\t\t$pairs++;\n\t\t\t$lastChar = null;\n\t\t}\n\t\t\n\t\t// otherwise update $lastChar\n\t\telse $lastChar = $char;\n\t\t\n\t}\n\t\n\t// if 2+ pairs, true\n\tif($pairs >= 2) return true;\n\treturn false;\n\t\n}", "function motsPossible($mots, $lettres) {\n $mots_trouves = 0;\n \n foreach ($lettres[0] as $l0) {\n foreach ($lettres[1] as $l1) {\n foreach ($lettres[2] as $l2) {\n foreach ($lettres[3] as $l3) {\n foreach ($lettres[4] as $l4) {\n $mot_tmp = \"$l0$l1$l2$l3$l4\";\n if (in_array($mot_tmp, $mots)) {\n $mots_trouves++;\n }\n }\n }\n }\n }\n }\n \n return $mots_trouves;\n}", "function funnyString($s) {\n $str_array = str_split($s);\n $rev_array = array_reverse($str_array);\n $s_ascii = [];\n $r_ascii = [];\n for($i=0; $i<count($str_array); $i++) {\n array_push($s_ascii, ord($str_array[$i]));\n array_push($r_ascii, ord($rev_array[$i]));\n }\n $s_diff = [];\n $r_diff = [];\n for($j=0; $j<count($s_ascii)-1; $j++ ) {\n array_push($s_diff, abs($s_ascii[$j]-$s_ascii[$j+1]));\n array_push($r_diff, abs($r_ascii[$j]-$r_ascii[$j+1]));\n }\n if( $s_diff === $r_diff ) {\n return \"Funny\";\n }\n else {\n return \"Not Funny\";\n }\n}", "public function isAnagram($s, $t) \n {\n $sLen = strlen($s);\n $tLen = strlen($t);\n $sArr = [];\n $tArr = [];\n for ($i=0; $i<$sLen; $i++) {\n isset($sArr[$s[$i]])? $sArr[$s[$i]]++ : ($sArr[$s[$i]]=1);\n }\n for ($i=0; $i<$tLen; $i++) {\n isset($tArr[$t[$i]])? $tArr[$t[$i]]++ : ($tArr[$t[$i]]=1);\n }\n return $sArr == $tArr;\n }", "private function str2charCountArray($str) {\n\t\treturn array_count_values($this->str2charArray($str));\n\t}", "function str_utf8_mix_word_count($str = \"\"){\n\t$utf8_chinese_pattern=\"/[\\x{4e00}-\\x{9fff}\\x{f900}-\\x{faff}]/u\";\n\t$utf8_symbol_pattern=\"/[\\x{ff00}-\\x{ffef}\\x{2000}-\\x{206F}]/u\";\n $str = preg_replace($utf8_symbol_pattern, \"\", $str);\n return str_utf8_chinese_word_count($str) + strlen(preg_replace($utf8_chinese_pattern, \"\", $str));\n}", "protected function countMyAssociatedSia($sias){\n\n\t\t\t $myNotice=0;\n\t\t\t foreach ($sias as $sia) {\n\t\t\t \t\n\t\t\t \t//get teammembers\n\t\t\t \t $members=CommonFunction::updateMultiSelection('sia_program', 'sia_number',$sia,'team_members');\n\t\t\t \t$emp_id=Auth::user()->emp_id();\n\n\t\t\t \t//\n\t\t\t \t $teamMembers=[];\n\t\t\t\t $existance=0;\n\t\t\t\t if($members!=null){\n\t\t\t\t foreach ($members as $key => $value) {\n\t\t\t\t if (($pos = strpos($value, \"-\")) !== FALSE) { \n\t\t\t\t $teamMembers[] = substr($value, $pos+1); \n\t\t\t\t }\n\t\t\t\t } \n\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if (in_array($emp_id,$teamMembers))\n\t\t\t\t $myNotice++;\n\t\t\t }\n\t\t\t return $myNotice;\n }", "function StringWordCount ($input, &$count)\n {\n\t $count = str_word_count($input);\n\t return $count;\n }", "function beautify_string($string){\n $score = 0;\n\t$string = strtolower($string);\n\t$counts = array();\n\t\n\t//count occurences of string values if between a-z\n\tfor($i = 0; $i < strlen($string); $i++){\n\t\tif(preg_match(\"/^[a-z]$/\", $string[$i])){\n\t\t\tif(!array_key_exists($string[$i], $counts)){\n\t\t\t\t$counts[$string[$i]] = 1;\n\t\t\t}else{\n\t\t\t\t$counts[$string[$i]]++;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//sort occurences by appearance\n\tarsort($counts);\n\t\n\t//calculate score\n\t$beauty = 26;\n\t$score = 0;\n\t\n\tforeach($counts AS $key => $value) {\n\t\t$score += $beauty * $value;\n\t\t$beauty--;\n\t}\n\t\n\treturn($score);\n\t\n}", "function getNumTurns($array) {\n \n $numTurns = 0;\n for ($i = 0; $i < 3; $i++) {\n for ($j = 0; $j < 3; $j++) {\n //if the position in the game array is not \"N\"\n if(strcmp($array[$i][$j], \"N\") != 0) {\n $numTurns++;\n }\n }\n }\n return $numTurns;\n}", "function estimate_syllables($word) {\n $cmu_dict = CMUDict::get();\n static $arpabet_vowels = array(\n 'AO', 'AA', 'IY', 'UW', 'EH', 'IH', 'UH', 'AH', 'AX', 'AE', // Monophthongs\n 'EY', 'AY', 'OW', 'AW', 'OY', // Diphthongs\n 'ER' // R-colored vowels\n );\n static $english_vowels = array('A', 'E', 'I', 'O', 'U');\n\n $vowel_count = 0;\n\n // Count the number of Arpabet vowels in the line. Failing that, count the English vowels.\n $phonemes = $cmu_dict->getPhonemes($word);\n if ($phonemes === null) {\n // If it ends with S or 'S, then we can still potentially use the CMU dict, since S and 'S aren't vowels.\n $uppercased_word = strtoupper($word);\n if (ends_with(\"'S\", $uppercased_word)) {\n $phonemes = $cmu_dict->getPhonemes(substr($word, 0, -2));\n } else if (ends_with(\"'S\", $uppercased_word)) {\n $phonemes = $cmu_dict->getPhonemes(substr($word, 0, -1));\n }\n }\n if ($phonemes !== null) {\n foreach ($phonemes as $phoneme) {\n if (in_array($phoneme, $arpabet_vowels)) {\n $vowel_count++;\n }\n }\n } else {\n //echo \"Using English vowel counting for $word.\\n\";\n $letters = str_split(strtoupper($word));\n foreach ($letters as $letter) {\n if (in_array($letter, $english_vowels)) {\n $vowel_count++;\n }\n }\n }\n\n return $vowel_count;\n}", "function tach_chu_hien_thi($content){\r\n $mang = explode(\" \", $content);\r\n $str = \"\";\r\n $sochu = sizeof($mang);\r\n if($sochu < 10){\r\n for($j = 0; $j < sizeof($mang); $j++){\r\n $str = $str.\" \".$mang[$j];\r\n }\r\n }else{\r\n for($j = 0; $j < 15; $j++){\r\n $str = $str.\" \".$mang[$j];\r\n }\r\n }\r\n return $str;\r\n}", "function compareSemesters($sA, $sB){\n\t$dA = split(' ', $sA);\n\t$dB = split(' ', $sB);\n\tif((count($dA) != 2) || (count($dB) != 2) || (count($dA) != count($dB))) return 0;\n\tif(intval($dA[0]) < intval($dB[0])) return 1;\n\telse if (intval($dA[0]) > intval($dB[0])) return -1;\n\telse {\n\t\t$times = array(\"Spring\" => 0, \"Summer\" => 1, \"Fall\" => 2);\n\t\tif($times[$dA[1]] < $times[$dB[1]]) return 1;\n\t\telse if($times[$dA[1]] > $times[$dB[1]]) return -1;\n\t\telse return 0;\n\t}\n}", "public function countWordsDuplicatesReturnsCorrectCount()\n {\n $this->initializeSUT();\n $wordsCount = [\n 0 => \"My\",\n 1 => \"test\",\n 2 => \"string\",\n 3 => \"is\",\n 4 => \"just\",\n 5 => \"a\",\n 6 => \"string\",\n 7 => \"to\",\n 8 => \"test\",\n 9 => \"something\"\n ];\n\n $actual = $this->stringUtil->countWordsDuplicates($wordsCount);\n $this->assertEquals(2, $actual['test']);\n $this->assertEquals(2, $actual['string']);\n }", "function test_countRepeats_oneLetter()\n {\n $test_Repeat = new RepeatCounter;\n $input1 = 'a';\n $input2 = 'a';\n\n $result = $test_Repeat->countRepeats($input1, $input2);\n\n $this->assertEquals(1, $result);\n }", "function numero($s)\n{\n\t$j=0;\n\t$valor=false;\n\tfor($j=1; $j<10;$j++){\n\t\tif($s==$j){\n\t\t\t$valor=true;\n\t\t}\n\t}\n\treturn $valor;\n}", "private function getEnzymesTypeII() {\r\n // All enzymes with the same recognition pattern are grouped\r\n // The following information is provided for each endonuclease\r\n // \"AasI\" => array( First endonuclease of the list\r\n // 0 => \"AasI,DrdI,DseDI\", All endonucleases recognizing the same pattern\r\n // 1 => \"GACNN_NN'NNGTC\", Recognition pattern\r\n // 2 => \"(GAC......GTC)\", Recognition pattern for computing\r\n // 3 => 12, Length of all recognition pattern\r\n // 4 => 7, Cleavage position in upper strand\r\n // 5 => -2, Cleavage position in lower strand, relative to previous one\r\n // 6 => 6 Number of non-N bases within recognition pattern\r\n // ),\r\n\r\n $enzymes_array = Array(\r\n \"AasI\" => array(\"AasI,DrdI,DseDI\", \"GACNN_NN'NNGTC\", \"(GAC......GTC)\", 12, 7, -2, 6),\r\n \"AatI\" => array(\"AatI,Eco147I,PceI,SseBI,StuI\", \"AGG'CCT\", \"(AGGCCT)\", 6, 3, 0, 6),\r\n \"AatII\" => array(\"AatII\", \"G_ACGT'C\", \"(GACGTC)\", 6, 5, -4, 6),\r\n \"AbsI\" => array(\"AbsI\", \"CC'TCGA_GG\", \"(CCTCGAGG)\", 8, 2, 4, 8),\r\n \"Acc16I\" => array(\"Acc16I,AviII,FspI,NsbI\", \"TGC'GCA\", \"(TGCGCA)\", 6, 3, 0, 6),\r\n \"Acc65I\" => array(\"Acc65I,Asp718I\", \"G'GTAC_C\", \"(GGTACC)\", 6, 1, 4, 6),\r\n \"AccB1I\" => array(\"AccB1I,BanI,BshNI,BspT107I\", \"G'GYRC_C\", \"(GGCACC|GGCGCC|GGTACC|GGTGCC)\", 6, 1, 4, 6),\r\n \"AccB7I\" => array(\"AccB7I,BasI,PflMI,Van91I\", \"CCAN_NNN'NTGG\", \"(CCA.....TGG)\", 11, 7, -3, 6),\r\n \"AccBSI\" => array(\"AccBSI,BsrBI,MbiI\", \"CCG'CTC\", \"(CCGCTC|GAGCGG)\", 6, 3, 0, 6),\r\n \"AccI\" => array(\"AccI,FblI,XmiI\", \"GT'MK_AC\", \"(GTCTAC|GTCGAC|GTATAC|GTAGAC)\", 6, 2, 2, 6),\r\n \"AccII\" => array(\"AccII,Bsh1236I,BspFNI,BstFNI,BstUI,MvnI\", \"CG'CG\", \"(CGCG)\", 4, 2, 0, 4),\r\n \"AccIII\" => array(\"AccIII,Aor13HI,BseAI,Bsp13I,BspEI,Kpn2I,MroI\", \"T'CCGG_A\", \"(TCCGGA)\", 6, 1, 4, 6),\r\n \"AciI\" => array(\"AciI,BspACI,SsiI\", \"C'CG_C or G'CG_G\", \"(CCGC|GCGG)\", 4, 1, 2, 4),\r\n \"AclI\" => array(\"AclI,Psp1406I\", \"AA'CG_TT\", \"(AACGTT)\", 6, 2, 2, 6),\r\n \"AcoI\" => array(\"AcoI,CfrI,EaeI\", \"Y'GGCC_R\", \"(CGGCCA|CGGCCG|TGGCCA|TGGCCG)\", 6, 1, 4, 6),\r\n \"AcsI\" => array(\"AcsI,ApoI,XapI\", \"R'AATT_Y\", \"(AAATTC|AAATTT|GAATTC|GAATTT)\", 6, 1, 4, 6),\r\n \"AcvI\" => array(\"AcvI,BbrPI,Eco72I,PmaCI,PmlI,PspCI\", \"CAC'GTG\", \"(CACGTG)\", 6, 3, 0, 6),\r\n \"AcyI\" => array(\"AcyI,BsaHI,BssNI,BstACI,Hin1I,Hsp92I\", \"GR'CG_YC\", \"(GACGCC|GACGTC|GGCGCC|GGCGTC)\", 6, 2, 2, 6),\r\n \"AdeI\" => array(\"AdeI,DraIII\", \"CAC_NNN'GTG\", \"(CAC...GTG)\", 9, 6, -3, 6),\r\n \"AfaI\" => array(\"AfaI,RsaI\", \"GT'AC\", \"(GTAC)\", 4, 2, 0, 4),\r\n \"AfeI\" => array(\"AfeI,Aor51HI,Eco47III\", \"AGC'GCT\", \"(AGCGCT)\", 6, 3, 0, 6),\r\n \"AfiI\" => array(\"AfiI,Bsc4I,BseLI,BsiYI,BslI\", \"CCNN_NNN'NNGG\", \"(CC.......GG)\", 11, 7, -3, 4),\r\n \"AflII\" => array(\"AflII,BfrI,BspTI,Bst98I,MspCI,Vha464I\", \"C'TTAA_G\", \"(CTTAAG)\", 6, 1, 4, 6),\r\n \"AflIII\" => array(\"AflIII\", \"A'CRYG_T\", \"(ACACGT|ACATGT|ACGCGT|ACGTGT)\", 6, 1, 4, 6),\r\n \"AgeI\" => array(\"AgeI,AsiGI,BshTI,CspAI,PinAI\", \"A'CCGG_T\", \"(ACCGGT)\", 6, 1, 4, 6),\r\n \"AhdI\" => array(\"AhdI,AspEI,BmeRI,DriI,Eam1105I,EclHKI\", \"GACNN_N'NNGTC\", \"(GAC.....GTC)\", 11, 6, -1, 6),\r\n \"AhlI\" => array(\"AhlI,BcuI,SpeI\", \"A'CTAG_T\", \"(ACTAGT)\", 6, 1, 4, 6),\r\n \"AjiI\" => array(\"AjiI,BmgBI,BtrI\", \"CAC'GTC\", \"(CACGTC|GACGTG)\", 6, 3, 0, 6),\r\n \"AjnI\" => array(\"AjnI,EcoRII,Psp6I,PspGI\", \"'CCWGG_\", \"(CCAGG|CCTGG)\", 5, 0, 5, 5),\r\n \"AleI\" => array(\"AleI,OliI\", \"CACNN'NNGTG\", \"(CAC....GTG)\", 10, 5, 0, 6),\r\n \"AluI\" => array(\"AluI\", \"AG'CT\", \"(AGCT)\", 4, 2, 0, 4),\r\n \"Alw21I\" => array(\"Alw21I,BsiHKAI,Bbv12I\", \"G_WGCW'C\", \"(GAGCAC|GAGCTC|GTGCAC|GTGCTC)\", 6, 5, -4, 6),\r\n \"Alw44I\" => array(\"Alw44I,ApaLI,VneI\", \"G'TGCA_C\", \"(GTGCAC)\", 6, 1, 4, 6),\r\n \"AlwNI\" => array(\"AlwNI,CaiI\", \"CAG_NNN'CTG\", \"(CAG...CTG)\", 9, 6, -3, 6),\r\n \"Ama87I\" => array(\"Ama87I,AvaI,BmeT110I,BsiHKCI,BsoBI,Eco88I\", \"C'YCGR_G\", \"(CCCGAG|CCCGGG|CTCGAG|CTCGGG)\", 6, 1, 4, 6),\r\n \"ApaI\" => array(\"ApaI\", \"G_GGCC'C\", \"(GGGCCC)\", 6, 5, -4, 6),\r\n \"ApeKI\" => array(\"ApeKI,TseI\", \"G'CWG_C\", \"(GCAGC|GCTGC)\", 5, 1, 3, 5),\r\n \"AscI\" => array(\"AscI,PalAI,SgsI\", \"GG'CGCG_CC\", \"(GGCGCGCC)\", 8, 2, 4, 8),\r\n \"AseI\" => array(\"AseI,PshBI,VspI\", \"AT'TA_AT\", \"(ATTAAT)\", 6, 2, 2, 6),\r\n \"AsiSI\" => array(\"AsiSI,RgaI,SgfI\", \"GCG_AT'CGC\", \"(GCGATCGC)\", 8, 5, -2, 8),\r\n \"Asp700I\" => array(\"Asp700I,MroXI,PdmI,XmnI\", \"GAANN'NNTTC\", \"(GAA....TTC)\", 10, 5, 0, 6),\r\n \"AspA2I\" => array(\"AspA2I,AvrII,BlnI,XmaJI\", \"C'CTAG_G\", \"(CCTAGG)\", 6, 1, 4, 6),\r\n \"AspI\" => array(\"AspI,PflFI,PsyI,Tth111I\", \"GACN'N_NGTC\", \"(GAC...GTC)\", 9, 4, 1, 6),\r\n \"AspLEI\" => array(\"AspLEI,BstHHI,CfoI,HhaI\", \"G_CG'C\", \"(GCGC)\", 4, 3, -2, 4),\r\n \"AspS9I\" => array(\"AspS9I,BmgT120I,Cfr13I,Sau96I\", \"G'GNC_C\", \"(GG.CC)\", 5, 1, 3, 4),\r\n \"AssI\" => array(\"AssI,BmcAI,ScaI,ZrmI\", \"AGT'ACT\", \"(AGTACT)\", 6, 3, 0, 6),\r\n \"AsuC2I\" => array(\"AsuC2I,BcnI,BpuMI,NciI\", \"CC'S_GG\", \"(CCGGG|CCCGG)\", 5, 2, 1, 5),\r\n \"AsuNHI\" => array(\"AsuNHI,BspOI,NheI\", \"G'CTAG_C\", \"(GCTAGC)\", 6, 1, 4, 6),\r\n \"AvaII\" => array(\"AvaII,Bme18I,Eco47I,SinI,VpaK11BI\", \"G'GWC_C\", \"(GGACC|GGTCC)\", 5, 1, 3, 5),\r\n \"AxyI\" => array(\"AxyI,Bse21I,Bsu36I,Eco81I\", \"CC'TNA_GG\", \"(CCT.AGG)\", 7, 2, 3, 6),\r\n \"BalI\" => array(\"BalI,MlsI,MluNI,MscI,Msp20I\", \"TGG'CCA\", \"(TGGCCA)\", 6, 3, 0, 6),\r\n \"BamHI\" => array(\"BamHI\", \"G'GATC_C\", \"(GGATCC)\", 6, 1, 4, 6),\r\n \"BanII\" => array(\"BanII,Eco24I,EcoT38I,FriOI\", \"G_RGCY'C\", \"(GAGCCC|GAGCTC|GGGCCC|GGGCTC)\", 6, 5, -4, 6),\r\n \"BanIII\" => array(\"BanIII,Bsa29I,BseCI,BshVI,BspDI,BspXI,Bsu15I,BsuTUI,ClaI\", \"AT'CG_AT\", \"(ATCGAT)\", 6, 2, 2, 6),\r\n \"BauI\" => array(\"BauI\", \"C'ACGA_G'\", \"(CACGAG)\", 6, 1, 4, 6),\r\n \"BbeI\" => array(\"BbeI\", \"G_GCGC'C\", \"(GGCGCC)\", 6, 5, -4, 6),\r\n \"BbuI\" => array(\"BbuI,PaeI,SphI\", \"G_CATG'C\", \"(GCATGC)\", 6, 5, -4, 6),\r\n \"BbvCI\" => array(\"BbvCI\", \"CC'TCA_GC or GC'TGA_GG\", \"(CCTCAGC|GCTGAGG)\", 7, 2, 3, 7),\r\n \"BclI\" => array(\"BclI,FbaI,Ksp22I\", \"T'GATC_A\", \"(TGATCA)\", 6, 1, 4, 6),\r\n \"BfaI\" => array(\"BfaI,FspBI,MaeI,XspI\", \"C'TA_G\", \"(CTAG)\", 4, 1, 2, 4),\r\n \"BfmI\" => array(\"BfmI,BstSFI,SfcI\", \"C'TRYA_G\", \"(CTACAG|CTATAG|CTGCAG|CTGTAG)\", 6, 1, 4, 6),\r\n \"BfrBI\" => array(\"BfrBI\", \"ATG'CAT\", \"(ATGCAT)\", 6, 3, 0, 6),\r\n \"BfuCI\" => array(\"BfuCI,Bsp143I,BssMI,BstMBI,DpnII,Kzo9I,MboI,NdeII,Sau3AI\", \"'GATC_\", \"(GATC)\", 4, 0, 4, 4),\r\n \"BglI\" => array(\"BglI\", \"GCCN_NNN'NGGC\", \"(GCC.....GGC)\", 11, 7, -3, 6),\r\n \"BglII\" => array(\"BglII\", \"A'GATC_T\", \"(AGATCT)\", 6, 1, 4, 6),\r\n \"BisI\" => array(\"BisI,BlsI,Fnu4HI,Fsp4HI,GluI,ItaI,SatI\", \"GC'N_GC\", \"(GC.GC)\", 5, 2, 1, 4),\r\n \"BlpI\" => array(\"BlpI,Bpu1102I,Bsp1720I,CelII\", \"GC'TNA_GC\", \"(GCT.AGC)\", 7, 2, 3, 6),\r\n \"Bme1390I\" => array(\"Bme1390I,MspR9I,ScrFI\", \"CC'N_GG\", \"(CC.GG)\", 5, 2, 1, 4),\r\n \"Bme1580I\" => array(\"Bme1580I,BseSI,BstSLI\", \"G_KGCM'C\", \"(GGGCAC|GGGCCC|GTGCAC|GTGCCC)\", 6, 5, -4, 6),\r\n \"BmiI\" => array(\"BmiI,BspLI,NlaIV,PspN4I\", \"GGN'NCC\", \"(GG..CC)\", 6, 3, 0, 4),\r\n \"BmrFI\" => array(\"BmrFI,BssKI,BstSCI,StyD4I\", \"'CCNGG_\", \"(CC.GG)\", 5, 0, 5, 4),\r\n \"BmtI\" => array(\"BmtI\", \"G_CTAG'C\", \"(GCTAGC)\", 6, 5, -4, 6),\r\n \"BoxI\" => array(\"BoxI,PshAI,BstPAI\", \"GACNN'NNGTC\", \"(GAC....GTC)\", 10, 5, 0, 6),\r\n \"Bpu10I\" => array(\"Bpu10I\", \"CC'TNA_GC\", \"(CCT.AGC|GCT.AGG)\", 7, 2, 3, 6),\r\n \"Bpu14I\" => array(\"Bpu14I,Bsp119I,BspT104I,BstBI,Csp45I,NspV,SfuI\", \"TT'CG_AA\", \"(TTCGAA)\", 6, 2, 2, 6),\r\n \"BpvUI\" => array(\"BpvUI,MvrI,PvuI,Ple19I\", \"CG_AT'CG\", \"(CGATCG)\", 6, 4, -2, 6),\r\n \"BsaAI\" => array(\"BsaAI,BstBAI,Ppu21I\", \"YAC'GTR\", \"(CACGTA|CACGTG|TACGTA|TACGTG)\", 6, 3, 0, 6),\r\n \"BsaBI\" => array(\"BsaBI,Bse8I,BseJI,MamI\", \"GATNN'NNATC\", \"(GAT....ATC)\", 10, 5, 0, 6),\r\n \"BsaJI\" => array(\"BsaJI,BseDI,BssECI\", \"C'CNNG_G\", \"(CC..GG)\", 6, 1, 4, 4),\r\n \"BsaWI\" => array(\"BsaWI\", \"W'CCGG_W\", \"(ACCGGA|ACCGGT|TCCGGA|TCCGGT)\", 6, 1, 4, 6),\r\n \"Bse118I\" => array(\"Bse118I,BsrFI,BssAI,Cfr10I\", \"R'CCGG_Y\", \"(ACCGGC|ACCGGT|GCCGGC|GCCGGT)\", 6, 1, 4, 6),\r\n \"BseBI\" => array(\"BseBI,BstNI,BstOI,Bst2UI,MvaI\", \"CC'W_GG\", \"(CCAGG|CCTGG)\", 5, 2, 1, 5),\r\n \"BsePI\" => array(\"BsePI,BssHII,PauI\", \"G'CGCG_C\", \"(GCGCGC)\", 6, 1, 4, 6),\r\n \"BseX3I\" => array(\"BseX3I,BstZI,EagI,EclXI,Eco52I\", \"C'GGCC_G\", \"(CGGCCG)\", 6, 1, 4, 6),\r\n \"BseYI\" => array(\"BseYI\", \"C'CCAG_C\", \"(CCCAGC|GCTGGG)\", 6, 1, 4, 6),\r\n \"Bsh1285I\" => array(\"Bsh1285I,BsiEI,BstMCI\", \"CG_RY'CG\", \"(CGACCG|CGATCG|CGGCCG|CGGTCG)\", 6, 4, -2, 6),\r\n \"BshFI\" => array(\"BshFI,BsnI,BspANI,BsuRI,HaeIII,PhoI\", \"GG'CC\", \"(GGCC)\", 4, 2, 0, 4),\r\n \"BsiSI\" => array(\"BsiSI,HapII,HpaII,MspI\", \"C'CG_G\", \"(CCGG)\", 4, 1, 2, 4),\r\n \"BsiWI\" => array(\"BsiWI,Pfl23II,PspLI\", \"C'GTAC_G\", \"(CGTACG)\", 6, 1, 4, 6),\r\n \"Bsp120I\" => array(\"Bsp120I,PspOMI\", \"G'GGCC_C\", \"(GGGCCC)\", 6, 1, 4, 6),\r\n \"Bsp1286I\" => array(\"Bsp1286I,MhlI,SduI\", \"G_DGCH'C\", \"(GAGCAC|GAGCTC|GAGCCC|GTGCAC|GTGCTC|GTGCCC|GGGCAC|GGGCTC|GGGCCC)\", 6, 5, -4, 6),\r\n \"Bsp1407I\" => array(\"Bsp1407I,BsrGI,BstAUI\", \"T'GTAC_A\", \"(TGTACA)\", 6, 1, 4, 6),\r\n \"Bsp19I\" => array(\"Bsp19I,NcoI\", \"C'CATG_G\", \"(CCATGG)\", 6, 1, 4, 6),\r\n \"Bsp68I\" => array(\"Bsp68I,BtuMI,NruI\", \"TCG'CGA\", \"(TCGCGA)\", 6, 3, 0, 6),\r\n \"BspHI\" => array(\"BspHI,PagI,RcaI\", \"T'CATG_A\", \"(TCATGA)\", 6, 1, 4, 6),\r\n \"BspLU11I\" => array(\"BspLU11I,PciI,PscI\", \"A'CATG_T\", \"(ACATGT)\", 6, 1, 4, 6),\r\n \"BspMAI\" => array(\"BspMAI,PstI\", \"C_TGCA'G\", \"(CTGCAG)\", 6, 5, -4, 6),\r\n \"BssNAI\" => array(\"BssNAI,Bst1107I,BstZ17I\", \"GTA'TAC\", \"(GTATAC)\", 6, 3, 0, 6),\r\n \"BssSI\" => array(\"BssSI,Bst2BI\", \"C'ACGA_G or C'TCGT_G\", \"(CACGAG|CTCGTG)\", 6, 1, 4, 6),\r\n \"BssT1I\" => array(\"BssT1I,StyI,Eco130I,EcoT14I,ErhI\", \"C'CWWG_G\", \"(CCAAGG|CCATGG|CCTAGG|CCTTGG)\", 6, 1, 4, 6),\r\n \"Bst4CI\" => array(\"Bst4CI,HpyCH4III,TaaI\", \"AC_N'GT\", \"(AC.GT)\", 5, 3, -1, 4),\r\n \"BstH2I\" => array(\"BstH2I,HaeII\", \"R_GCGC'Y\", \"(AGCGCC|AGCGCT|GGCGCC|GGCGCT)\", 6, 5, -4, 6),\r\n \"BstAPI\" => array(\"BstAPI\", \"GCAN_NNN'NTGC\", \"(GCA.....TGC)\", 11, 7, -3, 6),\r\n \"BstC8I\" => array(\"BstC8I,Cac8I\", \"GCN'NGC\", \"(GC..GC)\", 6, 3, 0, 4),\r\n \"BstDEI\" => array(\"BstDEI,DdeI,HpyF3I\", \"C'TNA_G\", \"(CT.AG)\", 5, 1, 3, 4),\r\n \"BstDSI\" => array(\"BstDSI,BtgI\", \"C'CRYG_G\", \"(CCACGG|CCATGG|CCGCGG|CCGTGG)\", 6, 1, 4, 6),\r\n \"BstEII\" => array(\"BstEII,BstPI,Eco91I,EcoO65I,PspEI\", \"G'GTNAC_C\", \"(GGT.ACC)\", 7, 1, 5, 6),\r\n \"BstENI\" => array(\"BstENI,EcoNI,XagI\", \"CCTNN'N_NNAGG\", \"(CCT.....AGG)\", 11, 5, 1, 6),\r\n \"BstKTI\" => array(\"BstKTI\", \"G_AT'C\", \"(GATC)\", 4, 3, 2, 4),\r\n \"BstMWI\" => array(\"BstMWI,MwoI\", \"GCNN_NNN'NNGC\", \"(GC.......GC)\", 11, 7, -3, 4),\r\n \"BstNSI\" => array(\"BstNSI,NspI,XceI\", \"R_CATG'Y\", \"(ACATGC|ACATGT|GCATGC|GCATGT)\", 6, 5, -4, 6),\r\n \"BstSNI\" => array(\"BstSNI,Eco105I,SnaBI\", \"TAC'GTA\", \"(TACGTA)\", 6, 3, 0, 6),\r\n \"BstX2I\" => array(\"BstX2I,BstYI,MflI,PsuI,XhoII\", \"R'GATC_Y\", \"(AGATCC|AGATCT|GGATCC|GGATCT)\", 6, 1, 4, 6),\r\n \"BstXI\" => array(\"BstXI\", \"CCAN_NNNN'NTGG\", \"(CCA......TGG)\", 12, 8, -4, 6),\r\n \"CciNI\" => array(\"CciNI,NotI\", \"GC'GGCC_GC\", \"(GCGGCCGC)\", 8, 2, 4, 8),\r\n \"Cfr42I\" => array(\"Cfr42I,KspI,SacII,Sfr303I,SgrBI,SstII\", \"CC_GC'GG\", \"(CCGCGG)\", 6, 4, -2, 6),\r\n \"Cfr9I\" => array(\"Cfr9I,TspMI,XmaI,XmaCI\", \"C'CCGG_G\", \"(CCCGGG)\", 6, 1, 4, 6),\r\n \"CpoI\" => array(\"CpoI,CspI,RsrII,Rsr2I\", \"CG'GWC_CG\", \"(CGGACCG|CGGTCCG)\", 7, 2, 3, 7),\r\n \"Csp6I\" => array(\"Csp6I,CviQI,RsaNI\", \"G'TA_C\", \"(GTAC)\", 4, 1, 2, 4),\r\n \"CviAII\" => array(\"CviAII,FaeI,Hin1II,Hsp92II,NlaIII\", \"_CATG'\", \"(CATG)\", 4, 4, -4, 4),\r\n \"CviJI\" => array(\"CviJI,CviKI-1\", \"RG'CY\", \"(AGCC|AGCT|GGCC|GGCT)\", 4, 2, 0, 4),\r\n \"DinI\" => array(\"DinI,Mly113I,NarI\", \"GG'CG_CC\", \"(GGCGCC)\", 6, 2, 2, 6),\r\n \"DpnI\" => array(\"DpnI,MalI\", \"GA'TC\", \"(GATC)\", 4, 2, 0, 4),\r\n \"DraI\" => array(\"DraI\", \"TTT'AAA\", \"(TTTAAA)\", 6, 3, 0, 6),\r\n \"Ecl136II\" => array(\"Ecl136II,EcoICRI\", \"GAG'CTC\", \"(GAGCTC)\", 6, 3, 0, 6),\r\n \"Eco32I\" => array(\"Eco32I,EcoRV\", \"GAT'ATC\", \"(GATATC)\", 6, 3, 0, 6),\r\n \"EcoO109I\" => array(\"EcoO109I,DraII\", \"RG'GNC_CY\", \"(AGG.CCC|AGG.CCT|GGG.CCC|GGG.CCT)\", 7, 2, 3, 6),\r\n \"EcoRI\" => array(\"EcoRI\", \"G'AATT_C\", \"(GAATTC)\", 6, 1, 4, 6),\r\n \"EcoT22I\" => array(\"EcoT22I,Mph1103I,NsiI,Zsp2I\", \"A_TGCA'T\", \"(ATGCAT)\", 6, 5, -4, 6),\r\n \"EgeI\" => array(\"EgeI,EheI,SfoI\", \"GGC'GCC\", \"(GGCGCC)\", 6, 3, 0, 6),\r\n \"FatI\" => array(\"FatI\", \"'CATG_\", \"(CATG)\", 4, 0, 4, 4),\r\n \"FauNDI\" => array(\"FauNDI,NdeI\", \"CA'TA_TG\", \"(CATATG)\", 6, 2, 2, 6),\r\n \"FseI\" => array(\"FseI,RigI\", \"GG_CCGG'CC\", \"(GGCCGGCC)\", 8, 6, -4, 8),\r\n \"FspAI\" => array(\"FspAI\", \"RTGC'GCAY\", \"(ATGCGCAC|ATGCGCAT|GTGCGCAC|GTGCGCAT)\", 8, 4, 0, 8),\r\n \"GlaI\" => array(\"GlaI\", \"GC'GC\", \"(GCGC)\", 4, 2, 0, 4),\r\n \"Hin6I\" => array(\"Hin6I,HinP1I,HspAI\", \"G'CG_C\", \"(GCGC)\", 4, 1, 2, 4),\r\n \"HincII\" => array(\"HincII,HindII\", \"GTY'RAC\", \"(GTCAAC|GTCGAC|GTTAAC|GTTGAC)\", 6, 3, 0, 6),\r\n \"HindIII\" => array(\"HindIII\", \"A'AGCT_T\", \"(AAGCTT)\", 6, 1, 4, 6),\r\n \"HinfI\" => array(\"HinfI\", \"G'ANT_C\", \"(GA.TC)\", 5, 1, 3, 4),\r\n \"HpaI\" => array(\"HpaI,KspAI\", \"GTT'AAC\", \"(GTTAAC)\", 6, 3, 0, 6),\r\n \"Hpy188I\" => array(\"Hpy188I\", \"TC_N'GA\", \"(TC.GA)\", 5, 3, -1, 4),\r\n \"Hpy188III\" => array(\"Hpy188III\", \"TC'NN_GA\", \"(TC..GA)\", 6, 2, 2, 4),\r\n \"Hpy8I\" => array(\"Hpy8I\", \"GTN'NAC\", \"(GT..AC)\", 6, 3, 0, 4),\r\n \"Hpy99I\" => array(\"Hpy99I\", \"_CGWCG'\", \"(CGACG|CGTCG)\", 5, 5, -5, 5),\r\n \"HpyCH4IV\" => array(\"HpyCH4IV,MaeII\", \"A'CG_T\", \"(ACGT)\", 4, 1, 2, 4),\r\n \"HpyCH4V\" => array(\"HpyCH4V\", \"TG'CA\", \"(TGCA)\", 4, 2, 0, 4),\r\n \"HpyF10VI\" => array(\"HpyF10VI\", \"GCNN_NNN'NNGC\", \"(GC.......GC)\", 11, 7, -3, 4),\r\n \"KasI\" => array(\"KasI\", \"G'GCGC_C\", \"(GGCGCC)\", 6, 1, 4, 6),\r\n \"KpnI\" => array(\"KpnI\", \"G_GTAC'C\", \"(GGTACC)\", 6, 5, -4, 6),\r\n \"MabI\" => array(\"MabI,SexAI\", \"A'CCWGG_T\", \"(ACCAGGT|ACCTGGT)\", 7, 1, 5, 7),\r\n \"MaeIII\" => array(\"MaeIII\", \"'GTNAC_\", \"(GT.AC)\", 5, 0, 5, 4),\r\n \"MfeI\" => array(\"MfeI,MunI\", \"C'AATT_G\", \"(CAATTG)\", 6, 1, 4, 6),\r\n \"MluI\" => array(\"MluI\", \"A'CGCG_T\", \"(ACGCGT)\", 6, 1, 4, 6),\r\n \"MreI\" => array(\"MreI\", \"CG'CCGG_CG\", \"(CGCCGGCG)\", 8, 2, 4, 8),\r\n \"MroNI\" => array(\"MroNI,NgoMIV\", \"G'CCGG_C\", \"(GCCGGC)\", 6, 1, 4, 6),\r\n \"MseI\" => array(\"MseI,Tru1I,Tru9I\", \"T'TA_A\", \"(TTAA)\", 4, 1, 2, 4),\r\n \"MslI\" => array(\"MslI,RseI,SmiMI\", \"CAYNN'NNRTG\", \"(CAC....ATG|CAC....GTG|CAT....ATG|CAT....GTG)\", 10, 5, 0, 6),\r\n \"MspA1I\" => array(\"MspA1I\", \"CMG'CKG\", \"(CAGCGG|CAGCTG|CCGCGG|CCGCTG)\", 6, 3, 0, 6),\r\n \"MssI\" => array(\"MssI,PmeI\", \"GTTT'AAAC\", \"(GTTTAAAC)\", 8, 4, 0, 8),\r\n \"NaeI\" => array(\"NaeI,PdiI\", \"GCC'GGC\", \"(GCCGGC)\", 6, 3, 0, 6),\r\n \"NmuCI\" => array(\"NmuCI,Tsp45I\", \"'GTSAC_\", \"(GTCAC|GTGAC)\", 5, 0, 5, 5),\r\n \"PacI\" => array(\"PacI\", \"TTA_AT'TAA\", \"(TTAATTAA)\", 8, 5, -2, 8),\r\n \"PaeR7I\" => array(\"PaeR7I,Sfr274I,SlaI,StrI,TliI,XhoI\", \"C'TCGA_G\", \"(CTCGAG)\", 6, 1, 4, 6),\r\n \"PasI\" => array(\"PasI\", \"CC'CWG_GG\", \"(CCCAGGG|CCCTGGG)\", 7, 2, 3, 7),\r\n \"PfeI\" => array(\"TfiI,PfeI\", \"G'AWT_C\", \"(GAATC|GATTC)\", 5, 1, 3, 5),\r\n \"PfoI\" => array(\"PfoI\", \"T'CCNGG_A\", \"(TCC.GGA)\", 7, 1, 5, 6),\r\n \"PpuMI\" => array(\"PpuMI,Psp5II,PspPPI\", \"RG'GWC_CY\", \"(AGGACCC|AGGACCT|AGGTCCC|AGGTCCT|GGGACCC|GGGACCT|GGGTCCC|GGGTCCT)\", 7, 2, 3, 7),\r\n \"PsiI\" => array(\"PsiI\", \"TTA'TAA\", \"(TTATAA)\", 6, 3, 0, 6),\r\n \"Psp124BI\" => array(\"Psp124BI,SacI,SstI\", \"G_AGCT'C\", \"(GAGCTC)\", 6, 5, -44, 6),\r\n \"PspXI\" => array(\"PspXI\", \"VC'TCGA_GB\", \"(ACTCGAGC|ACTCGAGG|ACTCGAGT|CCTCGAGC|CCTCGAGG|CCTCGAGT|GCTCGAGC|GCTCGAGG|GCTCGAGT)\", 8, 2, 4, 8),\r\n \"PvuII\" => array(\"PvuII\", \"CAG'CTG\", \"(CAGCTG)\", 6, 3, 0, 6),\r\n \"SalI\" => array(\"SalI\", \"G'TCGA_C\", \"(GTCGAC)\", 6, 1, 4, 6),\r\n \"SanDI\" => array(\"SanDI\", \"GG'GWC_CC\", \"(GGGACCC|GGGTCCC)\", 7, 2, 3, 7),\r\n \"SbfI\" => array(\"SbfI,SdaI,Sse8387I\", \"CC_TGCA'GG\", \"(CCTGCAGG)\", 8, 6, -4, 8),\r\n \"SetI\" => array(\"SetI\", \"_ASST'\", \"(AGGT|AGCT|ACGT|ACCT)\", 4, 4, -4, 4),\r\n \"SfiI\" => array(\"SfiI\", \"GGCCN_NNN'NGGCC\", \"(GGCC.....GGCC)\", 13, 8, -3, 8),\r\n \"SgrAI\" => array(\"SgrAI\", \"CR'CCGG_YG\", \"(CACCGGCG|CACCGGTG|CGCCGGCG|CGCCGGTG)\", 8, 2, 4, 8),\r\n \"SgrDI\" => array(\"SgrDI\", \"CG'TCGA_CG\", \"(CGTCGACG)\", 8, 2, 4, 8),\r\n \"SmaI\" => array(\"SmaI\", \"CCC'GGG\", \"(CCCGGG)\", 6, 3, 0, 6),\r\n \"SmiI\" => array(\"SmiI,SwaI\", \"ATTT'AAAT\", \"(ATTTAAAT)\", 8, 4, 0, 8),\r\n \"SmlI\" => array(\"SmlI,SmoI\", \"C'TYRA_G\", \"(CTCAAG|CTCGAG|CTTAAG|CTTGAG)\", 6, 1, 4, 6),\r\n \"SrfI\" => array(\"SrfI\", \"GCCC'GGGC\", \"(GCCCGGGC)\", 8, 4, 0, 8),\r\n \"Sse9I\" => array(\"Sse9I,TasI,Tsp509I,TspEI\", \"'AATT_\", \"(AATT)\", 4, 0, 4, 4),\r\n \"SspI\" => array(\"SspI\", \"AAT'ATT\", \"(AATATT)\", 6, 3, 0, 6),\r\n \"TaiI\" => array(\"TaiI\", \"_ACGT'\", \"(ACGT)\", 4, 4, -4, 4),\r\n \"TaqI\" => array(\"TaqI\", \"T'CG_A\", \"(TCGA)\", 4, 1, 2, 4),\r\n \"TatI\" => array(\"TatI\", \"W'GTAC_W\", \"(AGTACA|AGTACT|TGTACA|TGTACT)\", 6, 1, 4, 6),\r\n \"TauI\" => array(\"TauI\", \"G_CSG'C\", \"(GCCGC|GCGGC)\", 5, 4, -3, 5),\r\n \"TspRI\" => array(\"TspRI\", \"_NNCASTGNN'\", \"(..CACTG..|..CAGTG..)\", 9, 9, -9, 5),\r\n \"XbaI\" => array(\"XbaI\", \"T'CTAG_A\", \"(TCTAGA)\", 6, 1, 4, 6),\r\n \"XcmI\" => array(\"XcmI\", \"CCANNNN_N'NNNNTGG\", \"(CCA.........TGG)\", 15, 8, -1, 6),\r\n \"ZraI\" => array(\"ZraI\", \"GAC'GTC\", \"(GACGTC)\", 6, 3, 0, 6),\r\n );\r\n return $enzymes_array;\r\n }", "function getCharacterCounts(string $name0, string $name1): array\n {\n $names = getCombinedNames($name0, $name1);\n $letters = [];\n\n for ($i = 0; $i < strlen($names); $i++) {\n $letters[$names[$i]] = returnCharacterCount($names[$i], $names);\n }\n\n return $letters;\n }", "function checkRepeatedWords($sentence)\n{\n $result = []; \n $str_array = explode(\" \", $sentence);\n $str_array_count_values = array_count_values($str_array);\n foreach ($str_array_count_values as $key => $value){\n if ($value > 1)\n $result[] = $key;\n }\n return $result;\n}", "private function validate_2($s)\n\t{\n\t\t$ns = array('<' => 0, '>' => 0, '&' => 0, '\\'' => 0, '\"' => 0);\n\t\tforeach (str_split($s) as $c) {\n\t\t\tif (isset($ns[$c])) {\n\t\t\t\t$ns[$c]++;\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'ctAmpersands' => $ns['&'],\n\t\t\t'ctApostrophes' => $ns['\\''],\n\t\t\t'ctLeftAngleBrackets' => $ns['<'],\n\t\t\t'ctQuotes' => $ns['\"'],\n\t\t\t'ctRightAngleBrackets' => $ns['>'],\n\t\t);\n\t}", "function iqTest(string $numbers): int\n{\n /** @var array{int} $arrayInt */\n $arrayInt = array_map(function ($val) {\n return $val % 2;\n }, explode(' ', $numbers));\n /** @var int $diffValue */\n $diffValue = array_sum($arrayInt) === 1 ? 1 : 0;\n\n return array_search($diffValue, $arrayInt) + 1;\n}", "function test_countRepeats_multiLetter_noMatch()\n {\n $test_Repeat = new RepeatCounter;\n $input1 = 'and';\n $input2 = 'but';\n\n $result = $test_Repeat->countRepeats($input1, $input2);\n\n $this->assertEquals(0, $result);\n }", "function is_anagram($string1, $string2) {\n if (count_chars($string1, 1) == count_chars($string2, 1))\n return 1;\n else\n return 0;\n}", "function countApplesAndOranges($s, $t, $a, $b, $apples, $oranges) {\r\n // Write your code here\r\n $result = [];\r\n $count = 0;\r\n foreach ($apples as $_apple) {\r\n # code...\r\n $position = $a + $_apple;\r\n if(($position >= $s) && ($position <= $t)){\r\n $count++;\r\n }\r\n }\r\n $result[] = $count;\r\n \r\n $count = 0;\r\n foreach ($oranges as $_orange) {\r\n # code...\r\n $position = $b + $_orange;\r\n if(($position >= $s) && ($position <= $t)){\r\n $count++;\r\n }\r\n }\r\n $result[] = $count;\r\n return $result;\r\n}", "function distance($a, $b)\n{\n if (strlen($a) !== strlen($b)) {\n throw new \\InvalidArgumentException(\"DNA strands must be of equal length.\", 1);\n }\n //\n // YOUR CODE GOES HERE\n //\n if ($a === $b)\n return 0;\n\n $charArrayA = str_split($a);\n $charArrayB = str_split($b);\n $hammingDistance = 0;\n foreach ($charArrayA as $idx => $value) {\n if( $charArrayA[$idx] !== $charArrayB[$idx]) {\n $hammingDistance++;\n }\n }\n\n return $hammingDistance;\n}", "function isIsogram($word){\r\n\r\n //Scinde une chaîne et capture les positions ,prend en compte les sous-chaînes non vides \r\n $chars_a = preg_split('//u',$word, -1, PREG_SPLIT_NO_EMPTY);\r\n\r\n//On applique la fonction strtolower sur le tableau\r\n $chars_array = array_map('strtolower', $chars_a);\r\n\r\n //Supression des espaces vides puis des tirets\r\n foreach($chars_array as $index => $letter){\r\n if($letter ==\" \"){\r\n unset($chars_array[$index]);\r\n }\r\n}\r\n\r\n foreach($chars_array as $index => $letter){\r\n if($letter ==\"-\" ){\r\n unset($chars_array[$index]);\r\n }\r\n}\r\n\r\n//array_count_values retourne un tableau key->lettre value->occurences(int)\r\n$occurence_array = array_count_values($chars_array);\r\n\r\n//pour chaque element de ce tableau on verifie qu'aucune lettre ne se répete\r\nforeach($occurence_array as $occurence){\r\n if ($occurence>1){\r\n return false;\r\n }\r\n}\r\nreturn true;\r\n}", "function countUniqChars($text)\n{\n $chars = str_split($text);\n $count = 0;\n $uniqChars = [];\n foreach ($chars as $char) {\n if (in_array($char, $uniqChars)) {\n continue;\n }\n $uniqChars[] = $char;\n $count++;\n }\n\n return $count;\n}", "private function pluralise($singular) {\n\n $last_letter = strtolower($singular[strlen($singular)-1]);\n switch($last_letter) {\n case 'y':\n return substr($singular,0,-1).'ies';\n case 's':\n return $singular.'es';\n default:\n return $singular.'s';\n }\n\n}", "function countWords($sentence)\n {\n $wordsArr = explode(' ', $sentence);\n $vals = array_count_values($wordsArr);\n\n echo \"<pre>\";\n print_r($vals);\n echo \"</pre>\";\n foreach ($vals as $key => $value)\n {\n echo \"<b>\" . $key . \"</b> occurs \" . $value . \" times in this sentence <br/>\";\n }\n }", "function yumusamaCheck($kelime){\n\t\t// $sondanIkinci = mb_substr($kelime, -2, -1);\n\t\t// // eger sondan ikinci unlu degilse yumusama olamaz\n\t\t// if(!in_array($sondanIkinci, UNLULER)) return -1;\n\t\t$sonHarf = mb_substr($kelime, -1);\n\t\tif($sonHarf === \"b\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"p\";\n\t\t}\n\t\tif($sonHarf === \"c\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"ç\";\n\t\t}\n\t\tif($sonHarf === \"d\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"t\";\n\t\t}\n\t\tif($sonHarf === \"g\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\tif($sonHarf === \"ğ\") {\n\t\t\treturn mb_substr($kelime, 0 ,mb_strlen($kelime)-1).\"k\";\n\t\t}\n\t\treturn -1;\n\t}", "function ProbabilitiesPatternsString($k, $alphabet_of_A_letters, $Pattern, $times)\n{\n\t// Generate all values\n\t$limit = pow($alphabet_of_A_letters, $k);\n\t$ok = 0;\n\tfor ($i = 0; $i < $limit; $i++)\n\t{\n\t\t$j = NumberToPatternOptimizedBinary($i, $k);\n\n\t\t// Is it a solution or not?\n\t\tif (PatternCount($j, $Pattern) >= $times)\n\t\t{\n\t\t\t$ok++;\n\t\t}\n\t\t// echo $j.'-'.PatternCount($j, $Pattern).'<br>';\n\t\t// $results[$j] = $results[$j] + 1;\n\t\t//echo '<hr>';\n\t}\n\n\techo $ok.'--';\n\n\treturn 1.0 * ( $ok / $limit);\n}", "function get_prodinv_count($st = NULL)\n {\n if ($st == \"NIL\") $st = \"\";\n $sql = \"select * from product where ProdName like '%$st%'\";\n $query = $this->db->query($sql);\n return $query->num_rows();\n }", "function sumOfNumbersDividedByNumberOfLetters($string) {\n\t$characters = str_split($string);\n\t// var_dump($characters);\n\t$letters = [];\n\t$numbers = [];\n\n\tforeach ($characters as $char) {\n\t\tif (ctype_alpha($char)) {\n\t\t\tarray_push($letters, $char);\n\t\t} elseif (ctype_digit($char)) {\n\t\t\t$numbers[] += $char;\n\t\t}\n\t}\n\treturn round(array_sum($numbers) / count($letters));\n}", "function addjapeng($kanjicity, $kanalocal, $kanacity, $kanastreet,/* $kanahouse,*/ $hyphens)\n\t{\n\t\tif (strstr(substr($kanjicity,8),encode(\"郡\"))!==false) $kanacity=substr($kanacity,0,8) . str_replace(encode(\"グン\"),\"gun \",substr($kanacity,8));\n\t\t$string= trim($kanalocal.\" \". $kanacity . \" \" . $kanastreet/* . \" \" . $kanahouse*/);\n\n\n\t\t//Array to prevent \"-shi,-ku\" errors\n\t\t$cities=array(encode(\"サイタマシ\") =>\"Saitamashi \",encode(\"キョウトシ\") =>\"Kyotoshi \",encode(\"センダイシ\") =>\"Sendaishi \",encode(\"キタキュウシュウシ\") =>\"Kita Kyushushi \",encode(\"チバシ\") =>\"Chibashi \",encode(\"ナゴヤシ\") =>\"Nagoyashi \",encode(\"サカイシ\") =>\"Sakaishi \",encode(\"オオサカシ\") =>\"Osakashi \",encode(\"カワサキシ\") =>\"Kawasakishi \",encode(\"ヒロシマシ\") =>\"Hiroshimashi \",encode(\"ニイガタシ\") =>\"Nigatashi \",encode(\"サッポロシ\") =>\"Sapporoshi \",encode(\"ヨコハマシ\") =>\"Yokohamashi \",encode(\"ハママツシ\") =>\"Hamamatsushi \",encode(\"コウベシ\") =>\"Kobeshi \",encode(\"フクオカシ\") =>\"Fukuokashi \",encode(\"シズオカシ\") =>\"Shizuokashi \");\n\t\t//Irregular combinations\n\t\t$irregular=array(encode(\"ゥウ\") => encode(\"ゥ\") ,encode(\"ォオ\") => encode(\"ォ\") ,encode(\"ョウ\") => encode(\"ョ\") ,encode(\"ュウ\") => encode(\"ュ\")/*, encode(\" ミナミ\") =>\" Minami \", encode(\" ヒガシ\") =>\" higashi \"/*, encode(\" キタ\") =>\" kita \", encode(\" ニシ\") =>\" nishi\" */);\n\t\t//Basic transition\n\t\t$trans=array(encode(\"シモウ\") => \"shimou\" ,encode(\"モトウ\") => \"motou\" ,encode(\"モトオ\") => \"motoo\" ,encode(\"ン\") => \"n\" ,encode(\"ヲ\") => \"wo\" ,encode(\"ワ\") => \"wa\" ,encode(\"ロウ\") => \"ro\" ,/*encode(\"ロオ\") => \"ro\" ,*/encode(\"ロ\") => \"ro\" ,encode(\"レ\") => \"re\" ,encode(\"ル\") => \"ru\" ,encode(\"リイ\") => \"ri\" ,encode(\"リョ\") => \"ryo\" ,encode(\"リュ\") => \"ryu\" ,encode(\"リャ\") => \"rya\" ,encode(\"リ\") => \"ri\" ,encode(\"ラ\") => \"ra\" ,encode(\"ヨウ\") => \"yo\" ,encode(\"ユウ\") => \"yu\" ,encode(\"ヨ\") => \"yo\" ,encode(\"ユ\") => \"yu\" ,encode(\"ヤ\") => \"ya\" ,encode(\"モオ\") => \"mo\" ,encode(\"モウ\") => \"mo\" ,encode(\"モ\") => \"mo\" ,encode(\"メ\") => \"me\" ,encode(\"ム\") => \"mu\" ,encode(\"ミョ\") => \"myo\" ,encode(\"ミュ\") => \"myu\" ,encode(\"ミャ\") => \"mya\" ,encode(\"ミ\") => \"mi\" ,encode(\"マ\") => \"ma\" ,encode(\"ボウ\") => \"bo\" ,encode(\"ボ\") => \"bo\" ,encode(\"ベ\") => \"be\" ,encode(\"ブウ\") => \"bu\" ,encode(\"ブ\") => \"bu\" ,encode(\"ビョ\") => \"byo\" ,encode(\"ビュ\") => \"byu\" ,encode(\"ビャ\") => \"bya\" ,encode(\"ビ\") => \"bi\" ,encode(\"バ\") => \"ba\" ,encode(\"ポウ\") => \"po\" ,encode(\"ポ\") => \"po\" ,encode(\"ペ\") => \"pe\" ,encode(\"プウ\") => \"pu\" ,encode(\"プ\") => \"pu\" ,encode(\"ピョ\") => \"pyo\" ,encode(\"ピュ\") => \"pyu\" ,encode(\"ピャ\") => \"pya\" ,encode(\"パ\") => \"pa\" ,encode(\"ノウ\") => \"no\" ,encode(\"ホウ\") => \"ho\" ,encode(\"ホ\") => \"ho\" ,encode(\"ヘ\") => \"he\" ,encode(\"フォ\") => \"fo\" ,encode(\"フェ\") => \"fe\" ,encode(\"フゥ\") => \"fu\" ,encode(\"フィ\") => \"fi\" ,encode(\"ファ\") => \"fa\" ,encode(\"フウ\") => \"fu\" ,encode(\"フ\") => \"fu\" ,encode(\"ヒョ\") => \"hyo\" ,encode(\"ヒュ\") => \"hyu\" ,encode(\"ヒャ\") => \"hya\" ,encode(\"ヒ\") => \"hi\" ,encode(\"ハ\") => \"ha\" ,encode(\"ノ\") => \"no\" ,encode(\"ネ\") => \"ne\" ,encode(\"ヌウ\") => \"nu\" ,encode(\"ヌ\") => \"ne\" ,encode(\"ニョ\") => \"nyo\" ,encode(\"ニュ\") => \"nyu\" ,encode(\"ニャ\") => \"nya\" ,encode(\"ニ\") => \"ni\" ,encode(\"ナ\") => \"na\" ,encode(\"ドオ\") => \"do\" ,encode(\"ドウ\") => \"do\" ,encode(\"ド\") => \"do\" ,encode(\"ディ\") => \"di\" ,encode(\"デ\") => \"de\" ,encode(\"ヅウ\") => \"ju\" ,encode(\"ヅ\") => \"ju\" ,encode(\"ヂョ\") => \"jyo\" ,encode(\"ヂュ\") => \"jyu\" ,encode(\"ヂャ\") => \"jya\" ,encode(\"ヂェ\") => \"jye\" ,encode(\"ヂィ\") => \"ji\" ,encode(\"ヂ\") => \"ji\" ,encode(\"ダ\") => \"da\" ,encode(\"トオ\") => \"to\" ,encode(\"トウ\") => \"to\" ,encode(\"ト\") => \"to\" ,encode(\"ティ\") => \"ti\" ,encode(\"テ\") => \"te\" ,encode(\"ツウ\") => \"tsu\" ,encode(\"ツ\") => \"tsu\" ,encode(\"チョ\") => \"cho\" ,encode(\"チュ\") => \"chu\" ,encode(\"チャ\") => \"cha\" ,encode(\"チェ\") => \"che\" ,encode(\"チィ\") => \"chi\" ,encode(\"チ\") => \"chi\" ,encode(\"タ\") => \"ta\" ,encode(\"ゾウ\") => \"zo\" ,encode(\"ゾオ\") => \"zo\" ,encode(\"ゾ\") => \"zo\" ,encode(\"ゼ\") => \"ze\" ,encode(\"ズ\") => \"zu\" ,encode(\"ジョ\") => \"jo\" ,encode(\"ジェ\") => \"je\" ,encode(\"ジュ\") => \"ju\" ,encode(\"ジャ\") => \"ja\" ,encode(\"ジ\") => \"ji\" ,encode(\"ザ\") => \"za\" ,encode(\"ソウ\") => \"so\" ,encode(\"ソオ\") => \"so\" ,encode(\"ソ\") => \"so\" ,encode(\"セ\") => \"se\" ,encode(\"ス\") => \"su\" ,encode(\"ショ\") => \"sho\" ,encode(\"シェ\") => \"she\" ,encode(\"シュ\") => \"shu\" ,encode(\"シャ\") => \"sha\" ,encode(\"シ\") => \"shi\" ,encode(\"サ\") => \"sa\" ,encode(\"ゴウ\") => \"go\" ,encode(\"ゴオ\") => \"go\" ,encode(\"ゴ\") => \"go\" ,encode(\"ゲ\") => \"ge\" ,encode(\"グ\") => \"gu\" ,encode(\"ギョ\") => \"gyo\" ,encode(\"ギェ\") => \"gye\" ,encode(\"ギュ\") => \"gyu\" ,encode(\"ギィ\") => \"gyi\" ,encode(\"ギャ\") => \"gya\" ,encode(\"ギ\") => \"gi\" ,encode(\"ガ\") => \"ga\" ,encode(\"コウ\") => \"ko\" ,encode(\"コオ\") => \"ko\" ,encode(\"コ\") => \"ko\" ,encode(\"ケ\") => \"ke\" ,encode(\"ク\") => \"ku\" ,encode(\"キョ\") => \"kyo\" ,encode(\"キェ\") => \"kye\" ,encode(\"キュ\") => \"kyu\" ,encode(\"キィ\") => \"kyi\" ,encode(\"キャ\") => \"kya\" ,encode(\"キ\") => \"ki\" ,encode(\"カ\") => \"ka\" ,encode(\"オオ\") => \"o\" ,encode(\"オウ\") => \"o\" ,encode(\"ヴォ\") => \"vo\" ,encode(\"ヴェ\") => \"ve\" ,encode(\"ヴィ\") => \"vi\" ,encode(\"ヴァ\") => \"va\" ,encode(\"ヴ\") => \"vu\" ,encode(\"オ\") => \"o\" ,encode(\"エ\") => \"e\" ,encode(\"ウ\") => \"u\" ,encode(\"イ\") => \"i\" ,encode(\"ア\") => \"a\",encode(\"ッ\") => \"l\");\n\t\t//Perform Conversion\n\t\t$string=strtr($string,$cities);\n\t\t$string=strtr($string,$irregular);\n\t\t$string=strtr($string,$trans);\n\t\t$string=strtoupper(substr($string,0,1)) . substr($string,1);\n\t\t$length=strlen($string);\n\t\t//echo \"<br />basic switch $string\";\n\t\t//Remove tsu or \"l\" as it is now written\n\t\tfor ($pos=0;$pos<=$length;$pos++)\n\t\t\t{\n\t\t\t\t$part=substr($string,$pos,1);\n\t\t\t\t$tsu=strstr($part,\"l\");\n\t\t\t\tif ($tsu!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$string=substr($string,0,$pos) . substr($string,($pos+1),1) . substr($string,($pos+1));\n\t\t\t\t\t}\n\t\t\t}\n\t\t//echo \"<br />remove tsu $string\";\n\t\t//Add Capital Letters to the start of each place\n\t\t$off=1+strpos($string,\" \");\n\t\twhile ($off!=1)\n\t\t\t{\n\t\t\t\t$string=substr($string,0,$off) . strtoupper(substr($string,$off,1)) . substr($string,($off+1));\n\t\t\t\t$off=1+strpos($string,\" \",$off);\n\t\t\t}\n\t\t//echo \"</br> Capital Letters $string\";\n\t\t//Function to add Hyphens to the end of each word\n\t\t$vowels=array(\"a\",\"e\",\"i\",\"o\",\"u\",\"n\");\n\t\t$stringer=explode(\" \",$string);\n\t\t$count=(count($stringer)-(1+$hyphens));\n\t\tfor ($i=0;$i<=$count;$i++)\n\t\t\t{\n\t\t\t\t$stringer[$i]=hyphenator($stringer[$i],$vowels);\n\t\t\t}\n\t\t$string=implode(\" \",$stringer);\n\t\t//echo \"<br />Hyphens $string\";\n\t\t//Strip off any bracketed areas\n\t\t$string=str_replace(\"ma-chi\",\"machi\",$string);\n\t\tif (strstr($string,encode(\"(\"))!==false) $string=substr($string,0,strpos($string,encode(\"(\"))) . substr($string,(8+strpos($string,encode(\")\"))));\n\t\t//echo \"<br />Final $string\";\n\t\treturn $string;\n\t}", "function encode($input)\n{\n if ($input == '') {\n return '';\n }\n\n $data = [];\n $lastInsertIndex = 0;\n $result = '';\n\n for ($i = 0; $i < strlen($input); $i++) {\n if ($i === 0) {\n $data[$i] = [$input[$i] => 1];\n continue;\n }\n\n if ($input[$i] === $input[$i-1]) {\n $data[$lastInsertIndex][$input[$lastInsertIndex]]++;\n continue;\n } else {\n $data[$i] = [$input[$i] => 1];\n $lastInsertIndex = $i;\n continue;\n }\n }\n\n foreach($data as $k=>$v) {\n foreach($v as $letter=>$count) {\n if ($count > 1) {\n $result .= $count . $letter;\n } else {\n $result .= $letter;\n }\n }\n }\n return $result;\n}", "function s_z($ige) {\r\n $s_z = '';\r\n $veg1 = substr($ige,-1);\r\n if ($veg1 === 's') {\r\n $s_z = 's';\r\n }\r\n if ($veg1 === 'z') {\r\n $s_z = 'z';\r\n }\r\n return $s_z;\r\n }", "private function getEnzymesTypeIIs() {\r\n $enzymes_array = Array(\r\n \"AarI\" => array(\"AarI\", \"CACCTGCNNNN'NNNN_\", \"(CACCTGC........)\", 15, 11, 4, 7),\r\n \"AarI@\" => array(\"\", \"\", \"(........GCAGGTG)\", 15, 0, 4, 7),\r\n \"Acc36I\" => array(\"Acc36I,BfuAI,BspMI,BveI\", \"ACCTGCNNNN'NNNN_\", \"(ACCTGC........)\", 14, 10, 4, 6),\r\n \"Acc36I@\" => array(\"\", \"\", \"(........GCAGGT)\", 14, 0, 4, 6),\r\n \"AclWI\" => array(\"AclWI,AlwI,BspPI\", \"GGATCNNNN'N_\", \"(GGATC.....)\", 10, 9, 1, 5),\r\n \"AclWI@\" => array(\"\", \"\", \"(.....GATCC)\", 10, 0, 1, 5),\r\n \"AcuI\" => array(\"AcuI,Eco57I\", \"R'AATT_Y\", \"(CTGAAGNNNNNNNNNNNNNN_NN')\", 22, 22, -2, 6),\r\n \"AcuI@\" => array(\"\", \"\", \"(................CTTCAG)\", 22, 2, -2, 6),\r\n \"Alw26I\" => array(\"Alw26I,BsmAI,BstMAI\", \"GTCTCN'NNNN_\", \"(GTCTC.....)\", 10, 6, 4, 5),\r\n \"Alw26I@\" => array(\"\", \"\", \"(.....GAGAC)\", 10, 0, 4, 5),\r\n \"AsuHPI\" => array(\"AsuHPI,HphI\", \"GTGANNNNNNN_N'\", \"(GGTGA........)\", 13, 13, -1, 5),\r\n \"AsuHPI@\" => array(\"\", \"\", \"(........TCACC)\", 13, 1, -1, 5),\r\n \"BbsI\" => array(\"BbsI,BpiI,BpuAI,BstV2I\", \"GAAGACNN'NNNN_\", \"(GAAGAC......)\", 12, 8, 4, 6),\r\n \"BbsI@\" => array(\"\", \"\", \"(......GTCTTC)\", 12, 0, 4, 6),\r\n \"BbvI\" => array(\"BbvI,BseXI,BstV1I\", \"GCAGCNNNNNNNN'NNNN_\", \"(GCAGC............)\", 17, 13, 4, 5),\r\n \"BbvI@\" => array(\"\", \"\", \"(............GCTGC)\", 17, 0, 4, 5),\r\n \"BccI\" => array(\"BccI\", \"CCATCNNNN'N_\", \"(CCATC.....)\", 10, 9, 1, 5),\r\n \"BccI@\" => array(\"\", \"\", \"(.....GATGG)\", 10, 0, 1, 5),\r\n \"BceAI\" => array(\"BceAI\", \"ACGGCNNNNNNNNNNNN'NN_\", \"(ACGGC..............)\", 19, 17, 2, 5),\r\n \"BceAI@\" => array(\"\", \"\", \"(..............GCCGT)\", 19, 0, 2, 5),\r\n \"BciVI\" => array(\"BciVI,BfuI\", \"GTATCCNNNNN_N'\", \"(GTATCC......)\", 12, 12, -1, 6),\r\n \"BciVI@\" => array(\"\", \"\", \"(......GGATAC)\", 12, 1, -1, 6),\r\n \"BfiI\" => array(\"BfiI,BmrI,BmuI\", \"ACTGGGNNNN_N'\", \"(ACTGGG.....)\", 11, 11, -1, 6),\r\n \"BfiI@\" => array(\"\", \"\", \"(.....CCCAGT)\", 11, 1, -1, 6),\r\n \"BpmI\" => array(\"BpmI,GsuI\", \"CTGGAGNNNNNNNNNNNNNN_NN'\", \"(CTGGAG................)\", 22, 22, -2, 6),\r\n \"BpmI@\" => array(\"\", \"\", \"(................CTCCAG)\", 22, 2, -2, 6),\r\n \"BpuEI\" => array(\"BpuEI\", \"CTTGAGNNNNNNNNNNNNNN_NN'\", \"(CTTGAG................)\", 22, 22, -2, 6),\r\n \"BpuEI@\" => array(\"\", \"\", \"(................CTCAAG)\", 22, 2, -2, 6),\r\n \"BsaI\" => array(\"BsaI,Bso31I,BspTNI,Eco31I\", \"GGTCTCN'NNNN_\", \"(GGTCTC.....)\", 11, 7, 4, 6),\r\n \"BsaI@\" => array(\"\", \"\", \"(.....GAGACC)\", 11, 0, 4, 6),\r\n \"BsaMI\" => array(\"BsaMI,BsmI,Mva1269I,PctI\", \"GAATG_CN'\", \"(GAATGC.)\", 7, 7, -2, 6),\r\n \"BsaMI@\" => array(\"\", \"\", \"(.GCATTC)\", 7, 2, -2, 6),\r\n \"Bse1I\" => array(\"Bse1I,BseNI,BsrI,BsrSI\", \"ACTG_GN'\", \"(ACTGG.)\", 6, 6, -2, 5),\r\n \"Bse1I@\" => array(\"\", \"\", \"(.CCAGT)\", 6, 2, -2, 5),\r\n \"Bse3DI\" => array(\"Bse3DI,BseMI,BsrDI\", \"GCAATG_NN'\", \"(GCAATG..)\", 8, 8, -2, 6),\r\n \"Bse3DI@\" => array(\"\", \"\", \"(..CATTGC)\", 8, 2, -2, 6),\r\n \"BseGI\" => array(\"BseGI,BstF5I\", \"GGATG_NN'\", \"(GGATG..)\", 7, 7, -2, 5),\r\n \"BseGI@\" => array(\"\", \"\", \"(..CATCC)\", 7, 2, -2, 5),\r\n \"BseMII\" => array(\"BseMII\", \"CTCAGNNNNNNNN_NN'\", \"(CTCAG..........)\", 15, 15, -2, 5),\r\n \"BseMII@\" => array(\"\", \"\", \"(..........CTGAG)\", 15, 2, -2, 5),\r\n \"BseRI\" => array(\"BseRI\", \"GAGGAGNNNNNNNN_NN'\", \"(GAGGAG..........)\", 16, 16, -2, 6),\r\n \"BseRI@\" => array(\"\", \"\", \"(..........CTCCTC)\", 16, 2, -2, 6),\r\n \"BsgI\" => array(\"BsgI\", \"GTGCAGNNNNNNNNNNNNNN_NN'\", \"(GTGCAG................)\", 22, 22, -2, 6),\r\n \"BsgI@\" => array(\"\", \"\", \"(................CTGCAC)\", 22, 2, -2, 6),\r\n \"BslFI\" => array(\"BslFI,FaqI\", \"GGGACNNNNNNNNNN'NNNN_\", \"(GGGAC..............)\", 19, 15, 4, 5),\r\n \"BslFI@\" => array(\"\", \"\", \"(..............GTCCC)\", 19, 0, 4, 5),\r\n \"BsmBI\" => array(\"BsmBI,Esp3I\", \"CGTCTCN'NNNN_\", \"(CGTCTC.....)\", 11, 7, 4, 6),\r\n \"BsmBI@\" => array(\"\", \"\", \"(.....GAGACG)\", 11, 0, 4, 6),\r\n \"BsmFI\" => array(\"BsmFI\", \"GGGACNNNNNNNNNN'NNNN_\", \"(GGGAC..............)\", 19, 15, 4, 5),\r\n \"BsmFI@\" => array(\"\", \"\", \"(..............GTCCC)\", 19, 0, 4, 5),\r\n \"BspCNI\" => array(\"BspCNI\", \"CTCAGNNNNNNN_NN'\", \"(CTCAG.........)\", 14, 14, -2, 5),\r\n \"BspCNI@\" => array(\"\", \"\", \"(.........CTGAG)\", 14, 2, -2, 5),\r\n \"BspQI\" => array(\"BspQI,LguI,PciSI,SapI\", \"GCTCTTCN'NNN_\", \"(GCTCTTC....)\", 11, 8, 3, 7),\r\n \"BspQI@\" => array(\"\", \"\", \"(....GAAGAGC)\", 11, 0, 3, 7),\r\n \"Bst6I\" => array(\"Bst6I,Eam1104I,EarI,Ksp632I\", \"CTCTTCN'NNN_\", \"(CTCTTC....)\", 10, 7, 3, 6),\r\n \"Bst6I@\" => array(\"\", \"\", \"(....GAAGAG)\", 10, 0, 3, 6),\r\n \"BtgZI\" => array(\"BtgZI\", \"GCGATGNNNNNNNNNN'NNNN_\", \"(GCGATG..............)\", 20, 16, 4, 6),\r\n \"BtgZI@\" => array(\"\", \"\", \"(..............CATCGC)\", 20, 0, 4, 6),\r\n \"BtsI\" => array(\"BtsI\", \"GCAGTG_NN'\", \"(GCAGTG..)\", 8, 8, -2, 6),\r\n \"BtsI@\" => array(\"\", \"\", \"(..CACTGC)\", 8, 2, -2, 6),\r\n \"EciI\" => array(\"EciI\", \"GGCGGANNNNNNNNN_NN'\", \"(GGCGGA...........)\", 17, 17, -2, 6),\r\n \"EciI@\" => array(\"\", \"\", \"(...........TCCGCC)\", 17, 2, -2, 6),\r\n \"Eco57MI\" => array(\"Eco57MI\", \"CTGRAGNNNNNNNNNNNNNN_NN'\", \"(CTGAAG................|CTGGAG................)\", 22, 22, -2, 6),\r\n \"Eco57MI@\" => array(\"\", \"\", \"(................CTCCAG|................CTTCAG)\", 22, 2, -2, 6),\r\n \"EcoP15I\" => array(\"EcoP15I\", \"CAGCAGNNNNNNNNNNNNNNNNNNNNNNNNN'NN_\", \"(CAGCAG...........................)\", 33, 31, 2, 6),\r\n \"EcoP15I@\" => array(\"\", \"\", \"(...........................CTGCTG)\", 33, 0, 2, 6),\r\n \"FauI\" => array(\"FauI,SmuI\", \"CCCGCNNNN'NN_\", \"(CCCGC......)\", 11, 9, 2, 5),\r\n \"FauI@\" => array(\"\", \"\", \"(......GCGGG)\", 11, 0, 2, 5),\r\n \"FokI\" => array(\"FokI,BtsCI\", \"GGATGNNNNNNNNN'NNNN_\", \"(GGATG.............)\", 18, 14, 4, 5),\r\n \"FokI@\" => array(\"\", \"\", \"(.............CATCC)\", 18, 0, 4, 5),\r\n \"HgaI\" => array(\"HgaI,CseI\", \"GACGCNNNNN'NNNNN_\", \"(GACGC..........)\", 15, 10, 5, 5),\r\n \"HgaI@\" => array(\"\", \"\", \"(..........GCGTC)\", 15, 0, 5, 5),\r\n \"HpyAV\" => array(\"HpyAV\", \"CCTTCNNNNN_N'\", \"(GACGC..........)\", 11, 11, -1, 5),\r\n \"HpyAV@\" => array(\"\", \"\", \"(......GAAGG)\", 11, 1, -1, 5),\r\n \"LweI\" => array(\"LweI,SfaNI\", \"GCATCNNNNN'NNNN_\", \"(GCATC.........)\", 14, 10, 4, 5),\r\n \"LweI@\" => array(\"\", \"\", \"(.........GATGC)\", 14, 0, 4, 5),\r\n \"MboII\" => array(\"MboII\", \"GAAGANNNNNNN_N'\", \"(GAAGA........)\", 13, 13, -1, 5),\r\n \"MboII@\" => array(\"\", \"\", \"(........TCTTC)\", 13, 1, -1, 5),\r\n \"MlyI\" => array(\"MlyI,SchI\", \"GAGTCNNNNN'\", \"(GAGTC.....)\", 10, 10, 0, 5),\r\n \"MlyI@\" => array(\"\", \"\", \"(.....GACTC)\", 10, 0, 0, 5),\r\n \"MmeAIII\" => array(\"MmeAIII\", \"TCCRACNNNNNNNNNNNNNNNNNN_NN'\", \"(GCCGAG.....................)\", 27, 27, -2, 6),\r\n \"MmeAIII@\" => array(\"\", \"\", \"(.....................CTCGGC)\", 27, 2, -2, 6),\r\n \"MmeI\" => array(\"MmeI\", \"TCCRACNNNNNNNNNNNNNNNNNN_NN'\", \"(TCCAAC....................|TCCGAC....................)\", 26, 26, -2, 6),\r\n \"MmeI@\" => array(\"\", \"\", \"(....................GTCGGA|....................GTTGGA)\", 26, 2, -2, 6),\r\n \"MnlI\" => array(\"MnlI\", \"CCTCNNNNNN_N'\", \"(CCTC.......)\", 11, 11, -1, 4),\r\n \"MnlI@\" => array(\"\", \"\", \"(.......GAGG)\", 11, 1, -1, 4),\r\n \"PleI\" => array(\"PleI,PpsI\", \"GAGTCNNNN'N_\", \"(GAGTC.....)\", 10, 9, 1, 5),\r\n \"PleI@\" => array(\"\", \"\", \"(.....GACTC)\", 10, 0, 1, 5),\r\n \"TaqII\" => array(\"TaqII\", \"GACCGANNNNNNNNN_NN' or CACCCANNNNNNNNN_NN'\", \"(GACCGA...........|CACCCA...........)\", 17, 17, -2, 6),\r\n \"TaqII@\" => array(\"\", \"\", \"(...........TCGGTC|...........TGGGTG)\", 17, 2, -2, 6),\r\n \"TsoI\" => array(\"TsoI\", \"TARCCANNNNNNNNN_NN'\", \"(TAACCA...........|TAGCCA...........)\", 17, 17, -2, 6),\r\n \"TsoI@\" => array(\"\", \"\", \"(...........TGGTTA|...........TGGCTA)\", 17, 2, -2, 6),\r\n \"TspDTI\" => array(\"TspDTI\", \"ATGAANNNNNNNNN_NN'\", \"(ATGAA...........)\", 16, 16, -2, 5),\r\n \"TspDTI@\" => array(\"\", \"\", \"(...........TTCAT)\", 16, 2, -2, 5),\r\n \"TspGWI\" => array(\"TspGWI\", \"ACGGANNNNNNNNN_NN'\", \"(ACGGA...........)\", 16, 16, -2, 5),\r\n \"TspGWI@\" => array(\"\", \"\", \"(...........TCCGT)\", 16, 2, -2, 5),\r\n );\r\n return $enzymes_array;\r\n }", "function countUniqChars($text)\n{\n $unique = [];\n foreach (array_diff(str_split($text), [null]) as $char) {\n if (!in_array($char, $unique)) {\n $unique[] = $char;\n }\n }\n return count($unique);\n}", "function afaire_compteur_jalon($jalon='', $statut='') {\n\t$valeur = 0;\n\t// Nombre total de afaire pour le jalon\n\t$select = array('t1.id_ticket');\n\t$from = array('spip_afaire AS t1');\n\t$where = array('t1.jalon='.sql_quote($jalon));\n\tif ($statut)\n\t\t$where = array_merge($where, array('t1.statut='.sql_quote($statut)));\n\t$result = sql_select($select, $from, $where);\n\t$valeur = sql_count($result);\n\treturn $valeur;\n}", "function array_count_keyes(array $arr, String $needle)\n\t{\n\n\t\treturn inMultDimArr($needle, $arr, true);\n\n\t}", "function ssn($ssn)\n {\n if (!preg_match(\"/^\\d{9}$/\", $ssn)) return false;\n\n $weights = array(3, 7);\n $sum = 0;\n for ($i = 0; $i<8; $i++) {\n $sum += $weights[$i % 2] * intval(substr($ssn, $i, 1));\n }\n return substr($ssn, 8, 1) == ($sum % 10);\n }", "public function countBySingungu($sh_sido) {\n\n\t\t// 전체보기\n\t\t$arr = array(\n\t\t\t'전체보기'\t=> 0\n\t\t);\n\n\t\t// 시군구 배열\n\t\t$sigungu_arr = selectSigungu($sh_sido);\n\t\tforeach($sigungu_arr as $key) {\n\t\t\t$arr[$key] = 0;\n\t\t}\n\n\t\t// 시군구별 카운트\n\t\t$select_table = \"(select a.sh_sigungu, \";\n\t\t$select_table.= \"(select count(b.sh_code) from tbl_service b where a.sh_code = b.sh_code) as cnt_service, \";\n\t\t$select_table.= \"(select count(c.sh_code) from tbl_staff c where a.sh_code = c.sh_code) as cnt_staff \";\n\t\t$select_table.= \"from tbl_shop a \";\n\t\t$select_table.= \"where a.sh_sido = '$sh_sido' \";\n\t\t$select_table.= \"and a.sh_state = 'Y' \";\n\t\t$select_table.= \"and a.open_time != '' \";\n\t\t$select_table.= \"and a.close_time != '' \";\n\t\t$select_table.= \"and a.sh_holiday != '' \";\n\t\t$select_table.= \"group by a.sh_code \";\n\t\t$select_table.= \"having cnt_staff * cnt_service > '0' ) t\";\n\t\t$select_field = \"t.sh_sigungu, count(t.sh_sigungu) as cnt\";\n\n\t\t$list = dbSelect($select_table, $select_field, \"\", \"group by t.sh_sigungu\", \"\");\n\n\t\t$cnt_total = 0;\n\t\tfor($i = 0 ; $i < sizeof($list) ; $i++) {\n\t\t\t$key = $list[$i]['sh_sigungu'];\n\t\t\t$arr[$key] = $list[$i]['cnt'];\n\t\t\t$cnt_total += $list[$i]['cnt'];\n\t\t}\n\n\t\t$arr['전체보기'] = $cnt_total;\n\n\t\treturn $arr;\n\t}", "function php02($n_caracteres_crypt,$coord,$dato_crypt){\n\t$n_caracteres = strlen($dato_crypt);\n\t$texto_crypt = php01($n_caracteres_crypt);\n\t$texto_n = '';\n\tfor($i = 0; $i < strlen($texto_crypt); $i++){\n\t\twhile ( $i == $coord){\n\t\t\tfor($j = 0; $j < strlen($dato_crypt); $j++){\n\t\t\t\t$texto_n = $texto_n . $dato_crypt[$j];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t$texto_n = $texto_n . $texto_crypt[$i];\n\t}\n\treturn $texto_n;\n}", "function countWords($string)\n{\n\t$array = [];\n\t$array = explode(' ', $string);\n\t$sum = count($array);\n\treturn $sum;\n}", "function solution($S, $P, $Q){\r\n $A = $C = $G = $T = 0;\r\n $results = array();\r\n $quantaties = array();\r\n $quantaties[-1]=\"0000\"; \r\n if ((strlen($S) < 1) || (strlen($S) > 100000))\r\n return 0;\r\n if ((count($P) < 1) || (count($P) > 50000))\r\n return 0;\r\n if ((count($Q) < 1) || (count($Q) > 50000))\r\n return 0;\r\n for ($i = 0; $i < strlen($S); $i++) {\r\n switch (substr($S, $i, 1)) {\r\n case 'A':\r\n $A++; \r\n break;\r\n case 'C':\r\n $C++;\r\n break;\r\n case 'G':\r\n $G++;\r\n break;\r\n case 'T':\r\n $T++;\r\n break;\r\n }\r\n $quantaties[$i]=$A.\"|\".$C.\"|\".$G.\"|\".$T; \r\n } \r\n// print_r($quantaties);\r\n $right=$left=array();\r\n for ($i = 0; $i < count($P); $i++) {\r\n $right=explode(\"|\", $quantaties[$Q[$i]]); print_r($right);\r\n $left=explode(\"|\", $quantaties[$P[$i]-1]); print_r($left);\r\n if (($right[0]-$left[0])!=0) $results[$i]=1;\r\n elseif (($right[1]-$left[1])!=0) $results[$i]=2;\r\n elseif (($right[2]-$left[2])!=0) $results[$i]=3;\r\n else $results[$i]=4;\r\n }\r\n return $results;\r\n}", "function hamDist($a ,$b) {\n\n $dist = 0;\n\n $a = str_split($a);\n $b = str_split($b);\n\n for ($i = 0; $i < count($a); $i++) {\n\n if (isset($a[$i]) && isset($b[$i])) { # While this won't give errors if the inputs aren't of the same length this function doesn't work properly for such use cases.\n\n $diff = ord($a[$i]) ^ ord($b[$i]);\n \n foreach (str_split(decbin($diff)) as $bit) {\n \n if ($bit) {\n \n $dist++;\n \n }\n \n }\n\n }\n \n }\n\n return $dist;\n\n}", "public function getSingularRules()\n {\n return array(\n '/(f)ish$/i' => '\\1\\2ish',\n '/(x|ch|ss|sh)es$/i' => '\\1',\n '/(m)ovies$/i' => '\\1\\2ovie',\n '/(s)eries$/i' => '\\1\\2eries',\n '/([^aeiouy]|qu)ies$/i' => '\\1y',\n '/([lr])ves$/i' => '\\1f',\n '/(tive)s$/i' => '\\1',\n '/([^f])ves$/i' => '\\1fe',\n '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\\1\\2sis',\n '/([ti])a$/i' => '\\1um',\n '/(p)eople$/i' => '\\1\\2erson',\n '/(m)en$/i' => '\\1\\2an',\n '/(s)tatus$/i' => '\\1\\2tatus',\n '/(c)hildren$/i' => '\\1\\2hild',\n '/(n)ews$/i' => '\\1\\2ews',\n '/s$/i' => '' \n );\n }", "function singularize($x) {\n\n if (substr($x, -1) != 's') {\n return $x;\n }\n\n $x = preg_replace('/ies$/i', 'y', $x, 1, $count);\n if ($count) return $x;\n\n return substr($x, 0, strlen($x) - 1);\n }", "function encryption($s) {\n $string = preg_replace('~\\W~', '', $s);\n $length = strlen($string);\n $sqrt = ceil(sqrt($length));\n\n $arrayOfLetters = str_split($string);\n $countOfRows = floor($length / $sqrt);\n\n if ($sqrt * $countOfRows <= $length) {\n $countOfRows = $sqrt;\n }\n\n $chunk = array_chunk($arrayOfLetters, $countOfRows);\n\n $str = [];\n for ($i = 0; $i < $countOfRows; $i++) {\n foreach ($chunk as $letters) {\n if (isset($letters[$i])) {\n $str[$i] .= $letters[$i];\n }\n }\n }\n\n return implode(' ', $str);\n}", "public static function syllables_count( $text ) {\n\t\t$syls = 0;\n\n\t\tif ( empty( $text ) ) {\n\t\t\treturn - 1;\n\t\t}\n\t\t$words = self::words( $text );\n\n\t\tforeach ( $words as $word ) {\n\t\t\t$syllables_count_word = self::syllables_count_word( $word );\n\t\t\t$syls += $syllables_count_word;\n\t\t}\n\t\tif ( 0 === $syls ) {\n\t\t\treturn - 2;\n\t\t} // Well that didn't work...\n\n\t\treturn $syls;\n\t}", "function get_jt($j){\n\t\t$type = \"Private Job\";\n\t\tswitch($j){\n\t\t\tcase \"BJ\": $type = \"Bus Jobs\"; break;\n\t\t\tcase \"VM\": $type = \"Vehicle Maintain\"; break;\n\t\t\tcase \"M\": $type = \"Institute Maintainance\"; break;\n\t\t\tcase \"TRG\": $type = \"Training (Full Time)\"; break;\n\t\t\tcase \"PRG\": $type = \"Training (Part Time)\"; break;\n\t\t\tcase \"PR\": $type = \"Production\"; break;\n\t\t\tcase \"STC\": $type = \"Special Training Course\"; break;\n\t\t\tcase \"VTI\": $type = \"Borella Institute\"; break;\n\t\t\tcase \"DP\": $type = \"Director Bunglow\"; break;\n\t\t}\n\t\treturn $type;\n\t}", "function block_multi_capital($str)\n\t{\n\t\t$pattern = \"/[A-Z]{2,}/\";\n\t\t$matched = array();\n\t\tpreg_match_all( $pattern, $str, $matched );\n\t\t$count = count( $matched,1 );\n\t\t$count = ( $count - 1 );\n\t\treturn ( $count > 1 ) ? FALSE : TRUE;\n\t}", "function encodeString($input_string)\n{\n $count = 0;\n $temp_str = '';\n $str_length = strlen($input_string);\n \n for($i=0;$i<$str_length;$i++)\n {\n $limit = 1;\n \n $curr = substr($input_string, $i, $limit); \n $next = substr($input_string, $i+1, $limit); \n \n //comparing current character with the next character\n if($curr == $next)\n {\n $count++;\n }\n else{\n $cnt = $count + 1;\n if($cnt != 1)\n {\n $temp_str .= $input_string[$i].$cnt; \n }\n else{\n $temp_str .= $input_string[$i];\n }\n \n $count = 0;\n }\n }\n \n return $temp_str;\n}", "private function validate_7(array $s)\n\t{\n\t\t$n = 0;\n\t\tforeach ($s['2000']['04']['01'] as $v) {\n\t\t\t$n += $v;\n\t\t}\n\t\treturn $n;\n\t}", "function FrequentWords($str, $k)\n{\n\tif ($k > strlen($str))\n\t{\n\t\treturn '';\n\t}\n\t$sets = array();\n\tfor ($i = 0; $i <= strlen($str) - $k; $i++)\n\t{\n\t\t$key = substr($str, $i, $k);\n\t\t$sets[$key] = $key;\n\t}\n\n\t// Which is the best?\n\t$max = 0;\n\tforeach ($sets as $key => $set)\n\t{\n\t\t$sets[$key] = PatternCount($str, $key);\n\t\t$max = max($sets[$key], $max);\n\t}\n\n\t// Display solution, space separated\n\t$solution = array();\n\tforeach ($sets as $key => $set)\n\t{\n\t\tif ($set == $max)\n\t\t{\n\t\t\t$solution[] = $key;\n\t\t}\n\t}\n\treturn implode(' ', $solution);\n}", "public function testWordsCount()\n {\n $text = \"este es un un texto de prueba\";\n $countWords = HelpersMan::count_words_repeated($text);\n\n $this->assertTrue($countWords['un'] == 2);\n }" ]
[ "0.8363663", "0.64525783", "0.59968877", "0.59528756", "0.5738675", "0.57164925", "0.5613633", "0.55969685", "0.54650354", "0.54533035", "0.54512143", "0.54168", "0.53998494", "0.5293583", "0.52293843", "0.5193835", "0.51238114", "0.51110286", "0.5090293", "0.50630563", "0.5057273", "0.5024482", "0.49767178", "0.49701282", "0.4936627", "0.4931024", "0.49114636", "0.49097234", "0.48832777", "0.4881635", "0.48806512", "0.4871336", "0.4855616", "0.48356554", "0.48075607", "0.47883835", "0.4785881", "0.4777062", "0.47769505", "0.47564366", "0.4747475", "0.47423866", "0.47197458", "0.471727", "0.4716049", "0.47027066", "0.46867183", "0.46843928", "0.46721545", "0.46667653", "0.46576384", "0.4655887", "0.46544588", "0.4644905", "0.4641353", "0.46332303", "0.46264845", "0.45996538", "0.4597061", "0.45927757", "0.45813784", "0.45793343", "0.45782217", "0.45714062", "0.45700783", "0.4567733", "0.45671156", "0.45618322", "0.454965", "0.45474663", "0.45455122", "0.45391014", "0.4531877", "0.4527073", "0.4523264", "0.45227748", "0.45198137", "0.4516916", "0.45127335", "0.45087218", "0.45064884", "0.45059592", "0.45012784", "0.44828537", "0.4475384", "0.44696072", "0.4461947", "0.4460024", "0.44457933", "0.44446132", "0.4434539", "0.44236648", "0.44001296", "0.4398939", "0.43972847", "0.439546", "0.43950832", "0.4391025", "0.43858787", "0.43843332" ]
0.78812754
1
Get the validation rules that apply to the request.
public function rules() { switch($this->method()) { case 'POST': { return [ 'name' => 'required|min:5', 'telephone' => 'string|nullable', 'website' => 'url|nullable', 'address' => 'string|nullable', 'city' => 'string|nullable', 'country' => 'string|nullable', 'avatar' => 'image|nullable', ]; } case 'PUT': { return [ 'name' => 'required|min:5', 'telephone' => 'string|nullable', 'website' => 'url|nullable', 'address' => 'string|nullable', 'city' => 'string|nullable', 'country' => 'string|nullable', 'avatar' => 'image|nullable', ]; } default:break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Constructor method for AuthenticationToken
public function __construct($_loginId = NULL,$_password = NULL,$_licenseKey = NULL,$_accountNumber = NULL) { parent::__construct(array('loginId'=>$_loginId,'password'=>$_password,'licenseKey'=>$_licenseKey,'accountNumber'=>$_accountNumber),false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(public string $token)\n {\n }", "public function __construct($token) {\n parent::__construct();\n $this->token = $token;\n }", "public function __construct()\n {\n $this->user = JWTAuth::parseToken()->authenticate();\n }", "public function __construct($token)\n {\n parent::__construct();\n $this->token = $token;\n }", "public function __construct()\n {\n $this->newToken = sha1(time().time()+60*60);\n }", "public function __construct($token) {\n $this->token = $token;\n }", "public function __construct($token)\n {\n $this->token = $token;\n }", "public function __construct($token)\n {\n $this->token = $token;\n }", "public function __construct($token)\n {\n $this->token = $token;\n }", "public function __construct($token)\n {\n $this->token = $token;\n }", "public function __construct($token)\n {\n parent::__construct($token);\n }", "public function __construct($token)\n {\n parent::__construct($token);\n }", "public function __construct()\n\t{\n\t\t$this->tokenId = bin2hex(random_bytes(32));\n\t}", "public function __construct(string $token)\n {\n $this->token = $token;\n }", "public function __construct($tokenData)\n {\n\t\t$xml = simplexml_load_string($tokenData);\n\t\tif(isset($xml))\n\t\t{\n\t $this->_tokenId = $xml->token->id;\n\t\t}\n }", "public function __construct(string $token)\n {\n $this->_token = $token;\n }", "public function __construct(TokenInterface $token)\n {\n $this->tokenId = $token->getId();\n $this->instanceId = $token->getInstance()->getId();\n }", "public function __construct()\n {\n parent::__construct();\n self::$token = Str::random(32);\n }", "public function __construct() {\n\t\tif (Session::started()) {\n\t\t\t$this->token = Session::get($this->token());\n\t\t}\n\n\t\t// If a token did not exist in the session for the user, we will attempt\n\t\t// to load the value of a \"remember me\" cookie for the driver, which\n\t\t// serves as a long-lived client side authenticator for the user.\n\t\tif (is_null($this->token)) {\n\t\t\t$this->token = $this->recall();\n\t\t}\n\t}", "public function __construct($api_token)\n {\n $this->api_token = 'Bearer ' . $api_token;\n }", "public function __construct()\n {\n $this->setTokenName(config('infusionsoft.token_name'));\n $this->setClientId(config('infusionsoft.client_id'));\n $this->setClientSecret(config('infusionsoft.client_secret'));\n $this->setRedirectUri(url(config('infusionsoft.redirect_uri')));\n if (config('infusionsoft.debug')) {\n $this->setDebug(true);\n }\n $new_token = false;\n if (Storage::exists($this->token_name)) {\n $token = unserialize(Storage::get($this->token_name));\n $this->setToken(new Token($token));\n } elseif (Request::has('code')) {\n $this->requestAccessToken(Request::get('code'));\n $new_token = true;\n } else {\n throw new InfusionsoftException(sprintf(\n 'You must authorize your application here: %s',\n $this->getAuthorizationUrl()\n ), 1);\n }\n $token = $this->getToken();\n $expired = ($token->getEndOfLife() - (time() * 2)) <= 0 ? true : false;\n if ($expired || $new_token) {\n $extra = $token->getExtraInfo();\n if (!$new_token) {\n $token = $this->refreshAccessToken();\n }\n Storage::disk(config('infusionsoft.filesystem'))->put($this->token_name, serialize([\n \"access_token\" => $token->getAccessToken(),\n \"refresh_token\" => $token->getRefreshToken(),\n \"expires_in\" => $token->getEndOfLife(),\n \"token_type\" => $extra['token_type'],\n \"scope\" => $extra['scope'],\n ]));\n }\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n // $this->middleware('jwt.auth');\n }", "public function __construct($token, $key)\n {\n $this->token = $token;\n $this->key = $key;\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n// $this->middleware('jwt.auth', ['except' => ['authenticate']]);\n }", "public function __construct($token, array $initialData = []);", "public function __construct() {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth');\n }", "function __construct(){\n $this->curl = new cURL;\n $this->generateAceessToken();\n }", "public function __construct()\n {\n $Auth = new auth(true);\n $this->userData = $Auth->CheckToken();\n // var_dump($Auth);\n }", "function __construct() {\n $this->_jinput = JFactory::getApplication()->input;\n $this->_token = $this->_jinput->get('token', '', 'STRING');\n ControlHelper::checkToken($this->_token) or jexit(JText::_('JINVALID_TOKEN'));\n parent::__construct();\n }", "public function __construct($email , $token)\n {\n $this->token = $token;\n $this->email = $email;\n }", "public function __construct()\n {\n parent::__construct();\n\n $app = App::getInstance();\n $auth = new Auth($app->getDb());\n\n if (!$auth->logged() || !$auth->authorized(Session::get('auth'))) {\n $this->redirectTo(\"HTTP/1.0 401 Unauthorized\", \"unauthorized\");\n }\n\n $this->hasToken();\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth');\n }", "public function __construct()\n {\n parent::__construct();\n $this->authentication = getAuthentication();\n }", "public function __construct(JsonWebTokenInterface $token) {\n $this->jwt = $token;\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth');\n }", "public function createToken(): self\n {\n $rawToken = random_bytes(self::TOKEN_SIZE);\n $this->token = Base64::encode($rawToken);\n $this->selector = Base64::encode(mb_substr($rawToken, 0, self::SELECTOR_SIZE, '8bit'));\n $this->hashedVerifier = Base64::encode(hash(Colloportus::HASH_FUNCTION, mb_substr($rawToken, self::SELECTOR_SIZE, self::VERIFIER_SIZE, '8bit'), true));\n\n return $this;\n }", "public function __construct($access_token)\n {\n $this->access_token = $access_token;\n }", "public function __construct()\n {\n parent::__construct();\n\n /* setup base parameters for authentication */\n $this->baseParams = [\n 'ts' => date('Y-m-d H:i:s'), //timestamp\n 'apikey' => config('marvel.public_key'), //public key\n 'hash' => md5(date('Y-m-d H:i:s').config('marvel.private_key').config('marvel.public_key')), //md5 combination of ts, private key and public key\n ];\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "public function __construct() {\n\t\t$client = new \\GuzzleHttp\\Client;\n\t\t$this->client = $client;\n\n\t\t$response = $this->client->request('POST', 'http://api.thingsee.com/v2/accounts/login', \n\t\t\t['json' => \n\t\t\t\t[\n\t\t\t\t\t'email' => Config::get('thingsee.email'), \n\t\t\t\t\t'password' => Config::get('thingsee.password')\n\t\t\t\t]\n\t\t\t]);\n\n\t\t// Obsolete, 401 and 500 will be caught in the calling function\n\t\t$statusCode = $response->getStatusCode();\n\n\t\t$data = json_decode($response->getBody(), true);\n\t\t$this->accountAuthToken = $data['accountAuthToken'];\n\t}", "public function __construct()\n {\n parent::__construct();\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $this->authMfaMode = $oConfig->item('authTwoFactorMode');\n $aConfig = $oConfig->item('authTwoFactor');\n $this->authMfaConfig = $aConfig[$this->authMfaMode];\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n\n $this->middleware('jwt.auth', ['except' => ['cron', 'secsleft']]);\n\n date_default_timezone_set('Asia/Calcutta');\n setlocale(LC_MONETARY, 'en_IN');\n\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n //$this->middleware('jwt.auth', ['except' => ['update']]);\n $this->middleware('jwt.auth', ['except' => ['near']]);\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('Admin_m', 'admin');\n\t\tif ($this->session->userdata('is_login_in') !== TRUE) {\n\t\t\tredirect('login');\n\t\t}\n\t\t$this->idUser = $this->session->userdata('id_admin');\n\t\t$this->tokenSession = $this->session->userdata('token');\n\t\t$this->tokenServer = $this->admin->get_token_byId($this->idUser)->row()->token;\n\n\t}", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n\n $this->middleware('jwt.auth');\n //check if admin!\n $this->middleware('admin.check');\n\n date_default_timezone_set('Asia/Calcutta');\n setlocale(LC_MONETARY, 'en_IN');\n\n\n\n }", "public function __construct()\n {\n $this->token_name = env('APP_NAME') . '_auth_token';\n $this->middleware('auth:api')->only('user');\n }", "public function __construct()\n {\n $this->API_TOKEN = env('API_TOKEN');\n// $this->API_TOKEN = '9876543210'; //TODO REMOVE THIS LINE AND REMOVE ABOVE COMMENT\n }", "public function __construct(TokenService $tokenService)\n {\n $this->tokenService = $tokenService;\n }", "public function __construct($token, $email)\n {\n $this->token = $token;\n $this->email = $email;\n }", "public function __construct(){\n\t\t\t$this->authentication();\n\t\t}", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['authenticate']]);\n }", "public function __construct( $token, $service_id ) {\n\t\t$this->token = $token;\n\t\t$this->service_id = $service_id;\n\t}", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['authenticate']]);\n\n }", "function __construct(){\n\t\t$this->key = TRELLO_DEV_KEY;\n\t\t$this->token = TRELLO_USER_TOKEN;\n\n\t\t$this->curl = new Curl();\n\t}", "public function __construct($FQDN, OAuthToken $token) \n {\n parent::__construct($FQDN, $token); \n }", "public function __construct()\n { \n\n $queries = DB::getQueryLog(); \n log_Qry($queries);\n\n $payload = JWTAuth::parseToken()->getPayload();\n \n\n }", "function __construct()\n {\n parent::__construct();\n header(\"Access-Control-Allow-Origin:*\");\n header(\"Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept\");\n header('Access-Control-Request-Method: OPTIONS, POST, GET, PUT, DELETE');\n\n // Configure limits on our controller methods\n // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php\n $this->methods['users_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['users_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['users_delete']['limit'] = 50; // 50 requests per hour per user/key\n\n $this->objOfJwt = new ImplementJWT();\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n //$this->middleware('jwt.auth', ['except' => ['authenticate']]);\n }", "public function __construct(Templater $templater, array $token);", "public function __construct()\n {\n $this->httpClient = new Client(['handler' => $this->setHandler(self::$connection->getAuthorizationToken())]);\n }", "public function __construct()\n\t\t{\n\t\t\t$this->_username = \"lenykoskey\";\n\t\t\t$this->_apiKey = \"abbfa09e621a6ece272a254e3fcd910657ff46e88f82db205499603d06dda908\";\n\n\t\t}", "public function __construct(string $method, string $token, string $password = null)\n {\n $this->header = static::buildAuthorizationHeader($method, $token, $password);\n }", "public function __construct()\n {\n // When performing on todo, must check the api_token as authenticated user\n\t\t// $this->middleware('auth');\n }", "public function __construct($token, $host = null)\n {\n $this->token = $token;\n\n if ($host != null) {\n $this->host = $host;\n }\n }", "function __construct()\n\t{\n\t\t$this->salt = \"ovancop1234\";\n\t\t$this->token = str_shuffle('cmsaj23y4ywdni237yeisa');\n\t\t$this->date = date('Y-m-d H:i:s');\n\n\t}", "public function createToken();", "public function __construct(string $token = null) {\n\t\t$this->token = $token ? $token : bin2hex(random_bytes(16));\n\t}", "function __construct($timeout=5) {\n\t\t$this->timeout = $timeout;\n\t\tif(!isset($_SESSION)) session_start();\n\t\t$this->tokenSet();\n\t}", "function __construct($environment, $username_or_token_getter, $password = null) {\r\r\n\t\tparent::__construct($environment, $username_or_token_getter, $password);\r\r\n\t}", "function __construct($environment, $username_or_token_getter, $password = null) {\r\r\n\t\tparent::__construct($environment, $username_or_token_getter, $password);\r\r\n\t}", "public function __construct($config, $cache, $client, $token = null)\n {\n parent::__construct($config, $cache, $client);\n\n $this->token = $token;\n }", "public function __construct($config, $cache, $client, $token = null)\n {\n parent::__construct($config, $cache, $client);\n\n $this->token = $token;\n }", "public function __construct() {\n $this->middleware( TokenAuth::class );\n }", "public function __construct(array $options = null)\n\t{\n\t\tif ( ! isset($options['access_token']))\n\t\t{\n\t\t\tthrow new Exception('Required option not passed: access_token'.PHP_EOL.print_r($options, true));\n\t\t}\n\t\t\n\t\t// if ( ! isset($options['expires_in']) and ! isset($options['expires']))\n\t\t// {\n\t\t// \tthrow new Exception('We do not know when this access_token will expire');\n\t\t// }\n\n\t\t$this->access_token = $options['access_token'];\n\t\t\n\t\t// Some providers (not many) give the uid here, so lets take it\n\t\tisset($options['uid']) and $this->uid = $options['uid'];\n\t\t\n\t\t//Vkontakte uses user_id instead of uid\n\t\tisset($options['user_id']) and $this->uid = $options['user_id'];\n\t\t\n\t\t//Mailru uses x_mailru_vid instead of uid\n\t\tisset($options['x_mailru_vid']) and $this->uid = $options['x_mailru_vid'];\n\t\t\n\t\t// We need to know when the token expires, add num. seconds to current time\n\t\tisset($options['expires_in']) and $this->expires = time() + ((int) $options['expires_in']);\n\t\t\n\t\t// Facebook is just being a spec ignoring jerk\n\t\tisset($options['expires']) and $this->expires = time() + ((int) $options['expires']);\n\t\t\n\t\t// Grab a refresh token so we can update access tokens when they expires\n\t\tisset($options['refresh_token']) and $this->refresh_token = $options['refresh_token'];\n\t}", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['index']]);\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['index', 'show', 'store']]);\n }", "public function __construct($organization_id)\n {\n Parent::__construct();\n\n\n // $this->guzzle = new \\GuzzleHttp\\Client();\n // dd('$organization',$organization );\n\n $this->organization_id = $organization_id;\n\n // $this->email_id = Auth::user()->email;\n // $this->password = Auth::user()->zoho_password;\n // $this->token = (Auth::user()->zoho_token) ? Auth::user()->zoho_token : $this->GetToken($this->email_id, $this->password);\n }", "public function __construct(StileroSPFBOauthAccesstoken $AccessToken) {\n parent::__construct();\n $this->AccessToken = $AccessToken;\n }", "public function __construct()\n {\n $this->setApiKey();\n $this->setRequestOptions();\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['authenticate', 'signUp', 'createOrGetUser', 'forgetPassword']]);\n }", "public function __construct()\n {\n $decryptor = Mage::helper('core');\n\n $this->AccountSid = Mage::helper('twilio')->getAccountSID();\n $this->AuthToken = Mage::helper('twilio')->getAuthToken();\n $this->twilioNumber = Mage::helper('twilio')->getTwilioNumber();\n $this->smsNotificationNumber = Mage::helper('twilio')->getSMSNotificationNumber();\n\n parent::__construct($this->AccountSid, $this->AuthToken);\n }", "public function token_via_constructor()\n {\n // Arrange\n $token = ['email', 'read', 'write'];\n\n // Act\n $returned = (new Service(null, [], [], $token))->getToken();\n\n // Assert\n $this->assertEquals($token, $returned);\n }", "public function __construct()\n {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['index', 'main']]);\n }", "public function __construct(string $token)\n {\n $this->client = (new PendingRequest)\n ->withUserAgent('Markix PHP Client')\n ->timeout(5)\n ->baseUrl($this->baseUrl)\n ->acceptJson()\n ->asJson()\n ->withToken($token)\n ->throw();\n\n // Register the services...\n $this->domains = new DomainService($this);\n $this->messages = new MessageService($this);\n }", "public function __construct($token,$name)\n {\n $this->token = $token;\n $this->name = $name;\n }", "private function __construct() {\n $App = App::get_instance();\n self::$csrf_cookie = $App->config('csrf_token');\n\t\t$this->set_token(false);\n\t}", "public function __construct($appToken, $authToken){\n \n $this->appToken = $appToken;\n $this->authToken = $authToken;\n\n return $this;\n }", "public function __construct(Request $request)\n {\n parent::__construct($request);\n\n if ($this->decode_res['uid'] ===null) {\n $this->res['query'] =null;\n $this->res['state'] = config('res_code.NO_AUTH');\n $this->res['msg'] = $this->decode_res['msg'].' no-token available';\n die(json_encode($this->res));\n }\n }", "public function __construct($token, $name)\n {\n $this->token = $token;\n $this->name = $name;\n }", "public function __construct()\n {\n// var_dump(\"UserName: \".$user->getId());\n// $this->tokenStorage = $tokenStorage;\n// $this->creator = $tokenStorage->getToken()->getUser();\n $this->created = new \\DateTime('now');\n $this->roles = ['ROLE_USER'];\n }", "public function __construct()\n {\n $this->api_id = Config::get('biddingos.ym.api_id');\n $this->api_token = md5(Config::get('biddingos.ym.api_token'));\n $this->refresh_time = Config::get('biddingos.ym.refresh_time');\n parent::__construct();\n }", "public function __construct() {\n // except for the authenticate method. We don't want to prevent\n // the user from retrieving their token if they don't already have it\n $this->middleware('jwt.auth', ['except' => ['authenticate','get_lifestyles']]);\n }", "public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }", "public function __construct(auth\\interfaces\\Token $token, array $data)\n {\n // Identifiers are required, all other data is optional.\n // The property check is put in place to allow child classes to map the identifier to the property\n // before calling the base constructor, in case the identifier is not available under the \"id\" key\n // in the raw data (and we don't want to rely on this convention globally).\n if (!isset($this->id)) {\n if (!isset($data['id'])) {\n throw new \\InvalidArgumentException('The Identity is missing an unique identifier.');\n }\n\n $this->id = $data['id'];\n }\n\n $this->tokens[] = $token;\n $this->raw = $data;\n }", "public function __construct()\n {\n $this->protocol = api_get_setting('sso_authentication_protocol');\n // There can be multiple domains, so make sure to take only the first\n // This might be later extended with a decision process\n $domains = explode(',', api_get_setting('sso_authentication_domain'));\n $this->domain = trim($domains[0]);\n $this->auth_uri = api_get_setting('sso_authentication_auth_uri');\n $this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');\n //cut the string to avoid recursive URL construction in case of failure\n $this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));\n $this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;\n $this->master_url = $this->protocol.$this->domain.$this->auth_uri;\n $this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);\n $this->target = api_get_path(WEB_PATH);\n }", "public function __construct()\n {\n $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);\n $this->enabled = false;\n $this->locked = false;\n $this->expired = false;\n $this->roles = new ArrayCollection();\n $this->credentialsExpired = false;\n $this->confirmationToken = base64_encode(utf8_encode(openssl_random_pseudo_bytes(10)));\n $this->createdAt = new \\DateTime();\n }", "public function __construct(callable $tokenGenerator, $tokenName = 'X-XSRF-TOKEN')\n {\n $this->tokenGenerator = $tokenGenerator;\n $this->tokenName = $tokenName;\n }", "public function __construct() {\n //errors var empty array\n $this->_errors = array();\n\n // filters the posts for submitted data\n $this->_username = $this->filter($_POST['username']);\n $this->_password = $this->filter($_POST['password']);\n\t\t$this->_password_confirm = $this->filter($_POST['password_confirm']);\n $this->_first_name = $this->filter($_POST['first_name']);\n $this->_last_name = $this->filter($_POST['last_name']);\n $this->_dob = $this->filter($_POST['dob']);\n $this->_address = $this->filter($_POST['address']);\n $this->_postcode = $this->filter($_POST['postcode']);\n $this->_email = $this->filter($_POST['email']);\n\n\n // assings token var to post\n $this->_token = $_POST['token'];\n \n\t // sets _sha1 to password\n $this->_sha1 = $this->_password;\n\n\t\t// encripts password\n\t\t\n\t\t$this->_sha1 = hash('sha1' ,$this->_sha1);\n\t\t//var_dump($this->_sha1);\n }", "public function setToken()\n {\n $this->token = Token::generate($this->email);\n\n return $this;\n }", "public function __construct($usernameOrToken = '', $password = '')\n {\n if (! function_exists('curl_init')) {\n trigger_error('PhonegapBuildApi library requires CURL module to be enabled');\n }\n\n if (! empty($usernameOrToken)) {\n if (! empty($password)) {\n $this->setCredentials($usernameOrToken, $password);\n } else {\n $this->setToken($usernameOrToken);\n }\n }\n }", "public function __construct($config = array())\n\t{\n\t\t// Clean up the salt pattern and split it into an array\n\t\t$config['salt_pattern'] = preg_split('/,\\s*/', $config['salt_pattern']);\n\n\t\t// Check model name: it should be string and should not contain the model prefix\n\t\tif (isset($config['model_name']) AND is_string($config['model_name']))\n\t\t\t$config['model_name'] = str_ireplace('model_', '', strtolower($config['model_name']));\n\t\telse\n\t\t\t$config['model_name'] = 'user';\n\n\t\t// Save the config in the object\n\t\t$this->_config = $config;\n\n\t\t// Set token model name and check model existence\n\t\t$this->_config['token_model_name'] = $this->_config['model_name'].'_token';\n\n\t\t$model_class = 'Model_'.$this->_config['token_model_name'];\n\n\t\tif ($this->_config['autologin_cookie'] AND ! class_exists($model_class))\n\t\t{\n\t\t\tthrow new Kohana_Exception ('Could not find token model class :name', array(':name' => $model_class));\n\t\t}\n\n\t\t$this->_session = Session::instance();\n\t}" ]
[ "0.7537068", "0.75002354", "0.7450454", "0.7385433", "0.7367643", "0.7341946", "0.73283356", "0.73283356", "0.73283356", "0.73283356", "0.73081046", "0.73081046", "0.7065835", "0.7009088", "0.6977902", "0.6969666", "0.6965691", "0.69431466", "0.6904627", "0.69020635", "0.68979716", "0.68893105", "0.6833477", "0.6812013", "0.6811523", "0.6806108", "0.678667", "0.6771639", "0.67694145", "0.67539275", "0.6746117", "0.67415947", "0.6727848", "0.67142123", "0.6671483", "0.665739", "0.6650316", "0.66355085", "0.66310227", "0.66296136", "0.6609966", "0.6599862", "0.6576157", "0.65752846", "0.6560287", "0.6532471", "0.6525461", "0.6521448", "0.6519786", "0.651731", "0.6513194", "0.6507959", "0.6504202", "0.6456423", "0.64525205", "0.64491093", "0.6434816", "0.6430872", "0.6429555", "0.6425226", "0.64127135", "0.6408584", "0.64051783", "0.64011174", "0.6392707", "0.6380779", "0.6376259", "0.63731366", "0.6372559", "0.6372559", "0.6361929", "0.6361929", "0.63582873", "0.6347541", "0.6340431", "0.6332468", "0.6331673", "0.6330108", "0.6321213", "0.63202685", "0.6303784", "0.6288318", "0.6287041", "0.62869644", "0.6279947", "0.6273842", "0.62645376", "0.6264488", "0.62620926", "0.624256", "0.62396944", "0.62370926", "0.6236695", "0.6234884", "0.6216155", "0.62152725", "0.62126094", "0.62104875", "0.62030154", "0.61829376", "0.6178124" ]
0.0
-1
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values
public static function __set_state(array $_array,$_className = __CLASS__) { return parent::__set_state($_array,$_className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}", "function from_export($value) {\n return $value;\n }", "public function export(): mixed;", "public function ExportObject() {\n // Init object\n $col = new stdClass();\n \n // Set values\n $col->id = $this->Id;\n $col->type = $this->Type;\n $col->label = $this->Label;\n $col->p = $this->P;\n \n // Return values\n return $col;\n }", "public function exportData() {\n\t\treturn $this->constructExportObject();\n\t}", "public function toObject();", "function ctools_export_new_object($table, $set_defaults = TRUE) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n $object = new $export['object'];\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($info['object default'])) {\r\n $object->$field = $info['object default'];\r\n }\r\n else if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if ($set_defaults) {\r\n // Set some defaults so this data always exists.\r\n // We don't set the export_type property here, as this object is not saved\r\n // yet. We do give it NULL so we don't generate notices trying to read it.\r\n $object->export_type = NULL;\r\n $object->{$export['export type string']} = t('Local');\r\n }\r\n return $object;\r\n}", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function createExport();", "public function newInstance(): object;", "public static function createFromGlobals();", "public function export (){\n\n }", "function &object(object $value, string $namespace = 'default'): object\n{\n $var = new Variable\\ObjectVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getObj();", "public static function toObject(){\r\n $args = func_get_args();\r\n \r\n if(count($args) >=2){\r\n $className = '\\\\'.str_replace('.', '\\\\', $args[0]);\r\n $refClass = new \\ReflectionClass($className);\r\n $toObjInstance = $refClass->newInstance();\r\n\r\n unset($args[0]);\r\n \r\n foreach($args as $arg){\r\n \r\n if(is_object($arg)){\r\n $arg = Obj::getProperties($arg);\r\n }\r\n \r\n if(is_array($arg)){\r\n foreach($arg as $propertyName=>$propertyValue){\r\n if($refClass->hasProperty($propertyName)){\r\n $property = $refClass->getProperty($propertyName);\r\n $property->setAccessible(true);\r\n $property->setValue($toObjInstance, $propertyValue);\r\n }\r\n }\r\n }\r\n }\r\n return $toObjInstance;\r\n }\r\n }", "public function export()\n {\n }", "function &stdClass(stdClass $value, string $namespace = 'default'): stdClass\n{\n $var = new Variable\\StdClassVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getExportableValues() {\n\t\telgg_deprecated_notice(__METHOD__ . ' has been deprecated by toObject()', 1.9);\n\t\treturn array(\n\t\t\t'id',\n\t\t\t'entity_guid',\n\t\t\t'name',\n\t\t\t'value',\n\t\t\t'value_type',\n\t\t\t'owner_guid',\n\t\t\t'type',\n\t\t);\n\t}", "public function ExportObject() {\n // Init object\n $overviewChart = new stdClass();\n \n // Set values\n $overviewChart->Types = $this->Types;\n $overviewChart->Chart = $this->Chart->ExportObject();\n \n //return result\n return $overviewChart;\n }", "public function export()\n {\n \n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getter () {\n return (object)[\n get_plugin_name => $this->plugin_name,\n get_plugin_version => $this->plugin_version,\n get_translation_slug => $this->translation_slug,\n get_admin_page_slug => $this->admin_page_slug,\n get_api_namespace => $this->api_namespace,\n get_options_name => $this->options_name\n ];\n }", "public function getObject() {}", "public function getObject() {}", "public function export()\n {\n //\n }", "function _instantiateExportDeployment($context) {\n\t\t$exportDeploymentClassName = $this->getExportDeploymentClassName();\n\t\t$this->import($exportDeploymentClassName);\n\t\t$exportDeployment = new $exportDeploymentClassName($context, $this);\n\t\treturn $exportDeployment;\n\t}", "function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }", "public function __CONSTRUCT(){\n\t}", "public function newInstance();", "public function newInstance();", "public function getInstance(): object;", "public function exportedVars(): iterable;", "public static function fromGlobals() {}", "public function ExportObject() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->GitHash = $this->GitHash;\n $submission->Categories = array();\n \n // Export each category\n foreach ($this->Categories as $category) {\n $submission->Categories[] = $category->ExportObject();\n }\n \n // return result\n return $submission;\n }", "public function getInstance(): object\n {\n }", "function ctools_get_default_object($table, $name) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!$export['default hook']) {\r\n return;\r\n }\r\n\r\n // Try to load individually from cache if this cache is enabled.\r\n if (!empty($export['cache defaults'])) {\r\n $defaults = _ctools_export_get_some_defaults($table, $export, array($name));\r\n }\r\n else {\r\n $defaults = _ctools_export_get_defaults($table, $export);\r\n }\r\n\r\n $status = variable_get($export['status'], array());\r\n\r\n if (!isset($defaults[$name])) {\r\n return;\r\n }\r\n\r\n $object = $defaults[$name];\r\n\r\n // Determine if default object is enabled or disabled.\r\n if (isset($status[$object->{$export['key']}])) {\r\n $object->disabled = $status[$object->{$export['key']}];\r\n }\r\n\r\n $object->{$export['export type string']} = t('Default');\r\n $object->export_type = EXPORT_IN_CODE;\r\n $object->in_code_only = TRUE;\r\n\r\n return $object;\r\n}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "public function getObject(): object;", "public function get_export_data()\n {\n\n $l_sql = \"SELECT isys_obj_type__id, isys_obj_type__title, isys_verinice_types__title, isys_verinice_types__const \" . \"FROM isys_obj_type \" . \"INNER JOIN isys_verinice_types ON isys_obj_type__isys_verinice_types__id = isys_verinice_types__id \";\n\n return $this->retrieve($l_sql);\n\n }", "public function dataProviderExport()\n {\n // Regular :\n $data = [\n [\n 'test string',\n var_export('test string', true),\n ],\n [\n 75,\n var_export(75, true),\n ],\n [\n 7.5,\n var_export(7.5, true),\n ],\n [\n null,\n 'null',\n ],\n [\n true,\n 'true',\n ],\n [\n false,\n 'false',\n ],\n [\n [],\n '[]',\n ],\n ];\n // Arrays :\n $var = [\n 'key1' => 'value1',\n 'key2' => 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => 'value1',\n 'key2' => 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'value1',\n 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'value1',\n 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n // Objects :\n $var = new \\StdClass();\n $var->testField = 'Test Value';\n $expectedResult = \"unserialize('\" . serialize($var) . \"')\";\n $data[] = [$var, $expectedResult];\n $var = function () {return 2;};\n $expectedResult = 'function () {return 2;}';\n $data[] = [$var, $expectedResult];\n return $data;\n }", "public static function export()\n {\n return null;\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function construct()\n {\n return $this->object;\n }", "public function metaExport($object = false);", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function getValuesObject()\n {\n $obj = new \\stdClass;\n\n foreach ( $this->keyValues as $key => $value )\n {\n $obj->$key = $value;\n }\n\n return $obj;\n }", "public function getObject();", "public function getObject();", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}", "public function __construct(VariableExportInterface $variableExport)\n {\n $this->serialized = $variableExport->toSerialize();\n }", "public function as_object($class = TRUE, $arguments = array());", "function var_export($expression, $return = false)\n{\n}", "function getObject();", "function getObject();", "abstract public function object();", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "abstract protected function createObject();", "function &getInstance($module_srl)\n\t{\n\t\treturn new ExtraVar($module_srl);\n\t}", "abstract function exportData();", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "abstract protected function exportFunctions();", "public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }", "public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}", "public function ExportItem() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->ImportDateTime = $this->ImportDateTime;\n $submission->User = $this->User;\n $submission->Good = $this->Good;\n $submission->Bad = $this->Bad;\n $submission->Strange = $this->Strange;\n $submission->GitHash = $this->GitHash;\n $submission->SequenceNumber = $this->SequenceNumber;\n \n // Return result\n return $submission;\n }", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "function instance($obj) {\n\tif (is_string($obj)) {\n\t\t$obj = new $obj;\n\t}\n\treturn $obj;\n}", "function ctools_var_export($var, $prefix = '') {\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $output = 'array()';\r\n }\r\n else {\r\n $output = \"array(\\n\";\r\n foreach ($var as $key => $value) {\r\n $output .= $prefix . \" \" . ctools_var_export($key) . \" => \" . ctools_var_export($value, $prefix . ' ') . \",\\n\";\r\n }\r\n $output .= $prefix . ')';\r\n }\r\n }\r\n else if (is_object($var) && get_class($var) === 'stdClass') {\r\n // var_export() will export stdClass objects using an undefined\r\n // magic method __set_state() leaving the export broken. This\r\n // workaround avoids this by casting the object as an array for\r\n // export and casting it back to an object when evaluated.\r\n $output = '(object) ' . ctools_var_export((array) $var, $prefix);\r\n }\r\n else if (is_bool($var)) {\r\n $output = $var ? 'TRUE' : 'FALSE';\r\n }\r\n else {\r\n $output = var_export($var, TRUE);\r\n }\r\n\r\n return $output;\r\n}", "public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function regularNew() {}", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "function ctools_export_object($table, $object, $indent = '', $identifier = NULL, $additions = array(), $additions2 = array()) {\r\n $schema = ctools_export_get_schema($table);\r\n if (!isset($identifier)) {\r\n $identifier = $schema['export']['identifier'];\r\n }\r\n\r\n $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . \"();\\n\";\r\n\r\n if ($schema['export']['can disable']) {\r\n $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . \"\\n\";\r\n }\r\n if (!empty($schema['export']['api']['current_version'])) {\r\n $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . \";\\n\";\r\n }\r\n\r\n // Put top additions here:\r\n foreach ($additions as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n $fields = $schema['fields'];\r\n if (!empty($schema['join'])) {\r\n foreach ($schema['join'] as $join) {\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $join_field) {\r\n $fields[$join_field] = $join['fields'][$join_field];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Go through our schema and joined tables and build correlations.\r\n foreach ($fields as $field => $info) {\r\n if (!empty($info['no export'])) {\r\n continue;\r\n }\r\n if (!isset($object->$field)) {\r\n if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = '';\r\n }\r\n }\r\n\r\n // Note: This is the *field* export callback, not the table one!\r\n if (!empty($info['export callback']) && function_exists($info['export callback'])) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . \";\\n\";\r\n }\r\n else {\r\n $value = $object->$field;\r\n if ($info['type'] == 'int') {\r\n if (isset($info['size']) && $info['size'] == 'tiny') {\r\n $info['boolean'] = (!isset($info['boolean'])) ? $schema['export']['boolean'] : $info['boolean'];\r\n $value = ($info['boolean']) ? (bool) $value : (int) $value;\r\n }\r\n else {\r\n $value = (int) $value;\r\n }\r\n }\r\n\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n }\r\n\r\n // And bottom additions here\r\n foreach ($additions2 as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n return $output;\r\n}", "function _construct(){ }", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function _init_obj()\n {\n // dummy\n }", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}", "function adminer_object() {\n\t\tinclude_once \"plugins/plugin.php\";\n\t\t// autoloader\n\t\tforeach (glob(\"plugins/*.php\") as $filename) {\n\t\t\tinclude_once $filename;\n\t\t}\n\t\t$plugins = array(\n\t\t\t// specify enabled plugins here\n\t\t\tnew AdminerDatabaseHide(array('information_schema', 'mysql', 'performance_schema')),\n\t\t\t//new AdminerDumpJson,\n\t\t\t//new AdminerDumpBz2,\n\t\t\t//new AdminerDumpZip,\n\t\t\t//new AdminerDumpXml,\n\t\t\t//new AdminerDumpAlter,\n\t\t\t//~ new AdminerSqlLog(\"past-\" . rtrim(`git describe --tags --abbrev=0`) . \".sql\"),\n\t\t\t//new AdminerFileUpload(\"\"),\n\t\t\t//new AdminerJsonColumn,\n\t\t\t//new AdminerSlugify,\n\t\t\t//new AdminerTranslation,\n\t\t\t//new AdminerForeignSystem,\n\t\t\t//new AdminerEnumOption,\n\t\t\t//new AdminerTablesFilter,\n\t\t\t//new AdminerEditForeign,\n\t\t);\n\n\t\treturn new AdminerPlugin($plugins);\n\t}", "public function newCObj() {}", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->fragile = $this->_fragile;\n $stdClass->parcelsCount = $this->_parcelsCount;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n return $stdClass;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }", "abstract public function prepare_new_object(array $args);", "protected function getRealScriptUserObj() {}", "public function export(bool $private = FALSE, bool $meta = FALSE) {\n\t\t$keys = [];\n\t\t$ret = [];\n\n\t\tif ($private) {\n\t\t\t$keys = static::$PRIVATE;\n\t\t} else {\n\t\t\t$keys = static::$PUBLIC;\n\t\t}\n\n\t\tif (!empty(array_intersect(EXP_RESERVED, $keys))) {\n\t\t\tthrow new ExportableException(\n\t\t\t\t\"Reserved key '\".EXP_CLASSNAME.\"' used in object.\"\n\t\t\t);\n\t\t}\n\n\t\tif ($meta) { // Add metadata.\n\t\t\t$ret[EXP_CLASSNAME] = get_class($this);\n\t\t\t$ret[EXP_VISIBILITY] = $private ? 'private' : 'public';\n\t\t}\n\n\t\tforeach ($keys as $k) {\n\t\t\t$current = $this->__exportable_get($k);\n\t\t\tswitch (gettype($current)) {\n\t\t\t\tcase 'object':\n\t\t\t\t\t$ret[$k] = $this->exp_obj(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\t\t$ret[$k] = $this->exp_array(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ret[$k] = $current;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public static function & GetInstance ();", "public function getInstance(): mixed;", "public function convertToUserIntObject() {}", "function FetchObj() {}" ]
[ "0.6951545", "0.69232285", "0.65775573", "0.63780814", "0.61447084", "0.6124327", "0.60560846", "0.60397184", "0.5923654", "0.5923654", "0.5923654", "0.5923654", "0.5923654", "0.5859233", "0.5837315", "0.5812245", "0.5802086", "0.5717504", "0.57162964", "0.5712339", "0.56903213", "0.56595755", "0.5640809", "0.56022894", "0.5526776", "0.55109495", "0.54620224", "0.54063857", "0.54063857", "0.5404142", "0.5375808", "0.5371887", "0.53706616", "0.53702146", "0.53702146", "0.53414696", "0.533712", "0.53158665", "0.53082156", "0.52968127", "0.52635765", "0.5260902", "0.5248091", "0.52451634", "0.52276367", "0.51886034", "0.5179024", "0.5150206", "0.51420516", "0.51334953", "0.5131524", "0.511764", "0.511764", "0.51175", "0.5114193", "0.5105998", "0.51003855", "0.509397", "0.509397", "0.5079056", "0.50410765", "0.5039707", "0.50331974", "0.5009165", "0.5006386", "0.50030124", "0.49972764", "0.49859205", "0.49852443", "0.49785307", "0.49744886", "0.49681154", "0.49568388", "0.49559537", "0.49535906", "0.49515152", "0.49422276", "0.49275482", "0.49275482", "0.49186963", "0.4916552", "0.49162814", "0.49089703", "0.49081865", "0.4895866", "0.48937374", "0.48886347", "0.4882453", "0.48817745", "0.48762545", "0.48756522", "0.48652247", "0.48629344", "0.48628816", "0.48479915", "0.48471147", "0.4841108", "0.4838144", "0.48376375", "0.48362547", "0.48354247" ]
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Login de un usuario
function login($usuario,$pass){ // Método 1: // $usuario = self::db()->quote($usuario); // $user=self::db()->query("select * from usuarios where usuario=$usuario")->fetch(PDO::FETCH_OBJ); // Método 2: $stmt=self::db()->prepare("select * from usuarios where usuario=:usuario"); $stmt->bindParam(':usuario',$usuario); $stmt->execute(); $user=$stmt->fetch(PDO::FETCH_OBJ); if(!$user || $user->password!=md5($pass)) return false; else { $_SESSION['usuario']=$user; return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login();", "public function login();", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "public function login()\n {\n if (isset($_POST['signIn'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n var_dump($userExist);\n \n if ($userExist === false) {\n header('Location: auth&alert=NotUser');\n exit();\n } else {\n $authUser = $this->usersManager->getAuthUser($_POST['login']);\n if (password_verify($_POST['password'], $authUser[0]->userPassword())) {\n $this->usersManager->setLastConnexionUser($authUser[0]->userId());\n $this->openSession($authUser[0]);\n } else {\n header('Location: auth&alert=Login');\n exit();\n }\n }\n } else {\n throw new Exception($this->datasError);\n }\n }", "private function login(){\n \n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function hacerLogin() {\n $user = json_decode(file_get_contents(\"php://input\"));\n\n if(!isset($user->email) || !isset($user->password)) {\n http_response_code(400);\n exit(json_encode([\"error\" => \"No se han enviado todos los parametros\"]));\n }\n \n //Primero busca si existe el usuario, si existe que obtener el id y la password.\n $peticion = $this->db->prepare(\"SELECT id,idRol,password FROM users WHERE email = ?\");\n $peticion->execute([$user->email]);\n $resultado = $peticion->fetchObject();\n \n if($resultado) {\n \n //Si existe un usuario con ese email comprobamos que la contraseña sea correcta.\n if(password_verify($user->password, $resultado->password)) {\n \n //Preparamos el token.\n $iat = time();\n $exp = $iat + 3600*24*2;\n $token = array(\n \"id\" => $resultado->id,\n \"iat\" => $iat,\n \"exp\" => $exp\n );\n \n //Calculamos el token JWT y lo devolvemos.\n $jwt = JWT::encode($token, CJWT);\n http_response_code(200);\n exit(json_encode($jwt . \"?\" . $resultado->idRol));\n \n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Password incorrecta\"]));\n }\n \n } else {\n http_response_code(404);\n exit(json_encode([\"error\" => \"No existe el usuario\"])); \n }\n }", "public static function login($usuario, $password = false);", "private function login(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t} //es una peticion POST\n\t\tif(isset($this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t\t\t#el constructor padre se encarga de procesar los datos de entrada\n\t\t\t$email = $this->datosPeticion['email']; \n \t\t$pwd = $this->datosPeticion['pwd'];\n \t\t//si los datos de la solicitud no es tan vacios se procesa\n \t\tif (!empty($email) and !empty($pwd)){\n \t\t\t//se valida el email\n \t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) { \n \t\t\t//consulta preparada mysqli_real_escape()\n \t\t\t\t$query = $this->_conn->prepare(\n \t\t\t\t\t\"SELECT id, nombre, email, fRegistro \n \t\t\t\t\t FROM usuario \n \t\t\t\t\t WHERE email=:email AND password=:pwd \");\n \t\t\t\t//se le prestan los valores a la query\n \t\t\t\t$query->bindValue(\":email\", $email); \n \t\t\t$query->bindValue(\":pwd\", sha1($pwd)); \n \t\t\t$query->execute(); //se ejecuta la consulta\n \t\t\t//Se devuelve un respuesta a partir del resultado\n \t\t\tif ($fila = $query->fetch(PDO::FETCH_ASSOC)){ \n\t\t\t $respuesta['estado'] = 'correcto'; \n\t\t\t $respuesta['msg'] = 'Los datos pertenecen a un usuario registrado';\n\t\t\t //Datos del usuario \n\t\t\t $respuesta['usuario']['id'] = $fila['id']; \n\t\t\t $respuesta['usuario']['nombre'] = $fila['nombre']; \n\t\t\t $respuesta['usuario']['email'] = $fila['email']; \n\t\t\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t\t\t } \n \t\t\t}\n \t\t} \n\t\t} // se envia un mensaje de error\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(3)), 400);\n\t}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function login(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\" && isset($_POST[\"Anmelden\"]) && $_POST[\"Anmelden\"] == \"Anmelden\") {\n if ($this->error == false) {\n $datenbank = new DatenbankAufrufe;\n #Prüfung ob der Benutzer bereits existiert\n $result = $datenbank->existBenutzer();\n if ($result == true) {\n $dbPasswort = $datenbank->passwortAuslesen();\n $pwKrypto = new PasswortSpeichern;\n $result2 = $pwKrypto->passwortAbgleich($_POST['passwort'], $dbPasswort);\n if ($result2 == true) {\n #SESSION\n $session = new sessionClass;\n $name = $datenbank->benutzernameAuslesen();\n $session->SessionStart($name, $datenbank);\n\n header(\"Location: index.php?site=main\");\n }\n else {\n echo \"Das Passwort ist nicht korrekt\";\n }\n } else {\n echo \"Bitte zuerst Registrieren\";\n }\n }\n }\n }", "public function login(){\n\n }", "public function logar()\n {\n if ($this->checkPost()) { \n $usuario = new \\App\\Model\\Usuario;\n $usuario->setLogin($this->post['usuario']);\n $usuario->setSenha($this->post['senha']);\n $usuario->authDb();\n redirect(DEFAULTCONTROLLER.'\\logado');\n } else {\n redirect(DEFAULTCONTROLLER);\n }\n }", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "private static function login() {\n if ( !self::validatePost() ) {\n return;\n }\n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $result = Database::getUser($_POST['email'],$password);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return;\n }\n \n $_SESSION['user']['id'] = $result[0]['id'];\n $_SESSION['user']['email'] = $result[0]['email'];\n $_SESSION['user']['nickname'] = $result[0]['nickname'];\n $_SESSION['user']['verified'] = $result[0]['verified'];\n $_SESSION['user']['moderator'] = $result[0]['moderator'];\n $_SESSION['user']['supermoderator'] = $result[0]['supermoderator'];\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n }", "public function login()\n {\n\t if( !isset( $_POST[\"username\"] ) || preg_match( '/[a-zA-Z]{1, 20}/', $_POST[\"username\"] ) )\n {\n $x = new UsersController;\n $x->index();\n }\n\n // Možda se ne šalje password; u njemu smije biti bilo što.\n if( !isset( $_POST[\"password\"] ) )\n {\n $x = new UsersController;\n $x->index();\n }\n \n $provjera = new ChatService;\n $row = $provjera->loginUser();\n\n if( $row === false )\n {\n // Taj user ne postoji, ili nije registriran upit u bazu nije vratio ništa.\n $x = new UsersController;\n $x->index();\n return;\n }\n else\n {\n\n // Postoji user. Dohvati hash njegovog passworda.\n $hash = $row['password_hash'];\n\n // Da li je password dobar?\n if( password_verify( $_POST['password'], $hash ) )\n {\n // Dobar je. Ulogiraj ga.\n $y = new ChatService;\n $_SESSION['id_user'] = $y->getUserId($_POST['username']);\n\n $x = new ChannelsController;\n $x->naslovna();\n \n return;\n }\n else\n {\n // Nije dobar. Crtaj opet login formu s pripadnom porukom.\n $x = new UsersController;\n $x->index();\n return;\n }\n }\n }", "public function login() {\n parent::conectarBD();\n\n $queri = parent::query(sprintf(\"select usu_id as codigo, usu_password as senha, \"\n . \"usu_token_sessao as token_sessao, usu_login as login from \"\n . table_prefix . \"usuario where usu_login = '%s' and \"\n . \"usu_password = '%s'\", $this->usu_login, $this->usu_password));\n\n if ($queri) {\n $dados = $queri->fetch_assoc();\n if ($dados) {\n $new_session_id = hash('sha256', $dados['senha'] . time());\n $queri2 = parent::query(\"update \" . table_prefix . \"usuario set usu_token_sessao = '$new_session_id' where usu_id = \" . $dados['codigo']);\n\n if ($queri2) {\n $dados['token_sessao'] = $new_session_id;\n parent::commit();\n parent::desconectarBD();\n return $dados;\n } else {\n parent::rollback();\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "public function login()\n {\n }", "public function login()\n {\n }", "public function login()\n {\n\t\tif(isset($_POST['email']) && isset($_POST['senha'])){\n\t\t\t\n\t\t\t//verifica se os $_POST estão vazios\n\t\t\tif(empty($_POST['email']) && empty($_POST['senha'])){\n\t\t\t\theader('Location: /admin?inputvazio=true');\n\t\t\t\treturn true;\n }\n \n $login = Container::getModel('admin');\n $login->setEmail($_POST['email']);\n $login->setSenha($_POST['senha']);\n\n //se a senha e o e-mail é o mesmo do banco\n if($login->login()){\n //cria as sessões\n session_start();\n $_SESSION['logado'] = true;\n $_SESSION['id'] \t= $login->getId();\n $_SESSION['nome'] \t= $login->getNome();\n $_SESSION['nivelAcesso'] \t= $login->geNivelAcesso();\n header('Location: /dashboard');\n }else{\n header('Location: /admin?logado=false');\n }\n }\n }", "public function loginAction() {\n\n\n $login = $this->getRequest()->getPost();\n if (!isset($login['username']) || !isset($login['password'])) {\n return $this->showMsg(-1, '用户名或者密码不能为空.');\n }\n\n\n $ret = Admin_Service_User::login($login['username'], $login['password']);\n\n\n if (Common::isError($ret)) return $this->showMsg($ret['code'], $ret['msg']);\n if (!$ret) $this->showMsg(-1, '登录失败.');\n $this->redirect('/Admin/Index/index');\n }", "public function login($userName, $password);", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }", "public function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db fpr this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token\n FROM users\n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the db, it means login failed\n if(!$token) {\n\n Router::redirect(\"/users/login/error\");\n \n\n # But if we did, login succeeded!\n } else {\n\n \n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n \n\n # Send them to the main page - or wherevr you want them to go\n Router::redirect(\"/\");\n # Send them back to the login page\n }\n }", "public function executeLogin()\n {\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "public function login() {\n if (isset($_POST['password'])) {\n $hash = $this->manager->getPassword();\n\n if (password_verify($_POST['password'], $hash)) {\n // On ouvre une session\n $_SESSION['admin-connected'] = true;\n // et on affiche la page pour l'administrateur\n header('Location:' . env(\"URL_PREFIX\") . '/admin');\n }\n else {\n // Si le mot de passe est incorrect,\n // on redirige sur la page de connexion avec un message d'erreur\n $this->response('login', [\n 'error' => \"invalid-password\"\n ]);\n }\n }\n }", "public static function LogIn ($userName = '', $password = '');", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function loginUser($user,$pwd){\n \n $pwdCr = mkpwd($pwd);\n \n \n \n $sql = new Sql();\n $userData = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario\n AND pwd_usuario = :pwd_usuario',array(':email_usuario'=>$user,':pwd_usuario'=>$pwdCr));\n \n if(!isSet($userData) || count($userData)==0){//CASO NADA RETORNADO\n return false;\n }elseif(count($userData)>0){//CASO DADOS RETORNADOS CONFERE O STATUS\n \n if($userData[0]['status_usuario']==0){\n \n return 0;//caso INATIVO entao retorna ZERO indicando cadastro NAO ATIVO\n \n }elseif($userData[0]['status_usuario']==1){//CASO USUARIO ATIVO GERA SESSION DO LOGIN\n \n \n //permissao do cliente\n $_SESSION['_uL'] = encode($userData[0]['permissao_usuario']);\n $_SESSION['logado'] = 'sim';\n \n //dados do usuario\n $_SESSION['_iU'] = encode($userData[0]['id_usuario']);\n $_SESSION['_iE'] = encode($userData[0]['id_empresa']);\n $_SESSION['_nU'] = encode($userData[0]['nome_usuario'] . ' ' . $userData[0]['sobrenome_usuario']);\n $_SESSION['_eU'] = encode($userData[0]['email_usuario']);\n \n return 1;\n }\n \n }\n \n \n }", "public function login(){\n\t\t\tValidator::validateOrRedirect($_POST,\n\t\t\t\t\t[\n\t\t\t\t\t\t\t\"required\" => [\"txt-input\", \"password\",\"action\"],\n\t\t\t\t\t\t\t\"email\" => \"txt-input\",\n\t\t\t\t\t],\n\t\t\t\t\t\"/login\");\n\t\t\t$this->resetMessage();\n\t $username=$_POST[\"txt-input\"];\n\t $password=$_POST[\"password\"];\n\t $action=$_POST[\"action\"];\n\t\t\t$userList =[];\n\t\t\t$column_value=array('email'=>$username,'password'=>$password);\n\t\t\t$uss=new User();\n\t\t\t$login=$uss->getBy($column_value);\n\t\t\tif (is_array($login)) {\n\t\t\t\tif (count($login)>0) {\n\t\t\t\t\tforeach ($login as $user)\n\t\t\t {\n\t\t\t\t\t\t$userList[]= array(\n\t\t\t 'user' =>$user['user_name'],\n\t\t\t 'email' =>$user['email'],\n\t\t\t 'password' =>$user['password']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$user=$userList[0][\"email\"];\n\t\t $pass=$userList[0][\"password\"];\n\t\t Redirect::to(\"/products\")->with([\n\t\t 'name'=>$userList[0][\"email\"],\n\t\t 'check'=>\"true\",\n\t\t ])->do();\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tRedirect::to(\"/login\")->with([\n\t\t \"message\" => \"Ha ocurrido un error: usuario o contraseña incorrectos.</br> Revise por favor\",\n\t\t \"type\" => \"danger\",\n\t\t ])\n\t\t ->do();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tRedirect::to(\"/login\")->with([\n\t \"message\" => $login,\n\t \"type\" => \"danger\",\n\t ])\n\t ->do();\n\t\t\t}\n\t }", "static public function ctrLoginUser(){ \n\t\t\tif(isset($_POST[\"ingUser\"])){\n\t\t\t\t//Intento de Logeo\n\t\t\t\tif((preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUser\"]))\n\t\t\t\t && (preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"]))){\n\t\t\t\t\t\t$tabla = \"usuarios\";\t//Nombre de la Tabla\n\n\t\t\t\t\t\t$item = \"usuario\";\t\t//Columna a Verficar\n\t\t\t\t\t\t$valor = $_POST[\"ingUser\"];\n\n\t\t\t\t\t\t//Encriptar contraseña\n\t\t\t\t\t\t$crPassword = crypt($_POST[\"ingPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\n\t\t\t\t\t\t$respuesta = ModelUsers::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t\t\tif($respuesta[\"usuario\"] == $_POST[\"ingUser\"]\n\t\t\t\t\t\t\t&& $respuesta[\"password\"] == $crPassword){\n\t\t\t\t\t\t\t\tif($respuesta[\"estado\"] == '1'){\n\t\t\t\t\t\t\t\t\t//Coincide \n\t\t\t\t\t\t\t\t\t$_SESSION[\"login\"] = true;\n\t\t\t\t\t\t\t\t\t//Creamos variables de Sesion\n\t\t\t\t\t\t\t\t\t$_SESSION[\"user\"] = $respuesta;\n\t\t\t\t\t\t\t\t\t//Capturar Fecha y Hora de Login\n\t\t\t\t\t\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t\t\t\t\t\t$fechaActual = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t$item1 = \"ultimo_login\";\n\t\t\t\t\t\t\t\t\t$valor1 = $fechaActual;\n\t\t\t\t\t\t\t\t\t$item2 = \"id_usuario\";\n\t\t\t\t\t\t\t\t\t$valor2 = $respuesta[\"id_usuario\"];\n\n\t\t\t\t\t\t\t\t\t$ultimoLogin = ModelUsers::mdlActualizarUsuario($tabla, $item1, $valor1, $item2, $valor2);\n\n\t\t\t\t\t\t\t\t\tif($ultimoLogin)\t//Redireccionando\n\t\t\t\t\t\t\t\t\t\techo '<script>location.reload(true);</script>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activado</div>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "function login() {\n $sql = \"SELECT *\n FROM USUARIOS\n WHERE (\n\t\t\t\t (email = '$this->email')\n )\";\n\n $resultado = $this->mysqli->query( $sql );//hacemos la consulta en la base de datos\n if ( $resultado->num_rows == 0 ) {//miramos si el numero de filas es 0\n \t\t\t return 'El usuario no existe';\n\n \t\t} else {//si no es 0, el usuario existe\n \t\t\t$tupla = $resultado->fetch_array();//devolvemos la tupla\n\n \t\t\t if ( $tupla[ 'password' ] == $this->password ) {//si la contraseña es correcta entra en la página\n \t\t\t\t return true;\n\n \t\t\t } else {//en caso contrario no entra\n \t\t\t\t return 'La password para este usuario no es correcta';\n \t\t\t }\n \t }\n\t }", "private function processFormLogin(){\n\t\t$username = $_REQUEST[\"usuario\"];\n\t\t$password = $_REQUEST[\"password\"];\n\t\t$validar = $this->users->getProcessUser($username, $password);\n\t\tif($validar){\n\t\t\tif (Seguridad::getTipo() == \"0\")\n\t\t\t\tView::redireccion(\"selectTable\", \"userController\");\n\t\t\telse\n\t\t\t\tView::redireccion(\"selectTable\", \"userController\");\n\t\t} else {\n\t\t\t$data[\"informacion\"] = \"Nombre de usuario o contraseña incorrecta.\";\n\t\t\tView::show(\"user/login\", $data);\n\t\t}\n\t}", "public function dologin() {\n $password=$this->model->getpassword($_POST['username']);\n if (!empty($_POST['password']) && !empty($password) && $password[0]['userpasswd']==$_POST['password']) {\n $_SESSION['username']=$_POST['username'];\n $id=$this->model->getid($_POST['username']);\n $_SESSION['userid']=$id[0]['userid'];\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->set('errormessage', \"Błędny login lub hasło!\");\n $this->view->set('redirectto', \"?v=user&a=login\");\n $this->view->render('error_view');\n }\n }", "function login()\n{\n\t$username = $this->Session->read('user');\n\tif ($username){\n\t$this->redirect('/inhabitants/');}\n\t\n\t$this->pageTitle = 'Login';\n\t\n\t$this->set('error', false);\n\t// jika form yg disubmit tidak kosong\n\tif ($this->data)\n\t{\n\t// jika username dan password cocok\n\t$results = $this->User->findByUsername($this->data['User']['username']);\n\t\tif ($results && $results['User']['password'] ==\n\t\tmd5($this->data['User']['password']))\n\t\t{\n\t\t\t$this->Session->write('user', $this->data['User']['username']);\n\t\t\t$this->Session->write('last_login', $results['User']['last_login']);\n\t\t\t$results['User']['last_login'] = date(\"Y-m-d H:i:s\");\n\t\t\t$this->User->save($results);\n\t\t\t// redirect\n\t\t\t$this->redirect('/users/');\n\t\t} else {\n\t\t\t$this->set('error', true);\n\t\t}\n\t}\n}", "public function postLogin(){\n\n\t\t\t//Guardamos los datos recibidos\n\t\t\t$userdata = array(\n\t\t\t\t'user' => Input::get('username'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\t//Validamos los datos y mandamos como segundo parametro la opcion de recordar usuario\n\t\t\tif(\n\t\t\t\tAuth::attempt(\n\t\t\t\t\t$userdata,\n\t\t\t\t\tInput::get('remember-me', 0)\n\t\t\t\t)\n\t\t\t){\n\t\t\t\t//Si son validos nos mandara al inicio\n\t\t\t\treturn Redirect::to('/');\n\t\t\t} else {\n\n\t\t\t\t//En caso de que no sean validos los datos nos mandara de nuevo al login con un mensaje de error\n\t\t\t\treturn Redirect::to('/login')\n\t\t\t\t\t\t\t\t\t\t->with('mensaje_error', 'Usuario y/o contrase&ntilde;a incorrecta')\n\t\t\t\t\t\t\t\t\t\t->withInput();\n\n\t\t\t}\n\n\t\t}", "public static function login() {\n \n $identificado = Login::get();\n \n echo \"<section class='container st-login'>\";\n echo \"<div class='row'>\";\n echo \"<div class='col-md-12'>\";\n echo \"<div class='login'>\";\n echo $identificado ?\n \"Hola <a href='/usuario/show/$identificado->id' class='logname'>$identificado->usuario</a>|\n <a href='/login/logout' class='logout'>salir</a>\" :\n \"<a href='/login' class='regis-link'>Identifícate</a><a class='regis-link' href='/usuario/create'>Regístrate</a>\";\n \n echo \"</div>\";\n \n echo \"</div>\";\n echo \"</div>\";\n echo \"</section>\";\n \n }", "private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }", "public function login($name, $password);", "function action_login(){\n \n if($this->request->method()==='POST'){\n \n $login = arr::get($_POST,'username');\n $password = arr::get($_POST,'password');\n if (Auth::instance()->login($login, $password )){\n $user = Auth::instance()->get_user();\n $this->redirect(Route::get('admin')->uri());\n }else{\n echo 'не залогинен';\n \n \n }\n \n \n \n }\n \n }", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function login()\n {\n if ($this->getCurrentUser()->get('id')) {\n $this->redirect($this->Auth->redirectUrl());\n }\n\n if ($user = $this->Auth->identify()) {\n $this->Auth->setUser($user);\n\n // set cookie\n if (!empty($this->getRequest()->getData('remember_me'))) {\n if ($CookieAuth = $this->Auth->getAuthenticate('Lil.Cookie')) {\n $CookieAuth->createCookie($this->getRequest()->getData());\n }\n }\n } else {\n if ($this->getRequest()->is('post') || env('PHP_AUTH_USER')) {\n $this->Flash->error(__d('lil', 'Invalid username or password, try again'));\n }\n }\n\n if ($this->getCurrentUser()->get('id')) {\n $redirect = $this->Auth->redirectUrl();\n $event = new Event('Lil.Auth.afterLogin', $this->Auth, [$redirect]);\n $this->getEventManager()->dispatch($event);\n\n return $this->redirect($redirect);\n }\n }", "function login() {\n\n if(empty($this->data['btnSubmit']) == false)\n {\n // Here we validate the user by calling that method from the User model\n if(($user = $this->Usuario->validateLogin($this->data)) != false)\n {\n // Write some Session variables and redirect to our next page!\n $this->setMessage('success', \"Bienvenido a fletescr.com!\");\n\n $roles = $user['Rol'];\n $userRoles = array();\n\n foreach($roles as $rol){\n $userRoles[] = $rol['id'];\n }\n $this->Auth->login($user);\n $this->Session->write('roles', $userRoles);\n\n // Go to our first destination!\n $this->Redirect(array('controller' => 'transport', 'action' => 'index', 'success' => '1'));\n exit();\n }\n else\n {\n $this->setMessage('error', \"El usuario o clave ingresados son incorrectos.\");\n $this->Redirect(array('controller' => 'transport', 'action' => 'index'));\n exit();\n }\n }\n }", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "public function loginprofesor_post() //INICIAR SESION = http://localhost/foxweb/Api/login\n {\n $matricula = $this->post('matricula');\n $password = $this->post('password');\n $type = $this->post('type');\n\n $datauser = $this->ApiModel->flogin($matricula, $password, $type);\n\n if ($datauser != false) {\n foreach ($datauser as $data) {\n $matricula = $data['matricula'];\n $nombre = $data['nombre'];\n $apellidos = $data['apellidos'];\n }\n\n $response = ['error' => false, 'status' => parent::HTTP_OK, \"matricula\" => $matricula, \"nombre\" => $nombre, \"apellidos\" => $apellidos];\n\n $this->response($response, parent::HTTP_OK);\n\n } else {\n\n $response = ['error' => true,'status' => parent::HTTP_NOT_FOUND, 'msg' => 'Usuario o Contraseña Invalidos!'];\n\n $this->response($response, parent::HTTP_NOT_FOUND);\n\n }\n }", "function login(){\n\t\t\n\t\tif (isset($_POST['submit'])) \n\t\t\t\n\t\t\tif ($_POST['email'] != \"\" && $_POST['password'] != \"\" ) {\n\t\t\t\t$usermodel = new UserModel();\n\t\t\t\t$r = mysqli_num_rows($usermodel->get_user_by_email($_POST['email']));\n\t\t\t\tif ($r!=0) {\n\t\t\t\t\t$row = mysqli_fetch_array($usermodel->get_user_by_email($_POST['email']));\n\t\t\t\t\tif ($row['matkhau'] == md5($_POST['password'])) {\n\t\t\t\t\t\t$_SESSION['nguoidung'] = $row['id'];\n\t\t\t\t\t\techo '<script language=\"javascript\">';\n\t\t\t\t\t\techo 'alert(\"Login success\");'; \n\t\t\t\t\t\techo 'window.location.href = \"/enovel\";';\n\t\t\t\t\t\techo '</script>';\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\techo '<script language=\"javascript\">';\n\t\t\t\t\t\techo 'alert(\"Error Password\");'; \n\t\t\t\t\t\techo '</script>';\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\techo '<script language=\"javascript\">';\n\t\t\t\t\techo 'alert(\"Account not exist, You need to register or check mail\");'; \n\t\t\t\t\techo 'window.location.href = \"/enovel/user/login.php\";';\n\t\t\t\t\techo '</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function loginAction()\n {\n\t\t$_SESSION['authen'] = 1;\n\t\t\n\t\t\n\t\t// Si le visiteur est déjà identifié, on le redirige vers l'accueil\n\t\t\n\t\tif ($this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\n\t\t\t\t\n\t\t\t// mise à jour de la session important pour les pages qui ne requiet pas d'authentification car impossible d'accéder aux informations d'authenltification\n\t\t\t/*if($this->getUser()->getUsername() != $this->getParameter('super_admin'))\n\t\t\treturn $this->redirect($this->generateUrl('cud_default_indexpage'));\n\t\t\telse*\n\t\t\treturn $this->redirect($this->generateUrl('cud_default_adminpage'));\n\t\t\t*/\n\t\t\treturn $this->redirect($this->generateUrl('alexandrie_frontend_homepage'));\n\t\t}\n\t\t\n\t\t$request = $this->getRequest();\n\t\t$session = $request->getSession();\n\t\t// On vérifie s'il y a des erreurs d'une précédente soumission du formulaire\n\t\tif ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {\n\t\t $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);\n\t\t} else {\n\t\t $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);\n\t\t $session->remove(SecurityContext::AUTHENTICATION_ERROR);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$user = new User;\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t\n\t $form = $this->createForm(new RegisterType, $user);\n\t\t$setting = $this->config();\n\t\t\n\t\treturn $this->render('AlexandrieFrontendBundle:Default:login.html.twig',array(\n\t\t // Valeur du précédent nom d'utilisateur entré parl'internaute\n\t\t 'last_username' => $session->get(SecurityContext::LAST_USERNAME),\n\t\t 'error' => $error,\n\t\t 'form_user' => $form->createView(),\n\t\t 'setting'=>$setting));\n\t\t\n\t\t\n\t\t//return $this->render('LegiafricaFrontendBundle:Default:login.html.twig',array());\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function login2(){\n $row = $this->_usuarios->getUsuario1(\n $this->getAlphaNum('usuario2'),\n $this->getSql('pass2')\n );\n \n // si no existe la fila.\n if(!$row){\n echo \"Nombre y/o contraseña incorrectos\";\n exit;\n }\n \n //Inicia session y define las variables de session \n Session::set('autenticado', true);\n Session::set('usuario', $row['usuario']);\n Session::set('id_role', $row['role']);\n Session::set('nombre', $row['nombre']);\n Session::set('ape_pat', $row['ape_pat']);\n Session::set('ape_mat', $row['ape_mat']);\n Session::set('clave_cetpro', $row['cetpro']);\n Session::set('id_usuario', $row['id']);\n Session::set('admin', $this->_usuarios->checkAdmin());\n Session::set('tiempo', time());\n \n echo \"ok\";\n }", "public function loginAction()\n {\n $this->_helper->layout->disableLayout(); // desabilita Zend_Layout\n\n // recebe os dados do formulrio via post\n $post = Zend_Registry::get('post');\n $username = Mascara::delMaskCNPJ(Mascara::delMaskCPF($post->Login)); // recebe o login sem mscaras\n $password = $post->Senha; // recebe a senha\n\n //Pega o IP do usuario\n\n $ip = $this->buscarIp();\n\n $tbLoginTentativasAcesso = new tbLoginTentativasAcesso();\n $LoginAttempt = $tbLoginTentativasAcesso->consultarAcessoCpf($username, $ip);\n\n\n //Pega timestamp atual\n $data = new Zend_Date();\n $timestamp = $data->getTimestamp();\n\n $maxTentativas = 4;\n $tempoBan = 300; // segundos\n\n // VERIFICA SE USUARIO ESTA BANIDO\n if (isset($LoginAttempt)) {\n $tempoLogin = $timestamp - strtotime($LoginAttempt->dtTentativa);\n\n if ($tempoLogin <= $tempoBan && $LoginAttempt->nrTentativa >= $maxTentativas) {\n parent::message('Acesso bloqueado, aguarde '.gmdate(\"i\", ($tempoBan + 5 - $tempoLogin)).' minuto(s) e tente novamente!', \"/\", \"ERROR\");\n } else {\n try {\n // valida os dados\n if (empty($username) || empty($password)) { // verifica se os campos foram preenchidos\n throw new Exception(\"Login ou Senha invalidos!\");\n } elseif (strlen($username) == 11 && !Validacao::validarCPF($username)) { // verifica se o CPF ? v?lido\n throw new Exception(\"O CPF informado invalido!\");\n } elseif (strlen($username) == 14 && !Validacao::validarCNPJ($username)) { // verifica se o CNPJ ? v?lido\n throw new Exception(\"O CNPJ informado invalido!\");\n } else {\n // realiza a busca do usurio no banco, fazendo a autenticao do mesmo\n $Usuario = new Usuario();\n $buscar = $Usuario->login($username, $password);\n\n\n\n if ($buscar) { // acesso permitido\n $tbLoginTentativasAcesso->removeTentativa($username, $ip);\n\n $auth = Zend_Auth::getInstance(); // instancia da autenti��o\n\n // registra o primeiro grupo do usurio (pega unidade autorizada, org�o e grupo do usu�rio)\n $Grupo = $Usuario->buscarUnidades($auth->getIdentity()->usu_codigo, 21); // busca todos os grupos do usu�rio\n\n $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo'); // cria a sess�o com o grupo ativo\n $GrupoAtivo->codGrupo = $Grupo[0]->gru_codigo; // armazena o grupo na sess�o\n $GrupoAtivo->codOrgao = $Grupo[0]->uog_orgao; // armazena o org�o na sess�o\n $this->orgaoAtivo = $GrupoAtivo->codOrgao;\n\n // redireciona para o Controller protegido\n return $this->_helper->redirector->goToRoute(array('controller' => 'principal'), null, true);\n } // fecha if\n else {\n if ($tempoLogin > $tempoBan) {\n $tbLoginTentativasAcesso->removeTentativa($username, $ip);\n }\n $LoginAttempt = $tbLoginTentativasAcesso->consultarAcessoCpf($username, $ip);\n\n //se nenhum registro foi encontrado na tabela Usuario, ele passa a tentar se logar como proponente.\n //neste ponto o _forward encaminha o processamento para o metodo login do controller login, que recebe\n //o post igualmente e tenta encontrar usuario cadastrado em SGCAcesso\n\n //INSERE OU ATUALIZA O ATUAL ATTEMPT\n if (!$LoginAttempt) {\n $tbLoginTentativasAcesso->insereTentativa($username, $ip, $data->get('YYYY-MM-dd HH:mm:ss'));\n } else {\n $tbLoginTentativasAcesso->atualizaTentativa($username, $ip, $LoginAttempt->nrTentativa, $data->get('YYYY-MM-dd HH:mm:ss'));\n }\n\n $this->forward(\"login\", \"login\");\n //throw new Exception(\"Usurio inexistente!\");\n }\n } // fecha else\n } // fecha try\n catch (Exception $e) {\n parent::message($e->getMessage(), \"index\", \"ERROR\");\n }\n }\n }\n }", "public function login(){\n\n if(isset($_POST)){\n \n /* identificar al usuario */\n /* consulta a la base de datos */\n $usuario = new Usuario();\n \n $usuario->setEmail($_POST[\"email\"]);\n $usuario->setPassword($_POST[\"password\"]);\n \n $identity = $usuario->login();\n \n\n if($identity && is_object($identity)){\n \n $_SESSION[\"identity\"]= $identity;\n\n if($identity->rol == \"admin\"){\n var_dump($identity->rol);\n\n $_SESSION[\"admin\"] = true;\n }\n }else{\n $_SESSION[\"error_login\"] = \"identificacion fallida\";\n }\n\n\n /* crear una sesion */\n \n }\n /* redireccion */\n header(\"Location:\".base_url);\n\n }", "function Login(){\n\n\t\t$this->ConectarBD();\n\t\t$sql = \"select * from EMPLEADOS where EMP_USER = '\".$this->EMP_USER.\"'\";\n\t\t$result = $this->mysqli->query($sql);\n\t\tif ($result->num_rows == 1 ){\n\t\t\t$tupla = $result->fetch_array();\n\t\t\tif ($tupla['EMP_PASSWORD'] == md5($this->EMP_PASSWORD)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 'La contraseña para este empleado es errónea';\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn \"El empleado no existe\";\n\t\t}\n\n\t}", "function p_login() {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n # Hash submitted password so we can compare it against one in the db\n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n # Search the db for this email and password\n # Retrieve the token if it's available\n $q = \"SELECT token \n FROM users \n WHERE email = '\".$_POST['email'].\"' \n AND password = '\".$_POST['password'].\"'\";\n\n $token = DB::instance(DB_NAME)->select_field($q);\n\n # If we didn't find a matching token in the database, it means login failed\n if(!$token) {\n\n # Send them back to the login page\n Router::redirect(\"/users/login/error\");\n\n # But if we did, login succeeded! \n } else {\n /* \n Store this token in a cookie using setcookie()\n Important Note: *Nothing* else can echo to the page before setcookie is called\n Not even one single white space.\n param 1 = name of the cookie\n param 2 = the value of the cookie\n param 3 = when to expire\n param 4 = the path of the cookie (a single forward slash sets it for the entire domain)\n */\n setcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n # update the last_login time for the user\n/* $_POST['last_login'] = Time::now();\n\n $user_id = DB::instance(DB_NAME)->update('users', $_POST); */\n\n # Send them to the main page - or whever you want them to go\n Router::redirect(\"/\");\n }\n }", "public function Login($parametros) {\n $helper = HelperFactory::getInstance('auth');\n\n //manda o login para o authHelper\n $helper->setUser($parametros['txt_login']);\n\n //manda a senha para o authHelper\n $helper->setPass($parametros['txt_senha']);\n\n //chama o metodo login\n $helper->login();\n }", "function login(){\n if(isset($_POST['login'])){\n $username = $_POST['username'];\n $password = $_POST['password'];\n\n $query = query(\"SELECT * FROM utenti WHERE username = '{$username}' AND password = '{$password}' \");\n conferma($query);\n\n if(mysqli_num_rows($query) == 0){\n\n creaAvviso('Utente o password Errati');\n header('Location: login.php');\n }else{\n\n $_SESSION['username'] = $username ;\n header('Location: admin/index.php');\n }\n }\n }", "function loginUser()\n {\n if (!empty($_POST['user']) && !empty($_POST['password'])) {\n $user = $_POST['user'];\n $password = $_POST['password'];\n $user_db = $this->model->getUser($user);\n if ($user_db && password_verify($password, $user_db->password)) {\n //chequeamos que la password ingresada sea correcta y el usuario exista\n session_start();\n $_SESSION['user'] = $user;\n header(\"Location: \" . BASE_URL . '../show-parking');\n } else {\n //muestro el login con mensaje de error por usuario o pass incorrectos\n $this->view->showLogin('Usuario o contraseña incorrectos');\n }\n } else {\n //muestro el login con mensaje de error por falta de datos\n $this->view->showLogin('Faltan datos obligatorios');\n }\n }", "public function login()\n {\n $this->vista->index();\n }", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function login($username, $password);", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function login($puruka=null){\n $this->prikaz('login', ['poruka'=>$puruka]);\n }", "function login($username, $password = null)\n {\n $f3->get('user')->copyfrom('POST');\n k($f3);\n $user = self::load(\"name = $username\");\n k($user);\n }", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "function login($email, $senha){// primeiro precisamos aceder os dados dos usuarios \n\t\t$sql = new sql();\n\n\t\t$results = $sql->select(\"SELECT * FROM usuarios WHERE email = :email AND senha = :senha\", array(\n\t\t\t\":email\"=>$email,\n\t\t\t\":senha\"=>$senha\n\t\t));\n\t\tif(count($results) > 0){\n\t\t\t$this->setDados($results[0]);\t\t\t\n\t\t}else{\n\t\t\tthrow new Exception(\"login e/ou email invalidade!\");\t\t\t\n\t\t}\n\n\t}", "public function login (){\n\t\t$user = $this->get_by(array(\n\t\t\t'email' => $this->input->post('email'),\n\t\t\t'password' => $this->hash($this->input->post('password')),\n\t\t\t), TRUE);\n\t\t\n\t\tif (count($user)) {\n\t\t\t// Log in user\n\t\t\t$data = array(\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'email' => $user->email,\n\t\t\t\t'id' => $user->id,\n\t\t\t\t'loggedin' => TRUE,\n\t\t\t);\n\t\t\t$this->session->set_userdata($data);\n\t\t}\n\t\t}", "function login($usuario) {\n // Una vez se cumpla la validacion del login contra la base de datos\n // seteamos como identificador de la misma, el email del usuario:\n $_SESSION[\"email\"] = $usuario[\"email\"];\n // dd($_SESSION);\n // Luego seteo la cookie. La mejor explicacion del uso de \n // setcookie() la tienen como siempre, en el manual de PHP\n // http://php.net/manual/es/function.setcookie.php\n setcookie(\"email\", $usuario[\"email\"], time()+3600);\n // A TENER EN CUENTA las observaciones de MDN sobre la seguridad\n // a la hora de manejar cookies, y de paso para comentarles por que\n // me hacia tanto ruido tener que manejar la session asi:\n // https://developer.mozilla.org/es/docs/Web/HTTP/Cookies#Security\n }", "public function actionLogin() {\n \n }", "function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }", "public function login($datos)\n {\n \n $ok = true;\n $sql = \"SELECT id, nombre , mail \n FROM \" . $this->tabla . \"\n WHERE mail='\" . $datos['mail'] . \"' AND clave='\" . md5($datos['clave']) . \"';\";\n\n $bd = new Bd($this->tabla);\n\n $res = $bd->consultaSimple($sql);\n \n if (!$res) {\n $ok = false;\n } else {\n\n session_start();\n $_SESSION['id'] = $res['id'];\n $_SESSION['nombre'] = $res['nombre'];\n $ok = true;\n }\n return $ok;\n }", "public function login()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n $email = SCMUtility::stripTags( (isset($_POST['email'])) ? $_POST['email'] : '' );\n $password = SCMUtility::stripTags( (isset($_POST['password'])) ? $_POST['password'] : '' );\n\n if( ! Session::Auth($email,$password) )\n {\n SCMUtility::setFlashMessage('Invalid email/password.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }", "public function do_login()\n {\n $this->userObject = new User();\n\n // grab the uID of the person signing in\n $uid = $this->userObject->checkUser($_POST['user_email'], $_POST['user_password']);\n\n // if the uID exists\n if ($uid) {\n\n $this->set('message', 'You logged in!');\n\n // grab the array of user-data from the database\n $user = $this->userObject->getUser($uid);\n\n // leave out the password\n unset($user['password']);\n unset($user[4]);\n\n // if (strlen($_SESSION['redirect']i) > 0) { // basically, if someone types in the url with the funciton after,\n // // supposed to redirect people to the pages they want.\n // $view = $_SESSION['redirect'];\n // unset($_SESSION['redirect']);\n // header('Location: ' . BASE_URL . $view);\n\n // make the SESSION key 'user' and set it equal to the aray of user-data\n $_SESSION['user'] = $user;\n\n header('Location: /index.php/');\n\n } else {\n\n $this->set('error', 'Sorry! Looks like something might be messed up with your Username or Password! :p');\n }\n }", "public function login(){\r\n if(IS_POST){\r\n //判断用户名,密码是否正确\r\n $managerinfo=D('User')->where(array('username'=>$_POST['username'],'pwd'=>md5($_POST['pwd'])))->find();\r\n if($managerinfo!==null){\r\n //持久化用户信息\r\n session('admin_id',$managerinfo['id']);\r\n session('admin_name', $managerinfo['username']);\r\n $this->getpri($managerinfo['roleid']);\r\n //登录成功页面跳到后台\r\n $this->redirect('Index/index');\r\n }else{\r\n $this->error('用户名或密码错误',U('Login/login'),1);\r\n }\r\n return;\r\n }\r\n $this->display();\r\n }", "public function login(){\n echo $this->name . ' logged in';\n }", "public function Login(){\n \t$usuarios=new UsuariosModel();\n \n \t//Conseguimos todos los usuarios\n \t$allusers=$usuarios->getLogin();\n \t \n \t//Cargamos la vista index y l e pasamos valores\n \t$this->view(\"Login\",array(\n \t\t\t\"allusers\"=>$allusers\n \t));\n }", "public function login()\n {\n if(is_logged_in()) {\n redirect_to(url('thread/index'));\n }\n\n $user = new User;\n $page = Param::get('page_next', 'login');\n\n switch($page) {\n case 'login':\n break;\n\n case 'lobby':\n $user->username = Param::get('username');\n $user->password = Param::get('password');\n\n try {\n $user = $user->verify();\n $_SESSION['id'] = $user['id'];\n } catch (UserNotFoundException $e) {\n $page = 'login';\n }\n break;\n\n default:\n throw new UserNotFoundException(\"User not found\");\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "public function login()\n {\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('.hide-on-med-and-down a[data-target=\"signinbox\"]'))\n ->click();\n // Digitar julio0001 em #signinbox input[name=\"login\"]\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('#signinbox input[name=\"login\"]'))\n ->sendKeys('bruno.prado');\n // Digitar 123456 em #signinbox input[name=\"password\"]\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('#signinbox input[name=\"password\"]'))\n ->sendKeys('1234');\n // Clicar em SIGN IN\n \n $this->navegador\n ->findElement(WebDriverBy::id('signinbox'))\n ->findElement(WebDriverBy::linkText('SIGN IN'))\n ->click(); \n \n }", "public function login()\n {\n $data = $this->request->data;\n if(!empty($data['username']) && !empty($data['password'])){\n $username = $data['username'];\n $password = md5($data['password']);\n $user = $this->User->find(\n 'first', array(\n 'conditions' => array(\n 'User.username' => $username,\n 'User.password' => $password\n )\n )\n );\n if(!empty($user)){\n $this->Session->write('user', $user);\n if(!empty($_SERVER['HTTP_REFERRER'])){\n $this->redirect($_SERVER['HTTP_REFERRER']);\n }else{\n $this->redirect('/');\n }\n }else{\n echo 'Ten dang nhap hoac mat khau khong dung';\n }\n }\n }", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "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}", "private function login(){\n\t\tif (empty($_POST['username'])) {\n\t\t\t$this->errors[] = \"Username field was empty.\";\n } elseif (empty($_POST['password'])) {\n $this->errors[] = \"Password field was empty.\";\n } elseif (!empty($_POST['username']) && !empty($_POST['password'])) { \n\t\t\t$this->username = filter_var($_POST['username'], FILTER_SANITIZE_STRING);\t\t\t\n \t\n\t\t\t//prepared statement to login user\n\t\t\t$sel = \"SELECT * FROM users WHERE username = ? OR email = ? \";\n \tif($stmt = $this->connection->prepare($sel)){\n \t\t$stmt->bind_param(\"ss\", $this->username, $this->username);\n \t\t$stmt->execute();\n \t\t//$stmt->bind_result();\n \t\t$res = $stmt->get_result();\n \t\t$user_info = $res->fetch_object();\n \t}\n\t\t\t\t\t\t\t\t\t\n\t\t\tif (password_verify($_POST['password'], $user_info->password)) {\n\t\t\t\t$_SESSION['username'] = $user_info->username;\n\t\t\t\t$_SESSION['email'] = $user_info->email;\n\t\t\t\t$_SESSION['user_login_status'] = 1;\n\t\t\t} else if(empty($user_info)){\n\t\t\t\t$this->errors[] = \"Wrong User name. Please try again\";\n\t\t\t} else {\n\t\t\t\t$this->errors[] = \"Wrong password. Please try again\";\n\t\t\t}\n\t\t}\n\t}", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "function userLogin()\n\t{\n\t\t$userName = $_POST['userName'];\n\t\t$password = $_POST['userPassword'];\n\t\t$rememberData = $_POST['rememberData'];\n\n\t\t# Verify if the user currently exists in the Database\n\t\t$result = validateUserCredentials($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$decryptedPassword = decryptPassword($result['password']);\n\n\t\t\t# Compare the decrypted password with the one provided by the user\n\t\t \tif ($decryptedPassword === $password)\n\t\t \t{\n\t\t \t$response = array(\"status\" => \"COMPLETE\");\n\n\t\t\t # Starting the sesion\n\t\t \tstartSession($result['fName'], $result['lName'], $userName);\n\n\t\t\t # Setting the cookies\n\t\t\t if ($rememberData)\n\t\t\t\t{\n\t\t\t\t\tsetcookie(\"cookieUserName\", $userName);\n\t\t\t \t}\n\t\t\t echo json_encode($response);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie(json_encode(errors(306)));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}", "protected function login( )\r\n {\r\n $this->sendData( 'USER', $this->_nick, $this->_nick . ' ' . $this->_user . ' : ' . $this->_realName );\r\n \r\n $this->sendData( 'NICK', $this->_nick );\r\n \r\n $this->_loggedOn = true;\r\n }", "public function actionLogin()\n {\n $this->layout = '/login';\n $manager = new Manager(['userId' => UsniAdaptor::app()->user->getId()]);\n $userFormDTO = new UserFormDTO();\n $model = new LoginForm();\n $postData = UsniAdaptor::app()->request->post();\n $userFormDTO->setPostData($postData);\n $userFormDTO->setModel($model);\n if (UsniAdaptor::app()->user->isGuest)\n {\n $manager->processLogin($userFormDTO);\n if($userFormDTO->getIsTransactionSuccess())\n {\n return $this->goBack();\n }\n }\n else\n {\n return $this->redirect($this->resolveDefaultAfterLoginUrl());\n }\n return $this->render($this->loginView,['userFormDTO' => $userFormDTO]);\n }", "public function login($usuario) {\n $_SESSION['usuario'] = $usuario;\n }", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "public function login(){\n\n }", "public function login()\n\t{\n\t\t$account = $_POST['account'];\n\t\t$password = $_POST['password'];\n\t\t$staff = D('Staff');\n\t\t$sql = \"select * from lib_staff where staff_id = '{$account}' and password='{$password}'\";\n\t\t$return = $staff->query($sql);\n\t\tif ($return) {\n\n\t\t\tcookie('staffAccount', $account, 3600 * 24);\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'success',\n\t\t\t\t'msg' => 'Welcome!'\n\t\t\t));\n\t\t\techo $json;\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "public function login() {\r\n $email = filter_input(INPUT_POST, \"email\");\r\n $password = filter_input(INPUT_POST, \"p\");\r\n\r\n if (isset($email, $password) && $email !== false && $password !== false) {\r\n\r\n if ($this->auth->login($email, $password)) {\r\n echo json_encode(\"ok\");\r\n return true;\r\n }\r\n }\r\n echo json_encode(\"zle prihlasovacie udaje\");\r\n return false;\r\n }", "function logar(){\n //$duracao = time() + 60 * 60 * 24 * 30 * 6;\n //proteção sql\n $login = $_POST['login'];\n $senha = $_POST['senha'];\n \n\n //criptografa\n //$senha = hash(\"sha512\", $senha);\n\n /*faz o select\n $sql = \"SELECT * FROM usuario WHERE login = '$login' AND senha = '$senha'\";\n $resultado = $link->query($sql);\n\n //se der resultado pega os dados no banco\n if($link->affected_rows > 0 ){ \n $dados = $resultado->fetch_array();\n $id = $dados['id_user'];\n $nome = $dados['nome'];\n $email = $dados['email'];\n $foto = $dados['foto_usuario'];\n $login = $dados['login'];\n $senha = $dados['senha'];\n $admin = $dados['is_admin'];\n //cria as variaveis de sessão\n $_SESSION['email'] = $email;\n $_SESSION['id'] = $id;\n $_SESSION['nome'] = $nome;\n $_SESSION['foto'] = $foto;\n $_SESSION['login'] = $login;\n $_SESSION['senha'] = $senha;\n $_SESSION['isAdmin'] = $admin;\n\n # testar se o checkbox foi marcado\n if (isset($_POST['conectado'])) {\n # se foi marcado cria o cookie\n setcookie(\"conectado\", \"sim\", $duracao, \"/\");\n # neste ponto, tambem enviamos para o navegador os cookies de login e senha, com validade de 6 meses\n setcookie(\"login\" , $login, $duracao, \"/\");\n setcookie(\"senha\" , $senha, $duracao, \"/\");\n }*/\n if($login == 'admin' && $senha == 'admin'){\n ?>\n <script> location.href=\"home.php\" </script>\n <?php\n }\n else{\n $_SESSION['msg'] = \"Senha ou usuario Incorreto!\";\n }\n\n //$link->close();\n}" ]
[ "0.7972771", "0.7972771", "0.7824892", "0.77906007", "0.7779214", "0.7583868", "0.7567928", "0.75670606", "0.7543904", "0.7527368", "0.74974775", "0.74844915", "0.747464", "0.74619037", "0.7452251", "0.74468625", "0.74401844", "0.74401677", "0.7412535", "0.74102825", "0.7405804", "0.74021775", "0.73898995", "0.7363632", "0.7363632", "0.7351329", "0.7349956", "0.7330787", "0.7330628", "0.72959703", "0.7279368", "0.72766787", "0.72745293", "0.72732073", "0.7272875", "0.7260947", "0.7260603", "0.7260367", "0.7259387", "0.72514874", "0.7224685", "0.7215292", "0.7202445", "0.7201652", "0.71996254", "0.71960586", "0.7193277", "0.7187553", "0.71827227", "0.7175031", "0.7168942", "0.7159751", "0.7157775", "0.7149668", "0.71476805", "0.71468806", "0.71424526", "0.7141173", "0.7127882", "0.7124775", "0.7123712", "0.7116745", "0.7116195", "0.7109668", "0.70919806", "0.7088571", "0.7085541", "0.7080139", "0.7080139", "0.7080139", "0.7075906", "0.7071785", "0.70687133", "0.70665824", "0.70660985", "0.7066072", "0.70659894", "0.70579267", "0.70493466", "0.70493156", "0.7045951", "0.70437557", "0.70428425", "0.703729", "0.7036832", "0.7036351", "0.7030678", "0.70303327", "0.7030016", "0.7029255", "0.70246327", "0.7024243", "0.70185524", "0.7012436", "0.70095944", "0.7007719", "0.70050645", "0.7000767", "0.6989269", "0.6985951", "0.6982623" ]
0.0
-1
Sets the company code on the request
protected function _setCompanyCode($storeId=null) { $config = Mage::getSingleton('avatax/config'); $this->_request->setCompanyCode($config->getCompanyCode($storeId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCompany($company_nid);", "public function getCompanyCode(){\n\t\t/* return company code */\n\t\treturn $this->_intCompanyCode;\n\t}", "protected function companyCode(){\n return config('company.code');\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 setYomiCompany($value)\n {\n $this->setProperty(\"YomiCompany\", $value, true);\n }", "public function setCustomerCompany($companyName = '') {\n $company = array(\n 'x_company'=>$this->truncateChars($companyName, 50),\n );\n $this->NVP = array_merge($this->NVP, $company); \n }", "public function setCompanyIdAttribute($input)\n {\n $this->attributes['company_id'] = $input ? $input : null;\n }", "public function setCustomerCompany($company)\n\t {\n\t \t $this->json['params'][$this->customer]['name']['company'] = $company;\n\t \t \n\t \t return $this;\n\t }", "public function contact_company()\n {\n }", "public function __construct($company) {\n $this->company = $company;\n }", "public function onSaveCompanySetting(Request $request)\n {\n $company = Company::findOrfail($request->cid);\n\n $validation = Validator::make($request->all(), [\n 'cname' => 'required|string|max:64|min:5',\n 'cstate' => 'required|string|max:64',\n 'ccity' => 'required|string|max:128',\n 'caddress' => 'required|string|max:128',\n 'ccontact' => 'required|string|max:64',\n 'cemail' => 'nullable|string|max:64',\n ]);\n\n\n if ($validation->passes()) {\n if ($request->cname) {\n $company->comp_name = $request->cname;\n }\n $company->comp_city = $request->ccity;\n $company->comp_address = $request->caddress;\n $company->comp_state = $request->cstate;\n $company->contact_no = $request->ccontact;\n $company->email = $request->cemail;\n $company->comp_status = $request->cstatus;\n $company->user_count = $request->ucount;\n\n\n if ($company->save()) {\n return response()->json([\n 'msg' => 'Changes saved successfully!',\n 'style' => 'color:darkblue'\n ]);\n } else {\n return response()->json([\n 'msg' => 'Sorry, something wrong, please try again.'\n ]);\n }\n } else {\n return response()->json([\n 'msg' => '<ul><li>company name required</li><li>Province/State required</li><li>City required</li><li>Address required</li><li>Contact required</li></ul>',\n 'style' => 'color:darkred'\n ]);\n }\n }", "public function setAgencyCode($value)\n {\n return $this->set('AgencyCode', $value);\n }", "public function setCompanyNameAttribute($value) {\n\t\t$this->company_name = $value;\n\t}", "public function setCode($code);", "public function setCode($code);", "public function __construct($company)\n {\n $this->company = $company;\n }", "public function getCompanyId()\n {\n return $this->company_id;\n }", "public function getCompanyId()\n {\n return $this->company_id;\n }", "public function company(string $company): self\n {\n $this->company = $company;\n\n return $this;\n }", "public function setAccountCode($value);", "public function setCompanyName($companyName)\r\n {\r\n $this->companyName = strip_tags($companyName);\r\n }", "public function setApiCode( $code, array $data = null );", "public function setCode(int $code)\n{\n self::$stored['codes'][] = $code;\n http_response_code($code);\n}", "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($value)\n {\n $this->setParameter('billingCompany', $value);\n $this->setParameter('shippingCompany', $value);\n\n return $this;\n }", "public function __construct(Company $company, Request $request)\n {\n $this->company = $company;\n $this->request = $request;\n }", "public function setCompany_name($company_name)\n {\n $this->company_name = $company_name;\n }", "function setAmocrmCode(string $code): void {\n\t}", "private function _setCompanyConfig(){\n\t\t/* Loading the company configuration file */\n\t\t$this->config->load('company'.DIRECTORY_SEPARATOR.$this->getCompanyCode().DIRECTORY_SEPARATOR.'config');\n\t}", "public function setCompanyId($company_id)\n\t\t{\n\t\t\t$this->company_id = $company_id;\n\t\t}", "function setResponseCode($code) {\n $this->responseCode = $code;\n }", "public function getCompany()\n {\n return $this->getParameter('billingCompany');\n }", "public function setCode($code)\n {\n $this->code = $code;\n }", "public function setCouponCode($code);", "public function setCompanyName($company_name) {\n\t\treturn $this->company_name = $company_name;\n\t}", "public function setCode($code)\n {\n $this->code = $this->getApiErrorCode($code);\n }", "protected function setHttpCode( $code)\r\n {\r\n $this->httpcode = $code;\r\n }", "function setCompanyFilter($value) {\n return $this->setAdditionalProperty('company_filter', $value);\n }", "private function add_company()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$company = $serviceManager->get('PM/Model/Companies');\n \t\n \t$result = $company->getCompanyById($this->pk);\t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['id']));\n \t\t$this->add_breadcrumb($company_url, $result['name'], TRUE);\n \t} \t\n }", "public function company(Request $request)\n {\n $company_customer = Company::find($request->id);\n return response()->json($company_customer);\n }", "public function setCode($Code)\n {\n $this->__set(\"code\", $Code);\n }", "public function storeCode() {\n if(!empty($_GET['code'])) {\n $this->code = $_GET['code'];\n update_option(self::CODE_OPTION_NAME, $_GET['code']);\n }\n }", "public function setCompanyName($value)\n {\n return $this->set('CompanyName', $value);\n }", "public function getCompanyId()\n {\n return array_get($this->config, 'company_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 __construct(Company $company)\n {\n $this->company = $company;\n }", "public function setCompanyName($value)\n {\n return $this->setProperty(\"CompanyName\", $value, true);\n }", "public function changeCompany()\r\n\t{\t\t\t\r\n\t\t$data = array('company_name' => $this->input->post('company_name'));\t\r\n\t\t\t\t//die('update');\r\n\t\t$where = array('id' => $this->session->userdata('emp_id'));\t\t\t\t\r\n\t\t$iStatus = $this->My_model->updateRecord('lang_company',$data,$where);\r\n\t\techo $iStatus;\t\t\r\n\t}", "function showCompany() {\n\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\n\t\t\t\t\t$editForm = new h2o('views/editCompany.html');\n\t\t\t\t\techo $editForm->render(compact('company'));\n\t\t\t\t}", "private function setResponseCode($responseCode) {\n $this->responseCode = $responseCode;\n }", "public function register_company() {\n \n $this->data['building'] = $this->company_management_model->get_building_listing();\n $this->output('company_management/register_company');\n }", "public function get_company() \n {\n return $this->company;\n }", "public function setCode($code) { $this->code = (int)$code; return $this; }", "public function setClientData($company) {\n // Make file name like: {client-name}-invoice-exported-31-Mar-2015-{uniqid}\n $this->invoiceHistory->file_name = $company->getClientName() . '-invoice-exported-' . date(\"d-M-Y\") . '-' . uniqid();\n // Set client_id column\n $this->invoiceHistory->client_id = $company->id;\n \n // Save client data\n return $this->invoiceHistory->save(false);\n }", "public function setCompanyShort($company)\n\t\t{\n\t\t\t$this->company = $company;\n\t\t}", "public function getCompany() {}", "public function setBrandByCode($code)\n\t{\n\t\tif (empty($this->company)) {\n\t\t\tthrow new \\Exception('Must Set Company before Brand');\n\t\t}\n\n\t\t$this->brand = $this->getBrandByCode($code);\n\t\t\n\t\tif (empty($this->brand)) {\n\t\t\tthrow new \\Exception(sprintf(\"Brand '%s' not found\",$code));\n\t\t}\n\t\t\n\t\t$this->logger->debug(sprintf(\"Code: '%s' Brand: '%s'\", $code, $this->brand));\n\t}", "public function setCompanyCity(string $company_city) {\n\n $this->company_city = $company_city;\n\n }", "function setCouponCode($code)\n {\n $this->_coupon = $this->coupon_id = $this->coupon_code = null;\n $this->_couponCode = $code;\n }", "public function getCompany()\n {\n return $this->company;\n }", "public function setCompanyName(string $company_name) {\n\n $this->company_name = $company_name;\n\n }", "private function setCompanyData($companyResult)\n\t{\n\t\t$_SESSION['company_id'] = $companyResult->id;\n\t\t$_SESSION['company_name'] = $companyResult->name;\n\t}", "public function setCode($code)\n\t{\n\t\t$this->code = (int) $code;\n\t}", "public function __construct(Company $company)\n {\n $this->companies= $company;\n\n }", "public function getBillingCompany()\n {\n return $this->getParameter('billingCompany');\n }", "public function setHttpCode($code) {\n $this->httpCode = $code;\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 setBillingCompany($value)\n {\n return $this->setParameter('billingCompany', $value);\n }", "public function company(array $options);", "public function edit_vehicle_companies(){\n\t\t$parameters['where'] = array('company_id !=' => 0);\n\t\t$parameters['select'] = '*';\n\t\t$data['companies'] = $this->MY_Model->getRows('company',$parameters);\n\t\techo json_encode($data);\n\t\t// print_r($data);\n\t}", "public function update(UpdateCompanyRequest $request, Company $company)\n {\n //dd($request->all());\n $company->update([\n 'name' => $request->name,\n 'description' => $request->description,\n 'email' => $request->email,\n 'phone' => $request->phone,\n 'website' => $request->website,\n\n 'street' => $request->street,\n 'street_number' => $request->street_number,\n 'address_info' => $request->address_info,\n 'postal_code' => $request->postal_code,\n 'location' => $request->location,\n 'state' => $request->state,\n 'country' => $request->country,\n 'lat' => $request->lat,\n 'lng' => $request->lng,\n\n 'employees' => $request->employees,\n 'has_branches' => $request->has_branches === 'on' ? true : false,\n 'has_insurance' => $request->has_insurance === 'on' ? true : false,\n 'has_newsletter' => $request->has_newsletter === 'on' ? true : false,\n 'founded' => $request->founded,\n 'defunct' => $request->defunct,\n\n 'facebook' => $request->facebook,\n 'twitter' => $request->twitter,\n 'instagram' => $request->instagram,\n 'linkedin' => $request->linkedin,\n 'snapchat' => $request->snapchat,\n 'blog' => $request->blog,\n 'skype' => $request->skype,\n 'pinterest' => $request->pinterest,\n 'youtube' => $request->youtube,\n\n 'status' => $request->status,\n 'type' => $request->has('type') ? implode(',', $request->type) : '',\n ]);\n\n if ($request->categories) {\n $company->categories()->sync($request->categories);\n }\n if ($request->countries) {\n $company->countries()->sync($request->countries);\n }\n\n session()->flash('success', 'Agency updated successfully');\n\n return redirect(route('companies.index'));\n }", "public function setResponseCode($code) {}", "function editCompany() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed in via the URL */\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$company->update_attributes(array('name'\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t 'city'\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t => $_POST['inputComments'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$company = Partner::find_by_name(params(0));\n\t\t\t\t\t\t$company->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "public function setCompany($companyIdAsString) {\n $this->companyId = $companyIdAsString;\n return $this;\n }", "public function setGlobalCurrencyCode($code);", "public function onCompanyData()\n {\n $data = post();\n $company = new Company;\n $company->name = $data['company'];\n $company->address = $data['address'];\n $company->zip = $data['zip'];\n $company->city_id = $data['city'];\n $company->state_id = $data['state'];\n $company->country_id = $data['country'];\n $company->save();\n if ($id = $data['user_id']) {\n $user = BaseUser::whereId($id)->first();\n $this->sendEmailConfirmation($data, $user);\n $this->sendAdminData($data, $user);\n }\n }", "protected function setOrganization() {}", "public function setCompanyCountry(string $company_country) {\n\n $this->company_country = $company_country;\n\n }", "function getCompanyId() {\n return $this->getAdditionalProperty('company_id');\n }", "public function setResponseCode($responseCode);", "public function testSetCodeClient() {\n\n $obj = new AppelsEnCours();\n\n $obj->setCodeClient(\"codeClient\");\n $this->assertEquals(\"codeClient\", $obj->getCodeClient());\n }", "public function update(Request $request, Company $company)\n {\n //\n }", "public function update(Request $request, Company $company)\n {\n //\n }", "public function update(Request $request, Company $company)\n {\n //\n }", "public function update(Request $request)\n {\n\n $company = Company::findOrFail($request->id);\n\n if ($company->admin_id != Auth::id()) {\n return json_encode(0);\n }\n\n $company->name = request('name');\n $company->email = request('email');\n $company->address = request('address');\n $company->city = request('city');\n $company->country = request('country');\n $company->phone_number = request('phone_number');\n $company->description = request('description');\n $company->date_of_establishment = request('date_of_establishment');\n\n $company->save();\n\n return json_encode($company);\n }", "public function storeCompany (CompanyRequest $request){\n $client= new Client();\n $client->names=null;\n $client->fatherLastName=null;\n $client->motherLastName=null;\n\n $client->birthdate = null;\n $client->documentNumber = $request->get('documentNumber');\n $client->email = strtolower( trim ( $request->get('email') ) );\n\n $client->gender = 'Empresa';\n if ( $request->get('phone')!='' ) $client->phone = $request->get('phone');\n $client->registerDate= date(\"Y-m-d H:i:s\");\n\n $client->businessName = trim ( $request->get('businessName') );\n\n $client->idDocumentType=$request->get('idDocumentType');\n\n $client->save();\n\n return Redirect('client')->with('message','El cliente ha sido registrado exitosamente.'); //es una URL\n }", "public function setCode($response_code)\n {\n $this->response_code = $response_code;\n\n return $this;\n }", "public function setResponseCode($code);", "public function update(CompanyRequest $request)\n {\n $company = auth()->user()->company;\n $company->name = $request->name;\n $company->email = $request->email;\n $company->location = $request->location;\n $company->contact = $request->company_contact;\n $company->save();\n\n if(!$company){\n return redirect()->back()->with('error', 'Invalid Input Data');\n }\n\n return redirect()->back()->with('success', 'Update Success!!');\n }", "public function cmsCambiasponsorCICB(Request $request){\n $sap_code = $request->sap_code;\n $sponsor = $request->sponsor;\n\n $update = User::Where('sap_code', '=', $sap_code)\n ->update(['sap_code_sponsor' => \"$sponsor\" ]);\n\n $update = contracts::Where('code', '=', $sap_code)\n ->update(['sponsor' => \"$sponsor\" ]);\n \n $update = control_ci::Where('codigo', '=', $sap_code)\n ->update(['codigop' => \"$sponsor\" ]);\n\n return 'change';\n }", "public function getCompanyNameIdentifier()\n {\n return 'company_name';\n }", "public function set_carrier_codes( $carrier_codes ) {\n\t\t$this->carrier_codes = $carrier_codes;\n\t}", "public function setCompany(?V1AccountsPostBodyCompany $company): self\n {\n $this->company = $company;\n\n return $this;\n }", "function update_company($company_id, $company_name, $email, $address, $city, $state, $zip, $phone, $fax, $sic_code, $sic_description, $website,$mc_number,$dot_number) {\n\t\t $str = \"UPDATE company SET company_name = '$company_name', email_address = '$email', address = '$address', city = '$city', state = '$state', zipcode = '$zip', phone_number = '$phone', fax_number = '$fax', sic_code = $sic_code, sic_description = '$sic_description', web_address = '$website',mc_number = '$mc_number', dot_number = '$dot_number' WHERE Comany_ID = $company_id\"; \n\t\tif($req = mysqli_query($link,$str)) return true;\n\t\telse return false;\n\t}", "public function getCompany();", "public function getCompany_name()\n {\n return $company_name;\n }", "public function setCode($code)\n {\n $this->code = (int) $code;\n\n return $this->mergeData([static::codeKey() => $this->code]);\n }", "public function productionCompany($value)\n {\n $this->setProperty('productionCompany', $value);\n return $this;\n }" ]
[ "0.6824985", "0.67729676", "0.6754309", "0.6581373", "0.6404025", "0.6381465", "0.636396", "0.62928736", "0.60676354", "0.5912539", "0.58679897", "0.5866091", "0.58572286", "0.5841614", "0.5838126", "0.5838126", "0.58292735", "0.5819711", "0.5819711", "0.58068526", "0.57791597", "0.5778744", "0.573998", "0.5738523", "0.57368135", "0.56822574", "0.56797403", "0.5668622", "0.56635076", "0.5629717", "0.5623604", "0.5620111", "0.56138295", "0.56119126", "0.56100714", "0.56079453", "0.56071407", "0.55943644", "0.5553983", "0.55323", "0.5525358", "0.5520668", "0.55030113", "0.549005", "0.5489473", "0.5486251", "0.54833597", "0.5476668", "0.54755867", "0.54722744", "0.5470038", "0.5469778", "0.54687154", "0.54649436", "0.54647", "0.5459974", "0.54556656", "0.5450423", "0.54497993", "0.5441431", "0.5440849", "0.5428834", "0.5409326", "0.54020387", "0.5394637", "0.53829885", "0.5364787", "0.53627735", "0.53627735", "0.53482187", "0.5333967", "0.53203696", "0.53111786", "0.5310489", "0.53101027", "0.5306629", "0.5306371", "0.5289813", "0.5257403", "0.52525425", "0.5247026", "0.5232788", "0.521243", "0.52066267", "0.52066267", "0.52066267", "0.5199865", "0.5197559", "0.5197116", "0.5195061", "0.5190043", "0.51867515", "0.5182826", "0.51811945", "0.5169131", "0.51665145", "0.5155491", "0.5152858", "0.51512045", "0.5144235" ]
0.72817117
0
Sends a request to the Avatax server
protected function _send($storeId) { $config = Mage::getSingleton('avatax/config')->init($storeId); $connection = $config->getTaxConnection(); $result = null; $message = null; try { $result = $connection->getTax($this->_request); } catch(Exception $exception) { $message = $exception->getMessage(); } if(!isset($result) || !is_object($result) || !$result->getResultCode()) { $result = Mage::getModel('Varien_Object') ->setResultCode(SeverityLevel::$Exception) ->setActualResult($result) ->setMessage($message); } $this->_log($this->_request, $result, $storeId, $connection); if($result->getResultCode() != SeverityLevel::$Success) { self::$_hasError = true; if(Mage::helper('avatax')->fullStopOnError($storeId)) { Mage::helper('avatax')->addErrorMessage($storeId); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendRequest()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\t\t\t$stream->close();\n\t\t}", "public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending parameters must be JSON.');\n }\n $lenght = strlen($jsondata);\n if($lenght<=0){\n $this->log(\"Length must be more than zero.\",'Exiting process.');\n $this->error_message(\"Length must be more than zero.\");\n }else{\n $lenght = $lenght <= 999 ? \"0\" . $lenght : $lenght;\n }\n\n $this->response_json = $this->oxd_socket_request(utf8_encode($lenght . $jsondata));\n\n $this->response_json = str_replace(substr($this->response_json, 0, 4), \"\", $this->response_json);\n if ($this->response_json) {\n $object = json_decode($this->response_json);\n if ($object->status == 'error') {\n $this->error_message($object->data->error . ' : ' . $object->data->error_description);\n } elseif ($object->status == 'ok') {\n $this->response_object = json_decode($this->response_json);\n }\n } else {\n $this->log(\"Response is empty...\",'Exiting process.');\n $this->error_message('Response is empty...');\n }\n }", "public function sendRequest()\n {\n }", "public function sendRequest( ) {\n\n }", "public function sendRequest()\n {\n $url = \"http://66.45.237.70/api.php\";\n $number = $this->senderObject->getMobile();\n $text = $this->senderObject->getMessage();\n\n try {\n $this->errorException();\n\n } catch (XenonException $exception) {\n $exception->showException($this->senderObject);\n }\n $config = $this->senderObject->getConfig();\n\n $data = array(\n 'username' => $config['username'],\n 'password' => $config['password'],\n 'number' => $number,\n 'message' => $text\n );\n try {\n $ch = curl_init(); // Initialize cURL\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $smsResult = curl_exec($ch);\n $status = $this->generateReport($smsResult, $data);\n\n } catch (XenonException $exception) {\n $exception->showException();\n }\n }", "public function send($request);", "function send_request() { \n if(!$this->connect()) { \n return false; \n } \n else { \n $this->result = $this->request($this->data);\n return $this->result; \n } \n }", "public function request();", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "public function sendRequest( $uri )\n\t{\n\t\t$this->response = Requests::get($uri, array(), array(\"timeout\" => $this->timeout));\n\t}", "public function send()\n {\n $this->jsonManager->domain = $this->uri;\n $this->jsonManager->port = $this->port;\n $this->jsonManager->online = $this->isOnline();\n $this->jsonManager->send();\n }", "abstract public function sendRequest(array $options);", "abstract public function request();", "function send_request($request)\n {\n $response = $request->send();\n return $this->parse_response($response);\n }", "public function send(): void\n {\n $requiredParams = [\n 'v' => $this->client->getVersion(),\n 'tid' => $this->client->getTrackingId(),\n 'cid' => $this->client->getClientId(),\n 't' => $this->getHitType(),\n ];\n $paramValues = array_merge(\n $requiredParams,\n $this->parameters\n );\n \n $url = $this->getBaseUrl();\n\n $guzzle = new \\GuzzleHttp\\Client();\n $result = $guzzle->request('POST', $url, ['form_params' => $paramValues]);\n\n if ($this->client->isDebug()) {\n var_dump((string) $result->getBody());\n }\n }", "protected function send()\n {\n $this->addAuthorization();\n\n $response = $this->client->post(\n $this->apiUrl,\n array(\n 'json' => array(\n 'query' => $this->getQuery(),\n 'variables' => $this->variables,\n ),\n 'headers' => $this->headers,\n )\n );\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody === null) {\n throw new \\RuntimeException('Invalid api call: '.json_encode($this->getQuery()));\n }\n\n $this->body = $responseBody;\n if (isset($responseBody['errors'])) {\n $this->errors = $responseBody['errors'];\n } else {\n $this->response = $responseBody['data'];\n }\n }", "public function sendRequest() {\n $response = file_get_contents($this->url);\n\n if ($response) {\n\n $this->response = $response;\n return true;\n } else {\n\n return false;\n }\n }", "public function sendRequestToEndpoint(): Response;", "public function request($index){\n $this->httpRequest->request($index);\n }", "public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }", "function request()\n {\n }", "public function send_cmd($request) {\n\t\t// make or get the socket filehandle\n\t\tif (!$this->init_socket() ) {\n\t\t\ttrigger_error (\"oSRS Error - Unable to establish socket: (\". $this->_socketErrorNum .\") \". $this->_socketErrorMsg, E_USER_WARNING);\n\t\t\tdie();\n\t\t}\n\n\t\t// Authenticate user\n\t\t$auth = $this->authenticate();\n\t\t\n\t\tif (!$auth) {\n\t\t\tif ($this->_socket) $this->close_socket();\n\t\t\ttrigger_error (\"oSRS Error - Authentication Error: \". $auth['error'], E_USER_WARNING);\n\t\t\tdie();\n\t\t}\n\n\t\t$this->send_data($request);\n\t\t$data = $this->read_data();\n \n $num_matches = preg_match('/<item key=\"response_code\">401<\\/item>/', $data, $matches);\n\n if ($num_matches > 0)\n trigger_error(\"oSRS Error - Reseller username or osrs_key is incorrect, please check your config file.\");\n \n\t\treturn $data;\n\t}", "public function send(Request $request);", "public function request()\n {\n }", "public function request()\n {\n }", "private function sendGetRequest($url)\n {\n // Send the request and process the response\n $guzzleResponse = $this->client->request('GET', $url);\n $this->lastResponse = new SmartwaiverResponse($guzzleResponse);\n }", "public function makeRequest(): void\n {\n if (!$this->token) {\n $this->login();\n }\n\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/rastreamento/ver',\n [\n 'headers' =>\n [\n 'Authorization' => 'Bearer ' . $this->token,\n ],\n 'json' => $this->buildRequest()\n ]\n )->then(function ($response) {\n $this->parseResult($response);\n });\n $promise->wait();\n } catch (RequestException $e) {\n $error = json_decode($e->getResponse()->getBody());\n if($error->message){\n $this->result->errors[] = utf8_decode($error->message->message);\n }\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send_request($action, $parameters);", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "public function send() {\r\n\t\t$this->resource->send();\r\n\t}", "private function send($request, $method)\n\t{\n\t\t$header[] = \"Host: \".$this->host;\n\t\t$header[] = \"Content-type: text/xml\";\n\t\t$header[] = \"Content-length: \".strlen($request) . \"\\r\\n\";\n\t\t$header[] = $request;\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt( $ch, CURLOPT_URL, $this->base_url.$method);\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, $header );\n\t\tcurl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );\n\t\t$result = curl_exec( $ch );\n\t\tcurl_close($ch); \n\n\t\treturn $this->format_response($result);\n\t}", "public function serviceRequest()\n {\n API::post('ivr/serviceRequest', array(\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "private function Send_CE_XML_Request($request)\n\t\t{\n\t\t\t$test_url = \"https://api.stgi.net/xml.pl\";\n\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $test_url);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t\n\t\t\t// turning off the server and peer verification(TrustManager Concept).\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n\t\t\n\t\t\treturn curl_exec($ch);\n\t\t}", "public function doRequests();", "public function sendRequest(Request $request);", "public function sendRequest(Request $request);", "public function send()\n {\n http_response_code( $this->getResultCode() );\n echo $this->getBody();\n }", "public function request() : ServerRequestInterface;", "public function send(){\n \n\n\t\t$sent = FALSE;\n\t\t\n\t\t$baseurl = \"http://api.clickatell.com\";\n\n\t\t$this->text = urlencode($this->text);\n\n\t\t//ap\n\t\t$this->to = '266'.$this->to;\n\n\t\t// auth call\n\t\t$url = \"$baseurl/http/auth?user=$this->username&password=$this->password&api_id=$this->api_id\";\n\n\t\t// do auth call\n\t\t$ret = file($url);\n\n\t\t// explode our response. return string is on first line of the data returned\n\t\t$sess = explode(\":\", $ret[0]);\n\t\tif ($sess[0] === 'OK') {\n\n\t\t\t$sess_id = trim($sess[1]); // remove any whitespace\n\t\t\t$url = \"$baseurl/http/sendmsg?session_id=$sess_id&to=$this->to&text=$this->text\";\n\n\t\t\t// do sendmsg call\n\t\t\t$ret = file($url);\n\t\t\t$send = explode(':', $ret[0]);\n\n\t\t\tif ($send[0] === \"ID\")\n\t\t\t{\n\t\t\t\t$sent = TRUE;\n\t\t\t} else {\n\t\t\t\techo 'Authentication failure: ' . $ret[0] . \"\\n\";\n\t\t\t}\n\t\n\t\t\treturn $sent;\n\t\t}\n\t}", "public function sendResponse();", "function send($data);", "function send($data);", "public function runRequest() {\n }", "function sendRequest($site_name, $send_xml, $header_type)\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $site_name);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $send_xml);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header_type);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 120);\n\n $result = curl_exec($ch);\n\n return $result;\n }", "public function send()\n {\n http_response_code($this->statusCode);\n $this->sendContent();\n }", "public function requestAction() {\n $this->api->login('request')->post()->loadTokenFromResponse();\n $_SESSION['request_token'] = $this->api->getOAuthToken();\n return $this->api->goRedirect('login');\n }", "public function sendRequest($sUrl);", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function send()\r\n\t{\r\n\t\t$header = $this->buildHeader();\r\n\r\n\t\t$this->response = $this->connect($header);\r\n\r\n\t\treturn $this->getContent();\r\n\t}", "public function doRequest()\n {\n $this->post('/api_v1/webhook/log/1',\n json_decode('{\n \"transaction_time\": \"1603711958\",\n \"id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\",\n \"event\": \"in-store-txn\",\n \"value\": 13.98,\n \"status\": \"complete\",\n \"customer_id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\"\n }'),\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $this->assertEquals(\n 200, $this->response->getStatusCode()\n );\n }", "abstract function do_api_request();", "public function send() {\n $options = array(\n 'headers' => array(\n 'Content-Type' => 'application/xml; charset=UTF8',\n ),\n 'body' => $this->buildMessage(),\n );\n\n try {\n $client = new Client();\n $response = $client->request('POST', $this->url, $options);\n\n if ($response->getStatusCode() == 204) {\n watchdog('ting_das', 'Service returned: !code', array('!code' => $response->getStatusCode()), WATCHDOG_ERROR);\n return TRUE;\n }\n }\n catch (GuzzleException $exception) {\n watchdog_exception('ting_das', $exception);\n }\n\n return FALSE;\n }", "public function iSendARequest($method, $url)\n {\n $url = $this->prepareUrl($url);\n $this->request = $this->getClient()->createRequest($method, $url);\n if (!empty($this->headers)) {\n $this->request->addHeaders($this->headers);\n }\n\n $this->sendRequest();\n }", "public function send()\n {\n header(\n $_SERVER[\"SERVER_PROTOCOL\"].\" \". // HTTP 1.1\n $this->statusCode.\" \". // 200\n $this->statusText // OK\n );\n foreach ($this->headers as $key => $value) {\n header(\"$key: $value\");\n }\n }", "public function iSendARequest($method, $url)\n {\n $url = $this->prepareUrl($url);\n\n if (version_compare(ClientInterface::VERSION, '6.0', '>=')) {\n $this->request = new Request($method, $url, $this->headers);\n } else {\n $this->request = $this->client->request($method, $url);\n if (!empty($this->headers)) {\n $this->request->addHeaders($this->headers);\n }\n }\n\n $this->sendRequest();\n }", "public function sendRequest()\n\t{\n\t\tphpCAS::traceBegin();\n\t\t$ch = curl_init($this->url);\n\t\tif(is_null($this->url) || ! $this->url)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t/**\n\t\t * *******************************************************\n\t\t * Set SSL configuration\n\t\t * *******************************************************\n\t\t */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT,'casUA_wa67h28m_alliance');\n\t\tif($this->caCertPath)\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath['pem']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLCERT, $this->caCertPath['crt']);\n\t\t\tcurl_setopt($ch, CURLOPT_SSLKEY, $this->caCertPath['key']);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tphpCAS::trace('CURL: Set CURLOPT_CAINFO');\n\t\t}\n\t\t\n\t\t// return the CURL output into a variable\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t/**\n\t\t * *******************************************************\n\t\t * Perform the query\n\t\t * *******************************************************\n\t\t */\n\t\t$buf = curl_exec($ch);\n\t\tif($buf === false)\n\t\t{\n\t\t\tphpCAS::trace('curl_exec() failed');\n\t\t\t$this->storeErrorMessage('CURL error #' . curl_errno($ch) . ': ' . curl_error($ch));\n\t\t\t$res = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storeResponseBody($buf);\n\t\t\tphpCAS::trace(\"Response Body: \\n\" . $buf . \"\\n\");\n\t\t\t$res = true;\n\t\t}\n\t\t// close the CURL session\n\t\tcurl_close($ch);\n\t\t\n\t\tphpCAS::traceEnd($res);\n\t\treturn $res;\n\t}", "public function request(){\n\n $url = 'https://www.amazon.com/ap/oa?client_id=' . \n urlencode($this->strategy['client_id']) . \n '&scope=' . urlencode($this->strategy['scope']) . \n '&response_type=code&redirect_uri=' . \n urlencode($this->strategy['redirect_uri']);\n\n header('Location: ' . $url);\n\t}", "function request($method, $path, $params, $headers=array())\n {\n $this->socket = @fsockopen($this->host, $this->port, $errorNumber, $errorString, (float)$this->timeout);\n if (!$this->socket)\n {\n throw new ConnectionError('Failed connecting to '.$this->host.':'.$this->port.': '.socket_strerror($errorNumber).' ('.$errorNumber.'); '. $error);\n }\n stream_set_timeout($this->socket, (float)$this->timeout);\n $this->params = $params;\n $this->method = $method;\n $this->headers = $header;\n $this->path = $path;\n }", "public function request(): void\n {\n if ($this->checkAccess()) {\n $this->realSubject->request();\n $this->logAccess();\n }\n }", "public function serve_request()\n {\n }", "function request($url, $options = array()) {\n\n\t\t// parse request\n\t\t$request = $this->_parseRequest($url, $options);\n\n\t\t// set host\n\t\t$host = $request['url']['scheme'] == 'https' ? sprintf('ssl://%s', $request['url']['host']) : $request['url']['host'];\n\t\t\n\t\t// connect with fsockopen\n\t\t$res = false;\n\t $fp = @fsockopen($host, $request['url']['port'], $errno, $errstr, $request['url']['timeout']);\n\t if ($fp !== false) {\n\t @fwrite($fp, $request['raw']);\n\t while (!feof($fp)) {\n\t $res .= fgets($fp, 4096);\n\t }\n\t @fclose($fp);\n\t }\n\n\t\t// parse response\n\t\t$res = $this->_parseResponse($res);\n\t\n\t\t// save to file\n\t\tif ($res && $request['file'] && file_put_contents($request['file'], $res['body']) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $res;\n\t}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "public function send() {}", "static function sendRequest( $host, $path, $query, $port = 80 ) {\n\t\t$socket = fsockopen( $host, $port, $errno, $error );\n\n\t\tif( !$socket )\n\t\t\treturn $error;\n\n\t\tif( $query )\n\t\t\t$query = '?' . $query;\n\n\t\tif( self::$userName && self::$password ) {\n\t\t\t$auth = \"Authorization: Basic \" . base64_encode( self::$userName . ':' . self::$password ) . \"\\r\\n\";\n\t\t} else {\n\t\t\t$auth = '';\n\t\t}\n\n\t\t$request = \"GET {$path}{$query} HTTP/1.1\\r\\nHost: $host\\r\\nConnection: Close\\r\\n{$auth}\\r\\n\";\n\n\t\tfwrite( $socket, $request );\n\t\t$response = stream_get_contents( $socket );\n\n\t\treturn $response;\n\t}", "public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}", "function send()\n {\n try{\n $client = new Client();\n $response = $client->request('POST', $this->base_url_SendSMS, [\n 'form_params' => [\n 'Userid' => $this->username,\n 'pwd' => $this->password,\n 'APIKEY' => $this->apikey,\n 'MSG' => $this->msgtext,\n 'FROM' => $this->from,\n 'To' => $this->to,\n ]\n ]);\n\n echo $response->getStatusCode(); // 200\n $response->getReasonPhrase(); // OK\n $response->getProtocolVersion(); // 1.1\n }\n catch(\\GuzzleHttp\\Exception\\ClientException $e){\n echo $e->getMessage();\n }\n catch(ErrorException $e){\n echo $e->getMessage();\n }\n }", "public function sendRequest($method, $params = '');", "protected function sendRequest($url,$param){\n $this->log(\"Making request to Amazon: \".$this->options['Action']);\n $response = $this->fetchURL($url,$param);\n\n while (isset($response['code']) && $response['code'] == '503' && $this->throttleStop==false){\n $this->sleep();\n $response = $this->fetchURL($url,$param);\n }\n\n $this->rawResponses[]=$response;\n return $response;\n }", "abstract public function send($data);", "public function request($method, $uri, array $options = []);", "public function send($data){\n $this->cServ->send($data) ;\n $this->close() ;\n }", "public function iSendARequest($method, $url)\n {\n $url = $this->prepareUrl($url);\n $this->request = new Request($method, $url, $this->getHeaders());\n\n $this->sendRequest();\n }", "abstract protected function request($method, $server, $path, $query = NULL, array $headers = array());", "public function send() {\n\n\t\t$current_time = time();\n\t\tif ( ! $this->should_send_tracking( $current_time ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$collector = $this->get_collector();\n\n\t\t$request = new WPSEO_Remote_Request( $this->endpoint );\n\t\t$request->set_body( $collector->get_as_json() );\n\t\t$request->send();\n\n\t\tupdate_option( $this->option_name, $current_time, 'yes' );\n\t}", "public function send()\n\t{\n\t\t$url \t\t= $this->getURL();\t\t\n\t\t$data \t\t= $this->getData();\n\t\t$method \t= $this->getMethod();\n\t\t\t\t\n\t\t$ch = curl_init();\n\t\t$options = $this->_options;\n\t\tcurl_setopt_array($ch, array(\n\t\t\tCURLOPT_USERAGENT \t => $options->useragent,\n\t\t\tCURLOPT_CONNECTTIMEOUT => $options->connection_timeout,\n\t\t\tCURLOPT_TIMEOUT\t\t => $options->timeout,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLINFO_HEADER_OUT\t => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => $options->ssl,\n\t\t\tCURLOPT_HEADER\t\t => false\n\t\t));\n\t \n $headers = array();\n //if data is string then \n //set the authorization header\n //A Hack to make the linked-in work wihtout affecting\n //other services\n if ( is_string($this->_data) ) {\n $headers[] = $this->_internal_request->to_header();\n $headers[] = \"Content-Type: text/plain\";\n }\n \n if ( !empty($headers) )\n curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);\n \n\t\tswitch ($method) \n\t\t{\n\t\t\tcase KHttpRequest::POST :\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\n\t\t\tcase KHttpRequest::PUT\t: \n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\t\n\t\t\tcase KHttpRequest::DELETE:\n\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\t\tif (!empty($data)) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\t\n\t\t$response = curl_exec($ch);\n\t\t\n\t\treturn new ComConnectOauthResponse($response, curl_getinfo($ch));\n\t}", "function send_to_server( $nEventLogIdn, $nDateTime, $userID ){\n\t\t//clients url will be here\n\t\t//$url = \"http://localhost/frm_att_data/toServer.php?\";\n\t\t//$url = \"http://202.161.188.108/school/schoobee/wh/app/web_api/attendance/recive_device_attendance.php?\";\n\t\t$url = \"http://202.161.188.108/school/schoobee/nababidhan/app/web_api/attendance/recive_device_attendance.php?\";\n\n $val = \"CHECKINOUT_ID=$nEventLogIdn&CARD_NO=$userID&CHECK_TIME=$nDateTime\";\n\n\t\t$server_url = $url.$val;\n\n\t\t//curl start\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $server_url,\n\t\tCURLOPT_USERAGENT => ''\n\t\t));\n\t\t$output = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\treturn $output;\n\t}", "static function sendRequest($site_name,$send_xml,$header_type) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$site_name);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS,$send_xml);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_HTTPHEADER,$header_type);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 120);\n\n $result = curl_exec($ch);\n\n return $result;\n }", "function send_request($postdata = \"\") {\n\t\tif(!is_array($postdata) ) $postdata = array();\n\t\t\n\t\t$url = $this->_build_url();\n\t\t\n\t\tif(!isset($postdata['ip_address'])) $postdata['ip_address'] = $this->_get_client_ip();\n\t\tif(!isset($postdata['user_agent'])) $postdata['user_agent'] = $this->_get_client_user_agent();\n\t\t$postdata['api_key'] = $this->api_key;\n\n\t\t$ch = curl_init($url);\n\n\t\tcurl_setopt($ch, CURLOPT_POST ,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, 'json='.$this->_json_encode($postdata));\n\t\tcurl_setopt($ch, CURLOPT_HEADER ,0); \n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT ,10);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\t\t\n\n\t\t$return_data = curl_exec($ch);\n\n\t\treturn $return_data;\n\t}", "function request($url, $options = array()) {\n\t\t\n\t\tif ($this->transport) {\n\t\t\treturn $this->transport->request($url, $options);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function doVendor() {\n\t$data = array();\n\t$data['apikey'] = APIKEY;\n\t\n\t$result = sendjson($data, HD_SERVER.\"/devices/vendors.json\");\n\t//$result = sendxml($data, HD_SERVER.\"/devices/vendors.xml\");\n}", "function callServer($method, $params) {\n \t//Always include the user id if we're not loggin in\n \tif($method != \"login\") {\n \t\t$params[\"apikey\"] = $this->api_key;\n \t}\n \n $post_vars = $this->httpBuildQuery($params);\n \n $payload = \"POST \" . $this->apiUrl[\"path\"] . \"?\" . $this->apiUrl[\"query\"] . \"&method=\" . $method . \" HTTP/1.0\\r\\n\";\n $payload .= \"Host: \" . $this->apiUrl[\"host\"] . \"\\r\\n\";\n $payload .= \"User-Agent: MCAPI/\" . $this->version .\"\\r\\n\";\n $payload .= \"Content-type: application/x-www-form-urlencoded\\r\\n\";\n $payload .= \"Content-length: \" . strlen($post_vars) . \"\\r\\n\";\n $payload .= \"Connection: close \\r\\n\\r\\n\";\n $payload .= $post_vars;\n \n ob_start();\n $sock = fsockopen($this->apiUrl[\"host\"], 80, $errno, $errstr, $this->timeout);\n if(!$sock) {\n $this->errorMessage = \"Could not connect (ERR $errno: $errstr)\";\n $this->errorCode = \"-99\";\n ob_end_clean();\n return false;\n }\n \n $response = \"\";\n fwrite($sock, $payload);\n while(!feof($sock)) {\n $response .= fread($sock, $this->chunkSize);\n }\n fclose($sock);\n ob_end_clean();\n \n list($throw, $response) = explode(\"\\r\\n\\r\\n\", $response, 2);\n \n if(ini_get(\"magic_quotes_runtime\")) $response = stripslashes($response);\n \n $serial = unserialize($response);\n if($response && $serial === false) {\n \t$response = array(\"error\" => \"Bad Response. Got This: \" . $response, \"code\" => \"-99\");\n } else {\n \t$response = $serial;\n }\n if(is_array($response) && isset($response[\"error\"])) {\n $this->errorMessage = $response[\"error\"];\n $this->errorCode = $response[\"code\"];\n return false;\n }\n \n return $response;\n }", "function msgsrv_request ($target, $cmd, $content, $link, $timeout = 30000) {}", "public function request($method, $url, array $body = [], array $headers = [], $version = '1.1');", "public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "public function send()\n\t{\n\t\tif(($this->xResponse))\n\t\t{\n\t\t\tforeach($this->aDebugMessages as $sMessage)\n\t\t\t{\n\t\t\t\t$this->xResponse->debug($sMessage);\n\t\t\t}\n\t\t\t$this->aDebugMessages = array();\n\t\t\t$this->xResponse->sendHeaders();\n\t\t\t$this->xResponse->printOutput();\n\t\t}\n\t}", "public function sendRequest($request_params) {\n\t\t$params = array();\n\n\t\t$params['request'] = $request_params;\n\t\t$params['app_id'] = $this->_app_id;\n\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->_api_url);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $params[\"request\"]);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t//execute request\n\t\t$result = curl_exec($ch);\n\n\t\t//test other\n\t\t$fm = fopen(\"try.txt\", \"w\");\n\t\tfwrite($fm, var_export($result, true));\n\n\n\t\t//json decode the result\n\t\t$result = json_decode($result);\n\n\t\t//check if is decoded correctly\n\t\tif($result == false || isset($result->success) == false) {\n\t\t\tthrow new Exception('Request was not correct');\n\t\t}\n\n\t\t//if there was an error in request\n\t\tif($result->success == false) {\n\t\t\tthrow new Exception($result->errormsg);\n\t\t}\n\n\t\t//if everything was successful return data\n\t\treturn json_encode($result->data);\n\t}" ]
[ "0.67841196", "0.6611842", "0.6598474", "0.64484686", "0.6354286", "0.63211995", "0.62487006", "0.6200312", "0.6057006", "0.60110354", "0.5979831", "0.5938756", "0.59122574", "0.59114504", "0.590221", "0.5899329", "0.5858882", "0.58583397", "0.576791", "0.5739436", "0.57153684", "0.5673281", "0.5664917", "0.5633214", "0.5633214", "0.56224084", "0.562198", "0.5611199", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.5609684", "0.56088763", "0.55992365", "0.557874", "0.5574241", "0.5563671", "0.553172", "0.55233556", "0.55143857", "0.55143857", "0.5473534", "0.5471325", "0.5462695", "0.54558563", "0.5445875", "0.5445875", "0.5439677", "0.540772", "0.53999865", "0.53997135", "0.5392219", "0.53728586", "0.5370343", "0.5358872", "0.53552055", "0.53467345", "0.5338263", "0.53289956", "0.53245115", "0.53228116", "0.5321086", "0.5319912", "0.53194535", "0.53162324", "0.5315131", "0.53037703", "0.53037703", "0.53037703", "0.53037703", "0.53037703", "0.5284369", "0.5268421", "0.5267331", "0.52622885", "0.52622646", "0.5256257", "0.5249296", "0.5248817", "0.5241798", "0.52223134", "0.52212787", "0.5221266", "0.52112186", "0.5209143", "0.52043164", "0.520093", "0.519959", "0.51898897", "0.51852846", "0.51826197", "0.5177256", "0.5167678", "0.5160479" ]
0.0
-1
Adds additional transaction based data
protected function _addGeneralInfo($object) { $storeId = $object->getStoreId(); $this->_setCompanyCode($storeId); $this->_request->setDetailLevel(DetailLevel::$Document); $this->_request->setDocDate(date('Y-m-d')); $this->_request->setExemptionNo(''); $this->_request->setDiscount(0.00); //cannot be used in Magento $this->_request->setSalespersonCode(Mage::helper('avatax')->getSalesPersonCode($storeId)); $this->_request->setLocationCode(Mage::helper('avatax')->getLocationCode($storeId)); $this->_request->setCountry(Mage::getStoreConfig('shipping/origin/country_id', $storeId)); $this->_request->setCurrencyCode(Mage::app()->getStore()->getBaseCurrencyCode()); $this->_addCustomer($object); if($object instanceof Mage_Sales_Model_Order && $object->getIncrementId()) { $this->_request->setReferenceCode('Magento Order #' . $object->getIncrementId()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTransaction($data) {\n\n $import = $this->getPdo()->prepare(\"INSERT into Transaction (day, amount, name, account_id, category_id) VALUES ( :date, :amount, :name, :accountId, :categoryId )\");\n\n $import->execute(array(\n 'date' \t\t=> $data['date'],\n 'amount' \t\t=> $data['amount'],\n 'name' \t \t\t=> $data['name'],\n 'accountId' \t=> $data['account_id'],\n 'categoryId' \t=> $data['category_id']\n ));\n\n return 'done';\n }", "private static function addTransaction($data)\n {\n global $db;\n\n try {\n $fields = implode(', ', array_map(\n function ($v, $k) {\n return sprintf('`%s`', $k);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $values = implode(', ', array_map(\n function ($v) {\n return sprintf(\"'%s'\", $v);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $db->Execute(\"\n\t\t\t\tINSERT INTO\n\t\t\t\t\t`\" . static::$table_name . \"` (\" . $fields . \")\n\t\t\t\tVALUES\n\t\t\t\t\t(\" . $values . \")\n\t\t\t\");\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "public function populateTransaction($data = array())\n\t{\n\t\ttry {\n\t\t\t$data = EMerchantPayHelper::sanitizeData($data, $this);\n\n\t\t\t// Check if transaction exists\n\t\t\t$insert_query = $this->db->query(\"\n\t\t\t\tSELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions`\n\t\t\t\tWHERE\n\t\t\t\t\t`unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n\n\t\t\tif ($insert_query->rows) {\n\t\t\t\t$this->updateTransaction($data);\n\t\t\t} else {\n\t\t\t\t$this->addTransaction($data);\n\t\t\t}\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "public function addTransactionChildren($data)\n\t{\n\t\t$oTransactionStatus = new Transactions_Status();\n\t\t$oTransactionStatus->setTransactionStatus($data['tr_id'], Transaction_Statuses::STATUS_SUBMITTED);\n\n\t\t$oProperties = new Transaction_Properties();\n\t\tforeach($data['properties'] as $value)\n\t\t{\n\t\t\t$oProperties->addProperty($data['tr_id'], $value['id'], $value['value']);\n\t\t}\n\t\t$oProperties->addProperty($data['tr_id'], 'transaction_password', $this->generatePassword());\n\n\t\t$oRelationship = new Transaction_Relationships();\n\t\t$relationship_id = $oRelationship->addRelationship($data);\n\t\t$oRelationship->handleRelationshipUploadedFiles(\n\t\t\t$relationship_id,\n\t\t\t$data['case_id'],\n\t\t\t$data['relationship_documents'],\n\t\t\t$this->getUploadedFiles('relationship_documents')\n\t\t);\n\n\t\t$oParty = new Transaction_Relationship_Parties();\n\t\t$data['rel_id'] = $relationship_id;\n\n\n\t\tforeach($data['parties'] as $party_data)\n\t\t{\n\t\t\t$party_data['rel_id'] = $relationship_id;\n\t\t\t$party_id = $oParty->addParty($party_data);\n\n\t\t\t$oSubjects = new Transaction_Relationship_Party_Subjects();\n\t\t\tforeach($party_data['data'] as $item)\n\t\t\t{\n\t\t\t\t$item['party_id'] = $party_id;\n\t\t\t\t$subject_id = $oSubjects->addSubject($item);\n\n\t\t\t\t$oSubjects->handleSubjectUploadedFiles(\n\t\t\t\t\t$subject_id,\n\t\t\t\t\t$data['case_id'],\n\t\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\n\t\t// objects part\n\t\t$oObject = new Transaction_Relationship_Objects();\n\t\tforeach($data['objects'] as $item)\n\t\t{\n\t\t\t$data['rel_id'] = $relationship_id;\n\t\t\t$data['object_type'] = $item['objectType'];\n\t\t\t$object_id = $oObject->addObject($data, $item['objectData']);\n\n\t\t\t$oObject->handleObjectUploadedFiles(\n\t\t\t\t$object_id,\n\t\t\t\t$data['case_id'],\n\t\t\t\t$item['fileData']['existing_files'],\n\t\t\t\t$this->getUploadedFiles($item['hash'])\n\t\t\t);\n\t\t}\n\t}", "public function addEntries(Transaction $trans);", "public function addTransaction($data)\n\t{\n\t\ttry {\n\t\t\t$fields = implode(', ', array_map(\n\t\t\t\t\tfunction ($value, $key) {\n\t\t\t\t\t\treturn sprintf('`%s`', $key);\n\t\t\t\t\t},\n\t\t\t\t\t$data,\n\t\t\t\t\tarray_keys($data)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$values = implode(', ', array_map(\n\t\t\t\t\tfunction ($value) {\n\t\t\t\t\t\treturn sprintf(\"'%s'\", $value);\n\t\t\t\t\t},\n\t\t\t\t\t$data,\n\t\t\t\t\tarray_keys($data)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->db->query(\"\n\t\t\t\tINSERT INTO\n\t\t\t\t\t`\" . DB_PREFIX . \"emerchantpay_checkout_transactions` (\" . $fields . \")\n\t\t\t\tVALUES\n\t\t\t\t\t(\" . $values . \")\n\t\t\t\");\n\t\t} catch (Exception $exception) {\n\t\t\t$this->logEx($exception);\n\t\t}\n\t}", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "public static function populateTransaction($data = array())\n {\n global $db;\n\n try {\n // Check if transaction exists\n $insertQuery = $db->Execute(\"\n SELECT\n *\n FROM\n `\" . static::$table_name . \"`\n WHERE\n `unique_id` = '\" . $data['unique_id'] . \"'\n \");\n\n if ($insertQuery->RecordCount() > 0) {\n static::updateTransaction($data);\n } else {\n static::addTransaction($data);\n }\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "function add_transaction($transaction_id, $date, $time, $customer, $value){\n $str_query=\"insert into pos_transaction set transaction_id='$transaction_id',date='$date',\n time='$time',customer='$customer',value='$value'\";\n return $this->query($str_query);\n }", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "public function transaction();", "public function transaction();", "function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \n\t $value = $bmtProducts[$pid];\n\t \n\t \t$file = 'people.log';\n\t\t$person = \"\".json_encode($data).\"\\n\";\n\n\t\tfile_put_contents($file, $person, FILE_APPEND | LOCK_EX);\n\t\t\n\t\t/** get member info by session ID **/\n\t\t$rows = getMemberInfoBySessionId($sessionId);\n\t\taddPoints($data, $rows, $value);\n\n\t\t\n\t}", "public function whmcs_add_transaction($params = array()) {\n\t\t$params['action'] = 'AddTransaction';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function add()\n\t{\n\t\t$this->_updatedata();\n\t}", "public function responseAdditionalUpdates($transaction)\n {\n }", "public function add(Transaction $transaction): void\n {\n $this->transactionsByUserAndType[$transaction->getUserId()][$transaction->getOperationType()][] = $transaction;\n }", "public function add_to_transaction(Request $request) {\n\n Log::info(\"TransactionController->add_to_transaction :- Inside \");\n $organization_id = Session::get('organization_id');\n $organization = Organization::findOrFail($organization_id);\n\n //dd($organization);\n\n $entry = [];\n\n /*$existing_transaction = Transaction::find($request->id);\n\n $transaction_type = AccountVoucher::find($existing_transaction->transaction_type_id);\n\n $reference_voucher = ReferenceVoucher::select('name', 'display_name', 'id')->where('name', $transaction_type->name)->where('status', 1)->get();\n\n $remote_reference_no = $existing_transaction->order_no;\n $remote_order_id = $existing_transaction->id;\n */\n\n $transaction_type = AccountVoucher::where('name', $request->transaction_name)->where('organization_id', $organization_id)->first();\n\n\n $previous_entry = Transaction::where('transaction_type_id', $transaction_type->id)->where('organization_id', $organization)->orderby('id', 'desc')->first();\n \n $existing_transaction = Transaction::where('id', $request->id)\n ->first();\n\n /* Update for status colour */\n\n DB::table('transactions')->where('id',$existing_transaction->id)->update(['notification_status'=> \"2\"]);\n\n /* end */ \n\n $remote_order = Organization::select('organizations.id','organizations.business_id','businesses.business_name','business_communication_addresses.mobile_no','business_communication_addresses.email_address','business_communication_addresses.address')\n ->leftjoin('businesses','businesses.id','=','organizations.business_id')\n ->leftjoin('business_communication_addresses','business_communication_addresses.business_id','=','businesses.id')\n ->where('organizations.id', $existing_transaction->organization_id)\n ->first();\n \n $existing_transaction_items = TransactionItem::where('transaction_id', $existing_transaction->id)->get(); \n \n $transaction = new Transaction;\n $transaction->user_type = $existing_transaction->user_type;\n $transaction->reference_no = $existing_transaction->order_no;\n $transaction->reference_id = $existing_transaction->id;\n $transaction->people_id = $remote_order->business_id;\n $transaction->ledger_id = $existing_transaction->ledger_id;\n $transaction->date = $existing_transaction->date;\n $transaction->due_date = $existing_transaction->due_date;\n $transaction->transaction_type_id = $transaction_type->id;\n $transaction->payment_mode_id = $existing_transaction->payment_mode_id ;\n $transaction->tax_type = $existing_transaction->tax_type;\n $transaction->term_id = $existing_transaction->term_id;\n $transaction->pin = Custom::otp(4);\n\n $transaction->name = $remote_order->business_name;\n $transaction->mobile = $remote_order->mobile_no;\n $transaction->email = $remote_order->email_address;\n $transaction->address = $remote_order->address;\n\n $transaction->billing_name = $existing_transaction->billing_name;\n $transaction->billing_mobile = $existing_transaction->billing_mobile;\n $transaction->billing_email = $existing_transaction->billing_email;\n $transaction->billing_address = $existing_transaction->billing_address;\n\n $transaction->shipping_name = $existing_transaction->shipping_name;\n $transaction->shipping_mobile = $existing_transaction->shipping_mobile;\n $transaction->shipping_email = $existing_transaction->shipping_email;\n $transaction->shipping_address = $existing_transaction->shipping_address;\n\n $transaction->shipment_mode_id = $existing_transaction->shipment_mode_id;\n $transaction->shipping_date = $existing_transaction->shipping_date;\n $transaction->discount_is_percent = $existing_transaction->discount_is_percent;\n $transaction->discount = $existing_transaction->discount;\n $transaction->organization_id = $organization_id;\n $transaction->sub_total = $existing_transaction->sub_total;\n $transaction->total = $existing_transaction->total;\n $transaction->notification_status = 2;\n $transaction->approval_status = 1;\n /*if($transaction_type->name == \"purchases\" || $transaction_type->name == \"goods_receipt_note\") {\n $transaction->notification_status = 1;\n }*/\n $transaction->save();\n\n Custom::userby($transaction, true);\n\n $account_ledgers = AccountLedger::select('account_ledgers.id');\n\n if($transaction->user_type == 0) {\n $account_ledgers->where('person_id', $transaction->people_id);\n $person_id = $transaction->people_id;\n $business_id = null;\n } else if($transaction->user_type == 1) {\n $account_ledgers->where('business_id', $transaction->people_id);\n $person_id = null;\n $business_id = $transaction->people_id;\n }\n\n $account_ledger = $account_ledgers->first();\n\n if($account_ledger != null) {\n $customer_ledger = $account_ledger->id;\n }\n else \n {\n $impersonal_ledger = AccountLedgerType::where('name', 'impersonal')->first();\n\n $people = People::find($transaction->people_id);\n\n if($transaction_type->name == \"purchases\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_creditor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'credit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n } \n else if($transaction_type->name == \"sales\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n }\n else if($transaction_type->name == \"job_invoice\") {\n\n $ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', $organization_id)->first();\n\n $customer_ledger = Custom::create_ledger($people->display_name, $organization, $people->display_name, $impersonal_ledger->id, $person_id, $business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', Session::get('ledger_approval'), '1', $organization_id, false);\n }\n }\n\n \n if($transaction->id != null) {\n\n foreach ($existing_transaction_items as $transaction_item)\n {\n $item = new TransactionItem;\n $item->transaction_id = $transaction->id;\n $item->item_id = $transaction_item->item_id;\n $item->quantity = $transaction_item->quantity;\n $item->rate = $transaction_item->rate;\n $item->amount = $transaction_item->amount;\n $item->tax = $transaction_item->tax;\n $item->tax_id = $transaction_item->tax_id;\n $item->is_tax_percent = $transaction_item->is_tax_percent;\n $item->discount = $transaction_item->discount;\n $item->discount_id = $transaction_item->discount_id;\n $item->is_discount_percent = $transaction_item->is_discount_percent;\n $item->save();\n\n $item_account = InventoryItem::where('id', $item->item_id)->where('organization_id', $organization_id)->first();\n\n //dd($item_account);\n\n if($item->tax_id != null) {\n\n $tax_amount = json_decode($item->tax, true);\n\n foreach ($tax_amount as $tax) {\n\n $tax_value = Tax::find($tax[\"id\"]);\n\n if($transaction_type->name == \"purchases\" || $transaction_type->name == \"credit_note\") {\n //Sales Tax is expense, All expenses are debit\n //Vendor (Payables) gives the item, Credit the giver\n $entry[] = ['debit_ledger_id' => $tax_value->purchase_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $tax[\"amount\"]];\n } else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"debit_note\" || $transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n //Sales Tax is liability, Liabilities are credit\n //Customer (Receivables) pays the tax, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $tax_value->sales_ledger_id, 'amount' => $tax[\"amount\"]];\n }\n }\n }\n\n\n if($transaction_type->name == \"purchases\") {\n\n //Item is expense, All expenses are debit\n //Vendor gives the item, Credit the giver\n\n if($item_account != null)\n {\n $entry[] = ['debit_ledger_id' => $item_account->expense_account , 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n }else{\n\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n }\n \n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->purchase_ledger_id;\n //Discount is income, All incomes are credit\n //Vendor loses amount on discount, All expenses are debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $discount_amount[\"amount\"]];\n }\n\n } \n else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\") \n {\n\n //Item sale is income, All incomes are credit\n //Customer gets the item, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $item_account->income_account, 'amount' => $item->amount];\n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount[\"amount\"]];\n }\n }\n\n else if($transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\") {\n\n //Item sale is income, All incomes are credit\n //Customer gets the item, Debit the receiver\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n if($item->discount_id != null) {\n\n $discount_amount = json_decode($item->discount);\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger_id, 'credit_ledger_id' => $customer_ledger, 'amount' => $discount_amount[\"amount\"]];\n }\n }\n\n else if($transaction_type->name == \"credit_note\") {\n\n $sale_return = AccountLedger::where('name', 'sale_return')->where('organization_id', $organization_id)->first()->id;\n //Sales Return Account Debit\n //Debtor or Customer Account Credit\n $entry[] = ['debit_ledger_id' => $sale_return, 'credit_ledger_id' => $customer_ledger, 'amount' => $item->amount];\n\n\n if($item_discount_amount != 0) {\n\n $discount_ledger = Discount::find($item->discount_id);\n\n if($discount_ledger == null) {\n $discount_ledger_id = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first()->id;\n } else {\n $discount_ledger_id = $discount_ledger->purchase_ledger_id;\n }\n //Accounts Receivable credit\n //Discount Allowed debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount];\n }\n } \n else if($transaction_type->name == \"debit_note\") \n {\n $purchase_return = AccountLedger::where('name', 'purchase_return')->where('organization_id', $organization_id)->first()->id;\n\n //Purchase Return Account Credit\n //Creditor Account Debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $purchase_return, 'amount' => $item->amount];\n\n if($item_discount_amount != 0) {\n\n $discount_ledger_id = Discount::findOrFail($item->discount_id)->sales_ledger_id;\n\n if($discount_ledger_id == null) {\n $discount_ledger_id = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first()->id;\n }\n\n //Accounts Payable debit\n //Discount credit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger_id, 'amount' => $item_discount_amount];\n }\n }\n }\n\n if($transaction_type->name == \"purchases\" || $transaction_type->name == \"credit_note\") {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n $discount_ledger = AccountLedger::where('name', 'purchase_discounts')->where('organization_id',$organization_id)->first();\n //Discount is income, All incomes are credit\n //Vendor loses amount on discount, All expenses are debit\n $entry[] = ['debit_ledger_id' => $customer_ledger, 'credit_ledger_id' => $discount_ledger->id, 'amount' => $transaction->discount];\n \n }\n\n\n } \n else if($transaction_type->name == \"sales\" || $transaction_type->name == \"sales_cash\" || $transaction_type->name == \"debit_note\") \n {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n\n $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first();\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount];\n\n }\n\n }\n\n else if($transaction_type->name == \"job_invoice\" || $transaction_type->name == \"job_invoice_cash\" || $transaction_type->name == \"debit_note\") {\n\n if($transaction->discount != null && $transaction->discount != 0) {\n\n $discount_ledger = AccountLedger::where('name', 'sales_discounts')->where('organization_id',$organization_id)->first();\n //Discount is expense, All expenses are debit\n //Customer gets discount, All incomes are credit\n $entry[] = ['debit_ledger_id' => $discount_ledger->id, 'credit_ledger_id' => $customer_ledger, 'amount' => $transaction->discount];\n\n }\n\n }\n\n\n usort($entry, function ($item1, $item2) {\n return $item1['debit_ledger_id'] - $item2['debit_ledger_id'];\n });\n\n $transaction->entry_id = Custom::add_entry($transaction->date, $entry, null, $transaction_type->name, $organization_id, 0, false);\n $transaction->save();\n \n\n if($transaction->entry_id != null) {\n\n $account_entry = AccountEntry::find($transaction->entry_id);\n\n $transaction->order_no = $account_entry->voucher_no;\n $transaction->gen_no = $account_entry->gen_no;\n $transaction->save();\n\n } else {\n\n // $gen_no = ($previous_entry != null) ? ($previous_entry->gen_no + 1) : $transaction_type->starting_value;\n $getGen_no=Custom::getLastGenNumber( $transaction_type->id, $organization_id );\n\n //$gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value;\n $vou_restart_value = AccountVoucher::select('restart')->where('id',$transaction_type->id)->first();\n //dd($vou_restart_value);\n \n \n if($vou_restart_value->restart == 0)\n {\n $gen_no=($getGen_no)?$getGen_no:$transaction_type->starting_value;\n Log::info(\"TransactionController->create :- after if Custom::gen_no - \".$gen_no);\n }\n else\n {\n $gen_no=($vou_restart_value->restart == 1)?$transaction_type->starting_value:$getGen_no;\n Log::info(\"TransactionController->create :- after Custom::gen_no - \".$gen_no);\n }\n\n \n $transaction->order_no = Custom::generate_accounts_number($transaction_type->name, $gen_no, false);\n $transaction->gen_no = $gen_no;\n $transaction->save();\n }\n\n }\n \n\n Log::info(\"TransactionController->add_to_transaction :- Return \");\n\n\n return response()->json(['status' => 1, 'message' => $transaction_type->display_name.config('constants.flash.added'), 'data' => []]);\n\n }", "public function addTransaction()\n {\n if(null === $this->obj_txn) {\n $this->obj_txn = new Transaction();\n }\n return $this->obj_txn;\n }", "public function add_transaction($transaction_values){\n $this->load->database();\n\n return $query = $this->db->insert('tbl_transactions',$transaction_values);\n }", "function TransactionRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_transaction\";\n\t\t\n\t\t$pDataHash['data_store']['ticket_id'] = $data[0];\n\t\t$pDataHash['data_store']['transact_no'] = $data[1];\n\t\t$pDataHash['data_store']['transact'] = $data[2];\n\t\t$pDataHash['data_store']['ticket_ref'] = $data[3];\n\t\t$pDataHash['data_store']['staff_id'] = $data[4];\n\t\t$pDataHash['data_store']['previous'] = $data[5];\n\t\t$pDataHash['data_store']['room'] = $data[6];\n\t\t$pDataHash['data_store']['applet'] = $data[7];\n\t\t$pDataHash['data_store']['office'] = $data[8];\n\t\t$pDataHash['data_store']['ticket_no'] = $data[9];\n\t\tif ( $data[10] == '[null]' )\n\t\t\t$pDataHash['data_store']['proom'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['proom'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['tags'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['tags'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['clearance'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['clearance'] = $data[12];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function add_data_to_tombstone(){\n }", "public function createTransaction()\n {\n }", "private function add_transaction_info($post)\n {\n global $woocommerce;\n $orderId = $post['x_invoice_num'];\n $order = new WC_Order($orderId);\n $message = __('Server Paysto payment system return data in post: ', 'woocommerce') .\n print_r($post, true);\n $order->add_order_note($message);\n return;\n }", "public function add(){\n if ($_POST) {\n if ($_POST[\"operation\"] == 'egreso'){\n $_POST[\"amount\"] = $_POST[\"amount\"]*(-1);\n }\n if ($this->transactions->save(\"transactions\", $_POST)) {\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }else{\n $this->redirect(array(\"controller\"=>\"transactions\", \"method\"=>\"add\"));\n }\n }\n \n $this->set(\"accounts\", $this->transactions->find(\"accounts\"));\n $this->set(\"categories\", $this->transactions->find(\"categories\"));\n $this->_view->setView(\"add\");\n /* }else{\n $this->redirect(array(\"controller\"=>\"transactions\"));\n }*/\n }", "public function actionAddTransaction()\n {\n if (Yii::$app->request->isAjax) {\n $row = Yii::$app->request->post('Transaction');\n if((Yii::$app->request->post('isNewRecord') && Yii::$app->request->post('_action') == 'load' && empty($row)) || Yii::$app->request->post('_action') == 'add')\n $row[] = [];\n return $this->renderAjax('_formTransaction', ['row' => $row]);\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function getAdditionalData() {\n $this->fillTableData($this->getTableName('sales/order_payment'), 'parent_id', array(\n 'method' => 'payment_method',\n ));\n }", "private function sellTrasactionAddsMoney(){\n\n }", "private function write_single($data){\r\n if($this->$data[0] !== NULL){\r\n //add row of data to transaction object\r\n $this->$data[0]->add_list($data);\r\n }else{\r\n $this->$data[0] = new transaction_object($data[0]);\r\n $this->$data[0]->add_header($this->default_headers[$data[0]]);\r\n $this->$data[0]->add_list($data);\r\n }\r\n }", "public function setData()\n {\n\n $custom_fields = (isset($this->transaction['_embedded']['fx:custom_fields'])) ? $this->transaction['_embedded']['fx:custom_fields'] : [];\n\t\t\n $applied_taxes = (isset($this->transaction['_embedded']['fx:applied_taxes'])) ? $this->transaction['_embedded']['fx:applied_taxes'] : [];\n $discounts = (isset($this->transaction['_embedded']['fx:discounts'])) ? $this->transaction['_embedded']['fx:discounts'] : []; \n\n $customer = new JSON\\Customer($this->transaction);\n $order = new JSON\\Order($this->transaction, $customer->getId());\n $details = new JSON\\Transactions($this->transaction['_embedded']['fx:items'], $order->getId(), $customer->getId());\n\t\t\n $custom = new JSON\\CustomFields($custom_fields, $order->getId(), $customer->getId());\n $shipping = new JSON\\Shipments($this->transaction['_embedded']['fx:shipments'], $order->getId(), $customer->getId());\n $taxes = new JSON\\Taxes($applied_taxes, $order->getId(), $customer->getId());\n $discounts = new JSON\\Discounts($discounts, $order->getId(), $customer->getId());\n $payments = new JSON\\Payments($this->transaction['_embedded']['fx:payments'], $order->getId(), $customer->getId());\n\n\n $this->foxydata = [\n 'customer' => $customer,\n 'order' => $order,\n 'details' => $details,\n 'custom_fields' => $custom,\n 'shipping' => $shipping,\n 'discounts' => $discounts,\n 'taxes' => $taxes,\n 'payments' => $payments\n ];\n }", "private function record_transaction( $details ) {\n\n\t\tglobal $wpdb;\n\n\t\t$sql_cols = \"user_id, timestamp, \";\n\t\t$sql_vals = \"'\" . $details['custom'] . \"','\" . current_time( 'mysql' ) . \"',\";\n\t\t$txn_cols = $this->record_transaction_columns();\n\t\tforeach ( $txn_cols as $column ) {\n\t\t\tif ( isset( $details[ $column ] ) ) {\n\t\t\t\t$sql_cols.= $column . \",\";\n\t\t\t\t$sql_vals.= \"'\" . $details[ $column ] . \"',\";\n\t\t\t}\n\t\t}\n\t\t$sql = \"INSERT INTO \" . $wpdb->prefix . $this->transaction_table . \" ( \" . rtrim( $sql_cols, ',' ) . \" ) VALUES ( \" . rtrim( $sql_vals, ',' ) . \" )\";\n\t\t\n\t\t$result = $wpdb->query( $sql );\n\t\t\n\t\treturn;\n\t}", "function transaction_add() {\r\n global $con;\r\n $data = json_decode(file_get_contents(\"php://input\"));\r\n $MONTH = $data->month;\r\n $AMOUNT = $data->amount;\r\n $BASKET = $data->basket;\r\n $FROMPERSON = $data->fromPerson;\r\n $BASKETOWNER = $data->basketOwner;\r\n $COMMENT = $data->comment;\r\n $CREATEDBY = $data->modifiedBy;\r\n $MODIFIEDBY = $data->modifiedBy;\r\n\r\n $qry_count = mysqli_query($con,\"SELECT * from ng_piggybank\");\r\n $num_rows = mysqli_num_rows($qry_count);\r\n if($num_rows > 0){\r\n $count = $num_rows + 1;\r\n }else{\r\n $count = 1;\r\n }\r\n $PBID = idCREATOR('PIGBANK', $num_rows);\r\n\r\n $qry = \"INSERT INTO ng_piggybank (\r\n PBID,\r\n AMOUNT, \r\n MONTH, \r\n BASKET, \r\n FROMPERSON,\r\n BASKETOWNER,\r\n COMMENT, \r\n CREATEDBY, \r\n MODIFIEDBY) \r\n VALUES (\r\n '$PBID',\r\n '$AMOUNT', \r\n '$MONTH', \r\n '$BASKET', \r\n '$FROMPERSON', \r\n '$BASKETOWNER',\r\n '$COMMENT', \r\n '$CREATEDBY', \r\n '$MODIFIEDBY')\";\r\n $result = mysqli_query($con,$qry);\r\n if(!$result){\r\n $arr = array('msg' => \"\", 'error' => $qry.'E_UNKNOWN');\r\n $jsn = json_encode($arr);\r\n trigger_error(\"Issue with mysql_query. Please check the detailed log\", E_USER_NOTICE);\r\n trigger_error(mysqli_error());\r\n print_r($jsn);\r\n }else{\r\n $arr = array('msg' => \"SUCCESS_PIGGYBANK_ADDED\", 'error' => '');\r\n $jsn = json_encode($arr);\r\n print_r($jsn);\r\n }\r\n}", "function add_transaction($angebotid, $useridKaeufer, $bewertungVerkaeuferT, $bewertungVerkaeuferV, $bewertungKaeuferT, $bewertungKaeuferV)\r\n {\r\n $stid = $this->parseSql(\"begin sp_addTransaction(:p1, :p2, :p3, :p4, :p5, :p6, :p7); end;\");\r\n oci_bind_by_name($stid, \":p1\", $angebotid);\r\n oci_bind_by_name($stid, \":p2\", $useridKaeufer);\r\n oci_bind_by_name($stid, \":p3\", $bewertungVerkaeuferT);\r\n oci_bind_by_name($stid, \":p4\", $bewertungVerkaeuferV);\r\n oci_bind_by_name($stid, \":p5\", $bewertungKaeuferT);\r\n oci_bind_by_name($stid, \":p6\", $bewertungKaeuferV);\r\n oci_bind_by_name($stid, \":p7\", $errorOut, 300);\r\n $stid = $this->executeParsedSql($stid);\r\n\r\n if (!$this->errorHappened($errorOut)) {\r\n return \"Transaction added!\";\r\n } else {\r\n return \"error\";\r\n }\r\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function foodbakery_add_transaction($fields = array()) {\n\t\t\tglobal $foodbakery_plugin_options;\n\t\t\tdefine(\"DEBUG\", 1);\n\t\t\tdefine(\"USE_SANDBOX\", 1);\n\t\t\tdefine(\"LOG_FILE\", \"./ipn.log\");\n\t\t\tinclude_once('../../../../wp-load.php');\n\t\t\tif ( is_array($fields) ) {\n\t\t\t\tforeach ( $fields as $key => $value ) {\n\t\t\t\t\tupdate_post_meta((int) $fields['foodbakery_transaction_id'], \"$key\", $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public function addLedger($etc = array(), $data = array()) {\r\n $this->db->insert('ksr_ledger', $data);\r\n }", "public function addOrderLayer()\n {\n $transactions = $this->orderDataArray->setOrderIds($this->getOrderIds())->getOrderLayer();\n\n if (!empty($transactions)) {\n /** @var $tm DataLayer */\n $tm = $this->getParentBlock();\n foreach ($transactions as $order) {\n $tm->addCustomDataLayer($order);\n }\n }\n }", "public function addTransactionId($id_order, $id_transaction)\r\n\t{\r\n\t\tif (version_compare(_PS_VERSION_, '1.5', '>='))\r\n\t\t{\r\n\t\t\t$new_order = new Order((int)$id_order);\r\n\t\t\tif (Validate::isLoadedObject($new_order))\r\n\t\t\t{\r\n\t\t\t\t$payment = $new_order->getOrderPaymentCollection();\r\n\t\t\t\tif (isset($payment[0]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$payment[0]->transaction_id = pSQL($id_transaction);\r\n\t\t\t\t\t$payment[0]->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function additional(array $data);", "abstract public function startTransaction();", "public function transactional();", "abstract public function determineTransaction();", "public function add_user_transaction ($dataArray = array())\n {\n return DB::table($this->config->get('tables.ACCOUNT_TRANSACTION'))\n ->insertGetId($dataArray);\n }", "public function add_data($data)\n {\n }", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function extend() \n {\n // default transaction type does not extend transaction DTO.\n return [];\n }", "public function add($data)\n {\n }", "protected function initData(){\n $paymentMethod = $this->getPaymentMethod();\n $order = $this->getLastOrder();\n\n $tokenSecret = $this->_encryptor->decrypt($paymentMethod->getConfigData(\"token_secret\"));\n\n $this->addData([\n \"amount\" => $order->getGrandTotal(),\n \"order_id\" => $order->getId(),\n \"email\" => $order->getCustomerEmail(),\n \"token_service\" => $paymentMethod->getConfigData(\"token_service\"),\n \"token_store\" => $paymentMethod->getConfigData(\"token_store\"),\n \"submit_url\" => $this->getSubmitUrl((boolean)$paymentMethod->getConfigData(\"sandbox\")),\n ]);\n\n $transaction = new Transaccion($this->getOrderId(),$this->getTokenStore(),$this->getAmount(),$this->getTokenService(),$this->getEmail());\n $transaction->setCt_token_secret($tokenSecret);\n $paymentArgs = $transaction->getArrayResponse();\n $this->setSignature($paymentArgs[\"ct_firma\"]);\n\n return $this;\n }", "public function saveTransactionFromRequest($request_id,$message,$status,$adminccount)\n {\n list($count,$request) = Mp3music_Api_Cart::getFinanceAccountRequests(\"paymentrequest_id = \".$request_id,\"\",1,1);\n $re = $request[0];\n $insert_item = array($re['request_date'],$re['request_user_id'],$adminccount['user_id'],'','',$re['request_amount'],$re['request_payment_acount_id'],$adminccount['paymentaccount_id'],$status,'request') ;\n //print_r($insert_item); die;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction(); \n $l_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music'); \n $list = $l_table->createRow();\n $list->transaction_date = $insert_item[0];\n $list->user_seller = $insert_item[1];\n $list->user_buyer = $insert_item[2];\n $list->item_id = $insert_item[3];\n $list->item_type = $insert_item[4];\n $list->amount = $insert_item[5];\n $list->account_seller_id = $insert_item[6];\n $list->account_buyer_id = $insert_item[7];\n $list->transaction_status = $insert_item[8];\n $list->params = $insert_item[9];\n $list->save();\n try {\n $db->commit();\n } catch (Exception $ex) {\n $db->rollback();\n break;\n } \n }", "abstract protected function _start_transaction();", "public static function createFromJson($transData) {\n $transaction = new Transaction();\n\n $transaction->id = $transData->id;\n $transaction->transactionDate = self::parseDate($transData->transactionDate);\n $transaction->clickDate = self::parseDate($transData->clickDate);\n $transaction->validationDate = self::parseDate($transData->validationDate);\n $transaction->advertiserId = $transData->advertiserId;\n $transaction->clickDevice = $transData->clickDevice;\n $transaction->transactionDevice = $transData->transactionDevice;\n $transaction->commissionStatus = $transData->commissionStatus;\n $transaction->declineReason = $transData->declineReason;\n $transaction->clickRefs = (array)$transData->clickRefs;\n $transaction->commissionAmount = $transData->commissionAmount->amount;\n $transaction->orderReference = $transData->orderRef;\n $transaction->saleAmount = $transData->saleAmount->amount;\n $transaction->siteName = $transData->siteName;\n $transaction->url = $transData->publisherUrl;\n $transaction->paid = $transData->paidToPublisher;\n $transaction->transactionType = $transData->type;\n\n $transaction->totalCommissionAmount = 0;\n\n // Process transaction parts:\n foreach ($transData->transactionParts as $transactionPartData) {\n $transactionPart = new TransactionPart();\n\n $transactionPart->commissionGroupId = $transactionPartData->commissionGroupId;\n $transactionPart->amount = $transactionPartData->amount;\n $transactionPart->commissionAmount = $transactionPartData->commissionAmount;\n\n // Add transaction part\n $transaction->transactionParts[] = $transactionPart;\n\n // Keep track of total commission (over all transaction parts)\n $transaction->totalCommissionAmount += $transactionPart->commissionAmount;\n }\n\n // Determine whether the commission for this sale is shared with other publisher:\n if ($transaction->totalCommissionAmount > 0 && $transaction->totalCommissionAmount != $transaction->commissionAmount) {\n $transaction->sharedCommission = true;\n $transaction->commissionPercentage = $transaction->commissionAmount / $transaction->totalCommissionAmount * 100;\n } else {\n $transaction->sharedCommission = false;\n $transaction->commissionPercentage = 100;\n }\n\n return $transaction;\n }", "public function add($data){\r\n \t$db = $this->getAdapter();\r\n \t$db->beginTransaction();\r\n\t\t$user_info = new Application_Model_DbTable_DbGetUserInfo();\r\n\t\t$result = $user_info->getUserInfo();\r\n\t\t$session_user=new Zend_Session_Namespace(SYSTEM_SES);\r\n\t\t$request=Zend_Controller_Front::getInstance()->getRequest();\r\n\t\t $level = $result[\"level\"];\r\n \ttry {\r\n \t\t$arr = array(\r\n \t\t\t'item_name'\t\t=>\t$data[\"name\"],\r\n \t\t\t'item_code'\t\t=>\t$data[\"pro_code\"],\r\n// \t\t\t'barcode'\t\t=>\t$data[\"barcode\"],\r\n \t\t\t'cate_id'\t\t=>\t$data[\"category_id\"],\r\n \t\t\t'product_type'\t=>\t$data[\"product_type\"],\r\n \t\t\t'cost_price'=>$data[\"cost_price\"],\r\n \t\t\t'selling_price'=>$data[\"selling_price\"],\r\n \t\t\t'user_id'\t\t=>\t$this->getUserId(),\r\n \t\t\t'note'\t\t\t=>\t$data[\"description\"],\r\n \t\t\t'create_date'\t\t=>\tdate(\"Y-m-d\"),\r\n \t\t\t\t\r\n \t\t);\r\n \t\t$this->_name=\"ln_ins_product\";\r\n \t\t$id = $this->insert($arr);\r\n\t\t\t\r\n \t\tif(!empty($data['identity'])){\r\n \t\t\t$identitys = explode(',',$data['identity']);\r\n \t\t\tforeach($identitys as $i)\r\n \t\t\t{\r\n \t\t\t\t$arr1 = array(\r\n \t\t\t\t\t'pro_id'\t\t\t=>\t$id,\r\n \t\t\t\t\t'location_id'\t\t=>\t$data[\"branch_id\".$i],\r\n \t\t\t\t\t'qty'\t\t\t\t=>\t$data[\"total_qty_\".$i],\r\n \t\t\t\t\t'qty_warning'\t\t=>\t$data[\"alert_qty\".$i],\r\n \t\t\t\t\t'last_mod_userid'\t=>\t$this->getUserId(),\r\n \t\t\t\t\t'last_mod_date'\t\t=>\tnew Zend_Date(),\r\n \t\t\t\t\t'last_mod_userid' => $this->getUserId(),\r\n \t\t\t\t);\r\n \t\t\t\t$this->_name = \"ln_ins_prolocation\";\r\n \t\t\t\t$this->insert($arr1);\r\n \t\t\t }\r\n \t\t }\r\n \t\t$db->commit();\r\n \t}catch (Exception $e){\r\n \t\t$db->rollBack();\r\n \t\tApplication_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());\r\n \t}\r\n }", "public function add($sAccount, $sVendor, $sCategory, $sDate, $iDebit, $iFixed, $sAmount, $sNotes)\n {\n \n //global $m_pSession;\n\n $sEnteredOn = date(\"Y-m-d H:i:s\");\n \n $bNewVendor = false;\n $bNewAccount = false;\n $bNewCategory = false;\n\n //Clean Account, Vendor and Category fields. Trim account and vender. Clean up Category and sub categories within the delemiter.\n $sVendor = trim($sVendor);\n $sAccount = trim($sAccount);\n $sCategory = $this->cleanCategory($sCategory);\n\n //Dealing with empty strings sent to add\n if(strlen($sVendor)!=0)\n $iVendorId = $this->pDatabase->selectValue(\"vendors/get_id_by_name\", $this->iUserId, $sVendor);\n else\n $iVendorId = 'NULL';\n \n if(strlen($sAccount)!=0)\n $iAccountId = $this->pDatabase->selectValue(\"accounts/get_id_by_name\", $this->iUserId, $sAccount);\n else\n $iAccountId = 'NULL';\n \n //Get category id form the database.\n if(strlen($sCategory)!=0)\n $iCategoryId = $this->pDatabase->selectValue(\"categories/get_id_by_name\", $this->iUserId, $sCategory);\n else\n $iCategoryId = 'NULL';\n \n //In case that any values are empty that shouldn't be empty\n if(($iVendorId=='NULL') && (strlen($sVendor)!=0)){ \n $this->addNew(\"vendors\",$sVendor); $bNewVendor=true;\n }\n if(($iCategoryId=='NULL') && (strlen($sCategory)!=0)){ \n $this->addNew(\"categories\",$sCategory); $bNewCategory=true;\n }\n if(($iAccountId=='NULL') && (strlen($sAccount)!=0)){ \n $this->addNew(\"accounts\",$sAccount); $bNewAccount=true;\n }\n \n \n \n //Add the transaction to the databse.\n $sTransactionId = $this->pDatabase->insert(\"transactions/add\", \"transactions\", $this->iUserId, $iVendorId, $iAccountId, $iCategoryId, $sDate, $iDebit, $iFixed, $sAmount, $sNotes, $sEnteredOn);\n\n //If error adding the transaction then clean up and report error.\n if ($sTransactionId == null)\n {\n //If vendor, account or category was created then delete them.\n if ($bNewVendor) $this->pDatabase->delete(\"vendors/delete\", $this->iUserId, $iVendorId);\n if ($bNewAccount) $this->pDatabase->delete(\"accounts/delete\", $this->iUserId, $iAccountId);\n if ($bNewCategory) $this->pDatabase->delete(\"categories/delete\", $this->iUserId, $iCategoryId);\n \n return XML::serialize(true, \"addTransaction\", \"type\",\"ERROR\",\"id\", \"-1\");\n }\n\n //If transaction is within visible period then add it to the list add it to the sorted list.\n\n\n return XML::serialize(true, \"addTransaction\", \"type\",\"OK\", \"id\",$sTransactionId);\n }", "public static function add($data){\n DB::table('order_items')->insert($data);\n }", "public function AddTransaction($options = array()){\n if( !isset($options['currency1']) ){\n $options['currency1'] = $options['currency'];\n }\n if( !isset($options['currency2']) ){\n $options['currency2'] = $options['currency1'];\n }\n\n return $this->api->CreateComplexTransaction(\n $options['amount'],\n $options['currency1'],\n $options['currency2'],\n $options['buyer_email'],\n $options['address'],\n $options['buyer_name'],\n $options['item_name'],\n $options['item_number'],\n $options['invoice'],\n $options['custom'],\n $options['ipn_url']\n );\n }", "public function addEntries(Transaction $trans)\n {\n foreach ( $this->totalsByItem as $item ) {\n $qtyDiff = $this->totalsByItem[$item];\n $unitCost = $item->getStandardCost();\n $extCost = GLEntry::round($unitCost * $qtyDiff);\n if ( $extCost == 0 ) continue;\n\n $trans->addEntry(\n $item->getStockAccount(),\n $extCost,\n $this->getGLMemo($item, $qtyDiff)\n );\n\n $trans->addEntry(\n $this->getAdjustmentAccount($item),\n -$extCost,\n $this->getGLMemo($item, $qtyDiff)\n );\n }\n }", "function AddData($conn)\r\n{\r\n\tglobal $x_credito_id;\r\n\t$sSql = \"SELECT * FROM `credito`\";\r\n\t$sWhere = \"\";\r\n\t$sGroupBy = \"\";\r\n\t$sHaving = \"\";\r\n\t$sOrderBy = \"\";\r\n\r\n\t// Check for duplicate key\r\n\t$bCheckKey = true;\r\n\t$sWhereChk = $sWhere;\r\n\tif ((@$x_credito_id == \"\") || (is_null($x_credito_id))) {\r\n\t\t$bCheckKey = false;\r\n\t} else {\r\n\t\tif ($sWhereChk <> \"\") { $sWhereChk .= \" AND \"; }\r\n\t\t$sTmp = (get_magic_quotes_gpc()) ? stripslashes($x_credito_id) : $x_credito_id;\t\t\t\r\n\t\t$sWhereChk .= \"(`credito_id` = \" . addslashes($sTmp) . \")\";\r\n\t}\r\n\tif ($bCheckKey) {\r\n\t\t$sSqlChk = $sSql . \" WHERE \" . $sWhereChk;\r\n\t\t$rsChk = phpmkr_query($sSqlChk, $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSqlChk);\r\n\t\tif (phpmkr_num_rows($rsChk) > 0) {\r\n\t\t\t$_SESSION[\"ewmsg\"] = \"Duplicate value for primary key\";\r\n\t\t\tphpmkr_free_result($rsChk);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tphpmkr_free_result($rsChk);\r\n\t}\r\n\r\n\tphpmkr_query('START TRANSACTION;', $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: BEGIN TRAN');\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_credito_num\"] != \"\") ? \" '\" . $GLOBALS[\"x_credito_num\"] . \"'\" : \"0\";\r\n\t$fieldList[\"`credito_num`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_cliente_num\"] != \"\") ? \" '\" . $GLOBALS[\"x_cliente_num\"] . \"'\" : \"0\";\r\n\t$fieldList[\"`cliente_num`\"] = $theValue;\r\n\r\n\t// Field credito_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_credito_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_credito_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_tipo_id`\"] = $theValue;\r\n\r\n\t// Field solicitud_id\r\n\t$theValue = ($GLOBALS[\"x_solicitud_id\"] != \"\") ? intval($GLOBALS[\"x_solicitud_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_id`\"] = $theValue;\r\n\r\n\t// Field credito_status_id\r\n\t$theValue = ($GLOBALS[\"x_credito_status_id\"] != \"\") ? intval($GLOBALS[\"x_credito_status_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_status_id`\"] = $theValue;\r\n\r\n\t// Field fecha_otrogamiento\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_otrogamiento`\"] = $theValue;\r\n\r\n\t// Field fecha_otrogamiento\r\n\t$theValue = ($GLOBALS[\"x_fecha_primerpago\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_primerpago\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_primerpago`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_fecha_abonocap\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_abonocap\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_abonocap`\"] = $theValue;\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_periodos_gracia\"] != \"\") ? intval($GLOBALS[\"x_periodos_gracia\"]) : 0;\r\n\t$fieldList[\"`periodos_gracia`\"] = $theValue;\r\n\r\n\t// Field importe\r\n\t$theValue = ($GLOBALS[\"x_importe\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_importe\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`importe`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_forma_pago_id\"] != \"\") ? intval($GLOBALS[\"x_forma_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`forma_pago_id`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_tipo_calculo\"] != \"\") ? intval($GLOBALS[\"x_tipo_calculo\"]) : \"NULL\";\r\n\t$fieldList[\"`tipo_calculo`\"] = $theValue;\r\n\r\n\t// Field tasa\r\n\t$theValue = ($GLOBALS[\"x_tasa\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_tasa\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tasa`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_iva\"] != \"\") ? \" '\" . intval($GLOBALS[\"x_iva\"]) . \"'\" : \"2\";\r\n\t$fieldList[\"`iva`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_plazo\"] != \"\") ? intval($GLOBALS[\"x_plazo\"]) : \"NULL\";\r\n\t$fieldList[\"`plazo_id`\"] = $theValue;\r\n\r\n\t// Field fecha_vencimiento\r\n\t$theValue = ($GLOBALS[\"x_fecha_vencimiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_vencimiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_vencimiento`\"] = $theValue;\r\n\r\n\t// Field tasa_moratoria\r\n\t$theValue = ($GLOBALS[\"x_tasa_moratoria\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_tasa_moratoria\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tasa_moratoria`\"] = $theValue;\r\n\r\n\t// Field medio_pago_id\r\n\t$theValue = ($GLOBALS[\"x_medio_pago_id\"] != \"\") ? intval($GLOBALS[\"x_medio_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`medio_pago_id`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_banco_id\"] != \"\") ? intval($GLOBALS[\"x_banco_id\"]) : \"0\";\r\n\t$fieldList[\"`banco_id`\"] = $theValue;\r\n\r\n\t// Field referencia_pago\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_referencia_pago\"]) : $GLOBALS[\"x_referencia_pago\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`referencia_pago`\"] = $theValue;\r\n\r\n\r\n\t// \r\n\t$theValue = ($GLOBALS[\"x_num_pagos\"] != \"\") ? intval($GLOBALS[\"x_num_pagos\"]) : \"0\";\r\n\t$fieldList[\"`num_pagos`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tdp\"]) : $GLOBALS[\"x_tdp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tarjeta_num`\"] = $theValue;\r\n\r\n\t// Field penalizacion\r\n\t$theValue = ($GLOBALS[\"x_penalizacion\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_penalizacion\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`penalizacion`\"] = $theValue;\r\n\t// garantia liquida\r\n\t$theValue = ($GLOBALS[\"x_garantia_liquida\"] != \"\") ? intval($GLOBALS[\"x_garantia_liquida\"]) : \"0\";\r\n\t$fieldList[\"`garantia_liquida`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `credito` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_credito_id = mysql_insert_id();\r\n\t\r\n//\t$theValue = ($GLOBALS[\"x_num_pagos\"] != \"\") ? intval($GLOBALS[\"x_num_pagos\"]) : \"0\";\r\n\t$fieldList[\"`credito_respaldo_id`\"] = intval($x_credito_id);\r\n\t\r\n\t// se hace para gaurdar una copia de como se otorgo el credito originalmente.\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `credito_respaldo` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn) or die(\"No se inserto en respaldo credito\".phpmkr_error().\"sql :\". $sSql);\r\n\t\r\n\t$fieldList = NULL;\r\n\t\r\n\t\r\n\t// credito_condicones\r\n\t\r\n\t\r\n\t\r\n//GENERA VENCIMIENTOS\r\n\r\n\tinclude(\"utilerias/datefunc.php\");\r\n\r\n\t$sSql = \"SELECT valor FROM plazo where plazo_id = \".$GLOBALS[\"x_plazo\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_plazo = $row[\"valor\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\t$sSql = \"SELECT valor FROM forma_pago where forma_pago_id = \".$GLOBALS[\"x_forma_pago_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_forma_pago = $row[\"valor\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n//\t$x_num_pagos = $x_plazo * $x_forma_pago;\r\n\t$x_num_pagos = $GLOBALS[\"x_num_pagos\"];\t\r\n\r\n\t$GLOBALS[\"x_importe\"] = str_replace(\",\",\"\",$GLOBALS[\"x_importe\"]);\r\n\t$temptime = strtotime(ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]));\t\r\n\t$x_interes = 0;\r\n\t$x_pago_act = 1;\r\n\t\r\n\r\n//tasa mensual\r\n$x_tasa_mensual = (($GLOBALS[\"x_tasa\"]/12)/100); \r\n\r\n//determinar tasa segun forma pago\r\nswitch ($x_forma_pago)\r\n{\r\n\tcase 28: // Mensual\r\n\t\t$x_tasa_calculada = (($GLOBALS[\"x_tasa\"]/12)/100); \r\n\t\tbreak;\r\n\tcase 15: // Quincenal\r\n\t\t$x_tasa_calculada = (($GLOBALS[\"x_tasa\"]/24)/100); \r\n\t\tbreak;\r\n\tcase 14: // Catorcenal\r\n\t\t$x_tasa_calculada = (($GLOBALS[\"x_tasa\"]/26)/100); \r\n\t\tbreak;\r\n\tcase 7: // Semanal\r\n\t\t$x_tasa_calculada = (($GLOBALS[\"x_tasa\"]/52)/100); \r\n\t\tbreak;\r\n}\r\n\r\nif($GLOBALS[\"x_iva\"] == 1){\r\n\t$x_tasa_calculada_pow = $x_tasa_calculada * 1.16;\r\n}else{\r\n\t$x_tasa_calculada_pow = $x_tasa_calculada;\t\r\n}\r\n\r\n\t\r\n/////// calculo promediado\t\r\nif($GLOBALS[\"x_tipo_calculo\"] == 1){\r\n\r\n\r\n\twhile($x_pago_act < $x_num_pagos + 1){\r\n\t\t\r\n\t\tif ($GLOBALS[\"x_forma_pago_id\"] == 3){\r\n\t\t\t// si la forma de pago es mensuial entonces en lugar de agragra 28 dias que es valor contemplado en la base de datos se agrega un mes completo\r\n\t\t\t$temptime = DateAdd('m',1,$temptime);\r\n\t\t\techo \"\";\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t// si no es mensual la\r\n\t\t$temptime = DateAdd('w',$x_forma_pago,$temptime);\r\n\t\t\t}\r\n\r\n\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\t\t\t\r\n\t\t$x_dia = strftime('%A',$temptime);\r\n\r\n//Validar domingos\r\n\t\tif($x_dia == \"SUNDAY\"){\r\n\t\t\t$temptime = strtotime($fecha_act);\r\n\t\t\t$temptime = DateAdd('w',1,$temptime);\r\n\t\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\r\n\t\t}\r\n\r\n//\t\t$x_interes_act = (1/pow((1+doubleval($GLOBALS[\"x_tasa\"] / 100 )),$x_pago_act));\r\n\r\n\t\t$x_interes_act = (1/pow((1+doubleval($x_tasa_calculada)),$x_pago_act));\r\n\r\n\r\n\t\t$x_interes = $x_interes + $x_interes_act;\r\n\t\r\n\t\t$sSql = \"insert into vencimiento values(0,$x_credito_id, $x_pago_act,1, '$fecha_act', 0, 0, 0, 0, 0, 0,NULL)\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$temptime = strtotime($fecha_act);\r\n\t\t$x_pago_act++;\t\r\n\t}\t\t\r\n\r\n\t$x_total_venc = round($GLOBALS[\"x_importe\"] / $x_interes);\r\n\t$x_capital_venc = ($GLOBALS[\"x_importe\"] / $x_num_pagos);\r\n\t$x_interes_venc = round($x_total_venc - $x_capital_venc);\r\n\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t$x_iva_venc = round($x_interes_venc * .15);\t\r\n\t\t$x_total_venc = $x_total_venc + $x_iva_venc;\r\n\t}else{\r\n\t\t$x_iva_venc = 0;\r\n\t}\r\n\r\n\t$sSql = \"update vencimiento set importe = $x_capital_venc, interes = $x_interes_venc, total_venc = $x_total_venc, iva = $x_iva_venc where credito_id = $x_credito_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n\r\n////////////////// fin calculo promediado\r\n\r\n\r\n}else{\r\n\r\n\r\n//calculo de los interes dias de gracias fecha_primerpago - fecha_oorgamiento\r\n// se suma al pago semanal dividido en todos los pagos\r\n// hay que respetar el interes normal del primer pago osea se suma al int del periodo de gracia.\r\n\r\n/*\r\n\r\nPARA ACCELI\r\n-----------------------\r\nPRIMERO SE CALCULA EN INTERES DEL TOTAL Y ESTO CORRESPONDE AL IMPORTE DEL VENCIMIENTO\r\nDE CADA PAGO HASTA EL DIA DE PRIMER PAGO. DESPUES SE DEBEN DE CALCULAR LOS INTERESES\r\nNORMAL DE FORMA TRADICIONAL CON ABONOS A CAPITAL\r\n\r\n\r\n1 determinar el total a pagar del credito importe + int + iva\r\n2 determinar num de venc solo int y sumar importe\r\n3 restar total int sin capital al importe total para sacar importe restante\r\n4 importe venc dividir imp restante entre vencimientos sobrantes redondeado\r\n5 primer venc abono cap = (importe venc - interes)\r\n6 resta abono cap determina interes y abono cap = (importe venc - interes)\r\n7 en el ultimo venc se debe de ajustar el abono a cap e importe del venc para ello se deben de ir sumando los abonos para restarlos al importe del prestamo)\r\n\r\ncalcinteres.xls en doctos accelicap\r\n\r\n*/\r\n\r\n//include(\"utilerias/datefunc.php\");\r\n\r\n\r\n\r\n//aqui\r\n\r\n\r\n\t$x_fecha_otrogamiento = $GLOBALS[\"x_fecha_otrogamiento\"];\r\n\t$x_fecha_primerpago = $GLOBALS[\"x_fecha_primerpago\"]; //esta vacia\r\n\t$x_fecha_abonocap = $GLOBALS[\"x_fecha_abonocap\"];\r\n\t$x_periodos_gracia = $GLOBALS[\"x_periodos_gracia\"];\r\n\t$x_importe = $GLOBALS[\"x_importe\"];\r\n\t$x_vencimiento_actual = 0;\r\n\r\n\r\n\t//dias de gracia - calcula saldo de interes para aplicar en el primer vencmiemtno\r\n\t$x_saldo_intereses = 0;\r\n\tif($x_fecha_primerpago != $x_fecha_otrogamiento && false){\r\n\r\n\t\t$x_fecha_ant = strtotime(ConvertDateToMysqlFormat($x_fecha_otrogamiento));\r\n\t\t$fecha_act = strtotime(ConvertDateToMysqlFormat($x_fecha_primerpago));\r\n\r\n\t\t$difference = $fecha_act - $x_fecha_ant; // Difference in seconds\r\n\t\t$x_dias_total = floor($difference / 86400);\r\n\r\n\t\t//calcular interes con tasa diaria\r\n\t\t$x_interes_gracia = ($x_importe * (($GLOBALS[\"x_tasa\"]/360)/100)) * $x_dias_total;\r\n\t\t\r\n\t\t$x_saldo_intereses = $x_interes_gracia;\r\n\t\t\r\n\t\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t\t$x_iva_gracia = round($x_saldo_intereses * .16);\t\r\n\t\t}else{\r\n\t\t\t$x_iva_gracia = 0;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\t$x_venc_num_sac = 0;\r\n\r\n\t//genera vencimientos sin abono a capital\r\n\t\r\n\t\r\n//\tif($x_fecha_abonocap != $x_fecha_otrogamiento){\r\n\tif($x_periodos_gracia > 0 && false){\t\t\r\n\t\t//genera vencimientos sin abono a capital\r\n\t\t$x_venc_num_sac = 1;\t\t\r\n\t\t$fecha_ant = $x_fecha_otrogamiento;\r\n\t\t$fecha_act = ConvertDateToMysqlFormat($x_fecha_otrogamiento);\t\t\r\n\t\t\r\n\t\t$x_contador = 1;\r\n\t\t\r\n//\t\twhile(strtotime($fecha_act) < strtotime(ConvertDateToMysqlFormat($x_fecha_abonocap)) || strtotime($fecha_act) == strtotime(ConvertDateToMysqlFormat($x_fecha_abonocap))){\r\n\t\twhile($x_contador <= $x_periodos_gracia || $x_contador == $x_periodos_gracia){\r\n\t\t\t\r\n\t\t\t$fecha_ant = strtotime(ConvertDateToMysqlFormat($fecha_ant));\r\n\t\t\tif ($GLOBALS[\"x_forma_pago_id\"] == 3){\r\n\t\t\t// si la forma de pago es mensuial entonces en lugar de agragra 28 dias que es valor contemplado en la base de datos se agrega un mes completo\r\n\t\t\t$fecha_act = DateAdd('m',1,$temptime);\r\n\t\t\t\r\n\t\t\t}else{\t\t\t\t\r\n\t\t\t$fecha_act = DateAdd('w',$x_forma_pago,$fecha_ant);\r\n\t\t\t}\r\n\t\t\t$fecha_act = strftime('%Y-%m-%d',$fecha_act);\r\n\t\t\t$fecha_act = strtotime(ConvertDateToMysqlFormat($fecha_act));\r\n\r\n\t\t\t\r\n\t\t\t$difference = $fecha_act - $fecha_ant; // Difference in seconds\r\n\t\t\t$x_dias_total = floor($difference / 86400);\t\t\r\n\r\n\t\t\t$x_interes_sac = ($x_importe * (($GLOBALS[\"x_tasa\"]/360)/100)) * $x_dias_total;\r\n\r\n\t\t\tif($x_saldo_intereses > 0 && $x_venc_num_sac == 1){\r\n\t\t\t\t$x_interes_sac = $x_interes_sac + $x_saldo_intereses;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t\t\t$x_iva_sac = round($x_interes_sac * .16);\t\r\n\t\t\t}else{\r\n\t\t\t\t$x_iva_sac = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$x_importe_vencimiento_sac = $x_interes_sac + $x_iva_sac;\r\n\r\n\r\n\t\t\t$fecha_act = strftime('%Y-%m-%d',$fecha_act);\r\n\t\t\t$fecha_ant = strftime('%Y-%m-%d',$fecha_ant);\t\r\n\r\n\t\t\t$sSql = \"insert into vencimiento values(0,$x_credito_id, $x_venc_num_sac,1, '\".$fecha_act.\"', 0, $x_interes_sac, 0, $x_iva_sac, 0, $x_importe_vencimiento_sac,NULL)\";\r\n\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\tif(!$x_result){\r\n\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\r\n\t\t\techo $sSql.\"<br>\";\r\n\t\t\techo $fecha_ant .\" -- \" .$x_fecha_abonocap.\"<br>\";\r\n\t\t\techo strtotime($fecha_ant) .\" - \". strtotime(ConvertDateToMysqlFormat($x_fecha_abonocap)).\"<br>\";\r\n\t\t\techo $fecha_act . \" < \" . $x_fecha_abonocap.\" - \".$x_contador.\"<br>\";\r\n\r\n\t\t\t$x_saldo_intereses = $x_saldo_intereses + $x_interes_sac;\r\n\t\t\t$fecha_ant = $fecha_act; \r\n\t\t\t$x_contador++;\r\n\t\t\t$x_venc_num_sac++;\r\n\t\t\t\r\n\t\t}\r\n\t\t$x_venc_num_sac = $x_venc_num_sac - 1;\r\n\t}\r\n\r\n\r\n//\tdie();\r\n\r\n\t//genera vencimientos con abono a capital\r\n\t//deterrmina venc restantes\r\n\r\n\r\n\t$x_venc_num_cac = $x_num_pagos - $x_venc_num_sac;\r\n\t$x_saldo_intereses = 0;\r\n\t$x_fecha_abonocap = $fecha_act;\r\n\t\r\n\t\r\n\t//calculo de pago de vencimientos\r\n\t$temptime = $x_fecha_abonocap;\r\n//\t$temptime = strtotime(ConvertDateToMysqlFormat($x_fecha_abonocap));\t\t\r\n\t$x_pago_act = 1;\r\n\twhile($x_pago_act < ($x_venc_num_cac + 1)){\r\n\t\tif ($GLOBALS[\"x_forma_pago_id\"] == 3){\r\n\t\t\t// si la forma de pago es mensuial entonces en lugar de agragra 28 dias que es valor contemplado en la base de datos se agrega un mes completo\r\n\t\t\t$temptime = DateAdd('m',1,$temptime);\r\n\t\t\t\r\n\t\t\t}else{\r\n\t\t$temptime = DateAdd('w',$x_forma_pago,$temptime);\r\n\t\t\t}\r\n\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\t\t\t\r\n\t\t$x_dia = strftime('%A',$temptime);\r\n\r\n\t\t//Validar domingos\r\n\t\tif($x_dia == \"SUNDAY\"){\r\n\t\t\t$temptime = strtotime($fecha_act);\r\n\t\t\t$temptime = DateAdd('w',1,$temptime);\r\n\t\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\r\n\t\t}\r\n\r\n\t\t$x_interes_act = (1/pow((1+doubleval($x_tasa_calculada_pow)),$x_pago_act));\r\n\t\t\r\n\t\t$x_interes = $x_interes + $x_interes_act;\r\n\t\r\n\t\t$temptime = strtotime($fecha_act);\r\n\t\t$x_pago_act++;\t\r\n\t}\t\t\r\n\t\r\n\r\n\t$x_total_venc = round($x_importe / $x_interes);\t\r\n/*\t\t\r\n\t$x_total_intereses = ($x_total_venc * $x_num_pagos) - $x_importe;\r\n\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t$x_total_intereses = $x_total_intereses * 1.16;\r\n\t\t$x_interes_venc = round($x_total_intereses / $x_num_pagos);\t\t\r\n\t\t$x_total_venc = $x_total_venc + $x_interes_venc;\r\n\t}\r\n*/\r\n\t\r\n\t\r\n/*\r\n\tif($x_saldo_intereses > 0){\r\n\t\t$x_total_venc = ($x_total_venc + (($x_saldo_intereses + $x_iva_gracia) / $x_venc_num_cac)); \r\n\t}\r\n*/\r\n\t//genera vencimientos saldos insolutos\r\n\t\r\n\t\r\n\t//$temptime = strtotime(ConvertDateToMysqlFormat($x_fecha_abonocap));\t\testa fecha viene vacia por eso nos da el error. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\r\n\t$temptime = strtotime(ConvertDateToMysqlFormat(ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"])));\t\r\n\t$x_fecha_dd = ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]);\r\n\t$x_saldo = $x_importe;\r\n\tif($x_venc_num_sac > 0){\r\n\t\t$x_venc_num = $x_venc_num_sac + 1;\r\n\t}else{\r\n\t\t$x_venc_num = 1;\r\n\t}\r\n\t$x_pago_act = 1;\r\n\t$x_capital_ajuste = 0;\r\n\twhile($x_pago_act < $x_venc_num_cac + 1){\r\n\t\t$x_interes_pp = 0;\r\n\r\n\t\tif ($GLOBALS[\"x_forma_pago_id\"] == 3){\r\n\t\t\t// si la forma de pago es mensuial entonces en lugar de agragra 28 dias que es valor contemplado en la base de datos se agrega un mes completo\r\n\t\t\t// si la fecha de pago es 29,30 ó 31 entonces se tomara como fecha de pago el ultimo dia de mes \t\t\t\r\n\t\t\t// temptime trae la fecha de otorgamiento a esta fecha le sacamos el dia\r\n\t\t\t\r\n\t\t\t$sqlDiaMes = \"SELECT DAYOFMONTH('$x_fecha_dd') as dia_mes \";\r\n\t\t\t$rsDiaMes = phpmkr_query($sqlDiaMes, $conn) or die (\"error al seleccionar el dia del mes\". phpmkr_error().\"sql:\".$sqlDiaMes);\r\n\t\t\t$rowDiaMes = phpmkr_fetch_array($rsDiaMes);\r\n\t\t\techo \"sql\".$sqlDiaMes.\"<br>\";\r\n\t\t\t$x_dia_de_mes = $rowDiaMes[\"dia_mes\"];\t\r\n\t\t\techo \"dia de mes\".$x_dia_de_mes.\"<br>\";\t\t\r\n\t\t\tif($x_dia_de_mes == 28 || $x_dia_de_mes == 29 || $x_dia_de_mes == 30 || $x_dia_de_mes == 31 ){\r\n\t\t\t\t// la fecha del siguiente vencimiento se pasa para el ultimo dia del mes\t\t\t\r\n\t\t\t\t$x_dias_faltantes = ultimoDiaMes($x_fecha_dd);\r\n\t\t\t\techo \"dias faltantes\".$x_dias_faltantes.\"<br>\";\r\n\t\t\t\t$fecha_act = DateAdd('w',$x_dias_faltantes,$temptime);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t}else{\t\t\t\r\n\t\t\t\t\t$fecha_act = DateAdd('m',1,$temptime);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t$fecha_act = DateAdd('w',$x_forma_pago,$temptime);\r\n\t\t\t}\r\n\t\t$fecha_act = strftime('%Y-%m-%d',$fecha_act);\t\r\n\t\t$x_fecha_dd = \t$fecha_act;\t\r\n\t\t$temptime = strftime('%Y-%m-%d',$temptime);\t\t\t\t\t\r\n\t\t\r\n\t\t$difference = strtotime($fecha_act) - strtotime($temptime); // Difference in seconds\r\n\t\t$x_dias_total = floor($difference / 86400);\r\n\r\n\r\n\t\t//calcular interes con tasa diaria\r\n\t\t$x_interes_pp = round(($x_saldo * (($GLOBALS[\"x_tasa\"]/360)/100)) * $x_dias_total);\r\n\t\t\r\n\t\t//calcular interes con tasa caluclada segun forma de pago\r\n\t\t$x_interes_pp = round($x_saldo * $x_tasa_calculada);\t\t\r\n\r\n\t\t//sumar saldo de interes gracia\r\n\t\t/*\r\n\t\tif($x_pago_act == 1 && $x_saldo_intereses > 0){\r\n\t\t\t$x_interes_pp = $x_interes_pp + $x_saldo_intereses;\r\n\t\t\t$x_saldo_intereses = 0;\r\n\t\t}\r\n\t\t*/\r\n\t\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t\t$x_iva_pp = round($x_interes_pp * .16);\t\r\n\t\t}else{\r\n\t\t\t$x_iva_pp = 0;\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\r\n/*\r\n\t\t$x_interes_pp = $x_interes_pp + $x_saldo_intereses;\r\n\t\t\r\n\t\tif((($x_interes_pp + $x_iva_pp) < $x_total_venc) || (($x_interes_pp + $x_iva_pp) == $x_total_venc)){\r\n\t\t\t$x_capital_pp = $x_total_venc - $x_interes_pp - $x_iva_pp;\r\n\t\t\t$x_saldo_intereses = 0;\r\n\t\t}else{\r\n\t\t\t$x_capital_pp = 0;\r\n\t\t\t$x_saldo_intereses = $x_interes_pp - ($x_total_venc + $x_iva_pp);\r\n\t\t\t$x_interes_pp = ($x_total_venc - $x_iva_pp);\r\n\t\t}\r\n\r\n*/\r\n\r\n\t\t$x_capital_pp = $x_total_venc - $x_interes_pp - $x_iva_pp;\r\n\t\t$x_saldo_intereses = 0;\r\n\r\n\r\n\r\n\r\n//ajuste de ultimo vencimiento\r\n\t\t$x_capital_ajuste = $x_capital_ajuste + $x_capital_pp;\r\n\t\tif($x_pago_act == $x_venc_num_cac){\r\n\t\t\t\r\n\t\t\tif($x_capital_ajuste < $x_importe){\r\n\t\t\t\t$x_ajuste = $x_importe - $x_capital_ajuste;\r\n\t\t\t\t$x_capital_pp = $x_capital_pp + $x_ajuste;\r\n\t\t\t\t$x_interes_pp = $x_interes_pp - $x_ajuste;\r\n\t\t\t}\r\n\r\n\t\t\tif($x_capital_ajuste > $x_importe){\r\n\t\t\t\t$x_ajuste = $x_capital_ajuste - $x_importe;\r\n\t\t\t\t$x_capital_pp = $x_capital_pp - $x_ajuste;\r\n\t\t\t\t$x_interes_pp = $x_interes_pp + $x_ajuste;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\r\n\r\n\t\t$sSql = \"insert into vencimiento values(0,$x_credito_id, $x_venc_num,1, '$fecha_act', $x_capital_pp, $x_interes_pp, 0, $x_iva_pp, 0, $x_total_venc,NULL)\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$temptime = strtotime($fecha_act);\r\n\t\t$x_saldo = $x_saldo - $x_capital_pp;\t\r\n\t\t$x_venc_num++;\t\r\n\t\t$x_pago_act++;\t\r\n\t}\t\t\r\n\r\n\t//$fecha_act = strftime('%Y-%m-%d',$fecha_act);\r\n\r\n///////////////// fin calculo no promediado\r\n\r\n\r\n}\r\n\r\n\r\nif($GLOBALS[\"x_garantia_liquida\"] == 1){\r\n\t// si hay garantia liquida se inserta en la tabla\r\n\t// se cambia le calculo ahora la garantia liquida cambia el monto\r\n\t//forma de pago\r\n\t#1 = semanal \r\n\t#2 = catorcenal\r\n\t#3 = mensual\r\n\t# 4 = quincenal\r\n\t\r\n\t// siel credito se torga semana y en 40 pagos la garantia liquida correspondera a 3 pagos\r\n\t// si es quincenal o catorcenal en 24 pagos las garantia liquida correspondera a 2 pagos\r\n\tif (($GLOBALS[\"x_forma_pago_id\"] == 1) && ($GLOBALS[\"x_num_pagos\"] == 40)){\r\n\t\t#garantia liquida = 3 pagos\r\n\t\t$x_total_venc_doble = $x_total_venc * 3;\r\n\t\t\r\n\t\t$sqlIGL = \"INSERT INTO garantia_liquida (`garantia_liquida_id`, `credito_id`, `monto`, `status`, `fecha`, `fecha_modificacion`) VALUES (NULL, $x_credito_id, $x_total_venc_doble, '7', \\\"\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"\\\", NULL);\";\t\r\n\t\t\r\n\t\techo $sqlIGL.\"<br>\";\r\n\t\t\r\n\t\t} else \tif((($GLOBALS[\"x_forma_pago_id\"] == 2) || ($GLOBALS[\"x_forma_pago_id\"] == 4))&& ($GLOBALS[\"x_num_pagos\"] == 24)){\r\n\t\t$x_total_venc_doble = $x_total_venc * 2;\r\n\t\t$sqlIGL = \"INSERT INTO garantia_liquida (`garantia_liquida_id`, `credito_id`, `monto`, `status`, `fecha`, `fecha_modificacion`) VALUES (NULL, $x_credito_id, $x_total_venc_doble, '7', \\\"\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"\\\", NULL);\";\t\r\n\t\t\r\n\t\t}else if($GLOBALS[\"x_forma_pago_id\"] == 1){\r\n\t\t$x_total_venc_doble = $x_total_venc * 2;\r\n\t\t\t$sqlIGL = \"INSERT INTO garantia_liquida (`garantia_liquida_id`, `credito_id`, `monto`, `status`, `fecha`, `fecha_modificacion`) VALUES (NULL, $x_credito_id, $x_total_venc_doble, '7', \\\"\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"\\\", NULL);\";\t\t\r\n\t\t}else{\t\r\n\t$sqlIGL = \"INSERT INTO garantia_liquida (`garantia_liquida_id`, `credito_id`, `monto`, `status`, `fecha`, `fecha_modificacion`) VALUES (NULL, $x_credito_id, $x_total_venc, '7', \\\"\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"\\\", NULL);\";\r\n\t\t}\r\n\t$rsIGL = phpmkr_query($sqlIGL, $conn) or die (\"Error al insertar en garantia liquida\".phpmkr_error().\"sql\".$sqlIGL);\t\r\n\t}\r\n\r\n\r\n\t$sSql = \"update credito set fecha_vencimiento = '$fecha_act' where credito_id = $x_credito_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\t$sSql = \"update solicitud set solicitud_status_id = 6 where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n\t$sSqlv = \"SELECT * FROM vencimiento WHERE credito_id = $x_credito_id \";\r\n\t$rsv = phpmkr_query($sSqlv, $conn) or die(\"error al seleccionar los vencimeinto del credito\". phpmkr_error().\"sql:\");\r\n\twhile($rowv = phpmkr_fetch_array($rsv)){\r\n\t\t//seleccionamos todos los campos del vencimiento, y los copiamos a la tabla de respaldo.\r\n\t\t$x_vencimiento_id = $rowv[\"vencimiento_id\"];\r\n\t\t$x_vencimiento_num = $rowv[\"vencimiento_num\"];\t\t\r\n\t\t$x_credito_id = $rowv[\"credito_id\"];\r\n\t\t$x_vencimiento_status_id = $rowv[\"vencimiento_status_id\"];\t\t\r\n\t\t$x_fecha_vencimiento = $rowv[\"fecha_vencimiento\"]; //5\r\n\t\t$x_importe = $rowv[\"importe\"];\r\n\t\t$x_interes = $rowv[\"interes\"];\r\n\t\t$x_iva = $rowv[\"iva\"];\t\t\r\n\t\t$x_iva_mor = $rowv[\"iva_mor\"];\t\r\n\t\t$x_fecha_remanente = $rowv[\"fecha_genera_remanente\"];//10\r\n\t\t$x_interes_moratorio = $rowv[\"interes_moratorio\"];\r\n\t\t$x_total_venc = $rowv[\"total_venc\"];\r\n\t\t\r\n\t\t\r\n\t\t#insertamos el registro de cada vencimiento en la tabla de respaldo vencimiento.\r\n\t\t\r\n\t\t#$sqlI =\"INSERT INTO vencimiento_respaldo values() \";\r\n\t\t$sqlI = \"insert into vencimiento_respaldo values(0,$x_credito_id, $x_vencimiento_num,1, '$x_fecha_vencimiento', $x_importe, $x_interes, 0, $x_iva, 0, $x_total_venc,NULL)\";\r\n\t\t$x_result = phpmkr_query($sqlI, $conn) or die(\"No se respaldo el vencimineto\". phpmkr_error().\"sql :\".$sqlI);\r\n\t\t\r\n\t\t\r\n\t\t}// fin while vencimientos\r\n\r\n//credito_tipo_id\r\n\r\n\r\n\t$sSql = \"SELECT credito_tipo_id FROM solicitud where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_credito_tipo_id = $row[\"credito_tipo_id\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\nif($x_credito_tipo_id != 2){\r\n\r\n\t$sSql = \"SELECT cliente_id FROM solicitud_cliente where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_cliente_id = $row[\"cliente_id\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\t$sSql = \"update cliente set cliente_num = '\".$GLOBALS[\"x_cliente_num\"].\"' where cliente_id = $x_cliente_id \";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n#die();\r\n//USUARIO Y PASSWORD\r\n\tinclude(\"utilerias/gen_pass_ec.php\");\r\n\r\n\t$x_asignada = 0;\r\n\twhile($x_asignada == 0){\r\n\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t$sSql = \"Select * from usuario where usuario = '$clave'\";\r\n\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t$x_usuario = $clave;\r\n\t\t\t$x_asignada = 10;\r\n\t\t}\r\n\t\tphpmkr_free_result($rs2);\r\n\t}\r\n\r\n\t$x_asignada = 0;\r\n\twhile($x_asignada == 0){\r\n\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t$sSql = \"Select * from usuario where clave = '$clave'\";\r\n\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t/*\t\t\r\n\t\t\t$sSql = \"update socios set clave = '$clave' where socio_id = $x_socio_id\";\r\n\t\t\tphpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t*/\r\n\t\t\t$x_clave = $clave;\r\n\t\t\t$x_asignada = 10;\r\n\t\t}\r\n\t\tphpmkr_free_result($rs2);\r\n\t}\r\n\r\n\t$sSql = \"SELECT * FROM cliente where cliente_id = $x_cliente_id\";\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_nombre = $row[\"nombre_completo\"].\" \". $row[\"apellido_paterno\"].\" \".$row[\"apellido_materno\"];\r\n\t$x_email = $row[\"email\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\t$fieldList = NULL;\r\n\t// Field usuario_rol_id\r\n\t$fieldList[\"`usuario_rol_id`\"] = 8;\r\n\r\n\t// Field usuario_status_id\r\n\t$fieldList[\"`usuario_status_id`\"] = 1;\r\n\r\n\t// Field usuario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_usuario) : $x_usuario; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`usuario`\"] = $theValue;\r\n\r\n\t// Field clave\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_clave) : $x_clave; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`clave`\"] = $theValue;\r\n\r\n\t// Field nombre\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_nombre) : $x_nombre; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field fecha_caduca\r\n\t$theValue = ($GLOBALS[\"x_fecha_caduca\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_caduca\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_caduca`\"] = $theValue;\r\n\r\n\t// Field fecha_visita\r\n\t$theValue = ($GLOBALS[\"x_fecha_visita\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_visita\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_visita`\"] = $theValue;\r\n\r\n\t// Field visitas\r\n\t$theValue = ($GLOBALS[\"x_visitas\"] != \"\") ? intval($GLOBALS[\"x_visitas\"]) : \"0\";\r\n\t$fieldList[\"`visitas`\"] = $theValue;\r\n\r\n\t// Field email\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_email) : $x_email; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`email`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `usuario` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t\r\n\t$x_usuario_id = mysql_insert_id();\r\n\r\n\t$sSql = \"update cliente set usuario_id = $x_usuario_id where cliente_id = $x_cliente_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n}else{\r\n\r\ninclude(\"utilerias/gen_pass_ec.php\");\r\n\r\n\t\t\t\t\r\n\r\n\r\n\t// seleccionamos el grupo_ID\r\n\t$sqlGrupo = \"SELECT grupo_id FROM solicitud_grupo WHERE solicitud_id = \".$GLOBALS[\"x_solicitud_id\"].\"\";\r\n\t$responseGid = phpmkr_query($sqlGrupo, $conn) or die(\"Error al seleccionar grupo id\".phpmkr_error().\"sql:\".$sqlGrupo);\r\n\t$rowgid = phpmkr_fetch_array($responseGid);\r\n\t$x_grupo_id = $rowgid[\"grupo_id\"];\r\n\t\r\n\tif(!empty($x_grupo_id)){\r\n\t\t\r\n\t\t\r\n\t\t//seleccionamos los id de los clientes que pertenecen a ese grupo\r\n\t\t$sqlClientes = \"SELECT * FROM creditosolidario WHERE creditoSolidario_id = $x_grupo_id \";\r\n\t\t$resposeClientes = phpmkr_query($sqlClientes, $conn) or die(\"Error a seleccionar los clientes del grupo\".phpmkr_error().\"sql:\".$sqlClientes);\r\n\t\t$rowClientes = phpmkr_fetch_array($resposeClientes);\r\n\t\t\t$GLOBALS[\"x_creditoSolidario_id\"] = $rowClientes[\"creditoSolidario_id\"];\r\n\t\t\t$GLOBALS[\"x_nombre_grupo\"] = $rowClientes[\"nombre_grupo\"];\r\n\t\t\t echo \"seleccionamos los id de los clintes\";\r\n\t\t\t$x_cont_g = 1;\r\n\t\t\twhile($x_cont_g <= 10){\r\n\t\t\t\t\r\n\t\t\t\t$GLOBALS[\"x_integrante_$x_cont_g\"] = $rowClientes[\"integrante_$x_cont_g\"];\r\n\t\t\t\t$GLOBALS[\"x_cliente_id_$x_cont_g\"] = $rowClientes[\"cliente_id_$x_cont_g\"];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// mientras hay integrantes, si no esta vacio el id y es numerico, se le asigna un numero de usuario.\r\n\t\t\t\tif ( !empty($GLOBALS[\"x_cliente_id_$x_cont_g\"]) && ($GLOBALS[\"x_cliente_id_$x_cont_g\"] != \"\") && intval($GLOBALS[\"x_cliente_id_$x_cont_g\"])){\r\n\t\t\t\t\techo \"entramos la while con el id \".$GLOBALS[\"x_cliente_id_$x_cont_g\"].\"<br>\";\r\n\t\t\t\t\t// seleccionamos el ultimo numero de cliente asignado y le agregamos 1\t\t\t\t\t \r\n\t\t\t\t\t\t\t$sSqlWrkn = \"SELECT max(cliente_num+0) as cliente_num_new FROM cliente \";\r\n\t\t\t\t\t\t\t$rswrkn = phpmkr_query($sSqlWrkn,$conn) or die(\"Failed to execute query\" . phpmkr_error() . ' SQL:' . $sSqlWrkn);\r\n\t\t\t\t\t\t\t$datawrkn = phpmkr_fetch_array($rswrkn);\r\n\t\t\t\t\t\t\t$x_cliente_num = $datawrkn[\"cliente_num_new\"] + 1;\r\n\t\t\t\t\t\t\t@phpmkr_free_result($rswrkn);\r\n\t\t\t\t\t \r\n\t \t\t\t\t// actualizamos el numero de cliente\t\t\t\t\t\r\n\t\t\t\t\t\t\t$sSql = \"UPDATE cliente SET cliente_num = $x_cliente_num WHERE cliente_id = \". $GLOBALS[\"x_cliente_id_$x_cont_g\"].\"\";\r\n\t\t\t\t\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\t\t\t\t\tif(!$x_result){\r\n\t\t\t\t\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\t\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\t\t\t\t\texit();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo \"numero de cliente = \" .$x_cliente_num.\"<br>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//USUARIO Y PASSWORD\r\n\t\t\t\t\t$x_asignada = 0;\r\n\t\t\t\t\twhile($x_asignada == 0){\r\n\t\t\t\t\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t\t\t\t\t$sSql = \"Select * from usuario where usuario = '$clave'\";\r\n\t\t\t\t\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t\t\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t\t\t\t\t$x_usuario = $clave;\r\n\t\t\t\t\t\t\t$x_asignada = 10;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tphpmkr_free_result($rs2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$x_asignada = 0;\r\n\t\t\t\t\twhile($x_asignada == 0){\r\n\t\t\t\t\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t\t\t\t\t$sSql = \"Select * from usuario where clave = '$clave'\";\r\n\t\t\t\t\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t\t\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t\t\t\t\t/*\t\t\r\n\t\t\t\t\t\t\t$sSql = \"update socios set clave = '$clave' where socio_id = $x_socio_id\";\r\n\t\t\t\t\t\t\tphpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t$x_clave = $clave;\r\n\t\t\t\t\t\t\t$x_asignada = 10;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tphpmkr_free_result($rs2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t$sSql = \"SELECT * FROM cliente where cliente_id =\".$GLOBALS[\"x_cliente_id_$x_cont_g\"]. \"\";\r\n\t\t\t\t\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t\t\t$row = phpmkr_fetch_array($rs);\r\n\t\t\t\t\t$x_nombre = $row[\"nombre_completo\"].\" \". $row[\"apellido_paterno\"].\" \".$row[\"apellido_materno\"];\r\n\t\t\t\t\t$x_email = $row[\"email\"];\r\n\t\t\t\t\tphpmkr_free_result($rs);\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t$fieldList = NULL;\r\n\t\t\t\t\t// Field usuario_rol_id\r\n\t\t\t\t\t$fieldList[\"`usuario_rol_id`\"] = 8;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field usuario_status_id\r\n\t\t\t\t\t$fieldList[\"`usuario_status_id`\"] = 1;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field usuario\r\n\t\t\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_usuario) : $x_usuario; \r\n\t\t\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t\t\t$fieldList[\"`usuario`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field clave\r\n\t\t\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_clave) : $x_clave; \r\n\t\t\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t\t\t$fieldList[\"`clave`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field nombre\r\n\t\t\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_nombre) : $x_nombre; \r\n\t\t\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t\t\t$fieldList[\"`nombre`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field fecha_registro\r\n\t\t\t\t\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t\t\t\t\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field fecha_caduca\r\n\t\t\t\t\t$theValue = ($GLOBALS[\"x_fecha_caduca\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_caduca\"]) . \"'\" : \"Null\";\r\n\t\t\t\t\t$fieldList[\"`fecha_caduca`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field fecha_visita\r\n\t\t\t\t\t$theValue = ($GLOBALS[\"x_fecha_visita\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_visita\"]) . \"'\" : \"Null\";\r\n\t\t\t\t\t$fieldList[\"`fecha_visita`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field visitas\r\n\t\t\t\t\t$theValue = ($GLOBALS[\"x_visitas\"] != \"\") ? intval($GLOBALS[\"x_visitas\"]) : \"0\";\r\n\t\t\t\t\t$fieldList[\"`visitas`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// Field email\r\n\t\t\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_email) : $x_email; \r\n\t\t\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t\t\t$fieldList[\"`email`\"] = $theValue;\r\n\t\t\t\t\r\n\t\t\t\t\t// insert into database\r\n\t\t\t\t\t$sSql = \"INSERT INTO `usuario` (\";\r\n\t\t\t\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t\t\t\t$sSql .= \") VALUES (\";\r\n\t\t\t\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t\t\t\t$sSql .= \")\";\r\n\t\t\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\t\t\tif(!$x_result){\r\n\t\t\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\t\t\texit();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$x_usuario_id = mysql_insert_id();\r\n\t\t\t\t\r\n\t\t\t\t\t$sSql = \"update cliente set usuario_id = $x_usuario_id where cliente_id = \". $GLOBALS[\"x_cliente_id_$x_cont_g\"] .\" \";\r\n\t\t\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\t\t\tif(!$x_result){\r\n\t\t\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\t\t\texit();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}// if vacio! , numerico\r\n\t\t\t\t$x_cont_g++;\r\n\t\t\t\t}// while 10\r\n\t\tphpmkr_free_result($rowClientes);\r\n\t\t\r\n\t\t\r\n\t\t}// ! vacio grupo id\r\n\r\n\t\t\r\n} // else if tipo !2\r\n\r\n\r\n//RENOVACIONES\r\n\t$sSql = \"SELECT promotor_id, solicitud_id_ant FROM solicitud where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_promotor_id = $row[\"promotor_id\"];\r\n\t$x_solicitud_id_ant = $row[\"solicitud_id_ant\"];\t\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\r\n\tif($x_solicitud_id_ant > 0 ){\r\n\r\n\t\t$sSql = \"SELECT credito_id FROM credito where solicitud_id = $x_solicitud_id_ant\";\r\n\t\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\t\t$x_credito_id_ant = $row[\"credito_id\"];\r\n\t\tphpmkr_free_result($rs);\t\t\r\n\t\r\n\t\t$sSql = \"update credito set credito_id_ant = $x_credito_id_ant where credito_id = $x_credito_id\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t\t$x_comision_importe = 50;\t\r\n\t}else{\r\n\t\t$x_comision_importe = 100;\r\n\t}\r\n\r\n\r\n//COMISIONES\r\n\r\n\r\n\r\n\t$fieldList = NULL;\r\n\t\r\n\t// Field promotor_id\r\n\t$fieldList[\"`promotor_id`\"] = $x_promotor_id;\r\n\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`credito_id`\"] = $x_credito_id;\r\n\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`vencimiento_id`\"] = 0;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field comision\r\n\t$theValue = ($GLOBALS[\"x_comision\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_comision\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comision`\"] = $theValue;\r\n\r\n\t// Field comision_importe\r\n\t$fieldList[\"`comision_importe`\"] = $x_comision_importe;\r\n\r\n\t// Field referencia\r\n\tif($GLOBALS[\"x_credito_num\"] != \"\"){\r\n\t\t$fieldList[\"`referencia`\"] = \"'\".$GLOBALS[\"x_credito_num\"].\"'\";\r\n\t}else{\r\n\t\t$fieldList[\"`referencia`\"] = \"NULL\";\r\n\t}\r\n\r\n\t// Field promotor_comision_status_id\r\n\t$fieldList[\"`promotor_comision_status_id`\"] = 1;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `promotor_comision` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\tphpmkr_query($sSql, $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\r\n\r\n\r\n\r\n\r\n\t$sSql = \"SELECT cliente_id FROM solicitud_cliente where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_cliente_id = $row[\"cliente_id\"];\r\n\tphpmkr_free_result($rs);\r\n\r\n//GENERA CASO CRM\r\n// debe ser dos dias despues de que se otorgo el credito, y se le deben dar dos dias de gracia.\r\n$currentdatecrm = getdate(time());\r\n$currtime = $currentdatecrm[\"hours\"].\":\".$currentdatecrm[\"minutes\"].\":\".$currentdatecrm[\"seconds\"];\t\r\n\r\n$cdate = getdate(time());\r\n$currdate2 = $cdate[\"mday\"].\"/\".$cdate[\"mon\"].\"/\".$cdate[\"year\"];\t\r\n$currdate2 = ConvertDateToMysqlFormat($currdate2);\r\n// fecha en que se otorgo el credito, no la fecha actual.\r\n$x_fecha_otorg = ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]);\r\n$currdate2 = $x_fecha_otorg;\r\n\r\n$temptime = strtotime($currdate2);\t\r\n$temptime = DateAdd('w',2,$temptime);\r\n$fecha_tarea = strftime('%Y-%m-%d',$temptime);\t\r\n\r\n/*$x_dia = strftime('%A',$temptime);\r\nif($x_dia == \"SUNDAY\"){\r\n\t$temptime = strtotime($fecha_venc);\r\n\t$temptime = DateAdd('w',1,$temptime);\r\n\t$fecha_tarea = strftime('%Y-%m-%d',$temptime);\r\n}\r\n$temptime = strtotime($fecha_tarea);*/\r\n\r\n\r\n\r\n\t$sSqlWrk = \"\r\n\tSELECT *\r\n\tFROM \r\n\t\tcrm_playlist\r\n\tWHERE \r\n\t\tcrm_playlist.crm_caso_tipo_id = 2\r\n\t\tAND crm_playlist.orden = 1\r\n\t\";\r\n\t// constancia de credito recibido\r\n\t$rswrk = phpmkr_query($sSqlWrk,$conn) or die(\"Failed to execute query\" . phpmkr_error() . ' SQL:' . $sSqlWrk);\r\n\t$datawrk = phpmkr_fetch_array($rswrk);\r\n\t$x_crm_playlist_id = $datawrk[\"crm_playlist_id\"];\r\n\t$x_prioridad_id = $datawrk[\"prioridad_id\"];\t\r\n\t$x_asunto = $datawrk[\"asunto\"];\t\r\n\t$x_descripcion = $datawrk[\"descripcion\"];\t\t\r\n\t$x_tarea_tipo_id = $datawrk[\"tarea_fuente\"];\t\t\r\n\t$x_orden = $datawrk[\"orden\"];\t\r\n\t$x_dias_espera = $datawrk[\"dias_espera\"];\r\n\t$x_dias_espera =$x_dias_espera +1;\r\n\t@phpmkr_free_result($rswrk);\r\n\r\n\r\n\t//Fecha Vencimiento\r\n\t$temptime = strtotime(ConvertDateToMysqlFormat($fecha_tarea));\t\r\n\t$temptime = DateAdd('w',$x_dias_espera,$temptime);\r\n\t$fecha_venc = strftime('%Y-%m-%d',$temptime);\t\r\n\techo \"fecha\".$fecha_venc.\"\";\r\n\t$x_dia = strftime('%A',$temptime);\r\n\tif($x_dia == \"SUNDAY\"){\r\n\t\t$temptime = strtotime($fecha_venc);\r\n\t\t$temptime = DateAdd('w',1,$temptime);\r\n\t\t$fecha_venc = strftime('%Y-%m-%d',$temptime);\r\n\t}\r\n\t$temptime = strtotime($fecha_venc);\r\n\r\n\r\n\t// SE CAMBIO LA FECHA, ANTES TENIA FECHA DE OTORGAMIENTO.\r\n\t$x_origen = 1;\r\n\t$x_bitacora = \"Seguimiento de Credito - (\".FormatDateTime($fecha_tarea,7).\" - $currtime)\";\r\n\r\n\t$x_bitacora .= \"\\n\";\r\n\t$x_bitacora .= \"$x_asunto - $x_descripcion \";\t\r\n\t\r\n\r\n\t$sSqlWrk = \"\r\n\tSELECT usuario_id\r\n\tFROM \r\n\t\tusuario\r\n\tWHERE \r\n\t\tusuario.usuario_rol_id = 2\r\n\tLIMIT 1\r\n\t\";\r\n\t\r\n\t$rswrk = phpmkr_query($sSqlWrk,$conn) or die(\"Failed to execute query\" . phpmkr_error() . ' SQL:' . $sSqlWrk);\r\n\t$datawrk = phpmkr_fetch_array($rswrk);\r\n\t$x_usuario_id = $datawrk[\"usuario_id\"];\r\n\t@phpmkr_free_result($rswrk);\r\n\t\r\n// SE CAMBIO LA FECHA ANTES TENIA FECHA DE OTORGAMIENTO\r\n\t$sSql = \"INSERT INTO crm_caso values (0,2,1,1,$x_cliente_id,'\".ConvertDateToMysqlFormat($fecha_tarea).\"',$x_origen,$x_usuario_id,'$x_bitacora','\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"',NULL,$x_credito_id)\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\t$x_crm_caso_id = mysql_insert_id();\t\r\n\t\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n// SE CAMBIO LA FECHA ANTES TENIA FECHA DE OTORGAMIENTO\r\n\t$sSql = \"INSERT INTO crm_tarea values (0,$x_crm_caso_id, $x_orden, $x_tarea_tipo_id, $x_prioridad_id,'\".ConvertDateToMysqlFormat($fecha_tarea).\"','$currtime','$fecha_venc',NULL,NULL,NULL, 1, 1, 2, $x_usuario_id, NULL,NULL, '$x_asunto','$x_descripcion',1)\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\t\r\n\r\n\r\n\r\n//FONDEO\r\n\t\r\n\tif(!empty($GLOBALS[\"x_fondeo_credito_id\"]) && $GLOBALS[\"x_fondeo_credito_id\"] > 0){\r\n\t\t$sSql = \"INSERT INTO fondeo_colocacion values (0,\".$GLOBALS[\"x_fondeo_credito_id\"].\",$x_credito_id)\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t}\r\n\r\n\t$dateC = date(\"Y_m_d\");\r\n\t$sqlCondi = \"INSERT INTO `credito_condiciones` (`credito_condiciones_id` ,`credito_id` ,`fecha` ,`status`) \";\r\n\t$sqlCondi .= \" VALUES ( NULL , $x_credito_id, \\\"$dateC\\\", '0')\";\r\n\t$rsCondi = phpmkr_query ($sqlCondi, $conn) or die (\"error al isertar en condiciones de credito\". phpmkr_error().\"sql :\". $sqlCondi);\r\n\t\r\n\t$sqlCondi = \"INSERT INTO `cheque_conciliado` (`cheque_conciliado_id` ,`credito_id` ,`fecha` ,`status`) \";\r\n\t$sqlCondi .= \" VALUES ( NULL , $x_credito_id, \\\"$dateC\\\", '0')\";\r\n\t$rsCondi = phpmkr_query ($sqlCondi, $conn) or die (\"error al isertar en condiciones de credito\". phpmkr_error().\"sql :\". $sqlCondi);\r\n\r\n\r\n\tphpmkr_query('commit;', $conn);\t \r\n\treturn true;\r\n}", "function AddData($conn)\r\n{\r\n\tglobal $x_credito_id;\r\n\t$sSql = \"SELECT * FROM `credito`\";\r\n\t$sWhere = \"\";\r\n\t$sGroupBy = \"\";\r\n\t$sHaving = \"\";\r\n\t$sOrderBy = \"\";\r\n\r\n\t// Check for duplicate key\r\n\t$bCheckKey = true;\r\n\t$sWhereChk = $sWhere;\r\n\tif ((@$x_credito_id == \"\") || (is_null($x_credito_id))) {\r\n\t\t$bCheckKey = false;\r\n\t} else {\r\n\t\tif ($sWhereChk <> \"\") { $sWhereChk .= \" AND \"; }\r\n\t\t$sTmp = (get_magic_quotes_gpc()) ? stripslashes($x_credito_id) : $x_credito_id;\t\t\t\r\n\t\t$sWhereChk .= \"(`credito_id` = \" . addslashes($sTmp) . \")\";\r\n\t}\r\n\tif ($bCheckKey) {\r\n\t\t$sSqlChk = $sSql . \" WHERE \" . $sWhereChk;\r\n\t\t$rsChk = phpmkr_query($sSqlChk, $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSqlChk);\r\n\t\tif (phpmkr_num_rows($rsChk) > 0) {\r\n\t\t\t$_SESSION[\"ewmsg\"] = \"Duplicate value for primary key\";\r\n\t\t\tphpmkr_free_result($rsChk);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tphpmkr_free_result($rsChk);\r\n\t}\r\n\r\n\tphpmkr_query('START TRANSACTION;', $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: BEGIN TRAN');\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_credito_num\"] != \"\") ? \" '\" . $GLOBALS[\"x_credito_num\"] . \"'\" : \"0\";\r\n\t$fieldList[\"`credito_num`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_cliente_num\"] != \"\") ? \" '\" . $GLOBALS[\"x_cliente_num\"] . \"'\" : \"0\";\r\n\t$fieldList[\"`cliente_num`\"] = $theValue;\r\n\r\n\t// Field credito_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_credito_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_credito_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_tipo_id`\"] = $theValue;\r\n\r\n\t// Field solicitud_id\r\n\t$theValue = ($GLOBALS[\"x_solicitud_id\"] != \"\") ? intval($GLOBALS[\"x_solicitud_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_id`\"] = $theValue;\r\n\r\n\t// Field credito_status_id\r\n\t$theValue = ($GLOBALS[\"x_credito_status_id\"] != \"\") ? intval($GLOBALS[\"x_credito_status_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_status_id`\"] = $theValue;\r\n\r\n\t// Field fecha_otrogamiento\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_otrogamiento`\"] = $theValue;\r\n\r\n\t// Field importe\r\n\t$theValue = ($GLOBALS[\"x_importe\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_importe\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`importe`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_forma_pago_id\"] != \"\") ? intval($GLOBALS[\"x_forma_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`forma_pago_id`\"] = $theValue;\r\n\r\n\r\n\t// Field tasa\r\n\t$theValue = ($GLOBALS[\"x_tasa\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_tasa\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tasa`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_iva\"] != \"\") ? \" '\" . intval($GLOBALS[\"x_iva\"]) . \"'\" : \"2\";\r\n\t$fieldList[\"`iva`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_plazo\"] != \"\") ? intval($GLOBALS[\"x_plazo\"]) : \"NULL\";\r\n\t$fieldList[\"`plazo_id`\"] = $theValue;\r\n\r\n\t// Field fecha_vencimiento\r\n\t$theValue = ($GLOBALS[\"x_fecha_vencimiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_vencimiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_vencimiento`\"] = $theValue;\r\n\r\n\t// Field tasa_moratoria\r\n\t$theValue = ($GLOBALS[\"x_tasa_moratoria\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_tasa_moratoria\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tasa_moratoria`\"] = $theValue;\r\n\r\n\t// Field medio_pago_id\r\n\t$theValue = ($GLOBALS[\"x_medio_pago_id\"] != \"\") ? intval($GLOBALS[\"x_medio_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`medio_pago_id`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_banco_id\"] != \"\") ? intval($GLOBALS[\"x_banco_id\"]) : \"0\";\r\n\t$fieldList[\"`banco_id`\"] = $theValue;\r\n\r\n\t// Field referencia_pago\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_referencia_pago\"]) : $GLOBALS[\"x_referencia_pago\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`referencia_pago`\"] = $theValue;\r\n\r\n\r\n\t// \r\n\t$theValue = ($GLOBALS[\"x_num_pagos\"] != \"\") ? intval($GLOBALS[\"x_num_pagos\"]) : \"0\";\r\n\t$fieldList[\"`num_pagos`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tdp\"]) : $GLOBALS[\"x_tdp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tarjeta_num`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `credito` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_credito_id = mysql_insert_id();\r\n\t\r\n\t\r\n//GENERA VENCIMIENTOS\r\n\r\n\tinclude(\"utilerias/datefunc.php\");\r\n\r\n\t$sSql = \"SELECT valor FROM plazo where plazo_id = \".$GLOBALS[\"x_plazo\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_plazo = $row[\"valor\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\t$sSql = \"SELECT valor FROM forma_pago where forma_pago_id = \".$GLOBALS[\"x_forma_pago_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_forma_pago = $row[\"valor\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n//\t$x_num_pagos = $x_plazo * $x_forma_pago;\r\n\t$x_num_pagos = $GLOBALS[\"x_num_pagos\"];\t\r\n\r\n\t$GLOBALS[\"x_importe\"] = str_replace(\",\",\"\",$GLOBALS[\"x_importe\"]);\r\n\t$temptime = strtotime(ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]));\t\r\n\t$x_interes = 0;\r\n\t$x_pago_act = 1;\r\n\twhile($x_pago_act < $x_num_pagos + 1){\r\n/*\t\r\n\t\tswitch ($GLOBALS[\"x_forma_pago_id\"])\r\n\t\t{\r\n\t\t\tcase \"1\": // semanal\r\n\t\t\t\t$temptime = DateAdd('w',7,$temptime);\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"2\": // quincenal\r\n\t\t\t\t$temptime = DateAdd('w',14,$temptime);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"3\": // mensual\r\n\t\t\t\t$temptime = DateAdd('w',28,$temptime);\t\t\t\t\r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t}\r\n\r\n\r\n\r\nstrftime Formatos primer parametro\r\n\r\n%a - abbreviated weekday name \r\n%A - full weekday name \r\n%b - abbreviated month name \r\n%B - full month name \r\n%c - preferred date and time representation \r\n%C - century number (the year divided by 100, range 00 to 99) \r\n%d - day of the month (01 to 31) \r\n%D - same as %m/%d/%y \r\n%e - day of the month (1 to 31) \r\n%g - like %G, but without the century \r\n%G - 4-digit year corresponding to the ISO week number (see %V). \r\n%h - same as %b \r\n%H - hour, using a 24-hour clock (00 to 23) \r\n%I - hour, using a 12-hour clock (01 to 12) \r\n%j - day of the year (001 to 366) \r\n%m - month (01 to 12) \r\n%M - minute \r\n%n - newline character \r\n%p - either am or pm according to the given time value \r\n%r - time in a.m. and p.m. notation \r\n%R - time in 24 hour notation \r\n%S - second \r\n%t - tab character \r\n%T - current time, equal to %H:%M:%S \r\n%u - weekday as a number (1 to 7), Monday=1. Warning: In Sun Solaris Sunday=1 \r\n%U - week number of the current year, starting with the first Sunday as the first day of the first week \r\n%V - The ISO 8601 week number of the current year (01 to 53), where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week \r\n%W - week number of the current year, starting with the first Monday as the first day of the first week \r\n%w - day of the week as a decimal, Sunday=0 \r\n%x - preferred date representation without the time \r\n%X - preferred time representation without the date \r\n%y - year without a century (range 00 to 99) \r\n%Y - year including the century \r\n%Z or %z - time zone or name or abbreviation \r\n%% - a literal % character \r\n\t\t\r\n*/\r\n\t\t$temptime = DateAdd('w',$x_forma_pago,$temptime);\r\n\r\n\r\n\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\t\t\t\r\n\t\t$x_dia = strftime('%A',$temptime);\r\n\r\n//Validar domingos\r\n\t\tif($x_dia == \"SUNDAY\"){\r\n\t\t\t$temptime = strtotime($fecha_act);\r\n\t\t\t$temptime = DateAdd('w',1,$temptime);\r\n\t\t\t$fecha_act = strftime('%Y-%m-%d',$temptime);\r\n\t\t}\r\n\r\n\t\t$x_interes_act = (1/pow((1+doubleval($GLOBALS[\"x_tasa\"] / 100 )),$x_pago_act));\r\n\r\n\t\t$x_interes = $x_interes + $x_interes_act;\r\n\t\r\n\t\t$sSql = \"insert into vencimiento values(0,$x_credito_id, $x_pago_act,1, '$fecha_act', 0, 0, 0, 0, 0, 0)\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$temptime = strtotime($fecha_act);\r\n\t\t$x_pago_act++;\t\r\n\t}\t\t\r\n\r\n\t$x_total_venc = round($GLOBALS[\"x_importe\"] / $x_interes);\r\n\t$x_capital_venc = ($GLOBALS[\"x_importe\"] / $x_num_pagos);\r\n\t$x_interes_venc = round($x_total_venc - $x_capital_venc);\r\n\tif($GLOBALS[\"x_iva\"] == 1){\r\n\t\t$x_iva_venc = round($x_interes_venc * .16);\t\r\n\t\t$x_total_venc = $x_total_venc + $x_iva_venc;\r\n\t}else{\r\n\t\t$x_iva_venc = 0;\r\n\t}\r\n\r\n\t$sSql = \"update vencimiento set importe = $x_capital_venc, interes = $x_interes_venc, total_venc = $x_total_venc, iva = $x_iva_venc where credito_id = $x_credito_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\t$sSql = \"update credito set fecha_vencimiento = '$fecha_act' where credito_id = $x_credito_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\t\r\n// fecha actual, quedara registrada como dia en que se dio de alta el credito, la otra fecha es la fecha de otorgamiento de credito:::: no son la misma fecha. \t\r\n$currentdate = getdate(time());\r\n$currdate = $currentdate[\"year\"].\"-\".$currentdate[\"mon\"].\"-\".$currentdate[\"mday\"];\r\n$x_fecha_alta = $currdate;\r\n\r\n//die();\r\n\t$sSql = \"update solicitud set solicitud_status_id = 6, fecha_otorga_credito = \\\"\".$x_fecha_alta.\"\\\" where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n\r\n\r\n//credito_tipo_id\r\n\r\n\r\n\t$sSql = \"SELECT credito_tipo_id FROM solicitud where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_credito_tipo_id = $row[\"credito_tipo_id\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n//if($x_credito_tipo_id == 1){\r\nif($x_credito_tipo_id > 0){\t\r\n\r\n\t$sSql = \"SELECT cliente_id FROM solicitud_cliente where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_cliente_id = $row[\"cliente_id\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\t$sSql = \"update cliente set cliente_num = '\".$GLOBALS[\"x_cliente_num\"].\"' where cliente_id = $x_cliente_id \";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n\r\n//USUARIO Y PASSWORD\r\n\tinclude(\"utilerias/gen_pass_ec.php\");\r\n\r\n\t$x_asignada = 0;\r\n\twhile($x_asignada == 0){\r\n\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t$sSql = \"Select * from usuario where usuario = '$clave'\";\r\n\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t$x_usuario = $clave;\r\n\t\t\t$x_asignada = 10;\r\n\t\t}\r\n\t\tphpmkr_free_result($rs2);\r\n\t}\r\n\r\n\t$x_asignada = 0;\r\n\twhile($x_asignada == 0){\r\n\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t$sSql = \"Select * from usuario where clave = '$clave'\";\r\n\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t/*\t\t\r\n\t\t\t$sSql = \"update socios set clave = '$clave' where socio_id = $x_socio_id\";\r\n\t\t\tphpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t*/\r\n\t\t\t$x_clave = $clave;\r\n\t\t\t$x_asignada = 10;\r\n\t\t}\r\n\t\tphpmkr_free_result($rs2);\r\n\t}\r\n\r\n\t$sSql = \"SELECT * FROM cliente where cliente_id = $x_cliente_id\";\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_nombre = $row[\"nombre_completo\"].\" \". $row[\"apellido_paterno\"].\" \".$row[\"apellido_materno\"];\r\n\t$x_email = $row[\"email\"];\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\t$fieldList = NULL;\r\n\t// Field usuario_rol_id\r\n\t$fieldList[\"`usuario_rol_id`\"] = 8;\r\n\r\n\t// Field usuario_status_id\r\n\t$fieldList[\"`usuario_status_id`\"] = 1;\r\n\r\n\t// Field usuario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_usuario) : $x_usuario; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`usuario`\"] = $theValue;\r\n\r\n\t// Field clave\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_clave) : $x_clave; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`clave`\"] = $theValue;\r\n\r\n\t// Field nombre\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_nombre) : $x_nombre; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field fecha_caduca\r\n\t$theValue = ($GLOBALS[\"x_fecha_caduca\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_caduca\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_caduca`\"] = $theValue;\r\n\r\n\t// Field fecha_visita\r\n\t$theValue = ($GLOBALS[\"x_fecha_visita\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_visita\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_visita`\"] = $theValue;\r\n\r\n\t// Field visitas\r\n\t$theValue = ($GLOBALS[\"x_visitas\"] != \"\") ? intval($GLOBALS[\"x_visitas\"]) : \"0\";\r\n\t$fieldList[\"`visitas`\"] = $theValue;\r\n\r\n\t// Field email\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_email) : $x_email; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`email`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `usuario` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t\r\n\t$x_usuario_id = mysql_insert_id();\r\n\r\n\t$sSql = \"update cliente set usuario_id = $x_usuario_id where cliente_id = $x_cliente_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n}else{\r\n\r\n\tinclude(\"utilerias/gen_pass_ec.php\");\r\n\r\n\t$sSql = \"SELECT cliente_id FROM solicitud_inciso where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\twhile ($row = phpmkr_fetch_array($rs)){\r\n\t\t$x_cliente_id = $row[\"cliente_id\"];\r\n\r\n\t\t$sSql = \"update cliente set cliente_num = '\".$GLOBALS[\"x_cliente_num\"].\"' where cliente_id = $x_cliente_id \";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\r\n\t\t//USUARIO Y PASSWORD\r\n\t\t$x_asignada = 0;\r\n\t\twhile($x_asignada == 0){\r\n\t\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t\t$sSql = \"Select * from usuario where usuario = '$clave'\";\r\n\t\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t\t$x_usuario = $clave;\r\n\t\t\t\t$x_asignada = 10;\r\n\t\t\t}\r\n\t\t\tphpmkr_free_result($rs2);\r\n\t\t}\r\n\t\r\n\t\t$x_asignada = 0;\r\n\t\twhile($x_asignada == 0){\r\n\t\t\t$clave = generate(8, \"No\", \"Yes\", \"Yes\");\r\n\t\t\t$sSql = \"Select * from usuario where clave = '$clave'\";\r\n\t\t\t$rs2 = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\tif (phpmkr_num_rows($rs2) == 0) {\t\r\n\t\t\t\t/*\t\t\r\n\t\t\t\t$sSql = \"update socios set clave = '$clave' where socio_id = $x_socio_id\";\r\n\t\t\t\tphpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t\t\t*/\r\n\t\t\t\t$x_clave = $clave;\r\n\t\t\t\t$x_asignada = 10;\r\n\t\t\t}\r\n\t\t\tphpmkr_free_result($rs2);\r\n\t\t}\r\n\t\r\n\t\t$sSql = \"SELECT * FROM cliente where cliente_id = $x_cliente_id\";\r\n\t\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\t\t$x_nombre = $row[\"nombre_completo\"].\" \". $row[\"apellido_paterno\"].\" \".$row[\"apellido_materno\"];\r\n\t\t$x_email = $row[\"email\"];\r\n\t\tphpmkr_free_result($rs);\t\t\r\n\t\r\n\t\r\n\t\t$fieldList = NULL;\r\n\t\t// Field usuario_rol_id\r\n\t\t$fieldList[\"`usuario_rol_id`\"] = 8;\r\n\t\r\n\t\t// Field usuario_status_id\r\n\t\t$fieldList[\"`usuario_status_id`\"] = 1;\r\n\t\r\n\t\t// Field usuario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_usuario) : $x_usuario; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`usuario`\"] = $theValue;\r\n\t\r\n\t\t// Field clave\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_clave) : $x_clave; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`clave`\"] = $theValue;\r\n\t\r\n\t\t// Field nombre\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_nombre) : $x_nombre; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`nombre`\"] = $theValue;\r\n\t\r\n\t\t// Field fecha_registro\r\n\t\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\t\r\n\t\t// Field fecha_caduca\r\n\t\t$theValue = ($GLOBALS[\"x_fecha_caduca\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_caduca\"]) . \"'\" : \"Null\";\r\n\t\t$fieldList[\"`fecha_caduca`\"] = $theValue;\r\n\t\r\n\t\t// Field fecha_visita\r\n\t\t$theValue = ($GLOBALS[\"x_fecha_visita\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_visita\"]) . \"'\" : \"Null\";\r\n\t\t$fieldList[\"`fecha_visita`\"] = $theValue;\r\n\t\r\n\t\t// Field visitas\r\n\t\t$theValue = ($GLOBALS[\"x_visitas\"] != \"\") ? intval($GLOBALS[\"x_visitas\"]) : \"0\";\r\n\t\t$fieldList[\"`visitas`\"] = $theValue;\r\n\t\r\n\t\t// Field email\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($x_email) : $x_email; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`email`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `usuario` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$x_usuario_id = mysql_insert_id();\r\n\t\r\n\t\t$sSql = \"update cliente set usuario_id = $x_usuario_id where cliente_id = $x_cliente_id\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t}\r\n\tphpmkr_free_result($rs);\t\t\r\n}\r\n\r\n\r\n\r\n//RENOVACIONES\r\n\t$sSql = \"SELECT promotor_id, solicitud_id_ant FROM solicitud where solicitud_id = \".$GLOBALS[\"x_solicitud_id\"];\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t$row = phpmkr_fetch_array($rs);\r\n\t$x_promotor_id = $row[\"promotor_id\"];\r\n\t$x_solicitud_id_ant = $row[\"solicitud_id_ant\"];\t\r\n\tphpmkr_free_result($rs);\t\t\r\n\r\n\r\n\r\n\tif($x_solicitud_id_ant > 0 ){\r\n\r\n\t\t$sSql = \"SELECT credito_id FROM credito where solicitud_id = $x_solicitud_id_ant\";\r\n\t\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\t\t$x_credito_id_ant = $row[\"credito_id\"];\r\n\t\tphpmkr_free_result($rs);\t\t\r\n\t\r\n\t\t$sSql = \"update credito set credito_id_ant = $x_credito_id_ant where credito_id = $x_credito_id\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t\t$x_comision_importe = 50;\t\r\n\t}else{\r\n\t\t$x_comision_importe = 100;\r\n\t}\r\n\r\n\r\n//COMISIONES\r\n\r\n\r\n\r\n\t$fieldList = NULL;\r\n\t\r\n\t// Field promotor_id\r\n\t$fieldList[\"`promotor_id`\"] = $x_promotor_id;\r\n\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`credito_id`\"] = $x_credito_id;\r\n\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`vencimiento_id`\"] = 0;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_otrogamiento\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field comision\r\n\t$theValue = ($GLOBALS[\"x_comision\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_comision\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comision`\"] = $theValue;\r\n\r\n\t// Field comision_importe\r\n\t$fieldList[\"`comision_importe`\"] = $x_comision_importe;\r\n\r\n\t// Field referencia\r\n\tif($GLOBALS[\"x_credito_num\"] != \"\"){\r\n\t\t$fieldList[\"`referencia`\"] = \"'\".$GLOBALS[\"x_credito_num\"].\"'\";\r\n\t}else{\r\n\t\t$fieldList[\"`referencia`\"] = \"NULL\";\r\n\t}\r\n\r\n\t// Field promotor_comision_status_id\r\n\t$fieldList[\"`promotor_comision_status_id`\"] = 1;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `promotor_comision` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\tphpmkr_query($sSql, $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\r\n\r\n\r\n\r\n//GENERA CASO CRM\r\n$currentdatecrm = getdate(time());\r\n$currtime = $currentdatecrm[\"hours\"].\":\".$currentdatecrm[\"minutes\"].\":\".$currentdatecrm[\"seconds\"];\t\t\r\n\r\n\t$sSqlWrk = \"\r\n\tSELECT *\r\n\tFROM \r\n\t\tcrm_playlist\r\n\tWHERE \r\n\t\tcrm_playlist.crm_caso_tipo_id = 2\r\n\t\tAND crm_playlist.orden = 1\r\n\t\";\r\n\t\r\n\t$rswrk = phpmkr_query($sSqlWrk,$conn) or die(\"Failed to execute query\" . phpmkr_error() . ' SQL:' . $sSqlWrk);\r\n\t$datawrk = phpmkr_fetch_array($rswrk);\r\n\t$x_crm_playlist_id = $datawrk[\"crm_playlist_id\"];\r\n\t$x_prioridad_id = $datawrk[\"prioridad_id\"];\t\r\n\t$x_asunto = $datawrk[\"asunto\"];\t\r\n\t$x_descripcion = $datawrk[\"descripcion\"];\t\t\r\n\t$x_tarea_tipo_id = $datawrk[\"tarea_fuente\"];\t\t\r\n\t$x_orden = $datawrk[\"orden\"];\t\r\n\t$x_dias_espera = $datawrk[\"dias_espera\"];\t\t\r\n\t@phpmkr_free_result($rswrk);\r\n\r\n\r\n\t//Fecha Vencimiento\r\n\t$temptime = strtotime(ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]));\t\r\n\t$temptime = DateAdd('w',$x_dias_espera,$temptime);\r\n\t$fecha_venc = strftime('%Y-%m-%d',$temptime);\t\t\t\r\n\t$x_dia = strftime('%A',$temptime);\r\n\tif($x_dia == \"SUNDAY\"){\r\n\t\t$temptime = strtotime($fecha_venc);\r\n\t\t$temptime = DateAdd('w',1,$temptime);\r\n\t\t$fecha_venc = strftime('%Y-%m-%d',$temptime);\r\n\t}\r\n\t$temptime = strtotime($fecha_venc);\r\n\r\n\r\n\r\n\t$x_origen = 1;\r\n\t$x_bitacora = \"Seguimiento de Credito - (\".FormatDateTime($GLOBALS[\"x_fecha_otrogamiento\"],7).\" - $currtime)\";\r\n\r\n\t$x_bitacora .= \"\\n\";\r\n\t$x_bitacora .= \"$x_asunto - $x_descripcion \";\t\r\n\t\r\n\r\n\t$sSqlWrk = \"\r\n\tSELECT usuario_id\r\n\tFROM \r\n\t\tusuario\r\n\tWHERE \r\n\t\tusuario.usuario_rol_id = 2\r\n\tLIMIT 1\r\n\t\";\r\n\t\r\n\t$rswrk = phpmkr_query($sSqlWrk,$conn) or die(\"Failed to execute query\" . phpmkr_error() . ' SQL:' . $sSqlWrk);\r\n\t$datawrk = phpmkr_fetch_array($rswrk);\r\n\t$x_usuario_id = $datawrk[\"usuario_id\"];\r\n\t@phpmkr_free_result($rswrk);\r\n\t\r\n\r\n\t$sSql = \"INSERT INTO crm_caso values (0,2,1,1,$x_cliente_id,'\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"',$x_origen,$x_usuario_id,'$x_bitacora','\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"',NULL,$x_credito_id)\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\t$x_crm_caso_id = mysql_insert_id();\t\r\n\t\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\r\n\r\n\t$sSql = \"INSERT INTO crm_tarea values (0,$x_crm_caso_id, $x_orden, $x_tarea_tipo_id, $x_prioridad_id,'\".ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_otrogamiento\"]).\"','$currtime','$fecha_venc',NULL,NULL,NULL, 1, 1, 2, $x_usuario_id, NULL,NULL, '$x_asunto','$x_descripcion',1)\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\texit();\r\n\t}\r\n\t\r\n\r\n//FONDEO\r\n\t\r\n\tif(!empty($GLOBALS[\"x_fondeo_credito_id\"]) && $GLOBALS[\"x_fondeo_credito_id\"] > 0){\r\n\t\t$sSql = \"INSERT INTO fondeo_colocacion values (0,\".$GLOBALS[\"x_fondeo_credito_id\"].\",$x_credito_id)\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\r\n\tphpmkr_query('commit;', $conn);\t \r\n\treturn true;\r\n}", "function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}", "public function getTransaction();", "public function addMain($data = array()) {\r\n if ($data['kst_trans'] != 'ADJUSTMENT') {\r\n if ($this->isValidCoa(array(\r\n 'coa' => $data['kst_coa'],\r\n 'cbid' => ses_cabang)) == FALSE)\r\n return FALSE;\r\n }\r\n\r\n if ($this->db->insert(\"ksr_trans\", $data) == FALSE) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "public static function twispay_tw_logTransaction( $data ) {\n global $wpdb;\n\n /* Extract the WooCommerce order. */\n $order = wc_get_order($data['id_cart']);\n\n $already = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM \" . $wpdb->prefix . \"twispay_tw_transactions WHERE transactionId = '%s'\", $data['transactionId']) );\n if ( $already ) {\n /* Update the DB with the transaction data. */\n $wpdb->query( $wpdb->prepare( \"UPDATE \" . $wpdb->prefix . \"twispay_tw_transactions SET status = '%s' WHERE transactionId = '%d'\", $data['status'], $data['transactionId'] ) );\n } else {\n\n $checkout_url = ((false !== $order) && (true !== $order)) ? ( esc_url( wc_get_checkout_url() . 'order-pay/' . explode('_', $data['id_cart'])[0] . '/?pay_for_order=true&key=' . $order->get_data()['order_key']) ) : (\"\");\n\n $wpdb->get_results( $wpdb->prepare( \"INSERT INTO `\" . $wpdb->prefix . \"twispay_tw_transactions` (`status`, `id_cart`, `identifier`, `orderId`, `transactionId`, `customerId`, `cardId`, `checkout_url`) VALUES ('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%s');\", $data['status'], $data['id_cart'], $data['identifier'], $data['orderId'], $data['transactionId'], $data['customerId'], $data['cardId'], $checkout_url ) );\n }\n }", "public function startTransaction(): void;", "public function addTransferStock($post){\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\n\t\t\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t$identity = explode(',',$post['identity']);\r\n\t\tforeach($identity as $i){\n\t\t\tif($post['from_location_id_'.$i]!== $post['to_location_id_'.$i]){\r\n\t\t\t\t\n// \t\t\t\t$data_transfer=array(\r\n// \t\t\t\t\t\t'pro_id'\t\t=> $post['item_id_'.$i],\r\n// \t\t\t\t\t\t'FromLocationId'=> $post['from_location_id_'.$i],\r\n// \t\t\t\t\t\t'ToLocationId'\t=> $post['to_location_id_'.$i],\r\n// \t\t\t\t\t\t'qty'\t\t\t=> $post['qty_id_'.$i],\r\n// \t\t\t\t\t\t'user_id' \t=> $GetUserId,\r\n// \t\t\t\t\t\t'date_transfer'\t=> new Zend_Date(),\r\n// \t\t\t\t\t\t'remark'\t => $post['remark']\r\n\t\t\t\t\r\n// \t\t\t\t);\r\n// \t\t\t\t$db->insert(\"tb_stocktransfer\", $data_transfer);\r\n// \t\t\t\tunset($data_transfer);\t\t\t\t\n\t\t\t\t\n\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location_id_'.$i]);\n\t\t\t\tif($rows){\n\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t'qty' =>$rows['qty']- $post['qty_id_'.$i]\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\n\t\t\t\t\t\n\t\t\t\t\t//add move history\n\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location_id_'.$i],\n\t\t\t\t\t\t\t\t//\t\t'Remark'\t\t\t=> $post['remark'],\r\n\t\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\n\t\t\t\t\tunset($data_qty_location);unset($rows);\n\t\t\t\t\t//update product location to\n\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location_id_'.$i]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($rows_gets_qty){\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\t\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location_id_'.$i],\n\t\t\t\t\t\t\t\t\t//\t'Remark'\t\t\t=> $post['remark'],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t}//if recieve deosn't exist in product location \n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\t//if receive not have\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location_id_'.$i],\n\t\t\t\t\t\t\t\t\t//'Remark'\t\t\t=> $post['remark'],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{//if from doesn't exist\n\t\t\t\t\t//add qty in location if from doesn't exist\n\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t'LocationId' => $post['from_location_id_'.$i],\r\n\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\tunset($add_pro_location);\n //echeck for get product location\n\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location_id_'.$i],\n\t\t\t\t\t\t//\t'Remark'\t\t\t=> $post['remark_i'],\r\n\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\tunset($data_history);\n\t\t\t\t\t\n\t\t\t\t\t//for get stock \n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location_id_'.$i]);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\n\t\t\t\t\t\t\t //add move history \n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location_id_'.$i],\n\t\t\t\t\t\t\t//\t\t'Remark'\t\t\t=> $post['remark'],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\t//if doesn't exist from and to\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location_id_'.$i],\n\t\t\t\t\t\t\t//\t\t'Remark'\t\t\t=> $post['remark'],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t}\n\t\t\t\t}\r\n\t\t\t}\n\t\t}\n\t}", "public function inTransaction();", "public function inTransaction();", "public function AddTransactionWithDraw($data){\n \t$this->_name='cs_withdraw';\r\n \t$session_user=new Zend_Session_Namespace('auth');\n \t$user_id = $session_user->user_id;\r\n \tif(empty($data['withdraw_dollar'])){\r\n \t\t$w_dollar = 0;\r\n \t}else{\r\n \t\t$w_dollar =$data['withdraw_dollar'] ;\r\n \t\t$rs_dollar = $this->getMoneyInAccountBySender($data['sender'],1);\r\n \t\t$this->updateOldDeposit($w_dollar,$rs_dollar);\r\n \t}\r\n \tif(empty($data['withdraw_bath'])){\r\n \t\t$w_bath = 0;\r\n \t}else{\r\n \t\t$w_bath =$data['withdraw_bath'];\r\n \t\t$rs_bath = $this->getMoneyInAccountBySender($data['sender'],2);\r\n \t\t$this->updateOldDeposit($w_bath,$rs_bath);\r\n \t}\r\n \tif(empty($data['withdraw_riel'])){\r\n \t\t$w_riel = 0;\r\n \t}else{\r\n \t\t$w_riel = $data['withdraw_riel'];\r\n \t\t$rs_riel = $this->getMoneyInAccountBySender($data['sender'],3);\r\n \t\t$this->updateOldDeposit($w_riel,$rs_riel);\r\n \t}\r\n \t$this->_name='cs_withdraw';\r\n \t$data = array(\r\n \t\t\t'sender_id'=>$data['sender'],\r\n \t\t\t'invoice'=>$data['invoice_no'],\r\n \t\t\t'wd_amountdollar'=>$w_dollar,\r\n \t\t\t'wd_amountbath'=>$w_bath,\r\n \t\t\t'wd_amountriel'=>$w_riel,\r\n \t\t\t'user_id'=>$user_id,\r\n \t\t\t'create_date'=>$data['send_date'],\r\n \t);\r\n \t$id = $this->insert($data);\n \t\n \t$process = 0;\r\n \t$amount = 0;\r\n \t$dbc = new Application_Model_DbTable_DbCapital();\r\n \tfor($i=1; $i<4; $i++){//for add capital detail and update current capital by staff\r\n \t\tif(!empty($w_dollar) AND $i==1){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 1;\r\n \t\t\t$amount = $w_dollar;\r\n \t\t}elseif(!empty($w_bath) AND $i==2){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 2;\r\n \t\t\t$amount = $w_bath;\r\n \t\t}elseif(!empty($w_riel) AND $i==3){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 3;\r\n \t\t\t$amount = $w_riel;\r\n \t\t}\r\n \t\tif($process==1){//with draw tran_type = 7\r\n \t\t\t$_arr = array(\r\n \t\t\t\t\t'tran_id' \t=>$id,\r\n \t\t\t\t\t'tran_type' =>7,\r\n \t\t\t\t\t'curr_type'\t=>$curr_type,\r\n \t\t\t\t\t'amount'\t=>-$amount,//cos withdraw money to customer\r\n \t\t\t\t\t'user_id'\t=>$user_id\r\n \t\t\t);\r\n \t\r\n \t\t\t$dbc->addMoneyToCapitalDetail($_arr);\r\n \t\t\t \r\n \t\t\t$rs = $dbc->DetechCapitalExist($user_id, $curr_type,null);\r\n \t\t\tif(!empty($rs)){//update old user\r\n \t\t\t\t$arr = array(\r\n \t\t\t\t\t\t'amount'=>$rs['amount']-$amount\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->updateCurrentBalanceById($rs['id'],$arr);\r\n \t\t\t}else{\r\n \t\t\t\t$date = date(\"Y-m-d H:i:s\");\r\n \t\t\t\t$arr =array(\r\n \t\t\t\t\t\t'amount'=>-$amount,\r\n \t\t\t\t\t\t'currencyType'=>$curr_type,\r\n \t\t\t\t\t\t'userid'=>$user_id,\r\n \t\t\t\t\t\t'statusDate'=>$date\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->AddCurrentBalanceById($arr);\r\n \t\t\t}\r\n \t\r\n \t\t}\r\n \t\t \r\n \t\t$process = 0;\r\n \t}\n }", "public function extendData() {\n }", "abstract public function InTransaction();", "public function add($data)\n {\n // $this->db->insert($this->_table, $this);\n\t\t$this->db->insert('tb_event', $data);\n\t\t\treturn true;\n }", "public abstract function beginTransaction();", "abstract protected function getTransactions();", "public function add_deal($data_arr,&$validation_passed,&$new_transaction_id,&$err_arr){\n\t\tdie(\"NO LONGER USED\");\n \n }", "protected function addOtherData(array $data) : void\n {\n $this->otherData += $data;\n }", "public function addTransaction(\\CGROSS\\Drinkaccounting\\Domain\\Model\\Transaction $transaction) {\n\t\t// Calc transaction balance\n\t\t$transaction->setBalanceOld($this->getBalance());\n\t\t$transaction->setBalanceNew($this->getBalance() + $transaction->getSum());\n\t\t// Calc new account balance\n\t\t$this->setBalance($this->getBalance() + $transaction->getSum());\n\t\t$transaction->setAccount($this);\n\t\t$this->transactions->add($transaction);\n\t}", "public function add($data)\n {\n $tableName = $this->getTableName();\n return $this->callChain('insert', [$tableName, $data], $this->getStorage());\n }", "function addTransaction($account, $expensetype, $amount, $type, $date){\n\t\t// check if input data is valid\n\t\tif($expensetype == null || strlen($expensetype) == 0){\n\t\t\tthrow new Exception (\"Please enter a valid transaction type.\");\n\t\t}\n\t\telse if ($amount == null || strlen($amount) == 0 || !(is_numeric($amount))){\n\t\t\tthrow new Exception (\"Please enter a valid amount.\");\n\t\t} \n\t\telse if ($date == null){\n\t\t\tthrow new Exception (\"Please enter a date.\");\n\t\t} else {\n\t\t\t$urlms = $this->urlms;\n\t\t\t$urlmsLab = $urlms->getLab_index(0);\n\t\t\t// find the account that receives a transaction\n\t\t\t$fundingAccount = $this->findFundingAccount($account);\n\t\t\t// create a new expense and add it to the account that was previously found using the input\n\t\t\t$newExpense = new Expense($amount, $date, $expensetype, $fundingAccount);\n\t\t\t$fundingAccount->addExpense($newExpense);\n\t\t\t\n\t\t\t// check if transaction is an expense or a fund\n\t\t\t// and add or substract from balance accordingly\n\t\t\tif($type == \"expense\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() - $newExpense->getAmount());\n\t\t\t\t$newExpense->setAmount(-$amount);\n\t\t\t} \n\t\t\telse if ($type == \"fund\"){\n\t\t\t\t$fundingAccount->setBalance($fundingAccount->getBalance() + $newExpense->getAmount());\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception (\"Please choose a valid type of transaction.\");\n\t\t\t}\n\t\t\t// Write data\n\t\t\t//$persistence = new Persistence();\n\t\t\t$this->persistence->writeDataToStore($urlms);\n\t\t\t\n\t\t\t?>\n\t\t\n\t\t\t<!-- Refresh back to funding view -->\n\t\t\t<HTML>\n\t\t\t\t<meta http-equiv=\"refresh\" content=\"0; URL='../view/FundingView.php'\" />\n\t\t\t\t<p>New transation item successfully added!</p>\n\t\t\t\t<a href=\"../view/FundingView.php\">Back</a>\n\t\t\t</HTML><?php\n\t\t}\n\t}", "function addtoTranscript()\r\n {\r\n \r\n }", "public function beginTransaction();", "public function beginTransaction();", "public function beginTransaction();", "function the_incomplete_transaction() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if flash data exists\n if ( $CI->session->flashdata('incomplete_transaction') ) {\n\n // Get incomplete transaction\n $transaction = $CI->session->flashdata('incomplete_transaction');\n\n // Verify if pay's data exists\n if ( isset($transaction['pay']['amount']) && isset($transaction['pay']['currency']) ) {\n\n // Prepare data to save\n $transaction_params = array(\n 'user_id' => $CI->user_id,\n 'amount' => $CI->security->xss_clean($transaction['pay']['amount']),\n 'currency' => $CI->security->xss_clean($transaction['pay']['currency']),\n 'created' => time()\n );\n\n // Try to save the transaction\n $transaction_id = $CI->base_model->insert('transactions', $transaction_params);\n\n // Verify if the transaction was created\n if ( $transaction_id ) {\n\n // Verify if the transaction has fields\n if ( !empty($transaction['fields']) ) {\n\n // List all fields\n foreach ( $transaction['fields'] as $field_name => $field_value ) {\n\n // Prepare data to save\n $transaction_field = array(\n 'transaction_id' => $transaction_id,\n 'field_name' => $CI->security->xss_clean($field_name),\n 'field_value' => $CI->security->xss_clean($field_value)\n );\n\n // Try to save the transaction's field\n $CI->base_model->insert('transactions_fields', $transaction_field);\n\n }\n\n }\n\n // Verify if the transaction has options\n if ( !empty($transaction['options']) ) {\n\n // List all options\n foreach ( $transaction['options'] as $option_name => $option_value ) {\n\n // Prepare data to save\n $transaction_option = array(\n 'transaction_id' => $transaction_id,\n 'option_name' => $CI->security->xss_clean($option_name),\n 'option_value' => $CI->security->xss_clean($option_value)\n );\n\n // Try to save the transaction's option\n $CI->base_model->insert('transactions_options', $transaction_option);\n\n }\n \n }\n\n // Set the transaction's id\n $transaction['transaction_id'] = $transaction_id;\n\n // Set transaction data which will be used if gateway uses ajax for a better security\n $CI->session->set_flashdata('incomplete_transaction_saved', $transaction);\n\n // Return transaction\n return $transaction;\n\n }\n\n }\n\n }\n\n return false;\n \n }", "public function insertTransactionJson($input){\r\n try{\r\n foreach($input[\"transactionsresponse\"] as $key=>$trans){\r\n $storeId = (string)$trans['storeId'];\r\n $transactionDate = (string)$trans['transactionDate'];\r\n $amount = (string)$trans['amount'];\r\n $fee = (string)$trans['fee'];\r\n $amountToPrincipal = (string)$trans['amountToPrincipal'];\r\n $amountToEscrow = (string)$trans['amountToEscrow'];\r\n $amountToInterest = (string)$trans['amountToInterest'];\r\n $ledgerBalance = (string)$trans['ledgerBalance'];\r\n $checkNumber = (string)$trans['checkNumber'];\r\n $transactionType = (string)$trans['transactionType'];\r\n $pending = (string)$trans['pending'];\r\n $generatedDescription = (string)$trans['generatedDescription'];\r\n $transactionId = (string)$trans['transactionId'];\r\n $intradayOrderId = (string)$trans['intradayOrderId'];\r\n $exportTNUM = (string)$trans['exportTNUM'];\r\n $depositSlipIdentifier = (string)$trans['depositSlipIdentifier'];\r\n $checkImageIdentifier = (string)$trans['checkImageIdentifier'];\r\n $creditTransaction = (string)$trans['creditTransaction'];\r\n \r\n //convert date format from mm/dd/yyyy to yyyy-mm-dd\r\n $transactionDate = explode('/', $transactionDate);\r\n $transactionDate = [$transactionDate[2], $transactionDate[0], $transactionDate[1]];\r\n $transactionDate = join( '-', $transactionDate);\r\n\r\n if(!$this->insertTransaction( \r\n $storeId, \r\n $transactionDate, \r\n $amount, \r\n $fee, \r\n $amountToPrincipal, \r\n $amountToEscrow, \r\n $amountToInterest, \r\n $ledgerBalance, \r\n $checkNumber, \r\n $transactionType, \r\n $pending, \r\n $generatedDescription, \r\n $transactionId, \r\n $intradayOrderId, \r\n $exportTNUM, \r\n $depositSlipIdentifier, \r\n $checkImageIdentifier, \r\n $creditTransaction )){\r\n throw new Exception();\r\n }\r\n }\r\n }\r\n catch(Exception $ex) {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public function processVoucherAddRequest(Order $order, array $data);", "abstract public function commitTransaction();", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "public function vocherEntry($itemsData = array(), $data = array())\n {\n $date = new Zend_Date($data['date']);\n $this->_transactionTime = $date->getTimestamp();\n \n $purchaseData = array(\n 'created' => time(),\n 'created_by' => $this->getCurrentUser()->getUserId(),\n 'branch_id' => $data['branch_id'],\n 'vendor_id' => $data['vendor_id'],\n 'date' => $date->getTimestamp(),\n 'notes' => $data['notes'],\n 'payment_terms' => $data['payment_terms'],\n 'type' => $data['voucher_entry']\n );\n \n $this->_purchaseId = parent::create($purchaseData);\n \n $purchaseItemModel = new Core_Model_Finance_Purchase_ItemOthers;\n for ($i = 0; $i < count($itemsData); $i++ ) {\n $purchaseItemId = $purchaseItemModel->create($itemsData[$i], \n $this->_purchaseId);\n }\n \n $vendorModel = new Core_Model_Finance_Vendor($data['vendor_id']);\n $vendorLedgerId = $vendorModel->getLedgerId();\n $vendorName = $vendorModel->getName();\n $notes = 'Purchase from '.$vendorName;\n $vendorLedgerEntryId = $this->vendorLedgerEntry($vendorLedgerId, $notes);\n $taxLedgerEntries = $this->taxLedgerEntry($notes);\n \n $fa_ledger_entry_ids = array();\n $fa_ledger_entry_ids['0'] = $vendorLedgerEntryId;\n if ($data['voucher_entry'] == 1) {\n $fa_ledger_entry_ids['1'] = $this->assestLedgerEntry();\n }\n else {\n $fa_ledger_entry_ids['1'] = $this->expenseLedgerEntry();\n } \n \n for($i = 0; $i <= sizeof($taxLedgerEntries)-1; $i += 1) {\n array_push($fa_ledger_entry_ids, $taxLedgerEntries[$i]);\n }\n $fa_ledger_entry_ids = serialize($fa_ledger_entry_ids);\n $table = $this->getTable();\n $dataToUpdate['s_ledger_ids'] = $fa_ledger_entry_ids;\n $where = $table->getAdapter()->quoteInto('purchase_id = ?',\n $this->_purchaseId);\n $result = $table->update($dataToUpdate, $where);\n \n return $this->_purchaseId;\n }", "public function beginTransaction():void;", "function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }", "private static function updateTransaction($data)\n {\n global $db;\n\n try {\n $fields = implode(', ', array_map(\n function ($v, $k) {\n return sprintf(\"`%s` = '%s'\", $k, $v);\n },\n $data,\n array_keys(\n $data\n )\n ));\n\n $db->Execute(\"\n\t\t\t\tUPDATE\n\t\t\t\t\t`\" . static::$table_name . \"`\n\t\t\t\tSET\n\t\t\t\t\t\" . $fields . \"\n\t\t\t\tWHERE\n\t\t\t\t `unique_id` = '\" . $data['unique_id'] . \"'\n\t\t\t\");\n } catch (\\Exception $exception) {\n //$this->logEx($exception);\n }\n }", "public function addDetail($data) {\r\n /* FILTER KELENGKAPAN TRANSAKSI BY JENIS ACCOUNT */\r\n if ($this->isValidCoa(array(\r\n 'coa' => $data['dkst_coa'],\r\n 'cbid' => ses_cabang)) == FALSE)\r\n return FALSE;\r\n\r\n if ($this->db->insert(\"ksr_dtrans\", $data) == FALSE) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function add($data)\n {\n DB::beginTransaction();\n try{\n $steps = json_decode($data['etapas']);\n\n $data['idsituacao'] = 1;\n $data['idgrupo'] = 1;\n $data['qtdetapas'] = count($steps);\n $data['criado_em'] = date('Y-m-d H:i:s');\n $data['atualizado_em'] = date('Y-m-d H:i:s');\n $data['idatribuidor'] = Auth::guard('user')->user()->id;\n\n unset($data['etapas']);\n\n $new = $this->task->create($data);\n\n if($new->id){\n foreach($steps as $step){\n $post = [\n 'nmetapa' => $step->nmetapa,\n 'idtarefa' => $new->id,\n 'idsituacao' => 1,\n 'descricao' => $step->descricao,\n 'criado_em' => $data['criado_em'],\n 'atualizado_em' => $data['atualizado_em'],\n ];\n\n $this->step->create($post);\n }\n\n $new->participant->user->notify(new ParticipantTask($new));\n\n DB::commit();\n return ['status' => '00'];\n }\n\n DB::rollback();\n return ['status' => '01', 'message' => 'Ocorreu um erro! Caso o erro persista favor contatar o administrador.'];\n }catch(\\Exception $e){\n DB::rollback();\n return ['status' => '01', 'message' => $e->getMessage()];\n }\n }", "abstract public function add_item();", "function it_exchange_paypal_pro_addon_add_child_transaction( $paypal_pro_id, $payment_status, $subscriber_id=false, $amount ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id( $paypal_pro_id );\n\tif ( !empty( $transactions ) ) {\n\t\t//this transaction DOES exist, don't try to create a new one, just update the status\n\t\tit_exchange_paypal_pro_addon_update_transaction_status( $paypal_pro_id, $payment_status );\n\t} else {\n\n\t\tif ( !empty( $subscriber_id ) ) {\n\n\t\t\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id_by_subscriber_id( $subscriber_id );\n\t\t\tforeach( $transactions as $transaction ) { //really only one\n\t\t\t\t$parent_tx_id = $transaction->ID;\n\t\t\t\t$customer_id = get_post_meta( $transaction->ID, '_it_exchange_customer_id', true );\n\t\t\t}\n\n\t\t} else {\n\t\t\t$parent_tx_id = false;\n\t\t\t$customer_id = false;\n\t\t}\n\n\t\tif ( $parent_tx_id && $customer_id ) {\n\t\t\t$transaction_object = new stdClass;\n\t\t\t$transaction_object->total = $amount;\n\t\t\tit_exchange_add_child_transaction( 'paypal_pro', $paypal_pro_id, $payment_status, $customer_id, $parent_tx_id, $transaction_object );\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public function add($data = null) {\n $this->_begin();\n $res = $this->execute($this->addHandlers, $data);\n if ($res['success']) {\n $this->_commit();\n\t\t}\n return $res;\n }", "public function beginTransaction() {\n parent::beginTransaction();\n $this->activeTransaction = true;\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'transaction_date' => 'required',\n 'transaction_code' => 'required',\n 'account_number' => 'required',\n 'amount' => 'required|numeric',\n 'narration' => 'required',\n 'created_by' => 'required',\n 'payment_to' => 'required'\n ]);\n \n $transaction = new Transaction();\n $lastTrans = \\App\\Transaction::all()->pop();\n if (!empty($lastTrans)) {\n $lastId= $lastTrans->id;\n } else {\n $lastId=0;\n }\n if ($request->transaction_code==\"DOB\") {\n $transaction->balance=$request->amount;\n $transaction->amount_paid=0;\n } else {\n $transaction->amount_paid=$request->amount;\n $transaction->balance=0;\n }\n \n $transaction->trn_ref_no = \"MPost\" . \"-\" .$request->payment_to . \"-\" .($lastId +1);\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = null;\n $transaction->liters = 0;\n $transaction->rate = null;\n $transaction->total_cost = null;\n $transaction->narration = $request->narration;\n $transaction->account_number=$request->account_number;\n $transaction->transaction_code = $request->transaction_code;\n $customer=Customer::where(\"customer_number\", $request->payment_to)->get();\n if (isset($customer[0]->customer_name)) {\n $customerName= $customer[0]->customer_name;\n } else {\n $customerName=\"\";\n }\n $transaction->customer_name = $customerName;\n \n \n $transaction->shortages = 0;\n \n $supplier=\"\";\n $supplier=Supplier::where(\"supplier_number\", $request->payment_to)->get();\n if (isset($supplier[0]->supplier_name)) {\n $supplierName=$supplier[0]->supplier_name;\n } else {\n $supplierName=\"\";\n }\n \n $transaction->supplier_name = $supplierName;\n \n \n $transaction->unit_price = 0;\n $transaction->payment_mode = \"N/A\";\n //$transaction->approved_by\n\n $transaction->save();\n Session::flash('flash_message', 'Record successfully added!');\n\n return redirect()->back();\n }", "public function addExtra($data)\n {\n $data = $this->hydrateIfJsonToArray($data);\n $this->extra[] = $data;\n }", "public static function beginTransaction()\n {\n }", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }" ]
[ "0.6877677", "0.68373334", "0.68190765", "0.6753844", "0.6666689", "0.66106004", "0.66040033", "0.65054077", "0.64266956", "0.63649374", "0.634392", "0.634392", "0.6239117", "0.6184395", "0.61705106", "0.6145838", "0.60797167", "0.6069154", "0.6061244", "0.6038127", "0.6037161", "0.59960747", "0.59724456", "0.5873395", "0.5867171", "0.58637124", "0.58417946", "0.5821026", "0.5820252", "0.5819688", "0.57849103", "0.5782869", "0.57530665", "0.57425797", "0.57300884", "0.57268494", "0.57203746", "0.571005", "0.5701928", "0.56984514", "0.5669781", "0.5666815", "0.5661134", "0.56599313", "0.56586486", "0.5651805", "0.5640256", "0.5633278", "0.5630004", "0.5608361", "0.5604364", "0.5577514", "0.55657136", "0.5560202", "0.55577", "0.55549836", "0.55492073", "0.55492073", "0.5541139", "0.55329424", "0.55223167", "0.54912347", "0.54812133", "0.5471067", "0.5457592", "0.54571056", "0.54571056", "0.5448495", "0.54379743", "0.5432796", "0.5429374", "0.5427895", "0.5427539", "0.5426028", "0.54211044", "0.54194224", "0.54161555", "0.54080623", "0.54019135", "0.54016936", "0.54016936", "0.54016936", "0.5392245", "0.5384225", "0.537852", "0.5377879", "0.5375845", "0.537479", "0.53723747", "0.5367798", "0.5367112", "0.53640676", "0.53544414", "0.53515196", "0.53479326", "0.53468835", "0.5346314", "0.53456104", "0.53437716", "0.53418", "0.53399634" ]
0.0
-1
Sets the customer info if available
protected function _addCustomer($object) { $format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId()); $customer = Mage::getModel('customer/customer'); $customerCode = ''; if($object->getCustomerId()) { $customer->load($object->getCustomerId()); $taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode(); $this->_request->setCustomerUsageType($taxClass); } switch($format) { case OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY: if($customer->getId()) { $customerCode = $customer->getName() . ' (' . $customer->getId() . ')'; } else { $address = $object->getBillingAddress() ? $object->getBillingAddress() : $object; $customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)'; } break; case OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL: $customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail(); break; // New code by David Dzimianski - CSH 2013 case OnePica_AvaTax_Model_Source_Customercodeformat::CUST_MAS_ID: $customerCode = $object->getData('mas_id') ? '00' . $object->getData('mas_id') : '00' . $customer->getData('mas_id'); break; case OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID: default: $customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId(); break; } $this->_request->setCustomerCode($customerCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public function loadData(Customer $customer)\n {\n /** @noinspection PhpUndefinedMethodInspection */\n $customerDataAllowed = Shopware()\n ->Plugins()\n ->Frontend()\n ->NostoTagging()\n ->Config()\n ->get(Bootstrap::CONFIG_SEND_CUSTOMER_DATA);\n if ($customerDataAllowed) {\n if (method_exists('\\Shopware\\Models\\Customer\\Customer', 'getDefaultBillingAddress')) {\n /** @var Address $address */\n $address = $customer->getDefaultBillingAddress();\n if ($address instanceof Address) {\n $this->setFirstName($address->getFirstname());\n $this->setLastName($address->getLastname());\n $this->setPostCode($address->getZipCode());\n $this->setPhone($address->getPhone());\n $this->setCountry($address->getCountry()->getIso());\n }\n } elseif (method_exists('\\Shopware\\Models\\Customer\\Customer', 'getBilling')) {\n /** @phan-suppress-next-line UndeclaredTypeInInlineVar */\n /** @var Billing $address */\n /** @noinspection PhpUndefinedMethodInspection */\n $address = $customer->getBilling(); /** @phan-suppress-current-line PhanUndeclaredMethod */\n if ($address instanceof Billing) {\n $this->setFirstName($address->getFirstName());\n $this->setLastName($address->getLastName());\n $this->setPostCode($address->getZipCode());\n $this->setPhone($address->getPhone());\n try {\n /** @var Country $country */\n $country = Shopware()\n ->Models()\n ->getRepository('\\Shopware\\Models\\Country\\Country')\n ->findOneBy(array('id' => $address->getCountryId()));\n $this->setCountry($country->getName());\n } catch (Exception $e) {\n /** @noinspection PhpUndefinedMethodInspection */\n Shopware()->Plugins()->Frontend()->NostoTagging()->getLogger()->error($e->getMessage());\n }\n }\n }\n $this->setEmail($customer->getEmail());\n $emailHelper = new EmailHelper();\n $this->setMarketingPermission(\n $emailHelper->isEmailOptedIn($customer->getEmail())\n );\n }\n Shopware()->Events()->notify(\n __CLASS__ . '_AfterLoad',\n array(\n 'nostoOrderBuyer' => $this,\n 'customer' => $customer\n )\n );\n }", "public static function set_customer_data( $customer ) {\n\t\t$customer->update_meta_data( 'vat_number', self::$data['vat_number'] );\n\t}", "protected function _ensureCustomer()\n {\n if ( $this->_isGuestOrder() && Mage::helper('gueststorecredit')->canConvertGuest() ) {\n $customer = Mage::helper('gueststorecredit')->createNewCustomerFromOrder($this->getOrder());\n\n $this->getCreditMemo()->setCustomerId($customer->getId());\n\n $this->setCustomerId($customer->getId())\n ->setCustomer($customer);\n\n $this->setIsFromGuestFlag(true);\n }\n\n parent::_ensureCustomer();\n }", "public function setCustomerName($customer_name){\n $this->customer_name = $customer_name;\n }", "function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \n if ($this->Customer->exists($customer_id))\n {\n $this->sale_lib->set_customer($customer_id);\n if($this->config->item('automatically_email_receipt'))\n {\n $this->sale_lib->set_email_receipt(1);\n }\n }\n else\n {\n $data['error']=lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "function setSpecificCustomers($specificCustomers) {\n\t\t$this->_specificCustomers = $specificCustomers;\n\t}", "public function setCustomerName($customerName);", "protected function set_customer_data( $data = array() ) {\n\n\t\t// if there is no data to set, bail\n\t\tif ( ! is_array( $data ) || empty( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$data = wp_parse_args( $data, array(\n\t\t\t'email' => '',\n\t\t\t'payerId' => '',\n\t\t\t'firstName' => '',\n\t\t\t'lastName' => '',\n\t\t\t'phone' => '',\n\t\t\t'countryCode' => '',\n\t\t\t'shippingAddress' => array(),\n\t\t\t'billingAddress' => array(),\n\t\t) );\n\n\t\t$address_defaults = array(\n\t\t\t'streetAddress' => '',\n\t\t\t'extendedAddress' => '',\n\t\t\t'locality' => '',\n\t\t\t'region' => '',\n\t\t\t'postalCode' => '',\n\t\t\t'countryCodeAlpha2' => '',\n\t\t);\n\n\t\t$billing_address = wp_parse_args( $data['billingAddress'], $address_defaults );\n\t\t$shipping_address = wp_parse_args( $data['shippingAddress'], $address_defaults );\n\n\t\t$details = array(\n\t\t\t'billing' => array(\n\t\t\t\t'first_name' => $data['firstName'],\n\t\t\t\t'last_name' => $data['lastName'],\n\t\t\t\t'email' => $data['email'],\n\t\t\t\t'phone' => $data['phone'],\n\t\t\t\t'country' => $billing_address['countryCodeAlpha2'],\n\t\t\t\t'address_1' => $billing_address['streetAddress'],\n\t\t\t\t'address_2' => $billing_address['extendedAddress'],\n\t\t\t\t'city' => $billing_address['locality'],\n\t\t\t\t'state' => $billing_address['region'],\n\t\t\t\t'postcode' => $billing_address['postalCode'],\n\t\t\t),\n\t\t\t'shipping' => array(\n\t\t\t\t'first_name' => $data['firstName'],\n\t\t\t\t'last_name' => $data['lastName'],\n\t\t\t\t'country' => $shipping_address['countryCodeAlpha2'],\n\t\t\t\t'address_1' => $shipping_address['streetAddress'],\n\t\t\t\t'address_2' => $shipping_address['extendedAddress'],\n\t\t\t\t'city' => $shipping_address['locality'],\n\t\t\t\t'state' => $shipping_address['region'],\n\t\t\t\t'postcode' => $shipping_address['postalCode'],\n\t\t\t),\n\t\t);\n\n\t\tWC()->session->set( 'wc_braintree_paypal_cart_customer_details', $details );\n\t}", "public function setCustomer(\\Fastbill\\Customer\\Customer $customer)\n {\n $this->customer = $customer;\n }", "protected function _afterLoad()\n {\n parent::_afterLoad();\n if ($plexId = $this->getData('plex_id')) {\n $this->customer = Mage::getModel('customer/customer')->load($plexId);\n } else {\n $this->customer = Mage::getModel('customer/customer');\n }\n }", "public function setCustomerId(?string $customerId): void\n {\n $this->customerId['value'] = $customerId;\n }", "public function createCustomer($data = array()){\n\n $email = $data['account']['email'];\n\n /** @var $customer Mage_Customer_Model_Customer */\n $customer = Mage::getModel('customer/customer');\n\n // load user if exist\n $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId());\n $customer->loadByEmail($email);\n\n $isNew = true;\n if($customer->getId() > 0){\n $isNew = false;\n }\n\n if($isNew){\n $customer->setData($data['account']);\n }else{\n $customer->setFirstname($data['account']['firstname']);\n $customer->setLastname($data['account']['lastname']);\n }\n\n foreach (array_keys($data['address']) as $index) {\n $address = Mage::getModel('customer/address');\n\n $addressData = array_merge($data['account'], $data['address'][$index]);\n\n // Set default billing and shipping flags to address\n // TODO check if current shipping info is the same than current default one, and avoid create a new one.\n $isDefaultBilling = isset($data['account']['default_billing'])\n && $data['account']['default_billing'] == $index;\n $address->setIsDefaultBilling($isDefaultBilling);\n $isDefaultShipping = isset($data['account']['default_shipping'])\n && $data['account']['default_shipping'] == $index;\n $address->setIsDefaultShipping($isDefaultShipping);\n\n $address->addData($addressData);\n\n // Set post_index for detect default billing and shipping addresses\n $address->setPostIndex($index);\n\n $customer->addAddress($address);\n }\n\n // Default billing and shipping\n if (isset($data['account']['default_billing'])) {\n $customer->setData('default_billing', $data['account']['default_billing']);\n }\n if (isset($data['account']['default_shipping'])) {\n $customer->setData('default_shipping', $data['account']['default_shipping']);\n }\n if (isset($data['account']['confirmation'])) {\n $customer->setData('confirmation', $data['account']['confirmation']);\n }\n\n if (isset($data['account']['sendemail_store_id'])) {\n $customer->setSendemailStoreId($data['account']['sendemail_store_id']);\n }\n\n if($isNew){\n doLog('creating user');\n $customer\n ->setPassword($data['account']['password'])\n ->setForceConfirmed(true)\n ->save();\n $customer->cleanAllAddresses();\n }else{\n doLog('updating user');\n $customer->save();\n\t $customer->setConfirmation(null);\n\t $customer->save();\n }\n\n return $customer;\n }", "public function updateCustomer($accessCode)\n {\n $response = $this->_doRapidAPI('Transaction/' . $accessCode, 'GET');\n if ($response->isSuccess()) {\n $customer = $this->_quote->getCustomer();\n $billingAddress = $this->_quote->getBillingAddress();\n $shippingAddress = $this->_quote->getShippingAddress();\n $trans = $response->getTransactions();\n\n if (isset($trans[0]['Customer'])) {\n $billing = $trans[0]['Customer'];\n $billingAddress->setFirstname($billing['FirstName'])\n ->setLastName($billing['LastName'])\n ->setCompany($billing['CompanyName'])\n ->setJobDescription($billing['JobDescription'])\n ->setStreet($billing['Street1'])\n ->setStreet2($billing['Street2'])\n ->setCity($billing['City'])\n ->setState($billing['State'])\n ->setPostcode($billing['PostalCode'])\n ->setCountryId(strtoupper($billing['Country']))\n ->setEmail($billing['Email'])\n ->setTelephone($billing['Phone'])\n ->setMobile($billing['Mobile'])\n ->setComments($billing['Comments'])\n ->setFax($billing['Fax'])\n ->setUrl($billing['Url']);\n }\n if (isset($trans[0]['ShippingAddress'])) {\n $shipping = $trans[0]['ShippingAddress'];\n $shippingAddress->setFirstname($shipping['FirstName'])\n ->setLastname($shipping['LastName'])\n ->setStreet($shipping['Street1'])\n ->setStreet2($shipping['Street2'])\n ->setCity($shipping['City'])\n ->setPostcode($shipping['PostalCode'])\n ->setCountryId(strtoupper($shipping['Country']))\n ->setEmail($shipping['Email'])\n ->setFax($shipping['Fax']);\n\n if ($shipping['State']\n && $shipping['Country']\n && $region = Mage::getModel('directory/region')->loadByCode($shipping['State'], $shipping['Country'])\n ) {\n $shippingAddress->setRegion($region->getName())\n ->setRegionId($region->getId());\n }\n if ($shipping['Phone']) {\n $shippingAddress->setTelephone($shipping['Phone']);\n }\n }\n $this->_quote->assignCustomerWithAddressChange($customer, $billingAddress, $shippingAddress)->save();\n }\n }", "public function addCustomerData()\n {\n $customer = Mage::getModel('customer/customer');\n // alias => attribute_code\n $attributes = array(\n 'customer_lastname' => 'lastname',\n 'customer_middlename' => 'middlename',\n 'customer_firstname' => 'firstname',\n 'customer_email' => 'email'\n );\n\n foreach ($attributes as $alias => $attributeCode) {\n $attribute = $customer->getAttribute($attributeCode);\n /* @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */\n\n if ($attribute->getBackendType() == 'static') {\n $tableAlias = 'customer_' . $attribute->getAttributeCode();\n\n $this->getSelect()->joinLeft(\n array($tableAlias => $attribute->getBackend()->getTable()),\n sprintf('%s.entity_id=main_table.customer_id', $tableAlias),\n array($alias => $attribute->getAttributeCode())\n );\n\n $this->_fields[$alias] = sprintf('%s.%s', $tableAlias, $attribute->getAttributeCode());\n }\n else {\n $tableAlias = 'customer_' . $attribute->getAttributeCode();\n\n $joinConds = array(\n sprintf('%s.entity_id=main_table.customer_id', $tableAlias),\n $this->getConnection()->quoteInto($tableAlias . '.attribute_id=?', $attribute->getAttributeId())\n );\n\n $this->getSelect()->joinLeft(\n array($tableAlias => $attribute->getBackend()->getTable()),\n join(' AND ', $joinConds),\n array($alias => 'value')\n );\n\n $this->_fields[$alias] = sprintf('%s.value', $tableAlias);\n }\n }\n\n $this->setFlag('has_customer_data', true);\n return $this;\n }", "public function update_customer_profile($host_obj, $customer, $data)\n\t\t{\n\t\t\t/* This method is never called in the transparent redirect scenario */\n\t\t}", "private function addCustomerData($options)\n {\n $this->post['BillingEmail'] = isset($options['email']) ? $options['email'] : null;\n $this->post['BillingPhoneNumber'] = isset($options['phone']) ? $options['phone'] : null;\n }", "public function __construct() {\n parent::__construct ();\n $this->setHiddenCustomer ( [ 'id','is_active','creator_id','updator_id','created_at','updated_at' ] );\n }", "public function __construct(Customers $customer)\n {\n $this->customer = $customer;\n }", "private function setCustomer($customer_id)\n {\n session(['customer_id' => $customer_id]);\n }", "public function setCustomerSkin()\n {\n $this->skin = null;\n $this->locale = null;\n $this->currentInterface = \\XLite::CUSTOMER_INTERFACE;\n\n $this->setOptions();\n }", "public function saveExtraRegistrationData($customerId)\n {\n if (isset($_POST['billing_first_name'])) {\n update_user_meta($customerId, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n if (isset($_POST['billing_last_name'])) {\n update_user_meta($customerId, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n if (isset($_POST['billing_address_1'])) {\n update_user_meta($customerId, 'billing_address_1', sanitize_text_field($_POST['billing_address_1']));\n }\n if (isset($_POST['billing_city'])) {\n update_user_meta($customerId, 'billing_city', sanitize_text_field($_POST['billing_city']));\n }\n if (isset($_POST['billing_postcode'])) {\n update_user_meta($customerId, 'billing_postcode', sanitize_text_field($_POST['billing_postcode']));\n }\n if (isset($_POST['billing_phone'])) {\n update_user_meta($customerId, 'billing_phone', sanitize_text_field($_POST['billing_phone']));\n }\n if (isset($_POST['billing_country'])) {\n update_user_meta($customerId, 'billing_country', sanitize_text_field($_POST['billing_country']));\n }\n }", "public function __construct($customermaster_data)\n {\n $this->customermaster_data =$customermaster_data;\n }", "public function setCustomer($name, $identity, $email = '', $phone = '') {\n\n $this->jsonData['Customer'] = array(\n 'Identity' => $this->validateNumber($identity, 14),\n 'FullName' => $this->validateString($name, 288),\n 'Email' => $this->validateEmail($email),\n 'Phone' => $this->validateNumber($phone, 11)\n );\n }", "public function customer() {\n $this->access_lib->_is(\"adm,mgr\");\n\n $data['header'] = $this->header;\n\n $this->load->view('report_customer_v', $data);\n }", "public function getOrCreateCustomer();", "private function updateBilling($data)\n {\n $customer = new Customer();\n\n if ($customer->isGuest()){\n $customer->setEmail(trim($data['email']));\n }\n\n $customer->setValue(\"billing_first_name\",trim($data['fName']));\n Session::set('billing_first_name',trim($data['fName']));\n $customer->setValue(\"billing_last_name\",trim($data['lName']));\n Session::set('billing_last_name',trim($data['lName']));\n $customer->setValue(\"billing_phone\",trim($data['phone']));\n Session::set('billing_phone',trim($data['phone']));\n $address = array(\n \"address1\"=>trim($data['addr1']),\n \"address2\"=>trim($data['addr2']),\n \"city\"=>trim($data['city']),\n \"state_province\"=>trim($data['state']),\n \"postal_code\"=>trim($data['postal']),\n \"country\"=>trim($data['count']),\n );\n $customer->setValue(\"billing_address\",$address);\n Session::set('billing_address',$address);\n }", "public function woocommerce_checkout_update_customer_data( $update_customer_data, $checkout_object ) {\n\n\t\t$name = $_POST['address_book'];\n\t\t$user = wp_get_current_user();\n\t\t$address_book = $this->get_address_book( $user->ID );\n\t\t$update_customer_data = false;\n\t\t$ignore_shipping_address = true;\n\n\t\tif ( $_POST['ship_to_different_address'] ) {\n\t\t\t$ignore_shipping_address = false;\n\t\t}\n\n\t\t// Name new address and update address book.\n\t\tif ( ( 'add_new' === $name || ! isset( $name ) ) && false === $ignore_shipping_address ) {\n\n\t\t\t$address_names = $this->get_address_names( $user->ID );\n\n\t\t\t$name = $this->set_new_address_name( $address_names );\n\t\t}\n\n\t\tif ( false === $ignore_shipping_address ) {\n\t\t\t$this->update_address_names( $user->ID, $name );\n\t\t}\n\n\t\t// Billing address.\n\t\t$billing_address = array();\n\t\tif ( $checkout_object->checkout_fields['billing'] ) {\n\t\t\tforeach ( array_keys( $checkout_object->checkout_fields['billing'] ) as $field ) {\n\t\t\t\t$field_name = str_replace( 'billing_', '', $field );\n\n\t\t\t\t$billing_address[ $field_name ] = $checkout_object->get_posted_address_data( $field_name );\n\t\t\t}\n\t\t}\n\n\t\t// Shipping address.\n\t\t$shipping_address = array();\n\t\tif ( $checkout_object->checkout_fields['shipping'] ) {\n\t\t\tforeach ( array_keys( $checkout_object->checkout_fields['shipping'] ) as $field ) {\n\t\t\t\t$field_name = str_replace( 'shipping_', '', $field );\n\n\t\t\t\t// Prevent address book and label fields from being written to the DB.\n\t\t\t\tif ( 'address_book' === $field_name || 'address_label' === $field_name ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$shipping_address[ $field_name ] = $checkout_object->get_posted_address_data( $field_name, 'shipping' );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $billing_address as $key => $value ) {\n\t\t\tupdate_user_meta( $user->ID, 'billing_' . $key, $value );\n\t\t}\n\t\tif ( WC()->cart->needs_shipping() && false === $ignore_shipping_address ) {\n\t\t\tforeach ( $shipping_address as $key => $value ) {\n\t\t\t\tupdate_user_meta( $user->ID, $name . '_' . $key, $value );\n\t\t\t}\n\t\t}\n\n\t\treturn $update_customer_data;\n\t}", "protected function setCustomerFromAccountOrUser(): self\n {\n return $this->setCustomer($this->getCustomerFromAccountOrUser());\n }", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "function customers_init(&$options, $memberInfo, &$args){\n\n\t\treturn TRUE;\n\t}", "public function storeCustomerData($obj){\n if($obj){\n Customer::create(array(\n 'name' => $obj-> name,\n 'address' => $obj-> address,\n 'checked' => $obj-> checked,\n 'description' => $obj-> description,\n 'interest' => $obj-> interest,\n 'date_of_birth' => $obj-> date_of_birth,\n 'email' => $obj-> email,\n 'account' => $obj-> account,\n 'credit_card' => $this->storeCreditCard($obj-> credit_card) \n ));\n }\n \n }", "public function setCustomers($val)\n {\n $this->_propDict[\"customers\"] = $val;\n return $this;\n }", "public function customer()\n {\n \n // Sustomer is stil step 0\n $this->set_step(0);\n\n\n\n // You are logged in, you dont have access here\n if($this->current_user)\n {\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n }\n\n\n\n // Check to see if a field is available\n if( $this->input->post('customer') )\n {\n\n $input = $this->input->post();\n switch($input['customer'])\n {\n case 'register':\n $this->session->set_userdata('nitrocart_redirect_to', NC_ROUTE .'/checkout/billing');\n redirect('users/register');\n break;\n case 'guest':\n $this->session->set_userdata('user_id', 0);\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n break;\n default:\n break;\n }\n //more like an system error!\n $this->session->set_flashdata( JSONStatus::Error , 'Invalid selection');\n redirect( NC_ROUTE . '/checkout');\n }\n\n $this->set_step(0);\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('User Account')\n ->build( $this->theme_layout_path . 'customer');\n }", "public function setCustomerID($customer_id)\n {\n $this->customer_id = $customer_id;\n }", "protected function _getCustomer()\n {\n return Mage::registry('current_customer');\n }", "public function __construct(Customer $customer)\n {\n $this->customer = $customer;\n }", "public function __construct(Customer $customer)\n {\n $this->customer = $customer;\n }", "protected function _getCustomer()\n {\n $customer = parent::_getCustomer();\n\n $data = $this->getRequest()->getPost();\n \n \t$addressData = array ('postcode'=>$data['zipcode']);\n\t\t\n\t\t$address = Mage::getModel('customer/address');\n \t\t\n \t\t$address->addData($addressData);\n\t\t\n\t\t$customer->addAddress($address);\n\n $zipcodezone = Mage::getModel('zipcodezone/zipcodezone')->getCollection()\n ->addFieldToFilter('start', array('lteq' => $data['zipcode']))\n ->addFieldToFilter('end', array('gteq' => $data['zipcode']))\n ->getFirstItem();\n\n $customer->setZipcodezone($zipcodezone->getId());\n\n return $customer;\n }", "public function setCustomerId($id);", "function updateCustomerInfo() {\n\n $stmt = $GLOBALS['con']->prepare(\"UPDATE customerInfo SET first_name=?, last_name=?, street_address=?, zip=?, city=?, us_state=?, phone=?, email=?, preferred_contact=? WHERE id=?\");\n $stmt->bind_param(\"ssssssssss\", $firstName, $lastName, $address, $zipCode, $city, $state, $phone, $email, $preferredContact, $uid);\n\n // Get all customer information from POST \n // form request via escaping/validating function call\n $uid = validateInput('uid', 'post');\n $firstName = validateInput('firstName', 'post');\n $lastName = validateInput('lastName', 'post');\n $address = validateInput('address', 'post');\n $zipCode = validateInput('zipCode', 'post');\n $city = validateInput('city', 'post');\n $state = validateInput('state', 'post');\n $phone = validateInput('phone', 'post');\n $email = validateInput('email', 'post');\n $preferredContact = validateInput('preferredContact', 'post');\n \n $stmt->execute();\n $stmt->close(); \n }", "public function UseCustomer ($customer_id) {\n\t\t$this->Param('customer_id',$customer_id);\n\n\t\treturn true;\n\t}", "public function UseCustomer ($customer_id) {\n\t\t$this->Param('customer_id',$customer_id);\n\n\t\treturn true;\n\t}", "protected function _prepareCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->getCustomerSession()->getCustomer();\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n }\n\n if ($shipping && !$shipping->getSameAsBilling()\n && (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())\n ) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n }\n\n if (isset($customerBilling) && !$customer->getDefaultBilling()) {\n $customerBilling->setIsDefaultBilling(true);\n }\n\n if ($shipping && isset($customerShipping) && !$customer->getDefaultShipping()) {\n $customerShipping->setIsDefaultShipping(true);\n } else if (isset($customerBilling) && !$customer->getDefaultShipping()) {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n $quote->setCustomer($customer);\n }", "function setCustomeruuid($customer_uuid)\n {\n $this->customer_uuid = $customer_uuid;\n }", "protected function _prepareCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->getCustomerSession()->getCustomer();\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n }\n if ($shipping && !$shipping->getSameAsBilling() &&\n (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n }\n\n if (isset($customerBilling) && !$customer->getDefaultBilling()) {\n $customerBilling->setIsDefaultBilling(true);\n }\n if ($shipping && isset($customerShipping) && !$customer->getDefaultShipping()) {\n $customerShipping->setIsDefaultShipping(true);\n } else if (isset($customerBilling) && !$customer->getDefaultShipping()) {\n $customerBilling->setIsDefaultShipping(true);\n }\n $quote->setCustomer($customer);\n }", "public function _setCustomerQuote()\n {\n // Retrieve a valid quote\n if ($quote = $this->_retrieveQuote()) {\n\n // Verify that the customer is a valid customer of the quote\n $this->_verifyCustomerForQuote($quote);\n /* Set the session quote if required.\n Needs to be done after verifying the current customer */\n if ($this->_getCheckoutSession()->getQuoteId() != $quote->getId()) {\n $this->_logger->debug(__(\"Setting quote to current session\"));\n // Set the quote in the current object\n $this->_setQuote($quote);\n // Set the quote in the session\n $this->_getCheckoutSession()->setQuoteId($quote->getId());\n }\n // Make sure the qoute is active\n $this->_activateQuote($quote);\n } else {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__(\"Could not retrieve the quote\"));\n }\n }", "public function updateCustomerAddressAction() {\n if(!Mage::app()->getRequest()->isAjax()){\n $this->norouteAction();\n exit;\n }\n\n $postData = $this->getRequest()->getPost();\n parse_str($postData['form'], $billing);\n\n $customer = $this->_getCustomer();\n\n $address = new Varien_Object();\n $address->addData(\n array(\n 'state' => $billing['state'],\n 'city' => $billing['city'],\n 'street' => $billing['street'],\n 'zip_code' => $billing['zipcode'],\n 'firstname' => $billing['firstname'],\n 'lastname' => $billing['lastname'],\n 'telephone' => $billing['telephone'],\n 'phone_number' => $billing['telephone'],\n 'country_code' => $billing['country_id'],\n )\n );\n\n $response = Mage::getModel(\"payments/api\")->updateBilling($customer->getId(), $address);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('token' => $response)));\n }", "public static function saveCustomer($data) {\n $objCustomer = new Customer();\n $objCustomer->setFirstname($data['firstname']);\n $objCustomer->setLastname($data[\"lastname\"]);\n $objCustomer->setEmail($data[\"email\"]);\n $objCustomer->setTelephone($data[\"telephone\"]);\n $objCustomer->setFax($data[\"fax\"]);\n $objCustomer->setPassword($data[\"password\"]);\n $objCustomer->setStoreId(1);\n $objCustomer->setSalt(\"\");\n $objCustomer->setCart(\"\");\n $objCustomer->setWishlist(\"\");\n $objCustomer->setNewsletter(0);\n $objCustomer->setAddressId(0);\n $objCustomer->setCustomerGroupId(1);\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus(1);\n $objCustomer->setApproved(1);\n $objCustomer->setToken(\"\");\n $objCustomer->setDateAdded(date(\"Y-m-d H;i:s\"));\n\n $customerResult = $objCustomer->save(); // Save customer information\n\n $customerId = $objCustomer->getCustomerId();\n if($customerResult['success']){\n $objCustomerAddress = new CustomerAddress();\n $objCustomerAddress->setCustomerId($customerId);\n $objCustomerAddress->setFirstname($data[\"firstname\"]);\n $objCustomerAddress->setLastname($data[\"lastname\"]);\n $objCustomerAddress->setCompanyId($data[\"company\"]);\n $objCustomerAddress->setAddress1($data[\"address_1\"]);\n $objCustomerAddress->setAddress2($data[\"address_2\"]);\n $objCustomerAddress->setCity($data[\"city\"]);\n $objCustomerAddress->setPostcode($data[\"postcode\"]);\n $objCustomerAddress->setCountryId($data[\"country\"]);\n $objCustomerAddress->setZoneId($data[\"zone_id\"]);\n $objCustomerAddress->setTaxId(0);\n\n $result = $objCustomerAddress->save();// Save Customer Address information\n\n $addressId = $objCustomerAddress->getAddressId();\n\n $customerInfoObj = Customer::loadById($customerId);\n $objCustomer = new Customer();\n $objCustomer->setCustomerId($customerId);\n $objCustomer->setFirstname($customerInfoObj->getFirstname());\n $objCustomer->setLastname($customerInfoObj->getLastname());\n $objCustomer->setEmail($customerInfoObj->getEmail());\n $objCustomer->setTelephone($customerInfoObj->getTelephone());\n $objCustomer->setFax($customerInfoObj->getFax());\n $objCustomer->setPassword($customerInfoObj->getPassword());\n $objCustomer->setStoreId($customerInfoObj->getStoreId());\n $objCustomer->setSalt($customerInfoObj->getSalt());\n $objCustomer->setCart($customerInfoObj->getCart());\n $objCustomer->setWishlist($customerInfoObj->getWishlist());\n $objCustomer->setNewsletter($customerInfoObj->getNewsletter());\n $objCustomer->setAddressId($addressId);\n $objCustomer->setCustomerGroupId($customerInfoObj->getCustomerGroupId());\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus($customerInfoObj->getStatus());\n $objCustomer->setApproved($customerInfoObj->getApproved());\n $objCustomer->setToken($customerInfoObj->getToken());\n $objCustomer->setDateAdded($customerInfoObj->getDateAdded());\n\n return $objCustomer->save(); // Save customer information\n }\n }", "function set_customer_id($blog_id, $customer_id) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_stripe_customers WHERE blog_id = %d\", $blog_id) );\t\t\t\t\t\t\t\t\t\n\t\tif ( $exists ) {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET customer_id = %s WHERE blog_id = %d\", $customer_id, $blog_id) );\t\t\t\t\t\t\t\n\t\t} else {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO {$wpdb->base_prefix}pro_sites_stripe_customers(blog_id, customer_id) VALUES (%d, %s)\", $blog_id, $customer_id) );\t\t\t\t\t\t\t\n\t\t}\n\t}", "function\tsetCustomerOfferNo( $_myCustomerOfferNo) {\n\t\tFDbg::begin( 1, basename( __FILE__), __CLASS__, __METHOD__.\"( '$_myCustomerOfferNo')\") ;\n\t\t$this->CustomerOfferNo\t=\t$_myCustomerOfferNo ;\n\t\tif ( strlen( $_myCustomerOfferNo) > 0) {\n\t\t\t$this->reload() ;\n\t\t}\n\t\tFDbg::end() ;\n\t}", "public function setCustomerAddress($customerAddress = '') {\n $address = array(\n 'x_address'=>$this->truncateChars($customerAddress, 60),\n );\n $this->NVP = array_merge($this->NVP, $address); \n }", "public function setCustomerPhone($customerPhone = '000-000-0000') {\n $phone = array(\n 'x_phone'=>$this->truncateChars($this->cleanPhoneNumber($customerPhone), 25),\n );\n $this->NVP = array_merge($this->NVP, $phone); \n }", "public function init()\r\n\t\t{\r\n\t\t\tif ($this->_mAction == 'add_cust')\r\n\t\t\t{\r\n\t\t\t\t$customer_firstname = $_POST['customer_first_name'];\r\n\t\t\t\t$customer_surname = $_POST['customer_surname'];\r\n\t\t\t\t$customer_email = $_POST['customer_email'];\r\n\t\t\t\t$customer_password = $_POST['customer_password'];\r\n\t\t\t\t$customer_address_line_one = $_POST['customer_address_line_one'];\r\n\t\t\t\t$customer_town = $_POST['customer_town'];\r\n\t\t\t\t$customer_city = $_POST['customer_city'];\r\n\t\t\t\t$customer_county = $_POST['customer_county'];\r\n\t\t\t\t$customer_postcode = $_POST['customer_postcode'];\r\n\t\t\t\t$customer_telephone = $_POST['customer_telephone'];\r\n\t\t\t\t\r\n\t\t\t\tif ($customer_firstname == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'First name is empty';\r\n\t\t\t\tif ($customer_surname == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'Surname is empty';\r\n\t\t\t\tif ($customer_email == null || !preg_match(\"/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][_\\.0-9a-zA-Z-]*)$/i\",$customer_email))\r\n\t\t\t\t\t$this->mErrorMessage = 'Please correct the email address';\r\n\t\t\t\tif ($customer_password == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'Password is empty';\r\n\t\t\t\tif ($customer_address_line_one == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'Street Address is empty';\r\n\t\t\t\tif ($customer_town == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'Town is empty';\r\n\t\t\t\tif ($customer_city == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'City is empty';\r\n\t\t\t\tif ($customer_county == null)\r\n\t\t\t\t\t$this->mErrorMessage = 'County is empty';\r\n\t\t\t\tif ($customer_postcode == null || strlen($customer_postcode) > 8)\r\n\t\t\t\t\t$this->mErrorMessage = 'Please correct the post code';\r\n\t\t\t\tif ($customer_telephone == null || strlen($customer_telephone) > 11)\r\n\t\t\t\t\t$this->mErrorMessage = 'Please correct the telephone number';\r\n\t\t\t\r\n\t\t\t\tif ($this->mErrorMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\trequire_once BUSINESS_DIR . 'password_hasher.php';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$hashed_password = PasswordHasher::Hash($customer_password);\r\n\t\t\t\t\t\r\n\t\t\t\t\tCustomer::AddCustomer($customer_firstname, $customer_surname,\r\n\t\t\t\t\t\t\t\t\t\t$customer_email, $hashed_password, $customer_password,\r\n\t\t\t\t\t\t\t\t\t\t$customer_address_line_one, $customer_town,\r\n\t\t\t\t\t\t\t\t\t\t$customer_city, $customer_county,\r\n\t\t\t\t\t\t\t\t\t\t$customer_postcode, $customer_telephone);\r\n\t\t\t\t\t\r\n\t\t\t\t\theader('Location: ' . htmlspecialchars_decode(\r\n\t\t\t\t\t$this->mLinkToCustomersAdmin));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// If we want to see a customers details\r\n\t\t\tif ($this->_mAction == 'edit_cust')\r\n\t\t\t{\r\n\t\t\t\theader('Location: ' . htmlspecialchars_decode(\r\n\t\t\t\t\tLink::ToCustomerAdmin($this->_mActionedCustomerID)));\r\n\t\t\t\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t\t$this->mCustomers = Customer::GetCustomersList();\r\n\t\t\t$this->mCustomersCount = count($this->mCustomers);\r\n\t\t}", "protected function _moduleExportCustomerInit($data)\n\t{\n\t\tif (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Export_Customers)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->template->assign('modalTitle', 'Export Customers to ' . $this->_module->GetName());\n\t\t$this->template->assign('module', $this->_module);\n\t\t$this->template->assign('lists', $this->_module->getLists());\n\t\t$this->template->assign('typePlural', 'Customers');\n\t\t$this->template->assign('typeSingular', 'Customer');\n\n\t\t$user = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUser();\n\t\t$this->template->assign('useremail', $user['useremail']);\n\n\t\t$this->template->display('emailintegration.moduleexport.tpl');\n\t}", "public static function getCustomerInfo() {\n\t\t\tif (isset(self::$customer['user'])) {\n\t\t\t\treturn self::$customer['user'];\n\t\t\t}\n\t\t\treturn NULL;\n\t\t}", "private function setCustomerAddressData(&$AfterPayRequestParams, $basket)\n {\n $shippingAddressId = $basket->customerShippingAddressId ?? $basket->customerInvoiceAddressId;\n\n if (!is_null($shippingAddressId))\n {\n if ($shippingAddressId == -99)\n {\n $shippingAddressId = $basket->customerInvoiceAddressId;\n }\n\n if (!is_null($shippingAddressId))\n {\n $AfterPayRequestParams['customer']['address'] = $this->getAddressById($basket->customerInvoiceAddressId);\n }\n if (!is_null($shippingAddressId) && $shippingAddressId != $basket->customerInvoiceAddressId)\n {\n\n /** @var \\Plenty\\Modules\\Frontend\\Services\\AccountService $plentyAccountService */\n $plentyAccountService = pluginApp(\\Plenty\\Modules\\Frontend\\Services\\AccountService::class);\n $customer = $plentyAccountService->getAccountContactId();\n $AfterPayRequestParams['deliveryCustomer'] = $this->setCustomerData($customer, $basket);\n $AfterPayRequestParams['deliveryCustomer']['address'] = $this->getAddressById($shippingAddressId);\n\n }\n }\n }", "public function setCustomerEmail($customer_email){\n $this->customer_email = $customer_email;\n }", "public function syncCustomers()\n { \n \n $last_customer = Customer::orderBy(\"id\", \"desc\")->get()->take(1)->first();\n if($last_customer) {\n $last_customer_id = $last_customer->customerid;\n } else {\n $last_customer_id = 449367507001;\n }\n $get_url = \"https://f79e3def682b671af1591e83c38ce094:[email protected]/admin/customers.json?since_id=$last_customer_id&limit=250\"; //449367507001\n \n $contents = file_get_contents($get_url);\n \n $shopify_customers = json_decode($contents);\n \n foreach ($shopify_customers->customers as $key => $shopify_customer) {\n \n $customer = Customer::find($shopify_customer->id);\n \n if(!$customer){\n $customer = new Customer;\n }\n \n $customer->customerid = $shopify_customer->id;\n $customer->email = rtrim($shopify_customer->email);\n $customer->first_name = rtrim($shopify_customer->first_name);\n $customer->last_name = rtrim($shopify_customer->last_name);\n $customer->created_at = $shopify_customer->created_at;\n $customer->updated_at = $shopify_customer->updated_at;\n $customer->orders_count = $shopify_customer->orders_count;\n $customer->total_spent = $shopify_customer->total_spent;\n \n if (!empty($shopify_customer->default_address->phone)) {\n $customer->phone = $shopify_customer->default_address->phone;\n }\n \n $customer->admin_graphql_api_id = $shopify_customer->admin_graphql_api_id;\n \n $customer->save();\n }\n \n echo 'Done !';\n }", "private function populateCustomerReference(Customer $customer)\n {\n $customerReference = NostoCustomerManager::getCustomerReference($customer);\n if (!empty($customerReference)) {\n $this->setCustomerReference($customerReference);\n } else {\n $customerReference = NostoCustomerManager::generateCustomerReference($customer);\n NostoCustomerManager::saveCustomerReference($customer, $customerReference);\n $this->setCustomerReference($customerReference);\n }\n }", "public function setCustomerPhone($customer_phone){\n $this->customer_phone = $customer_phone;\n }", "public function customer($customer_id, &$data){\n if(!$this->that->config->get('koraki_registered'))\n return;\n\n if(empty($customer_id)){\n return;\n }\n\n $this->that->load->model('account/customer');\n\n $customer = $this->that->model_account_customer->getCustomer($customer_id);\n\n $this->that->load->model('localisation/country');\n\n $country_info = $this->that->model_localisation_country->getCountry($data['country_id']);\n\n $variables = array(\n \"fname\" => $customer['firstname'],\n \"lname\" => $customer['lastname'],\n \"city\" => $data['city'],\n \"country\" => $country_info['name'],\n \"country_code\" => $country_info['iso_code_2']\n );\n\n $location_array = array();\n array_push($location_array, $data['city']);\n array_push($location_array, $country_info['name']);\n $location = $data['city'] ? join(\", \", $location_array) : $country_info['name'];\n $location_verb = (empty($data['country_id']) && empty($data[0]['city'])) ? \"\" : \" from \" . $location;\n\n\n if(isset($customer) && $customer['newsletter']) {\n $post = array(\n \"variables\" => json_encode($variables),\n \"notificationText\" => empty($customer['firstname'])?\"Someone\" : $customer['firstname'] . $location_verb . \" registered as a user\",\n \"location\" => $location\n );\n\n $this->post($post);\n }\n }", "public function setPayerInfo($data=null) {\n if(!is_array($data)) {\n $p = $this->getPayment();\n $b = $this->getBilling();\n $data = array(\n 'EMAIL' => $p['email']\n );\n // 'COUNTRYCODE' => $b['country']\n }\n $this->_payerInfo = $data;\n }", "function add_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$vals = array(\n\t\t\t'NULL',\n\t\t\t$this->preorderID,\n\t\t\tmysql_real_escape_string($this->customerinfo['fname']),\n\t\t\tmysql_real_escape_string($this->customerinfo['lname']),\n\t\t\t$this->customerinfo['amountdown'],\n\t\t\tNO\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorder_customers VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "public function getCustomers()\n {\n\t\t$customers = $this->ShopifyClient->call('GET','/admin/customers.json',$this->config);\t\t\n\t\t$arra = array();\n\t\tif(!empty($customers['customers']))\n\t\t{\n\t\t\t$keyArr = array('id','email','accepts_marketing','first_name','last_name','orders_count','state','total_spent','last_order_id','note',\n\t\t\t\t\t\t\t'verified_email','multipass_identifier','tax_exempt','tags','last_order_name','addresses');\n\t\t\t$shopifyKeyArr = array('id','email','accepts_marketing','first_name','last_name','orders_count','state','total_spent','last_order_id','note',\n\t\t\t\t\t\t\t'verified_email','multipass_identifier','tax_exempt','tags','last_order_name','addresses');\n\t\t\t\n\t\t\tforeach($customers as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\tif(!empty($val['default_address'])){\n\t\t\t\t\t\tarray_push($keyArr, 'default_address');\n\t\t\t\t\t\tarray_push($shopifyKeyArr, 'default_address');\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404;\n\t\t$message = 'Customers not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$customers = $this->getJsonDataFormat($arra,$status_code,$message);\t\n\t\treturn $customers;\n }", "public function getCustomerName(){\n return $this->customer_name;\n }", "public function __construct(Customer $customer)\n {\n $this->user = $customer;\n }", "public function form_is_available_to_update_customers()\n {\n\n }", "public function createOrUpdateCustomer($customer_id, $json_data)\n {\n $customer = $this->getCustomerById($customer_id);\n if (property_exists($customer,'detail')) {\n # To create\n $customer_data = $this->createCustomer($json_data);\n } else {\n # To update\n $customer_data = $this->updateCustomer($customer_id,$json_data);\n }\n }", "public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \"&nbsp;by&nbsp;\" . $this->userName;\n\t}", "public function setCustomerName($customerName){\n return $this->setData(self::CUSTOMER_NAME, $customerName);\n }", "public function cbc_customer_profile() {\n \n\t\t\ttry {\n\t\t\t set_time_limit(0);\n\t\t\t\t$ch_active = $this->Session->read('Auth.Customer.ch_active');\n\t\t\t\tif($ch_active =='' || $ch_active =='null'){\n\t\t\t\t\n\t\t\t\t} elseif ($ch_active =='STSTY05') {\n\t\t\t\t\t\n\t\t\t\t\t$this->redirect('editprofile');\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t$this->redirect('view');\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif (isset($this->data) && !empty($this->data)) {\n\t\t\t\t\n\t\t\t\t\t$setValidates = array('vc_company', 'vc_first_name', 'vc_surname', 'vc_cont_per', 'vc_address1', 'vc_address2', \n\t\t\t\t\t'vc_address3', 'vc_tel_no', 'vc_fax_no', 'vc_mobile_no','vc_alter_email',\n\t\t\t\t\t'vc_alter_phone_no','vc_alter_cont_person');\n\t\t\t\t\t$setValidatesDocUpd = array('vc_upload_doc_name');\n\n\t\t\t\t\t$vc_comp_code = $this->Session->read('Auth.Member.vc_comp_code');\n \n\t\t\t\t\t$vc_user_no = $this->Session->read('Auth.Member.vc_user_no');\n \n\t\t\t\t $vc_customer_no = $this->Session->read('Auth.Member.vc_username');\n\n $vc_email_id = $this->Session->read('Auth.Member.vc_email_id');\n \n\t\t\t\t\t$this->data['Customer']['nu_cust_vehicle_card_id'] = $this->Customer->getPrimaryKey();\n\t\t\t\t\t\n\t\t\t\t\t$this->data['DocumentUploadCbc']['nu_cust_vehicle_card_id'] = $this->data['Customer']['nu_cust_vehicle_card_id'];\n\t\t\t\n\t\t\t\t\t$this->data['DocumentUploadCbc']['nu_upload_id'] = $this->DocumentUploadCbc->getPrimaryKey();\n \n\t\t\t\t\t$this->data['Customer']['vc_cust_no'] = $vc_customer_no;\n \n\t\t\t\t\t$this->data['Customer']['vc_comp_code'] = $vc_comp_code;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['Customer']['vc_username'] = $vc_customer_no;\n\t\t\t\t\t\n\t\t\t\t\t//\t$this->data['Customer']['nu_account_balance'] = 0;\n\t\t\t\t\t\n\t\t\t\t\t$this->data['Customer']['vc_email'] = $vc_email_id;\n \n\t\t\t\t\t$this->data['Customer']['vc_user_no'] = $vc_user_no;\n \n\t\t\t\t\t$this->data['Customer']['dt_created'] = date('Y-m-d H:i:s');\n \n\t\t\t\t\t$this->data['Customer']['ch_active'] = 'STSTY03';\n\t\t\t\t\t\n\t\t\t\t\t$this->DocumentUploadCbc->create(false);\n\n\t\t\t\t\t$this->DocumentUploadCbc->set($this->data['DocumentUploadCbc']);\n\n $this->Customer->create(false);\n\t\t\t\t\t\n $this->Customer->set($this->data['Customer']); \n\n $this->unsetValidateVariable($setValidates, array_keys($this->Customer->validate), &$this->Customer);\n\n\t\t\t\t\t$saveData['Member']['dt_user_modified'] = date('Y-m-d H:i:s');\n\t\t\t\t\t\n $saveData['Member']['vc_cbc_customer_no'] = $vc_customer_no;\n\t\t\t\t\t\n $saveData['Member']['vc_user_no'] = $vc_user_no;\n\t\t\t\t\t\n if ($this->Customer->validates(array('fieldList' => $setValidates)) &&\n\t\t\t\t\t$this->DocumentUploadCbc->validates(array('fieldList' => $setValidatesDocUpd))) {\n\t\t\t\t\t\n\t\t\t\t\t\t$vc_alter_email = $this->data['Customer']['vc_alter_email'];\n\t\t\t\t\t\t\n $this->Member->validate = null;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$file = $this->data['DocumentUploadCbc']['vc_upload_doc_name'];\n\n\t\t\t\t\t\t$filename = $file['name'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($filename!='')\n\t\t\t\t\t\t$filename = $this->renameUploadFile($filename);\n\n\t\t\t\t\t\t$dir = WWW_ROOT. \"uploadfile\" . DS .$vc_customer_no. DS. \"Application Form\";\n\n\t\t\t\t\t\tif (!file_exists($dir)) {\n\n\t\t\t\t\t\t\tmkdir($dir, 0777, true);\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t@$insertData['DocumentUploadCbc'] = array(\n\t\t\t\t\t\t\t\t\t'vc_user_no' => $vc_user_no,\n\t\t\t\t\t\t\t\t\t'vc_comp_code' => $vc_comp_code,\n\t\t\t\t\t\t\t\t\t'vc_cust_no' => $vc_customer_no,\n\t\t\t\t\t\t\t\t\t'vc_upload_doc_for' => $this->globalParameterarray['DOCUPLOAD01'],\n\t\t\t\t\t\t\t\t\t'vc_upload_doc_name' => trim($filename),\n\t\t\t\t\t\t\t\t\t'dt_date_uploaded' => date('d-M-Y'),\n\t\t\t\t\t\t\t\t\t'vc_upload_doc_path' => $dir\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(move_uploaded_file($file[\"tmp_name\"], $dir . DS . $filename) == true){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($this->Customer->save($this->data['Customer']) && $this->Member->save($saveData) && $this->DocumentUploadCbc->save($insertData)) {\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/***************** Email Shoot to customer ******************/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tlist( $selectedType, $type, $selectList ) = $this->getRFATypeDetail($this->Session->read('Auth.Member.vc_comp_code'));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->from = $this->AdminName . '<' . $this->AdminEmailID . '>';\n\n\t\t\t\t\t\t\t\t$this->Email->to = trim($this->Session->read('Auth.Member.vc_email_id'));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->bcc = array(trim($this->AdminCbcEmailID));\n\n\t\t\t\t\t\t\t\t$this->Email->subject = strtoupper($selectedType) . \" Account Add \";\n\n\t\t\t\t\t\t\t\t$this->Email->template = 'registration';\n\n\t\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\n\t\t\t\t\t\t\t\t$this->set('name', ucfirst(trim($this->Session->read('Auth.Member.vc_user_firstname'))) . ' ' . ucfirst(trim($this->Session->read('Auth.Member.vc_user_lastname'))));\n\n\t\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\n\t\t\t\t\t\t\t\t$mesage = \" Request to activate your account has been received, please wait for approval !!\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> <br> Username : \".trim($this->Session->read('Auth.Member.vc_username'));\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t//$mesage .= \"<br> <br>RFA Account No. : \".trim($this->Session->read('Auth.Member.vc_cbc_customer_no'));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->send($mesage);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->to = array();\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->bcc = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/***************** Email Shoot at alternative email id *****************/\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(isset($vc_alter_email) && !empty($vc_alter_email)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tlist( $selectedType, $type, $selectList ) = $this->getRFATypeDetail($this->Session->read('Auth.Member.vc_comp_code'));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->from = $this->AdminName . '<' . $this->AdminEmailID . '>';\n\n\t\t\t\t\t\t\t\t$this->Email->to = trim($vc_alter_email);\n\n\t\t\t\t\t\t\t\t$this->Email->subject = strtoupper($selectedType) . \" Account Add \";\n\n\t\t\t\t\t\t\t\t$this->Email->template = 'registration';\n\n\t\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\n\t\t\t\t\t\t\t\t$this->set('name', ucfirst(trim($this->Session->read('Auth.Member.vc_user_firstname'))) . ' ' . ucfirst(trim($this->Session->read('Auth.Member.vc_user_lastname'))));\n\n\t\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\n\t\t\t\t\t\t\t\t$mesage = \" Request to activate your account has been received, please wait for approval !!\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> <br> Username : \".trim($this->Session->read('Auth.Member.vc_username'));\n\t\t\t\t\n\t\t\t\t\t\t\t\t$this->Email->send($mesage);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/****************** Email Send To Admin *********************/\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* $this->Email->from = ucfirst(trim($this->Session->read('Auth.Member.vc_user_firstname'))) . ' ' . ucfirst(trim($this->Session->read('Auth.Member.vc_user_lastname'))) . '<' . trim($this->Session->read('Auth.Member.vc_email_id')) . '>';\n\n\t\t\t\t\t\t\t\t$this->Email->to = trim($this->AdminEmailID);\n\n\t\t\t\t\t\t\t\t$this->Email->subject = strtoupper($selectedType) . \" Account Add \";\n\n\t\t\t\t\t\t\t\t$this->Email->template = 'registration';\n\n\t\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\n\t\t\t\t\t\t\t\t$this->set('name', $this->AdminName);\n\n\t\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\n\t\t\t\t\t\t\t\t$mesage = strtoupper($selectedType) . \" Customer Profile Activation Request\";; \n\n\t\t\t\t\t\t\t\t$this->Email->send($mesage); */\n\n \n\t\t\t\t\t\t\t\t/*********************************************/\n\n\t\t\t\t\t\t\t\t$this->data = null;\n\n\t\t\t\t\t\t\t\t$this->Session->write('Auth.Member.vc_cbc_customer_no', $vc_customer_no);\n\n\t\t\t\t\t\t\t\t$this->Session->setFlash('Your account has been created successfully, pending for approval from RFA !!', 'success');\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->redirect('view');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->setFlash(\"File not uploaded successfully !!\",'error');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->set('data',$this->data);\n\n\t\t\t\t\t\t\t$this->redirect('view');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n }\n\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n } // end of post\n\t\t\t\t\n } catch (Exception $e) {\n\n\t\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\n\t\t\t\texit;\n\t\t\t}\n }", "public function loadByCustomer(Mage_Customer_Model_Customer $customer) {\n $this->setSavedCustomerId($customer->getEntityId());\n $this->setSavedCustomerEmail($customer->getEmail());\n return parent::loadByCustomer($customer);\n }", "protected function _validateCustomerData(array $data)\n {\n /** @var $customerForm Mage_Customer_Model_Form */\n $customerForm = Mage::getModel('customer/form');\n $customerForm->setFormCode('checkout_register')\n ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax());\n\n $quote = $this->getQuote();\n if ($quote->getCustomerId()) {\n $customer = $quote->getCustomer();\n $customerForm->setEntity($customer);\n $customerData = $quote->getCustomer()->getData();\n } else {\n /* @var $customer Mage_Customer_Model_Customer */\n $customer = Mage::getModel('customer/customer');\n $customerForm->setEntity($customer);\n $customerRequest = $customerForm->prepareRequest($data);\n $customerData = $customerForm->extractData($customerRequest);\n }\n\n $customerErrors = $customerForm->validateData($customerData);\n if ($customerErrors !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $customerErrors)));\n }\n\n if ($quote->getCustomerId()) {\n return $this;\n }\n\n $customerForm->compactData($customerData);\n\n // Spoof customer password\n $password = $customer->generatePassword();\n $customer->setPassword($password);\n $customer->setPasswordConfirmation($password);\n $customer->setConfirmation($password);\n // set NOT LOGGED IN group id explicitly,\n // otherwise copyFieldset('customer_account', 'to_quote') will fill it with default group id value\n $customer->setGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);\n\n $result = $customer->validate();\n if (true !== $result && is_array($result)) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $result)));\n }\n\n if ($quote->getCheckoutMethod() == self::METHOD_REGISTER) {\n // save customer encrypted password in quote\n $quote->setPasswordHash($customer->encryptPassword($customer->getPassword()));\n }\n\n // copy customer/guest email to address\n $quote->getBillingAddress()->setEmail($customer->getEmail());\n\n // copy customer data to quote\n Mage::helper('core')->copyFieldset('customer_account', 'to_quote', $customer, $quote);\n\n return $this;\n }", "public function setCustomerIdAttribute($input)\n {\n $this->attributes['customer_id'] = $input ? $input : null;\n }", "public function setCustomerIdAttribute($input)\n {\n $this->attributes['customer_id'] = $input ? $input : null;\n }", "public function testGetCustomer()\n {\n $customerData = $this->getMockBuilder(\\Magento\\Customer\\Api\\Data\\CustomerInterface::class)\n ->getMockForAbstractClass();\n $this->customerSession->expects($this->once())->method('getCustomerId')->will($this->returnValue(1));\n $this->customerRepository\n ->expects($this->once())\n ->method('getById')\n ->with(1)\n ->will($this->returnValue($customerData));\n\n $customer = $this->block->getCustomer();\n $this->assertSame($customerData, $customer);\n }", "public function setCustomer( $customer ) {\r\n\t\t$this->_customer = $customer;\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function cs_wc_save_extra_register_fields( $customer_id ) {\r\n if ( isset( $_POST['billing_first_name'] ) ) {\r\n // WordPress default first name field.\r\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n // WooCommerce billing first name.\r\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) ) {\r\n // WordPress default last name field.\r\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n // WooCommerce billing last name.\r\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n }\r\n}", "function set_woo_customer_meta( $user_id = 0, $user_args = array() ) {\n\n\t// Bail without our pieces.\n\tif ( empty( $user_id ) ) {\n\t\treturn false;\n\t}\n\n\t// Set the default args.\n\t$default_args = array(\n\t\t'billing_address_1' => $user_args['street-name'],\n\t\t'billing_city' => $user_args['city'],\n\t\t'billing_country' => 'US',\n\t\t'billing_email' => $user_args['email-address'],\n\t\t'billing_first_name' => $user_args['first-name'],\n\t\t'billing_last_name' => $user_args['last-name'],\n\t\t'billing_phone' => $user_args['phone'],\n\t\t'billing_postcode' => $user_args['zipcode'],\n\t\t'billing_state' => $user_args['state'],\n\t\t'shipping_address_1' => $user_args['street-name'],\n\t\t'shipping_city' => $user_args['city'],\n\t\t'shipping_country' => 'US',\n\t\t'shipping_first_name' => $user_args['first-name'],\n\t\t'shipping_last_name' => $user_args['last-name'],\n\t\t'shipping_postcode' => $user_args['zipcode'],\n\t\t'shipping_state' => $user_args['state'],\n\t);\n\n\t// Filter the available meta args we pass.\n\t$filtered_args = apply_filters( Core\\HOOK_PREFIX . 'generate_customer_meta_args', array(), $user_id );\n\n\t// Set my product args.\n\t$customer_args = wp_parse_args( $filtered_args, $default_args );\n\n\t// Update our keys.\n\tforeach ( $customer_args as $meta_key => $meta_value ) {\n\t\tupdate_user_meta( $user_id, $meta_key, $meta_value );\n\t}\n\n\t// And that's it.\n\tdo_action( Core\\HOOK_PREFIX . 'after_customer_meta_generated', $user_id, $user_args );\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 }", "private function addCustomerData($options)\n {\n $this->post['email'] = $options['email'];\n $this->post['ip_address'] = $options['ip'];\n }", "private function _expressCheckout()\r\n\t{\r\n\t\t/* We need to double-check that the token provided by PayPal is the one expected */\r\n\t\t$result = $this->paypal_usa->postToPayPal('GetExpressCheckoutDetails', '&TOKEN='.urlencode(Tools::getValue('token')));\r\n\t\tif ((strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING') && $result['TOKEN'] == Tools::getValue('token') && $result['PAYERID'] == Tools::getValue('PayerID'))\r\n\t\t{\r\n\t\t\t/* Checks if a customer already exists for this e-mail address */\r\n\t\t\tif (Validate::isEmail($result['EMAIL']))\r\n\t\t\t{\r\n\t\t\t\t$customer = new Customer();\r\n\t\t\t\t$customer->getByEmail($result['EMAIL']);\r\n\t\t\t}\r\n\r\n\t\t\t/* If the customer does not exist yet, create a new one */\r\n\t\t\tif (!Validate::isLoadedObject($customer))\r\n\t\t\t{\r\n\t\t\t\t$customer = new Customer();\r\n\t\t\t\t$customer->email = $result['EMAIL'];\r\n\t\t\t\t$customer->firstname = $result['FIRSTNAME'];\r\n\t\t\t\t$customer->lastname = $result['LASTNAME'];\r\n\t\t\t\t$customer->passwd = Tools::encrypt(Tools::passwdGen());\r\n\t\t\t\t$customer->add();\r\n\t\t\t}\r\n\r\n\t\t\t/* Look for an existing PayPal address for this customer */\r\n\t\t\t$addresses = $customer->getAddresses((int)Configuration::get('PS_LANG_DEFAULT'));\r\n\t\t\tforeach ($addresses as $address)\r\n\t\t\t\tif ($address['alias'] == 'PayPal')\r\n\t\t\t\t{\r\n\t\t\t\t\t$id_address = (int)$address['id_address'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t/* Create or update a PayPal address for this customer */\r\n\t\t\t$address = new Address(isset($id_address) ? (int)$id_address : 0);\r\n\t\t\t$address->id_customer = (int)$customer->id;\r\n\t\t\t$address->id_country = (int)Country::getByIso($result['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE']);\r\n\t\t\t$address->id_state = (int)State::getIdByIso($result['PAYMENTREQUEST_0_SHIPTOSTATE'], (int)$address->id_country);\r\n\t\t\t$address->alias = 'PayPal';\r\n\t\t\t$address->lastname = substr($result['PAYMENTREQUEST_0_SHIPTONAME'], 0, strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '));\r\n\t\t\t$address->firstname = substr($result['PAYMENTREQUEST_0_SHIPTONAME'], strpos($result['PAYMENTREQUEST_0_SHIPTONAME'], ' '), strlen($result['PAYMENTREQUEST_0_SHIPTONAME']) - strlen($address->lastname));\r\n\t\t\t$address->address1 = $result['PAYMENTREQUEST_0_SHIPTOSTREET'];\r\n\t\t\tif ($result['PAYMENTREQUEST_0_SHIPTOSTREET2'] != '')\r\n\t\t\t\t$address->address2 = $result['PAYMENTREQUEST_0_SHIPTOSTREET2'];\r\n\t\t\t$address->city = $result['PAYMENTREQUEST_0_SHIPTOCITY'];\r\n\t\t\t$address->postcode = $result['PAYMENTREQUEST_0_SHIPTOZIP'];\r\n\t\t\t$address->save();\r\n\r\n\t\t\t/* Update the cart billing and delivery addresses */\r\n\t\t\t$this->context->cart->id_address_delivery = (int)$address->id;\r\n\t\t\t$this->context->cart->id_address_invoice = (int)$address->id;\r\n\t\t\t$this->context->cart->update();\r\n\r\n\t\t\t/* Update the customer cookie to simulate a logged-in session */\r\n\t\t\t$this->context->cookie->id_customer = (int)$customer->id;\r\n\t\t\t$this->context->cookie->customer_lastname = $customer->lastname;\r\n\t\t\t$this->context->cookie->customer_firstname = $customer->firstname;\r\n\t\t\t$this->context->cookie->passwd = $customer->passwd;\r\n\t\t\t$this->context->cookie->email = $customer->email;\r\n\t\t\t$this->context->cookie->is_guest = $customer->isGuest();\r\n\t\t\t$this->context->cookie->logged = 1;\r\n\r\n\t\t\t/* Save the Payer ID and Checkout token for later use (during the payment step/page) */\r\n\t\t\t$this->context->cookie->paypal_express_checkout_token = $result['TOKEN'];\r\n\t\t\t$this->context->cookie->paypal_express_checkout_payer_id = $result['PAYERID'];\r\n\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tModule::hookExec('authentication');\r\n\t\t\telse\r\n\t\t\t\tHook::exec('authentication');\r\n\r\n\t\t\t/* Redirect the use to the \"Shipping\" step/page of the order process */\r\n\t\t\tTools::redirectLink($this->context->link->getPageLink('order.php', false, null, array('step' => '3')));\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t}\r\n\t}", "public function setCustomerCity($customerCity = '') {\n $city = array(\n 'x_city'=>$this->truncateChars($customerCity, 40),\n );\n $this->NVP = array_merge($this->NVP, $city); \n }", "public function getCustomer()\n {\n return $this->data->customer;\n }", "protected function loadCustomersData()\n {\n //Se recupera la informacion basica\n $attributes = ['customer_id', 'first_name', 'last_name', 'archived'];\n $data = Customer::orderBy('first_name')\n ->get($attributes);\n $customers = new Collection();\n\n //Ahora se recupera su estado\n foreach ($data as $record) {\n $customer = new stdClass();\n $customer->id = $record->customer_id;\n $customer->fullName = $record->first_name . ' ' . $record->last_name;\n $customer->archived = $record->archived == 0 ? false : true;\n\n //Recupero los creditos y abonos para calcular las estadisticas\n $credits = $record->credits()->orderBy('credit_date')->get();\n $payments = $record->payments()->orderBy('payment_date')->get();\n\n $statistics = $this->getState($credits, $payments);\n\n $customer->balance = $statistics->balance;\n $customer->state = $statistics->state;\n $customer->lastCredit = $statistics->lastCredit;\n $customer->balanceColor = $statistics->balanceState;\n $customer->time = $statistics->paymentTime;\n\n $customers->push((array) $customer);\n }\n\n $this->customers = $customers;\n }", "public static function updateCustomerData($data)\n\t{\n\t\t$data = self::encode($data, self::$key, self::$cookie_lifetime);\n\t\t$url = '/updateCustomer.json';\n\t\t$query = array('customer_data' => $data);\n\n\t\treturn self::processQuery($url, $query);\n\t}", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function needsCustomerInput(): bool\n {\n return static::NEEDS_CUSTOMER_INPUT;\n }", "public function getCustomer();", "public function __construct(array $data)\n {\n $this->customer = $data;\n }", "public function update_customers(){\n\t\textract($this->security->xss_clean(html_escape(array_merge($this->data,$_POST))));\n\n\t\tif($q_id==1){\n\t\t\techo \"Sorry! This Record Restricted! Can't Update\";exit();\n\t\t}\n\n\t\t$state = (!empty($state)) ? $state : 'NULL';\n\n\t\t//Validate This customers already exist or not\n\t\t/*$query=$this->db->query(\"select * from db_customers where upper(customer_name)=upper('$customer_name') and id<>$q_id\");\n\t\tif($query->num_rows()>0){\n\t\t\treturn \"This Customers Name already Exist.\";\n\t\t\t\n\t\t}\n\t\telse{*/\n\t\t\t$query1=\"update db_customers set customer_name='$customer_name',mobile='$mobile',phone='$phone',\n\t\t\t\t\t\t\temail='$email',country_id='$country',state_id=$state,city='$city',\n\t\t\t\t\t\t\topening_balance='$opening_balance',\n\t\t\t\t\t\t\tpostcode='$postcode',address='$address',gstin='$gstin',tax_number='$tax_number'\n\t\t\t\t\t\t\t where id=$q_id\";\n\t\t\tif ($this->db->simple_query($query1)){\n\t\t\t\t\t$this->session->set_flashdata('success', 'Success!! Customer Updated Successfully!');\n\t\t\t return \"success\";\n\t\t\t}\n\t\t\telse{\n\t\t\t return \"failed\";\n\t\t\t}\n\t\t/*}*/\n\t}", "private function storeCustomer(CustomerRequest $request)\n {\n // set the address values and create\n $address_array = array_add(array_add($request->address, 'city_id', $request->city_id), 'location', $request->location);\n $address = Address::create($address_array);\n\n // set the customer values\n $customer_array = array_add(array_add($request->except('address', 'city_id', 'country_id', 'location'), 'address_id', $address->address_id), 'active', $request->has('active'));\n $customer =Customer::create($customer_array);\n }", "public function setCustomerCountry($customerCountry = '') {\n $country = array(\n 'x_country'=>$this->truncateChars($customerCountry, 60),\n );\n $this->NVP = array_merge($this->NVP, $country); \n }", "public function appendCustomerInfo(\\service\\message\\common\\KeyValueItem $value)\n {\n return $this->append(self::customer_info, $value);\n }", "public function customer_info( $customer_id ) {\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id );\r\n\t}", "public function editCustomerDetails($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->nonPci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'YourGeneralReference' => $data['generalRef'],\n\t\t\t\t'LastName' => $data['lastName'],\n\t\t\t\t'FirstName' => $data['firstName'],\n\t\t\t\t'AddressLine1' => $data['addressLine1'],\n\t\t\t\t'AddressLine2' => $data['addressLine2'],\n\t\t\t\t'AddressSuburb' => $data['suburb'],\n\t\t\t\t'AddressState' => $data['state'],\n\t\t\t\t'AddressPostCode' => $data['postCode'],\n\t\t\t\t'EmailAddress' => $data['email'],\n\t\t\t\t'MobilePhoneNumber' => $data['phone'],\n\t\t\t\t'ContractStartDate' => $data['startDate'],\n\t\t\t\t'SmsPaymentReminder' => $data['smsReminder'],\n\t\t\t\t'SmsFailedNotification' => $data['smsFailed'],\n\t\t\t\t'SmsExpiredCard' => $data['smsExpired'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $response = $soapclient->editCustomerDetails($params);\n\t}" ]
[ "0.6905321", "0.6870604", "0.66836905", "0.6630586", "0.6579301", "0.65119594", "0.6505587", "0.64687395", "0.64602566", "0.64214426", "0.64042366", "0.6400823", "0.6389692", "0.6386668", "0.63471854", "0.6262302", "0.6244591", "0.62252444", "0.6169727", "0.6167018", "0.6165343", "0.6146158", "0.61218494", "0.6121639", "0.6063044", "0.60376054", "0.6032771", "0.6032514", "0.6030669", "0.6020754", "0.6020754", "0.60060924", "0.59922415", "0.5991098", "0.5990136", "0.5986515", "0.59843653", "0.59754276", "0.59754276", "0.59447974", "0.59327155", "0.59295475", "0.5915741", "0.5915741", "0.5911559", "0.5894768", "0.58919007", "0.58903754", "0.58822864", "0.58686906", "0.5853358", "0.58404315", "0.58307236", "0.5830717", "0.5821145", "0.58194786", "0.5813803", "0.58069146", "0.5797716", "0.57804996", "0.5771555", "0.576992", "0.5765995", "0.5764499", "0.5761972", "0.5760644", "0.5759552", "0.57538813", "0.5746578", "0.5744964", "0.5743406", "0.57358545", "0.57269555", "0.5723626", "0.57218957", "0.57201225", "0.57201225", "0.5715159", "0.57113135", "0.5706928", "0.57064146", "0.5703038", "0.5686781", "0.5672819", "0.56727505", "0.5669104", "0.5668085", "0.56652987", "0.5663195", "0.5663195", "0.5663195", "0.5658099", "0.56493366", "0.56482136", "0.56472075", "0.5645864", "0.5637982", "0.5635687", "0.56299645", "0.56249285" ]
0.5958564
39
Adds the orgin address to the request
protected function _setOriginAddress($store=null) { $country = Mage::getStoreConfig('shipping/origin/country_id', $store); $zip = Mage::getStoreConfig('shipping/origin/postcode', $store); $regionId = Mage::getStoreConfig('shipping/origin/region_id', $store); $state = Mage::getModel('directory/region')->load($regionId)->getCode(); $city = Mage::getStoreConfig('shipping/origin/city', $store); $street = Mage::getStoreConfig('shipping/origin/street', $store); $address = $this->_newAddress($street, '', $city, $state, $zip, $country); return $this->_request->setOriginAddress($address); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }", "public function getXForwardedFor();", "public static function appendCustomAuthParams($request)\r\n {\r\n // TODO: Add your custom authentication here\r\n\t\t// The following properties are available to use\r\n\t\t// Configuration::$contentType\r\n\t\t// Configuration::$appId\r\n\t\t// Configuration::$appKey\r\n\t\t// \r\n\t\t// ie. Add a header through:\r\n\t\t// $request.headers(array(\"key\" => \"value\"));\r\n }", "public function addRestaurant($query = null){\n return $this->host.static::$url['addRestaurant'];\n }", "public function getRegistrationAuthorityServiceAddress();", "public function setXForwardedFor($xForwardedFor);", "private function request($request=null){\r\n\r\n if(is_null($request)){\r\n\r\n $this->request = request_uri();\r\n\r\n }else{\r\n\r\n $this->request = $request;\r\n\r\n }\r\n\r\n\r\n }", "public function addUserGeoDataToRequest($request)\n {\n // get geo data\n $geo = arrayToStdClassObject(GeoIP::getLocation('120.149.144.13'/*$request->ip*/));\n\n // EXAMPLE:\n // isoCode \"AU\"\n // country \"Australia\"\n // city \"South Yarra\"\n // state \"VIC\"\n // postal_code \"3141\"\n // lat -37.8333\n // lon 144.9833\n // timezone \"Australia/Melbourne\"\n // continent \"OC\"\n\n // did we get valid data (true == false)\n $isValidData = ($geo->default)? false: true;\n\n // set request param\n foreach ($geo as $key => $value)\n $request->{$key} = ($isValidData)? $value : null;\n\n return $request;\n }", "public function addAddress($address);", "public function requestUri() {}", "public function addAddress()\n\t{\n\t\treturn $this->editAddress();\n\t}", "protected function authenticate(Request $request)\n {\n $email = $request->input('username');\n $password = $request->input('password');\n $request->request->add([\n 'username' => $email,\n 'password' => $password,\n 'grant_type' => 'password',\n 'client_id' => env('CLIENT_SECRET', ''),\n 'client_secret' => env('CLIENT_SECRET', ''),\n 'scope' => '*'\n ]);\n\n $proxy = Request::create(\n 'oauth/token',\n 'POST'\n );\n\n return Route::dispatch($proxy);\n // return Route::dispatch($tokenRequest)->getContent();\n }", "public function handlePreflightRequest(Request $request);", "public function storeCodeRequestURI() {\n update_option(self::CODE_REDIRECT_URI_OPTION_NAME, $this->getRedirectUri());\n }", "public function generateAuthUrl(Request $request)\n {\n return $this->setCurrentBankInSession($request, 'monzo')->authorizer->generateAuthUrl('https://auth.monzo.com/');\n }", "function getAddUserUrl(){\n return assemble_url('people_company_user_add', array('company_id' => $this->getId())); \n }", "public function addRequest(Request $request);", "public function registerDestination($request);", "public function add_endpoint($name, $places, $query_var = \\true)\n {\n }", "function beforeroute(){\n }", "function beforeroute(){\n }", "public abstract function appendToRequest(&$requestBase, $requestObject);", "private function is_address_passed_by_URL() {\n if ( ! isset( $this->is_address_in_url ) ) {\n $this->is_address_in_url = $this->slplus->SmartOptions->url_allow_address->is_true && ! empty( $_REQUEST['address'] );\n }\n\n return $this->is_address_in_url;\n }", "abstract public function goAuth(Request $request);", "function setRequestUri($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_REQUEST_URI, $inParamValue);\n\t}", "function beforeroute() {\r\n \r\n }", "public function setUrl(string $request)\n {\n $this->isBaseUrlEmpty();\n\n $this->url = $this->baseUrl . $request;\n }", "protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }", "protected function setAuthority()\n {\n $authority = null;\n if (null !== $this->user_info) {\n $authority = $this->user_info.'@';\n }\n\n if (null !== $this->host) {\n $authority .= $this->host;\n }\n\n if (null !== $this->port) {\n $authority .= ':'.$this->port;\n }\n\n return $authority;\n }", "private function addEndpointToBaseUrl(string $path = null){\n $this->endpoint = (!empty($path)) ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : DIRECTORY_SEPARATOR;\n\n $urlParts = parse_url($this->requestUrl);\n if (empty($urlParts['path'])) {\n $urlParts['path'] = rtrim($this->endpoint, '?');\n } else {\n $urlParts['path'] = rtrim($urlParts['path'], '/') . rtrim($this->endpoint, '?');\n }\n $this->requestUrl = http_build_url($urlParts);\n return $this->requestUrl;\n }", "public function addAuthorization($uri) {\n\t\t$this->routes[$uri] = $uri;\n\t}", "function add_endpoint() {\n flush_rewrite_rules();\n $whitelist_roles = array('administrator');\n $user = wp_get_current_user();\n $user_role = (array) $user->roles;\n \n if (in_array($user_role[0], $whitelist_roles)) {\n add_rewrite_endpoint( 'add-products', EP_ROOT | EP_PAGES );\n }\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function getIdentityServiceAddress();", "public function addAddressParams()\n {\n $oUser = $this->getUser();\n if (!$oUser) {\n return;\n }\n $oRequest = $this->getPayPalRequest();\n\n $oRequest->setParameter(\"EMAIL\", $oUser->oxuser__oxusername->value);\n\n $sAddressId = $oUser->getSelectedAddressId();\n if ($sAddressId) {\n $oAddress = oxNew(\"oxAddress\");\n $oAddress->load($sAddressId);\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oAddress->oxaddress__oxfname->value . \" \" . $oAddress->oxaddress__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oAddress->oxaddress__oxstreet->value . \" \" . $oAddress->oxaddress__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oAddress->oxaddress__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oAddress->oxaddress__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oAddress->oxaddress__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oAddress->oxaddress__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oAddress->oxaddress__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oAddress->oxaddress__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n } else {\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oUser->oxuser__oxfname->value . \" \" . $oUser->oxuser__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oUser->oxuser__oxstreet->value . \" \" . $oUser->oxuser__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oUser->oxuser__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oUser->oxuser__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oUser->oxuser__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oUser->oxuser__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oUser->oxuser__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oUser->oxuser__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n }\n }", "public function authUrl(Request $request)\n {\n return redirect($this->generateAuthUrl($request));\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n $host = str_replace(config('base.domain'), '', $request->getHost());\n $host = $host=='www.'?'':$host;\n return route($host.'login.index');\n }\n }", "function getAddress() {\n\t\t\t// check for https\n\t\t\t$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';\n\t\t\t// return the full address\n\t\t\treturn $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];\n\t\t}", "public function urlAuthorize() {\n return $this->host . '/oauth/authorize';\n }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "abstract protected function buildSpecificRequestUri();", "public function addAuthToUri($uri)\n {\n if (false !== $pos = strpos($uri, self::BASE_URI)) {\n\n return substr_replace($uri, $this->getAuth().'@', $pos, 0);\n }\n throw new \\InvalidArgumentException('uri is not an Aircall API Uri');\n }", "public function addConnection(Request $request)\n { \n $Authenticated = User::where('email', $request->input('authenticated'))->first();\n $user = User::where('name', $request->input('newConnection'))->first();\n $Authenticated->addConnection($user);\n return 'connection requested';\n }", "public function setAddressAddition($addressAddition) {\n\t\t$this->addressAddition = $addressAddition;\n\t}", "abstract protected function auth_url();", "public function proxy(){\n $uri=$_SERVER[\"REQUEST_URI\"];\n $pos=strpos($uri, '/?');\n if ($pos === false){\n # We do not have a path to proxy to, so just return ip for manual handling\n die($this->storageData[\"data\"][\"ip\"]);\n }else{\n # There is something to proxy\n $uri_split = explode(\"/?\",$uri);\n $url = \"http://\".$this->storageData[\"data\"][\"ip\"].$uri_split[1];\n header(\"Location: $url\");\n }\n return true;\n }", "public function append_to_resend_to($address)\n\t{\n\t\t$this->resend_to_array[] = $address;\n\t}", "public function add_ip_binding($param){\n $input = array(\n 'command' => '/ip/hotspot/ip-binding/add'\n );\n $out = array_merge($input, $param);\n return $this->query($out);\n }", "public function setOriginRequest($request) {\n\t\t$this->originRequest = $request;\n\t\treturn $this;\n\t}", "public function setEnableOnBehalfRequestorsToAddAccess($val)\n {\n $this->_propDict[\"enableOnBehalfRequestorsToAddAccess\"] = $val;\n return $this;\n }", "public function getRequestUri() {}", "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 }", "public function isPreflightRequest(Request $request);", "public function to($addr, $add = false) {\r\n\t\t$this->addr($addr, 'to', $add);\r\n\t}", "public function getEnableOnBehalfRequestorsToAddAccess()\n {\n if (array_key_exists(\"enableOnBehalfRequestorsToAddAccess\", $this->_propDict)) {\n return $this->_propDict[\"enableOnBehalfRequestorsToAddAccess\"];\n } else {\n return null;\n }\n }", "public static function authority(&$object) {\n\t\t\t$str_arr = array($object->user);\n\t\t\tif (empty($object->user) == FALSE && empty($object->pass)) {\n\t\t\t\t$str_arr[] = '@';\n\t\t\t} elseif (!empty($object->user)) {\n\t\t\t\t$str_arr[] = ':'.$object->pass.'@';\n\t\t\t}\n\t\t\t$str_arr[] = $object->host;\n\t\t\tif (!empty($object->port)) {\n\t\t\t\t$str_arr[] = ':'.$object->port;\n\t\t\t}\n\t\t\t$object->authority = implode('', $str_arr);\n\t\t}", "protected function getUri()\n {\n $uri = $this->request['REQUEST_URI'];\n $prefix = config('router', 'base_uri');\n if (substr($uri, 0, strlen($prefix)) == $prefix) {\n $uri = substr($uri, strlen($prefix));\n }\n\n $this->uri = rtrim($uri, \"/\");\n }", "public function requestTarget()\n {\n if ($this->method() === 'CONNECT' || $this->mode() === 'authority') {\n $credential = $this->credential();\n return ($credential ? $credential. '@' : '') . $this->host();\n }\n if ($this->mode() === 'absolute') {\n return $this->url();\n }\n if ($this->mode() === 'asterisk') {\n return '*';\n }\n $query = $this->query() ? '?' . http_build_query($this->query()) : '';\n $fragment = $this->fragment();\n return $this->path() . $query . ($fragment ? '#' . $fragment : '');\n }", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "public function getAuthority()\n {\n $userInfo = $this->getUserInfo();\n $host = $this->getHost();\n $port = $this->getPort();\n $showPort = !$this->isStandardPort($port, $this->scheme);\n\n return ($userInfo ? $userInfo . '@' : '') . $host . ($port && $showPort ? ':' . $port : '');\n }", "public function handle(Request $request, Closure $next)\n {\n // the \"REMOTE_ADDR\" header. This has been an issue for a while (just google for \"docker REMOTE_ADDR\")\n // but a solution seems far off.\n // A possible solution is - given that docker adds their own network and the default gateway IP will always end with .1 - to just\n // add the specified REMOTE_ADDR as trusted if it matches our server address. In the default configuration the proxying nginx\n // runs on the same host so it's relatively safe to assume this is correct.\n $remoteAddr = $request->server->get('REMOTE_ADDR');\n $serverAddr = $request->server->get('SERVER_ADDR');\n if ($serverAddr && $remoteAddr) {\n $lastDot = strrpos($serverAddr, '.');\n if ($lastDot !== false && substr($remoteAddr, $lastDot) === '.1' && strpos($remoteAddr, substr($remoteAddr, 0, $lastDot+1)) === 0) {\n $this->proxies[] = $remoteAddr;\n }\n }\n\n return parent::handle($request, $next);\n }", "public function getIpAddress()\n {\n return $this->getRequest()->ip;\n }", "function set_SearchAddressFromRequest($currentVal) {\n if ($this->is_address_passed_by_URL() && empty($currentVal)) {\n return stripslashes_deep($_REQUEST['address']);\n }\n return $currentVal;\n }", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function originIpAddress() {\n\t\treturn $this->getOriginIpAddress();\n\t}", "public function index(Request $request)\n\t{\n\t\treturn NoobarAddress::authenticate($request->user())->get()->map([$this, 'addressDetail']);\n\t}", "public function loginUri(Request $request);", "public function add() {\n parent::add();\n \n if(!$this->request->is('restful')) {\n $this->set('title_for_layout', _txt('op.add-a', array($this->viewVars['vv_authenticator']['Authenticator']['description'])));\n }\n }", "public function getAuthority() {\n\n $val = '';\n\n if (!empty($this->getUserInfo())) {\n $val .= $this->getUserInfo() . '@';\n }\n $val .= $this->uriParts['host'] ?? '';\n\n if (!empty($this->uriParts['port'])) {\n $val .= ':' . $this->uriParts['port'];\n }\n return $val;\n }", "public function getClientAddress(): string {}", "public function addRecepientsToList(Request $request)\n\t{\n\t\t# code...\n\t\t$mgClient = new Mailgun(env('MAILGUN_SECRET'));\n\t\t$address = $request['address'];\n\t\t$member = $request['member'];\n//\t\t$member = substr($member, 1);\n\n\t\ttry {\n\t\t\t$mgClient->post(\"lists/$address/members\", array(\n\t\t\t\t'address' => $member,\n\t\t\t\t'suscribed' => true\n\t\t\t));\n\t\t\treturn ['status' => 'OK'];\n\t\t} catch (Exception $e) {\n\t\t\treturn ['status' => 'ERROR'];\n\t\t}\n\t}", "private function setUri(): void\n {\n $this->uri = strtok($_SERVER['REQUEST_URI'],'?');\n }", "public function add(Request $request)\n {\n // Sending data to view\n return response()->view('app.allow.mac_address.add');\n }", "public function onKernelRequest(RequestEvent $event)\r\n {\r\n //Recupere la router courant\r\n $currentRoute = $event->getRequest()->attributes->get('_route');\r\n $token = $this->authorizationChecker->getToken();\r\n $user = $token ? $token->getUser() : null;\r\n\r\n if ($user instanceof Employer || $user instanceof Client) {\r\n $role = in_array('ROLE_UNACTIVATED', $user->getRoles());\r\n $role2 = in_array('ROLE_BLOQUE', $user->getRoles());\r\n // Redirige vers soit le deconnecte activation force \r\n if ($role && !$this->isAuthenticatedUser($currentRoute)) {\r\n $event->setResponse(new RedirectResponse($this->router->generate('activationforce')));\r\n }\r\n if ($role2 && !$this->isAuthenticatedUserB($currentRoute) ) {\r\n $event->setResponse(new RedirectResponse($this->router->generate('bloquerforce')));\r\n }\r\n //Rediger vers le home si deja active\r\n if (!$role && !$role2 && $this->isConnectUser($currentRoute)) {\r\n $event->setResponse(new RedirectResponse($this->router->generate('home')));\r\n }\r\n }\r\n }", "protected function set_url_this_add($val){ $this->input ['add_url'] = $val ; }", "public function getAddress();", "public function getAddress();", "public function store(AddressRequest $request)\n {\n //\n $endereço = new Address($request->all());\n $this->authorize('isOwner', $endereço);\n\n $endereço->save();\n\n return redirect('/');\n }", "private static function canAccess($request, $address){\n $currentUser_Account = $request->user;\n $user = $address->get_user();\n return ($user != null && $currentUser_Account->getId() === $user->getId()) || User_Precondition::ownerRequired($request);\n }", "private function origins()\n {\n if(array_has($_SERVER, 'HTTP_ORIGIN')){\n foreach (config('cors.origins') as $origin) {\n if ($_SERVER['HTTP_ORIGIN'] == $origin) {\n header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n break;\n }\n }\n\n if(config('cors.origins') == ['*']){\n header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);\n }\n }\n\n\n if(!array_has($_SERVER, 'HTTP_ORIGIN') &&\n env('APP_ENV') != 'local' &&\n config('cors.local') != 'true' &&\n config('cors.internal') == false){\n\n abort(403);\n }\n }", "public function createNewAddressAction(Request $request)\r\n {\r\n $response = array(\r\n 'message' => 'You must be logged-in to create a new address',\r\n 'isSuccessful' => false,\r\n 'data' => array(),\r\n );\r\n \r\n $doctrine = $this->getDoctrine();\r\n $securityContext = $this->container->get('security.context');\r\n if (\r\n $securityContext->isGranted('IS_AUTHENTICATED_FULLY') ||\r\n $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')\r\n ) {\r\n\r\n $authenticatedUser = $this->get('security.token_storage')\r\n ->getToken()\r\n ->getUser();\r\n\r\n $unitNumber = $request->get('unitNumber', '');\r\n $buildingName = $request->get('buildingName', '');\r\n $streetNumber = $request->get('streetNumber', '');\r\n $subdivision = $request->get('subdivision', '');\r\n $zipCode = $request->get('zipCode', '');\r\n $addressTitle = $request->get('addressTitle', '');\r\n $streetName = $request->get('streetName', null);\r\n $locationId = $request->get('locationId', null);\r\n $latitude = $request->get('latitude', null);\r\n $longitude = $request->get('longitude', null);\r\n\r\n $em = $doctrine->getManager();\r\n $location = $this->getDoctrine()\r\n ->getRepository('YilinkerCoreBundle:Location')\r\n ->findOneBy(array(\r\n 'locationId' => $locationId,\r\n 'locationType' => LocationType::LOCATION_TYPE_BARANGAY,\r\n ));\r\n\r\n if ($location !== null) {\r\n\r\n $form = $this->createForm('core_user_address', null);\r\n\r\n $form->submit(array(\r\n 'unitNumber' => $unitNumber,\r\n 'buildingName' => $buildingName,\r\n 'streetNumber' => $streetNumber,\r\n 'streetName' => $streetName,\r\n 'subdivision' => $subdivision,\r\n 'zipCode' => $zipCode,\r\n 'title' => $addressTitle,\r\n 'latitude' => $latitude, \r\n 'longitude' => $longitude,\r\n ));\r\n\r\n if($form->isValid()){\r\n $address = new UserAddress();\r\n $address->setUnitNumber($unitNumber);\r\n $address->setBuildingName($buildingName);\r\n $address->setStreetNumber($streetNumber);\r\n $address->setStreetName($streetName);\r\n $address->setSubdivision($subdivision);\r\n $address->setTitle($addressTitle);\r\n $address->setZipCode($zipCode);\r\n if($latitude != null){\r\n $address->setLatitude(floatval($latitude));\r\n }\r\n if($longitude != null){\r\n $address->setLongitude(floatval($longitude));\r\n }\r\n\r\n $insertedAddress = $this->get('yilinker_core.service.user_address.user_address')\r\n ->addUserAddress($authenticatedUser, $address, $location);\r\n\r\n $response['message'] = \"Address successfuly created\";\r\n $response['isSuccessful'] = true;\r\n $response['data'] = $insertedAddress->toArray();\r\n $response['data']['locationTree'] = $insertedAddress->getLocation()->getLocalizedLocationTree(true);\r\n }\r\n else{\r\n $response['message'] = $form->getErrors(true)[0]->getMessage();\r\n }\r\n }\r\n else{\r\n $response['message'] = \"The city, province and barangay must be set\";\r\n }\r\n }\r\n \r\n return new JsonResponse($response);\r\n }", "public function add($request){\n\n }", "private function resolveOrigin()\n {\n $uri = 'http';\n\n if (getenv('HTTPS') === 'on') {\n $uri .= 's';\n }\n\n $uri .= '://';\n $uri .= getenv('HTTP_HOST').getenv('REQUEST_URI');\n\n return $uri;\n }", "function to( $address='' )\n\t{\n\t\tif (func_num_args() == 0)\n\t\t\treturn FALSE;\n\n\t\t$this->to = $this->parse_address_args( func_get_args() );\n\t\t\n\t\treturn TRUE;\n\t}", "public function getUserAddress(Request $request)\n {\n $session_key =Crypt::decryptString($request->header('sessionKey'));\n $user =WxUser::where('session_key',$session_key)->first();\n if($user==null){\n return json_encode( ['msg'=>'USER_DOES_NOTE_EXIST','code'=>'20001']);\n }else{\n return $user->getAddress->tojson();\n }\n }", "function request_uri() {\n\t\tif(isset($_SERVER['argv'])) {\n\t\t\t$protocol = 'cli';\n\t\t\t$host = gethostname();\n\t\t\t$path = '/' . $_SERVER['SCRIPT_FILENAME'];\n\t\t\tif(count($_SERVER['argv']) > 1) {\n\t\t\t\tunset($_SERVER['argv'][0]);\n\t\t\t\t$query_string = '?' . http_build_query($_SERVER['argv']);\n\t\t\t} else {\n\t\t\t\t$query_string = '';\n\t\t\t}\n\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t} else {\n\t\t\tif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {\n\t\t\t\t$protocol = 'https';\n\t\t\t} else {\n\t\t\t\t$protocol = 'http';\n\t\t\t}\n\t\t\t$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';\n\t\t\t$path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';\n\t\t\t$query_string = isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? ('?' . $_SERVER['QUERY_STRING']) : '';\n\t\t\treturn $protocol . '://' . $host . $path . $query_string;\n\t\t}\n\t}", "public function onCreateRequest(Event $event)\n {\n $data = $event->toArray();\n\n /** @var $request Request */\n $request = $data['request'];\n $request->setAuth($this->username, $this->password);\n }", "function spectra_address_addowner ($owner, $address)\n\t{\n\t\t$prep = $GLOBALS[\"db\"][\"obj\"]->prepare (\"UPDATE `\".$GLOBALS[\"tables\"][\"ledger\"].\"` SET `owner` = ? where `address` = ?\");\n\t\t\n\t\tif (!$prep)\n\t\t{\n\t\t\techo \"Unable To Prepare Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$bound = $prep->bind_param (\"ss\", $owner, $address);\n\t\t\n\t\tif (!$bound)\n\t\t{\n\t\t\techo \"Unable To Bind Parameters (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$response = $prep->execute ();\n\t\t\n\t\tif ($GLOBALS[\"db\"][\"obj\"]->errno > 0)\n\t\t{\n\t\t\techo \"Unable To Execute Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "function base_request(Request $request, $key) {\r\n if($this->needs_auth($key)) {\r\n echo 'needs auth';\r\n session(['return_url' => $request->fullUrl()]);\r\n session()->save();\r\n\r\n if(phpsaaswrapper()->authorize($key) !== true) {\r\n $cookie = cookie('eon_referrer', $request->fullUrl(), 45000);\r\n return redirect(phpsaaswrapper()->authorize($key))->withCookie($cookie);\r\n }\r\n\r\n dd(phpsaaswrapper()->authorize($key));\r\n } else {\r\n // consume service\r\n\r\n return phpsaaswrapper()->display_api_uses($key);\r\n }\r\n }", "public function getAddress() {}", "function custom_rules_is_during_oauth(){\n\treturn (\n\t\t// on oauth route itself\n\t\targ(0) == 'oauth2' ||\n\t\t// or logging in using the form\n\t\t( isset( $_GET['destination'] ) &&\n\t\t stripos( $_GET['destination'], 'oauth2' ) !== FALSE )\n\t);\n}", "public function __construct() {\n $this->redirectTo = config('lyra.routes.web.prefix');\n parent::__construct();\n }", "public function adress(Request $request)\n {\n if($request->query->get('adress') === '12 chemin vert') {\n //return une reponse en utilisant la class Response\n return new Response('12 chemin vert');\n }else{\n //jeredirige vers la page /firstName.\n return $this->redirectToRoute('firstName_index');\n }\n }", "public function getFullRequestUri() {\n return $GLOBALS['base_url'] . request_uri();\n }", "public function addRequest($request)\n\t{\n\t $request->tutor_id=$this->id;\n\t return $request->save();\n\t}", "public function attach(HttpRequest $request) {}", "public static function setUri(string $uri): void {\r\n $_SERVER['REQUEST_URI'] = $uri;\r\n }", "public function setRequest()\n\t{\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('scheme', $this->symfony_request->getScheme());\n\n\t\t/** http://localhost/molajo/index.php returns 'http' */\n\t\t$this->set('is_secure', $this->symfony_request->isSecure());\n\n\t\t/** http://localhost:99/molajo/index.php retursn http:://localhost:99 (non-standard port) */\n\t\t$this->set('host', $this->symfony_request->headers->get('host'));\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_path', $this->symfony_request->getBasePath());\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo' */\n\t\t$this->set('base_url', $this->symfony_request->getBaseURL());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t/** http://localhost/molajo/index.php return http:://localhost */\n\t\t/** http://localhost/molajo:88/index.php return http:://localhost:88 */\n\t\t$this->set('http_host', $this->symfony_request->getHttpHost());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('request_uri', $this->symfony_request->getRequestUri());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('uri', $this->symfony_request->getUri());\n\n\t\t/** POST: Create GET: Read PUT: Update, DELETE: Delete */\n\t\t/** Many browsers do not support PUT or DELETE, $_SERVER['REQUEST_METHOD] supplements */\n\t\t$this->set('method', $this->symfony_request->getMethod());\n\n\t\t/** http://localhost/molajo/index.php returns 80 */\n\t\t$this->set('port', $this->symfony_request->getPort());\n\n\t\t$this->set('path_info', $this->symfony_request->getPathInfo());\n\n\t\t$this->set('query_string', $this->symfony_request->getQueryString());\n\n\t\tif ($this->symfony_request->getQueryString() == '') {\n\t\t\t$tempQueryParameters = array();\n\t\t} else {\n\t\t\t$tempQueryParameters = explode('&', $this->get('query_string'));\n\t\t}\n\n\t\t$query_parameters = array();\n\t\tif (count($tempQueryParameters) > 0) {\n\t\t\tforeach ($tempQueryParameters as $item) {\n\t\t\t\t$pair = explode('=', $item);\n\t\t\t\t$query_parameters[$pair[0]] = $pair[1];\n\t\t\t}\n\t\t}\n\t\t$this->set('query_parameters', $query_parameters);\n\n\t\t/** http://localhost/molajo/index.php returns '/molajo/index.php' */\n\t\t$this->set('base_url_path', $this->get('http_host') . $this->get('base_url')\n\t\t);\n\n\t\t/** http://localhost/molajo/index.php returns 'http://molajo/index.php' */\n\t\t$this->set('base_url_path_with_scheme',\n\t\t\t$this->get('scheme')\n\t\t\t\t. '://'\n\t\t\t\t. $this->get('http_host')\n\t\t\t\t. $this->get('base_url')\n\t\t);\n\n\t\t$this->set('ajax', $this->symfony_request->isXmlHttpRequest());\n\n\t\t$this->set('request_format', $this->symfony_request->getRequestFormat());\n\n\t\t$this->set('mime_type', $this->symfony_request->getMimeType($this->get('request_format')));\n\n\t\t$this->set('format', $this->symfony_request->getFormat($this->get('mime_type')));\n\n\t\t$this->set('content_type', $this->symfony_request->getContentType());\n\n\t\t/** Client */\n\t\t$this->set('client_ip', $this->symfony_request->getClientIp());\n\n\t\t/** Server */\n\t\t$this->set('user', $this->symfony_request->getUser());\n\n\t\t$this->set('password', $this->symfony_request->getPassword());\n\n\t\t$this->set('document_root', $this->symfony_request->server->get('DOCUMENT_ROOT'));\n\n\t\t$this->set('entry_point', $this->symfony_request->server->get('SCRIPT_FILENAME'));\n\n\t\t/** Language */\n\n\t\treturn true;\n\t}", "public function redirectTo()\n {\n return config('tenancy.client_url');\n }", "public function addwhitelistip() \n\t{\n\t\tUserModel::authentication();\n\t\t\n\t\tSecurityModel::add_ip_whitelist();\n }", "public function getAuthorizationUrl(ServerRequest $request);" ]
[ "0.5244849", "0.49339786", "0.48759738", "0.4861124", "0.48173746", "0.48070815", "0.47894713", "0.473459", "0.4728076", "0.4725611", "0.47071716", "0.46815178", "0.4676219", "0.46611896", "0.46460056", "0.46135435", "0.46059147", "0.4588351", "0.45841473", "0.45628965", "0.45628965", "0.45591465", "0.45569384", "0.45478112", "0.45438477", "0.45405704", "0.4522931", "0.45195597", "0.45165914", "0.45124063", "0.4506844", "0.45045277", "0.4499236", "0.44847086", "0.44842872", "0.44833922", "0.44762635", "0.44668812", "0.44592735", "0.44416982", "0.4441594", "0.44276902", "0.44216937", "0.4412448", "0.44104326", "0.4404553", "0.43965405", "0.4371912", "0.43707722", "0.43665457", "0.43651828", "0.43651214", "0.43646145", "0.43571973", "0.43532386", "0.43472958", "0.43470722", "0.4343985", "0.43418765", "0.43406248", "0.43360993", "0.4331151", "0.4325829", "0.4315846", "0.43141076", "0.43140683", "0.43105462", "0.43073055", "0.43069094", "0.4300133", "0.4297217", "0.42900515", "0.42815423", "0.42716062", "0.4264871", "0.42487067", "0.42487067", "0.4247307", "0.42456582", "0.42436564", "0.42427728", "0.42399523", "0.42330292", "0.4232788", "0.42318144", "0.42313594", "0.4227393", "0.4222947", "0.42145988", "0.42143142", "0.42138773", "0.42131156", "0.4212136", "0.4206804", "0.42046404", "0.4204343", "0.42024943", "0.42000967", "0.4199739", "0.41983888", "0.41948378" ]
0.0
-1
Adds the shipping address to the request
protected function _setDestinationAddress($address) { //$shippingAddress = $quote->getShippingAddress(); //$street = $address->getStreet(); $street = array(); $street1 = isset($street[0]) ? $street[0] : null; $street2 = isset($street[1]) ? $street[1] : null; $city = $address->getCity(); $zip = preg_replace('/[^0-9\-]*/', '', $address->getPostcode()); $state = Mage::getModel('directory/region')->load($address->getRegionId())->getCode(); $country = $address->getCountry(); if(($city && $state) || $zip) { $address = $this->_newAddress($street1, $street2, $city, $state, $zip, $country); return $this->_request->setDestinationAddress($address); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }", "public function addAddressParams()\n {\n $oUser = $this->getUser();\n if (!$oUser) {\n return;\n }\n $oRequest = $this->getPayPalRequest();\n\n $oRequest->setParameter(\"EMAIL\", $oUser->oxuser__oxusername->value);\n\n $sAddressId = $oUser->getSelectedAddressId();\n if ($sAddressId) {\n $oAddress = oxNew(\"oxAddress\");\n $oAddress->load($sAddressId);\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oAddress->oxaddress__oxfname->value . \" \" . $oAddress->oxaddress__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oAddress->oxaddress__oxstreet->value . \" \" . $oAddress->oxaddress__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oAddress->oxaddress__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oAddress->oxaddress__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oAddress->oxaddress__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oAddress->oxaddress__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oAddress->oxaddress__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oAddress->oxaddress__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n } else {\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oUser->oxuser__oxfname->value . \" \" . $oUser->oxuser__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oUser->oxuser__oxstreet->value . \" \" . $oUser->oxuser__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oUser->oxuser__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oUser->oxuser__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oUser->oxuser__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oUser->oxuser__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oUser->oxuser__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oUser->oxuser__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n }\n }", "public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }", "public function setShippingAddress($shippingAddress = '') {\n $address = array(\n 'x_ship_to_address'=>$this->truncateChars($shippingAddress, 60),\n );\n $this->NVP = array_merge($this->NVP, $address); \n }", "public function shipping_address() {\n if(is_null($this->shipping_address)){\n $this->shipping_address = new Address($this->shipping_address_id);\n }\n return $this->shipping_address;\n }", "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 save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}", "public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }", "public function addShippingAddress($shiptoname, $shiptostreet, $shiptocity, $shiptostate, $shiptozip, $shiptocountrycode, $shiptophonenum = null)\n\t{\n\t\t$address = func_get_args();\n\n\t\t// Validate fields\n\t\tif (strlen($shiptoname) > 32) throw new PayPalException('Shipping address name cannot exceed 32 characters!');\n\t\tif (strlen($shiptostreet) > 200) throw new PayPalException('Shipping street address cannot exceed 200 characters!');\n\t\telse if (strlen($shiptostreet) > 100) {\n\t\t\t$words = explode(\" \", $shiptostreet);\n\t\t\t$address['shiptostreet'] = \"\";\n\t\t\twhile(strlen($address['shiptostreet']) < 100 && $words) $address['shiptostreet'] += array_shift($words) . \" \";\n\t\t\tif ($words) $address['shiptostreet2'] = implode(\" \", $words);\n\t\t}\n\t\tif (strlen($shiptocity) > 40) throw new PayPalException('Shipping address city cannot exceed 40 characters!');\n\t\tif (strlen($shiptozip) > 20) throw new PayPalException('Shipping address postal code/ZIP cannot exceed 20 characters!');\n\t\tif (strlen($shiptocountrycode) > 2) throw new PayPalException('Shipping address country must be a 2 character code!');\n\t\tif ($shiptophonenum && strlen($shiptophonenum) > 20) throw new PayPalException('Shipping address phone number cannot exceed 20 characters!');\n\t\telse if (is_null($shiptophonenum)) unset($address['shiptophonenum']);\n\n\t\t$this->_payment_fields = array_merge($this->_payment_fields, compact('shiptoname', 'shiptostreet', 'shiptocity', 'shiptostate', 'shiptozip', 'shiptocountrycode', 'shiptophonenum'));\n\t\t$this->addroverride = 1;\n\t}", "function ShipToAddress()\r\n\t{\r\n\t\r\n\t}", "public function setShipToAddress($data=null) {\n if(!is_array($data)) {\n $s = $this->getShipping();\n $data = array(\n 'SHIPTONAME' => $s['firstName'] . ' ' . $s['lastName'],\n 'SHIPTOSTREET' => $s['address'],\n 'SHIPTOSTREET2' => $s['address2'],\n 'SHIPTOCITY' => $s['city'],\n 'SHIPTOSTATE' => $s['state'],\n 'SHIPTOCOUNTRYCODE' => $s['country'],\n 'SHIPTOZIP' => $s['zip']\n );\n }\n $this->_payerShipToAddress = $data;\n }", "public function store(CreateShippingAddressRequests $request)\n {\n try {\n $userId = Auth::id();\n $shipping = ShippingAddress::create([\n 'user_id' => $userId,\n 'address' => $request->address,\n 'is_default' => ShippingAddress::ADDRESS,\n ]);\n return $this->successResponse($shipping->load('user'), Response::HTTP_OK);\n } catch (Exception $e) {\n return $this->errorResponse(trans('errors.create_fail'), Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n }", "public function needs_shipping_address() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping_address', true === $this->needs_shipping() && ! wc_ship_to_billing_address_only() );\n\t}", "public function saveShippingAction() {\n\t\tif ($this->getRequest ()->isPost ()) {\n\t\t\t$preAddr = Mage::getSingleton ( 'customer/session' )->getPreaddress ();\n\t\t\t\n\t\t\tif ($preAddr) {\n\t\t\t\t$data = array ();\n\t\t\t\tif (! empty ( $preAddr ['ShippingAddress'] [0] )) {\n\t\t\t\t\t$preData = $preAddr ['ShippingAddress'];\n\t\t\t\t} else {\n\t\t\t\t\t$preData = $preAddr;\n\t\t\t\t}\n\t\t\t\t$dataId = $this->getRequest ()->getPost ( 'addressid' );\n\t\t\t\t\n\t\t\t\t$mpData = Mage::getModel ( 'masterpass/masterpass' );\n\t\t\t\tforeach ( $preData as $value ) {\n\t\t\t\t\tif ($dataId == $value ['AddressId']) {\n\t\t\t\t\t\t$reecipientName = $value ['RecipientName'];\n\t\t\t\t\t\t$name = Mage::helper ( 'masterpass' )->getRecipienName ( $reecipientName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line2'] )) {\n\t\t\t\t\t\t\t$lin2 = $value ['Line2'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin2 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line3'] )) {\n\t\t\t\t\t\t\t$lin3 = $value ['Line3'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin3 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$regionIdS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->statesMapping ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$regionS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->getMasterpassRegion ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$shippingPhone = $mpData->getRemoveDash ( Mage::helper ( 'masterpass' )->checkMasterpassData ( $value ['RecipientPhoneNumber'] ) );\n\t\t\t\t\t\t$data = array (\n\t\t\t\t\t\t\t\t'firstname' => $name [0],\n\t\t\t\t\t\t\t\t'lastname' => $name [1],\n\t\t\t\t\t\t\t\t'street' => array (\n\t\t\t\t\t\t\t\t\t\t0 => $value ['Line1'],\n\t\t\t\t\t\t\t\t\t\t1 => $lin2,\n\t\t\t\t\t\t\t\t\t\t2 => $lin3 \n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'city' => $value ['City'],\n\t\t\t\t\t\t\t\t'region_id' => $regionIdS,\n\t\t\t\t\t\t\t\t'region' => $regionS,\n\t\t\t\t\t\t\t\t'postcode' => $value ['PostalCode'],\n\t\t\t\t\t\t\t\t'country_id' => $value ['Country'],\n\t\t\t\t\t\t\t\t'telephone' => $shippingPhone \n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$customerAddressId = $this->getRequest ()->getPost ( 'shipping_address_id', false );\n\t\t\t\t$this->getOnepage ()->saveShipping ( $data, $customerAddressId );\n\t\t\t}\n\t\t}\n\t\t$this->loadLayout ( false );\n\t\t$this->renderLayout ();\n\t}", "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 }", "function useMemberShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = false;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}", "protected function processShippingAddress()\n {\n $this->updateStreetFields($this->addressFields['children']['street'], 'shippingAddress');\n\n if(false === $this->configResolver->getUseRegions()){\n unset($this->addressFields['children']['region']['filterBy']);\n unset($this->addressFields['children']['region_id']);\n }\n\n foreach ($this->fieldsConfig as $fieldName => $config) {\n $field = &$this->addressFields['children'][$fieldName];\n $this->configureField($field, 'shippingAddress', $config);\n }\n }", "protected function _addShipping($address)\n {\n $lineNumber = $this->_getNewLineCode();\n $storeId = $address->getQuote()->getStore()->getId();\n $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);\n $shippingAmount = max(\n 0.0, (float) $address->getBaseShippingAmount()\n );\n\n if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {\n $shippingAmount -= (float)$address->getBaseShippingDiscountAmount();\n }\n\n $line = $this->_getNewDocumentRequestLineObject();\n $line->setLineCode($lineNumber);\n $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);\n $line->setItemCode($shippingSku ?: self::DEFAULT_SHIPPING_ITEMS_SKU);\n $line->setItemDescription(self::DEFAULT_SHIPPING_ITEMS_DESCRIPTION);\n $line->setAvalaraGoodsAndServicesType($taxClass);\n $line->setNumberOfItems(1);\n $line->setlineAmount($shippingAmount);\n $discounted = (float)$address->getBaseShippingDiscountAmount()\n && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId) ? 'true' : 'false';\n $line->setDiscounted($discounted);\n\n if ($this->_getTaxDataHelper()->shippingPriceIncludesTax($storeId)) {\n $line->setTaxIncluded('true');\n }\n\n $this->_lines[$lineNumber] = $line;\n $this->_setLinesToRequest();\n $this->_lineToLineId[$lineNumber] = $shippingSku;\n\n return $lineNumber;\n }", "private function _addShippingElement($order)\n {\n $shippingAddress = $order->addChild('shippingAddress');\n $this->_addAddressElement(\n $shippingAddress,\n $this->shippingAddress['firstName'],\n $this->shippingAddress['lastName'],\n $this->shippingAddress['street'],\n $this->shippingAddress['postalCode'],\n $this->shippingAddress['city'],\n $this->shippingAddress['countryCode']\n );\n }", "function useDifferentShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = true;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}", "public function getAddressShipping()\n {\n return $this->addressShipping;\n }", "public function add_delivery_address(){\n $save_data['customer_id'] = $_REQUEST['customer_id'];\n $save_data['address_title'] = $_REQUEST['address_title'];\n $save_data['address'] = $_REQUEST['address'];\n $save_data['country_id'] = $_REQUEST['country_id'];\n $save_data['state_id'] = $_REQUEST['state_id'];\n $save_data['city_id'] = $_REQUEST['city_id'];\n $save_data['pincode'] = $_REQUEST['pincode'];\n\n $is_default = $_REQUEST['is_default'];\n $customer_id = $_REQUEST['customer_id'];\n\n $address_id = $this->User_Model->save_data('delivery_address', $save_data);\n if ($address_id) {\n if($is_default == 1){\n $up_data1['is_default'] = 0;\n $this->User_Model->update_info('customer_id', $customer_id, 'delivery_address', $up_data1);\n $up_data2['is_default'] = 1;\n $this->User_Model->update_info('address_id', $address_id, 'delivery_address', $up_data2);\n }\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Address Saved Successfuly\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Address Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function getShippingAddress(): Address\n {\n if (!isset($this->shippingAddress)) {\n throw new LocalizedException(__('Shipping address is not defined for instance purchase.'));\n }\n return $this->shippingAddress;\n }", "public function gETShipmentIdShippingAddressRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdShippingAddress'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/shipping_address';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getShippingAddress()\n {\n return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress;\n }", "public function getItemShippingAddresses();", "private function addAddress($options)\n {\n $address = $options['billing_address']\n ?: $options['address'];\n\n $this->post['card']['address_line1'] = $address['address1'];\n $this->post['card']['address_line2'] = $address['address2'];\n $this->post['card']['address_city'] = $address['city'];\n $this->post['card']['address_postcode'] = $address['zip'];\n $this->post['card']['address_state'] = $address['state'];\n $this->post['card']['address_country'] = $address['country'];\n }", "public function set_sess_cart_shipping_address()\n {\n $std = new stdClass();\n $std->shipping_first_name = $this->input->post('shipping_first_name', true);\n $std->shipping_last_name = $this->input->post('shipping_last_name', true);\n $std->shipping_email = $this->input->post('shipping_email', true);\n $std->shipping_phone_number = $this->input->post('shipping_phone_number', true);\n $std->shipping_address_1 = $this->input->post('shipping_address_1', true);\n $std->shipping_address_2 = $this->input->post('shipping_address_2', true);\n $std->shipping_country_id = $this->input->post('shipping_country_id', true);\n $std->shipping_state = $this->input->post('shipping_state', true);\n $std->shipping_city = $this->input->post('shipping_city', true);\n $std->shipping_zip_code = $this->input->post('shipping_zip_code', true);\n $std->billing_first_name = $this->input->post('billing_first_name', true);\n $std->billing_last_name = $this->input->post('billing_last_name', true);\n $std->billing_email = $this->input->post('billing_email', true);\n $std->billing_phone_number = $this->input->post('billing_phone_number', true);\n $std->billing_address_1 = $this->input->post('billing_address_1', true);\n $std->billing_address_2 = $this->input->post('billing_address_2', true);\n $std->billing_country_id = $this->input->post('billing_country_id', true);\n $std->billing_state = $this->input->post('billing_state', true);\n $std->billing_city = $this->input->post('billing_city', true);\n $std->billing_zip_code = $this->input->post('billing_zip_code', true);\n $std->use_same_address_for_billing = $this->input->post('use_same_address_for_billing', true);\n if (!isset($std->use_same_address_for_billing)) {\n $std->use_same_address_for_billing = 0;\n }\n\n if ($std->use_same_address_for_billing == 1) {\n $std->billing_first_name = $std->shipping_first_name;\n $std->billing_last_name = $std->shipping_last_name;\n $std->billing_email = $std->shipping_email;\n $std->billing_phone_number = $std->shipping_phone_number;\n $std->billing_address_1 = $std->shipping_address_1;\n $std->billing_address_2 = $std->shipping_address_2;\n $std->billing_country_id = $std->shipping_country_id;\n $std->billing_state = $std->shipping_state;\n $std->billing_city = $std->shipping_city;\n $std->billing_zip_code = $std->shipping_zip_code;\n } else {\n if (empty($std->billing_first_name)) {\n $std->billing_first_name = $std->shipping_first_name;\n }\n if (empty($std->billing_last_name)) {\n $std->billing_last_name = $std->shipping_last_name;\n }\n if (empty($std->billing_email)) {\n $std->billing_email = $std->shipping_email;\n }\n if (empty($std->billing_phone_number)) {\n $std->billing_phone_number = $std->shipping_phone_number;\n }\n if (empty($std->billing_address_1)) {\n $std->billing_address_1 = $std->shipping_address_1;\n }\n if (empty($std->billing_address_2)) {\n $std->billing_address_2 = $std->shipping_address_2;\n }\n if (empty($std->billing_country_id)) {\n $std->billing_country_id = $std->shipping_country_id;\n }\n if (empty($std->billing_state)) {\n $std->billing_state = $std->shipping_state;\n }\n if (empty($std->billing_city)) {\n $std->billing_city = $std->shipping_state;\n }\n if (empty($std->billing_zip_code)) {\n $std->billing_zip_code = $std->shipping_zip_code;\n }\n }\n $this->session->set_userdata('mds_cart_shipping_address', $std);\n }", "public function getShippingAddress(Request $request){\n $user_id = $request->id;\n if($user_id == ''){\n return view('pos.guest_shipping_address');\n }\n else{\n return view('pos.shipping_address', compact('user_id'));\n }\n }", "public function getShippingAddress(){\n return $this->_getData(self::SHIPPING_ADDRESS);\n }", "public function setShippingAddress(ShippingDetail $shippingDetail): RevisedSubscriptionRequest\n {\n $this->offsetSet(self::SHIPPING_ADDRESS, $shippingDetail);\n return $this;\n }", "public function shippingAddress()\n {\n return $this->belongsTo('App\\Address');\n }", "public function setShippingAddress(?Address $shippingAddress): void\n {\n $this->shippingAddress = $shippingAddress;\n }", "public function getShippingAddress()\n {\n return Mage::getSingleton('checkout/cart')->getQuote()->getShippingAddress();\n }", "public function sSaveShippingAddress($address, $id)\n {\n $sql = '\n INSERT INTO s_order_shippingaddress\n (\n userID,\n orderID,\n company,\n department,\n salutation,\n firstname,\n lastname,\n street,\n zipcode,\n city,\n phone,\n countryID,\n stateID,\n additional_address_line1,\n additional_address_line2,\n title\n )\n VALUES (\n :userID,\n :orderID,\n :company,\n :department,\n :salutation,\n :firstname,\n :lastname,\n :street,\n :zipcode,\n :city,\n :phone,\n :countryID,\n :stateID,\n :additional_address_line1,\n :additional_address_line2,\n :title\n )\n ';\n $sql = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveShipping_FilterSQL',\n $sql,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $array = [\n ':userID' => $address['userID'],\n ':orderID' => $id,\n ':company' => (string) $address['company'],\n ':department' => (string) $address['department'],\n ':salutation' => (string) $address['salutation'],\n ':firstname' => (string) $address['firstname'],\n ':lastname' => (string) $address['lastname'],\n ':street' => (string) $address['street'],\n ':zipcode' => (string) $address['zipcode'],\n ':city' => (string) $address['city'],\n ':phone' => (string) $address['phone'],\n ':countryID' => $address['countryID'],\n ':stateID' => $address['stateID'],\n ':additional_address_line1' => (string) $address['additional_address_line1'],\n ':additional_address_line2' => (string) $address['additional_address_line2'],\n ':title' => (string) $address['title'],\n ];\n $array = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveShipping_FilterArray',\n $array,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $result = $this->db->executeUpdate($sql, $array);\n\n $shippingId = $this->db->lastInsertId();\n\n $shippingAddressId = null;\n\n if ($this->session !== null) {\n $shippingAddressId = $this->session->get('checkoutShippingAddressId');\n }\n\n if ($shippingAddressId === null) {\n /** @var Customer $customer */\n $customer = $this->modelManager->getRepository(\\Shopware\\Models\\Customer\\Customer::class)\n ->find($address['userID']);\n $shippingAddressId = $customer->getDefaultShippingAddress()->getId();\n }\n\n $attributes = $this->attributeLoader->load('s_user_addresses_attributes', $shippingAddressId);\n\n $this->attributePersister->persist($attributes, 's_order_shippingaddress_attributes', $shippingId);\n\n return $result;\n }", "public function setShipping($shipping);", "public function updateShippingAddress(ResourceControllerEvent $event): void\n {\n /** @var Order $order */\n $order = $event->getSubject();\n\n $pickup = $this->getPickupAddress($order);\n\n if (!empty($pickup)) {\n $shipping = $order->getShippingAddress();\n $shipping->setCompany($pickup['company']);\n $shipping->setStreet($pickup['street_1']);\n $shipping->setCity($pickup['city']);\n $shipping->setPostcode($pickup['postcode']);\n $shipping->setCountryCode($pickup['country']);\n }\n }", "public function appendAddressDataToShippingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getModel('postident/config')->getAddressDataUsage()) {\n return;\n }\n \n if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Shipping\n && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Shipping\n ) {\n $transport = $observer->getTransport();\n $block = $observer->getBlock();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $addAddressTemplateHtml = $layout->createBlock(\n 'postident/checkout_onepage_shipping', 'postident_onepage_billing')\n ->renderView();\n $html = $html . $addAddressTemplateHtml;\n $transport->setHtml($html);\n }\n }", "public function setShipFromAddress($value)\n {\n $this->_fields['ShipFromAddress']['FieldValue'] = $value;\n return $this;\n }", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "public function setShippingAddress1($value)\n {\n return $this->setParameter('shippingAddress1', $value);\n }", "protected function _importAddress(&$request)\n {\n $address = $this->getAddress();\n if (!$address) {\n if ($this->getNoShipping()) {\n $request['no_shipping'] = 1;\n }\n return;\n }\n\n $request = Varien_Object_Mapper::accumulateByMap($address, $request, array_flip($this->_addressMap));\n\n // Address may come without email info (user is not always required to enter it), so add email from order\n if (!$request['email']) {\n $order = $this->getOrder();\n if ($order) {\n $request['email'] = $order->getCustomerEmail();\n }\n }\n\n $regionCode = $this->_lookupRegionCodeFromAddress($address);\n if ($regionCode) {\n $request['state'] = $regionCode;\n }\n $this->_importStreetFromAddress($address, $request, 'address1', 'address2');\n $this->_applyCountryWorkarounds($request);\n\n $request['address_override'] = 0;\n }", "public function shipping_adress()\n {\n return $this->hasOne(shipping_adress::class, 'id', 'shipping_adresses_id');\n }", "public function setShippingAddress($shippingAddress){\n return $this->setData(self::SHIPPING_ADDRESS, $shippingAddress);\n }", "public function getShippingAddress()\n {\n if (empty($this->_address)) {\n $this->_address = $this->getQuote()->getShippingAddress();\n }\n\n return $this->_address;\n }", "public function addAddress()\n\t{\n\t\treturn $this->editAddress();\n\t}", "public function addAddress($address);", "public function withShipFromAddress($value)\n {\n $this->setShipFromAddress($value);\n return $this;\n }", "private function addAddress($options)\n {\n if (!isset($options['address'])\n || !isset($options['billing_address'])\n ) {\n return false;\n }\n\n $address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['BillingStreet'] = isset($address['address1']) ? $address['address1'] : null;\n $this->post['BillingHouseNumber'] = isset($address['address2']) ? $address['address2'] : null;\n $this->post['BillingCity'] = isset($address['city']) ? $address['city'] : null;\n $this->post['BillingState'] = isset($address['state']) ? $address['state'] : null;\n $this->post['BillingPostCode'] = isset($address['zip']) ? $address['zip'] : null;\n }", "public function setShippingAmount($amount);", "public function setShippingAddress2($value)\n {\n return $this->setParameter('shippingAddress2', $value);\n }", "function get_item_shipping() {\n\t}", "public function getShippingAddress()\n {\n if (is_null($this->shippingAddress)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_SHIPPING_ADDRESS);\n if (is_null($data)) {\n return null;\n }\n\n $this->shippingAddress = BaseAddressModel::of($data);\n }\n\n return $this->shippingAddress;\n }", "public function gETOrderIdShippingAddressRequest($order_id)\n {\n // verify the required parameter 'order_id' is set\n if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $order_id when calling gETOrderIdShippingAddress'\n );\n }\n\n $resourcePath = '/orders/{orderId}/shipping_address';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orderId' . '}',\n ObjectSerializer::toPathValue($order_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getShippingAddress(): ?Address\n {\n return $this->shippingAddress;\n }", "function getPaypalShippingAddress()\n {\n return $this->getPaypalAddress('shipping');\n }", "public function saveShippingAction()\n {\n if (!$this->_isActive()) {\n parent::saveShippingAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost('shipping', array());\n $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);\n $result = $this->getOnepage()->saveShipping($data, $customerAddressId);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }", "public function getShippingAddress1()\n {\n return $this->getParameter('shippingAddress1');\n }", "public function postShipping(Request $request) {\n $cart = new Carts();\n $mycart = $cart->getCustomerCarts(Auth::guard('web')->user()->id);\n $name = $request->fname;\n $mycart->$name = $request->fvalue;\n $mycart->save();\n return response()->json([\n 'success' => '1',\n 'message' => 'Item save'\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 }", "function store_shipping_address($order_id)\n\t{\n\t\tif (is_null(post_param('address_name',NULL))) return NULL;\n\n\t\tif (is_null($GLOBALS['SITE_DB']->query_value_null_ok('shopping_order_addresses','id',array('order_id'=>$order_id))))\n\t\t{\n\t\t\t$shipping_address=array();\n\t\t\t$shipping_address['order_id']=$order_id;\n\t\t\t$shipping_address['address_name']=post_param('address_name','');\n\t\t\t$shipping_address['address_street']=post_param('address_street','');\n\t\t\t$shipping_address['address_zip']=post_param('address_zip','');\n\t\t\t$shipping_address['address_city']=post_param('address_city','');\n\t\t\t$shipping_address['address_country']=post_param('address_country','');\n\t\t\t$shipping_address['receiver_email']=post_param('payer_email','');\n\n\t\t\treturn $GLOBALS['SITE_DB']->query_insert('shopping_order_addresses',$shipping_address,true);\t\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function setShippingCost($shippingCost);", "public function getShippingAddressForSeller(Request $request){\n $user_id = $request->id;\n if($user_id == ''){\n return view('pos.frontend.seller.pos.guest_shipping_address');\n }\n else{\n return view('pos.frontend.seller.pos.shipping_address', compact('user_id'));\n }\n }", "public function getShipToAddress()\n {\n if (isset($this->data['ShipToAddress'])) {\n return $this->data['ShipToAddress'];\n } else {\n return false;\n }\n }", "public function newPaymentAddress() {\n $result = $this->newAPIRequest('POST', '/addresses', []);\n return $result;\n }", "public function setShipaddress($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->shipaddress !== $v) {\n $this->shipaddress = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_SHIPADDRESS] = true;\n }\n\n return $this;\n }", "public function getShippingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_SHIPPING]);\n }", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function getShipaddress()\n {\n return $this->shipaddress;\n }", "public function wc_address_book_checkout_update() {\n\n\t\tglobal $woocommerce;\n\n\t\t$name = $_POST['name'];\n\t\t$address_book = $this->get_address_book();\n\n\t\t$customer_id = get_current_user_id();\n\t\t$shipping_countries = $woocommerce->countries->get_shipping_countries();\n\n\t\t$response = array();\n\n\t\t// Get address field values.\n\t\tif ( 'add_new' !== $name ) {\n\n\t\t\tforeach ( $address_book[ $name ] as $field => $value ) {\n\n\t\t\t\t$field = preg_replace( '/^[^_]*_\\s*/', 'shipping_', $field );\n\n\t\t\t\t$response[ $field ] = $value;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// If only one country is available for shipping, include it in the blank form.\n\t\t\tif ( 1 === count( $shipping_countries ) ) {\n\t\t\t\t$response['shipping_country'] = key( $shipping_countries );\n\t\t\t}\n\t\t}\n\n\t\techo wp_json_encode( $response );\n\n\t\tdie();\n\t}", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "public function save_shippingAction() {\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', '');\r\n\t\t$payment_method = $this->getRequest()->getPost('payment_method', false);\r\n\t\t$old_shipping_method = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingMethod();\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t// if ($shipping_method && $shipping_method != '' && $shipping_method != $old_shipping_method) {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t\t$this->getOnepage()->saveShippingMethod($shipping_method);\r\n\t\t// }\r\n\t\t\r\n\t\t// if ($payment_method != '') {\r\n\t\t\ttry{\r\n\t\t\t\t$payment = $this->getRequest()->getPost('payment', array());\r\n\t\t\t\t$payment['method'] = $payment_method;\r\n\t\t\t\t$this->getOnepage()->savePayment($payment);\r\n\t\t\t\tMage::helper('onestepcheckout')->savePaymentMethod($payment);\r\n\t\t\t}\r\n\t\t\tcatch(Exception $e) {\r\n\t\t\t\t//\r\n\t\t\t}\r\n\t\t// }\r\n\t\t\r\n\t\t// $paymentHtml = $this->_getPaymentMethodsHtml();\r\n\t\t// $reviewHtml = $this->_getReviewTotalHtml();\r\n\t\t// $result = array('payment' => $paymentHtml, \r\n\t\t\t\t\t\t\t\t\t\t// 'review' => $reviewHtml);\r\n\t\t// $this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\r\n\t}", "public function setShipAddress(?Address $address = null): Cart;", "public function collect(Mage_Sales_Model_Quote_Address $address) {\r\n parent::collect($address);\r\n $this->_setAmount(0);\r\n $this->_setBaseAmount(0);\r\n \r\n $items = $this->_getAddressItems($address);\r\n if (!count($items)) { \r\n /**\r\n * this makes only address type shipping to come through\r\n */\r\n return $this; \r\n }\r\n $quote = $address->getQuote();\r\n if(Mage::app()->getRequest()->getControllerName() == \"checkout_cart\"){\r\n $address->setDeliveryCost('');\r\n $address->setBaseDeliveryCost('');\r\n $quote->setShippingDeliveryCost('');\r\n $quote->setDeliveryCost('');\r\n $address->setGrandTotal($address->getGrandTotal() + 0);\r\n $address->setBaseGrandTotal($address->getBaseGrandTotal() + 0);\r\n Mage::getSingleton ( 'core/session' )->setShippingDeliveryCost('');\r\n }\r\n else {\r\n $deliveryCost=$quote->getShippingDeliveryCost();\r\n $address->setDeliveryCost($deliveryCost);\r\n $address->setBaseDeliveryCost($deliveryCost);\r\n $quote->setDeliveryCost($deliveryCost);\r\n $address->setGrandTotal($address->getGrandTotal() + $address->getDeliveryCost());\r\n $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseDeliveryCost());\r\n Mage::getSingleton ( 'core/session' )->setShippingDeliveryCost($deliveryCost);\r\n }\r\n }", "public function getShippingAddressModel()\n {\n if (is_null($this->_shippingAddressModel)) {\n $object = Mage::getModel('customer/address');\n $this->_shippingAddressModel = Mage::objects()->save($object);\n }\n return Mage::objects()->load($this->_shippingAddressModel);\n }", "public function save_shipping($post) {\n\t\t$user = $this->session->userdata('user');\n\t\t// Grab only the data that belongs in the shipping table\n\t\t$data['first_name'] = $post['first_name'];\n\t\t$data['last_name'] = $post['last_name'];\n\t\t$data['address'] = $post['address'];\n\t\t$data['address_2'] = $post['address_2'];\n\t\t$data['state'] = $post['state'];\n\t\t$data['city'] = $post['city'];\n\t\t$data['country'] = $post['country'];\n\t\t$data['zip_code'] = $post['zip_code'];\n\n\t\t// If a record already exists, update it\n\t\tif ($userMailing = $this->fetch(array('user_id'=>$user['id']))) {\n\t\t\t$this->db->where(array('user_id',$user['id']));\n\t\t\t$this->db->update(self::TABLE, $data);\n\t\t} else {\n\t\t\t$data['user_id'] = $user['id'];\n\t\t\t$this->db->insert(self::TABLE, $data);\n\t\t}\n\n\t}", "public function setShipping($shippingAddress)\n {\n $this->_shipping['Name'] = $shippingAddress['shipping_firstname'].' '.$shippingAddress['shipping_lastname'];\n $this->_shipping['Address'] = array('AddressLine' => $shippingAddress['shipping_address1'].' '.$shippingAddress['shipping_address2'],\n 'City' => $shippingAddress['shipping_city'],\n 'StateProvinceCode' => $shippingAddress['shipping_state'],\n 'PostalCode' => $shippingAddress['shipping_zipcode'],\n 'CountryCode' => $shippingAddress['shipping_country'],\n );\n $this->_shipping['address_id'] = $shippingAddress['address_id'];\n $this->_shipping['contact_phone'] = $shippingAddress['contact_phone'];\n $this->_shipping['contact_email'] = $shippingAddress['contact_email'];\n $this->persist();\n }", "function getShipping()\n {\n return array('name'=>'test','cost'=>4.5);\n }", "public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }", "public function editOrderShipment($order_id = null) {\n\t\t$this->Order = ClassRegistry::init('Order');\n\t\t$this->layout = 'ajax';\n if ($this->request->is('post') || $this->request->is('put')) {\n if ($this->Shipment->save($this->request->data)) {\n $this->Session->setFlash(__('The shipment has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The shipment could not be saved. Please, try again.'));\n }\n } else {\n $options = array('conditions' => array('Shipment.order_id' => $order_id));\n\t\t\t$this->request->data = $this->Shipment->find('first', $options);\n\t\t\tif($this->request->data == array()){\n\t\t\t\tthrow new NotFoundException('no shipment found');\n\t\t\t}\n $this->request->data = $this->Shipment->find('first', $options);\n\t\t\t$myAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'myAddresses'));\n\t\t\t$connectedAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'connectedAddresses'));\n\t\t\t$thirdParty = ($this->User->getSecureList($this->Auth->user('id'), 'thirdParty'));\n\t\t\t$pageHeading = $title_for_layout = 'Shipping Address Edit';\n\t\t\t$carrier = $this->Order->carrier;\n\t\t\t$UPS = $this->Order->method['UPS'];\n\t\t\t$FedEx = $this->Order->method['FedEx'];\n\t\t\t$Other = $this->Order->method['Other'];\n\t\t\t$method = array($this->Order->method[$this->request->data['Shipment']['carrier']]);\n\t\t\t$shipmentBillingOptions = $this->getShipmentBillingOptions();\n\n\t\t\t$this->setBasicAddressSelects();\n\t\t\t$this->set(compact(\n\t\t\t\t\t'myAddresses', \n\t\t\t\t\t'connectedAddresses', \n\t\t\t\t\t'pageHeading', \n\t\t\t\t\t'title_for_layout', \n\t\t\t\t\t'carrier', \n\t\t\t\t\t'method',\n\t\t\t\t\t'UPS',\n\t\t\t\t\t'FedEx',\n\t\t\t\t\t'Other',\n\t\t\t\t\t'shipmentBillingOptions',\n\t\t\t\t\t'thirdParty'));\n }\n }", "public function shipping_address_select_field( $fields ) {\n\n\t\t$address_book = $this->get_address_book();\n\t\t$customer_id = wp_get_current_user();\n\n\t\t$address_selector['address_book'] = array(\n\t\t\t'type' => 'select',\n\t\t\t'class' => array( 'form-row-wide', 'address_book' ),\n\t\t\t'label' => __( 'Address Book', 'wc-address-book' ),\n\t\t\t'order' => -1,\n\t\t\t'priority' => -1,\n\t\t);\n\n\t\tif ( ! empty( $address_book ) && false !== $address_book ) {\n\n\t\t\tforeach ( $address_book as $name => $address ) {\n\n\t\t\t\tif ( ! empty( $address[ $name . '_address_1' ] ) ) {\n\t\t\t\t\t$address_selector['address_book']['options'][ $name ] = $this->address_select_label( $address, $name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$address_selector['address_book']['options']['add_new'] = __( 'Add New Address', 'wc-address-book' );\n\n\t\t\t$fields['shipping'] = $address_selector + $fields['shipping'];\n\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function getShippingInfo();", "public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }", "public function updateCustomerAddressAction() {\n if(!Mage::app()->getRequest()->isAjax()){\n $this->norouteAction();\n exit;\n }\n\n $postData = $this->getRequest()->getPost();\n parse_str($postData['form'], $billing);\n\n $customer = $this->_getCustomer();\n\n $address = new Varien_Object();\n $address->addData(\n array(\n 'state' => $billing['state'],\n 'city' => $billing['city'],\n 'street' => $billing['street'],\n 'zip_code' => $billing['zipcode'],\n 'firstname' => $billing['firstname'],\n 'lastname' => $billing['lastname'],\n 'telephone' => $billing['telephone'],\n 'phone_number' => $billing['telephone'],\n 'country_code' => $billing['country_id'],\n )\n );\n\n $response = Mage::getModel(\"payments/api\")->updateBilling($customer->getId(), $address);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('token' => $response)));\n }", "private function getShippingAddress(array $order) {\n\n $address = array('address_book_id' => '',\n 'address_type' => 'ship',\n 'lastname' => $order['shipping_lastname'],\n 'firstname' => $order['shipping_firstname'],\n 'telephone' => $order['telephone'],\n 'mobile' => '',\n 'gender' => '',\n 'postcode' => $order['shipping_postcode'],\n 'city' => $order['shipping_city'],\n 'zone_id' => $order['shipping_zone_id'],\n 'zone_code' => $order['shipping_zone_code'],\n 'zone_name' => $order['shipping_zone'],\n 'state' => '',\n 'address1' => $order['shipping_address_1'],\n 'address2' => $order['shipping_address_2'],\n 'country_id' => $order['shipping_country_id'],\n 'country_code' => $order['shipping_iso_code_3'],\n 'country_name' => $order['shipping_country'],\n 'company' => $order['shipping_company']);\n\n return $address;\n }", "public function getShippingDetails();", "public function getShippingAddress2()\n {\n return $this->getParameter('shippingAddress2');\n }", "public function update(ShippingAddress $shipping, CreateShippingAddressRequests $request)\n {\n try {\n $user = Auth::user();\n if ($user->id == $shipping->user_id) {\n $shipping->update([\n 'address'=> $request->address,\n ]);\n return $this->successResponse($shipping->load('user'), Response::HTTP_OK);\n } else {\n return $this->errorResponse(trans('errors.update_fail'), Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n } catch (Exception $e) {\n return $this->errorResponse(trans('errors.update_fail'), Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n }", "public function setSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');\n }", "public function get_sess_cart_shipping_address()\n {\n if (!empty($this->session->userdata('mds_cart_shipping_address'))) {\n return $this->session->userdata('mds_cart_shipping_address');\n }\n $std = new stdClass();\n $row = null;\n\n if ($this->auth_check) {\n $row = $this->profile_model->get_user_shipping_address($this->auth_user->id);\n } else {\n $row = $this->profile_model->get_user_shipping_address(null);\n }\n $std->shipping_first_name = $row->shipping_first_name;\n $std->shipping_last_name = $row->shipping_last_name;\n $std->shipping_email = $row->shipping_email;\n $std->shipping_phone_number = $row->shipping_phone_number;\n $std->shipping_address_1 = $row->shipping_address_1;\n $std->shipping_address_2 = $row->shipping_address_2;\n $std->shipping_country_id = $row->shipping_country_id;\n $std->shipping_state = $row->shipping_state;\n $std->shipping_city = $row->shipping_city;\n $std->shipping_zip_code = $row->shipping_zip_code;\n $std->billing_first_name = $row->shipping_first_name;\n $std->billing_last_name = $row->shipping_last_name;\n $std->billing_email = $row->shipping_email;\n $std->billing_phone_number = $row->shipping_phone_number;\n $std->billing_address_1 = $row->shipping_address_1;\n $std->billing_address_2 = $row->shipping_address_2;\n $std->billing_country_id = $row->shipping_country_id;\n $std->billing_state = $row->shipping_state;\n $std->billing_city = $row->shipping_city;\n $std->billing_zip_code = $row->shipping_zip_code;\n $std->use_same_address_for_billing = 1;\n $this->session->unset_userdata('mds_cart_shipping_address');\n return $std;\n }", "public function SetOrderShippingAddress($address, $isBilling = false)\n\t{\n\t\t// The shipping address attached to the quote, where the address should be stored\n\t\t$quoteShippingAddress = $this->getQuote()\n\t\t\t->setIsSplitShipping(false)\n\t\t\t->getShippingAddress();\n\n\t\t// Is an address ID - so it needs to be fetched\n\t\tif(!is_array($address)) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($address,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\tif(!$address) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Get the customer email address, if they're logged in\n\t\t\t$customer = getClass('ISC_CUSTOMER')->getCustomerInfo();\n\t\t\tif($customer) {\n\t\t\t\t$address['shipemail'] = $customer['custconemail'];\n\t\t\t}\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(!empty($address['customFormFields'])) {\n\t\t\t\tif($isBilling == true) {\n\t\t\t\t\t$address['customFormFields'] =\n\t\t\t\t\t\t$this->mapBillingFieldsToShipping($address['customFormFields']);\n\t\t\t\t}\n\t\t\t\t$quoteShippingAddress->setCustomFields($address['customFormFields']);\n\t\t\t}\n\t\t}\n\n\t\t// Store the billing address in the quote\n\t\t$quoteShippingAddress->setAddressByArray($address);\n\t\treturn true;\n\t}", "public function store(Request $request)\n {\n //dd($request->all());\n\n $this->validate($request, [\n 'shipper_code' => ['required', 'string', 'max:50'],\n 'shipper_name' => ['max:500']\n ]);\n\n $shipping = new Shipping([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'contact' => $request->get('contact'),\n 'gst_id' => $request->get('gst_id'),\n 'address1' => $request->get('address1'),\n 'city' => $request->get('city'),\n 'state' => $request->get('state'),\n 'country' => $request->get('country'),\n 'postcode' => $request->get('postcode'),\n 'telephone' => $request->get('telephone'),\n 'mobile' => $request->get('mobile'),\n 'fax' => $request->get('fax'),\n 'email' => $request->get('email'),\n 'credit_limit' => $request->get('credit_limit'),\n 'term_day' => $request->get('term_day'),\n 'invoice_format' => $request->get('invoice_format'),\n 'deleted_by' => ''\n ]);\n\n $code = $request->get('shipper_code');\n $name = $request->get('shipper_name');\n\n $checkshippercode = Shipping::where('shipper_code','=',$code)->exists();\n $checkshippername = Shipping::where('shipper_name','=',$name)->exists();\n\n if($checkshippercode == 'true')\n {\n return back()->with('error', 'Shipper code already existed.');\n }\n elseif($checkshippername == 'true')\n {\n return back()->with('error', 'Shipper name already existed.');\n }\n else\n {\n $destination = Destination::distinct()\n ->where('deleted_by','=','')\n ->orderBy('destination_code')\n ->get(['destination_code']);\n\n foreach($destination as $row){\n $data2 = array(\n 'shipper_code' => $code,\n 'destination_code' => $row['destination_code'],\n 'created_by' => '',\n 'created_on' => now()\n );\n\n DB::table('charges')->insert($data2);\n }\n\n $account = new Account([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'details' => 'Account created',\n 'amount' => '0.00',\n 'acc_bal' => '0.00',\n 'update_time' => now()\n ]);\n\n $log = new Log([\n 'status' => ''.strtoupper(auth()->user()->username).' create shipper account ['.$request->get('shipper_name').'].'\n ]);\n $log->save();\n\n //return $destination;\n $account->save();\n $shipping->save();\n return redirect()->route('shipping.index')->with('success', 'Shipping Account added successfully.');\n }\n\n }", "private function SaveMultipleShippingAddresses()\n\t{\n\t\t// Split shipping only works for signed in users\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=checkout');\n\t\t}\n\n\t\t// If split shipping is not available, take the customer back to the shipping address selection page\n\t\tif(!gzte11(ISC_MEDIUMPRINT) || !GetConfig('MultipleShippingAddresses') || !isset($_POST['multiaddress'])) {\n\t\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t}\n\n\t\t$silent = false;\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$silent = true;\n\t\t}\n\n\t\t$customerAddresses = getClass('ISC_CUSTOMER')\n\t\t\t->getCustomerShippingAddresses();\n\n\t\t$quoteItems = $this->getQuote()->getItems();\n\t\t$addressItems = array();\n\t\tforeach($quoteItems as $item) {\n\t\t\t// Digital items aren't shipped\n\t\t\tif($item->isDigital()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we don't have an address for this product, we need to throw back to the address\n\t\t\t// selection page, as they've done something dodgy.\n\t\t\t$quantity = $item->getQuantity();\n\t\t\t$itemId = $item->getId();\n\t\t\tfor($i = 1; $i <= $quantity; ++$i) {\n\t\t\t\t$id = $itemId.'_'.$i;\n\t\t\t\tif(!isset($_POST['multiaddress'][$id]) ||\n\t\t\t\t\t!isset($customerAddresses[$_POST['multiaddress'][$id]]) && $silent == false) {\n\t\t\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t\t}\n\n\t\t\t\t$customerAddressId = $customerAddresses[$_POST['multiaddress'][$id]]['shipid'];\n\t\t\t\tif(!isset($addressItems[$customerAddressId])) {\n\t\t\t\t\t$addressItems[$customerAddressId] = array();\n\t\t\t\t}\n\t\t\t\tif(!isset($addressItems[$customerAddressId][$itemId])) {\n\t\t\t\t\t$addressItems[$customerAddressId][$itemId] = 0;\n\t\t\t\t}\n\t\t\t\t++$addressItems[$customerAddressId][$itemId];\n\t\t\t}\n\t\t}\n\n\t\t// Remove all shipping addresses on the order and start fresh\n\t\t$this->getQuote()->setIsSplitShipping(true);\n\t\t$this->getQuote()->removeAllShippingAddresses();\n\n\t\t$updatedItems = array();\n\t\t$first = true;\n\t\tforeach($addressItems as $addressId => $items) {\n\t\t\t$address = getClass('ISC_ACCOUNT')->getShippingAddress($addressId,\n\t\t\t\tgetClass('ISC_CUSTOMER')->getCustomerId()\n\t\t\t);\n\n\t\t\t// Invalid address was selected\n\t\t\tif(!$address) {\n\t\t\t\tredirect(GetConfig('ShopPath').'/checkout.php?action=choose_shipping_address&type=single');\n\t\t\t}\n\n\t\t\t// First iteration should use existing shipping address\n\t\t\tif($first) {\n\t\t\t\t$quoteShippingAddress = $this->getQuote()->getShippingAddress();\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$quoteShippingAddress = new ISC_QUOTE_ADDRESS_SHIPPING;\n\t\t\t\t$quoteShippingAddress->setQuote($this->getQuote());\n\t\t\t\t$this->getQuote()->addShippingAddress($quoteShippingAddress);\n\t\t\t}\n\n\t\t\t$quoteShippingAddress->setAddressByArray($address);\n\n\t\t\t// If the address has custom fields, load those in too\n\t\t\tif($address['shipformsessionid']) {\n\t\t\t\t$formFields = $GLOBALS['ISC_CLASS_FORM']->getSavedSessionData(\n\t\t\t\t\t$address['shipformsessionid'],\n\t\t\t\t\tarray(),\n\t\t\t\t\tFORMFIELDS_FORM_ADDRESS\n\t\t\t\t);\n\t\t\t\t$quoteShippingAddress->setCustomFields($formFields);\n\t\t\t}\n\n\t\t\t$quoteAddressId = $quoteShippingAddress->getId();\n\t\t\tforeach($items as $itemId => $qty) {\n\t\t\t\t$item = $this->getQuote()->getItemById($itemId);\n\t\t\t\tif(!in_array($itemId, $updatedItems)) {\n\t\t\t\t\t$item->setAddressId($quoteAddressId);\n\t\t\t\t\t$item->setQuantity($qty, false);\n\t\t\t\t\t$updatedItems[] = $itemId;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$newItem = clone $item;\n\t\t\t\t\t$newItem->setQuantity($qty, false);\n\t\t\t\t\t$newItem->setAddressId($quoteAddressId);\n\t\t\t\t\t$this->getQuote()->addItem($newItem, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Do we need to go to the add address page?\n\t\tif(isset($_POST['addAnotherAddress'])) {\n\t\t\t$this_page = urlencode(\"checkout.php?action=choose_shipping_address\");\n\t\t\tredirect(getConfig('ShopPath').'/account.php?action=add_shipping_address&from='.$this_page);\n\t\t}\n\n\t\t// OK, the shipping method has been set, move on to the next step\n\t\tredirect(getConfig('ShopPath').'/checkout.php?action=choose_shipper');\n\t}", "public function store(AddressRequest $request)\n {\n $success = $this->repo->store(Auth::id());\n if($success) {\n //go to next page: delivery method\n return redirect()->route('delivery.index');\n } else {\n return redirect()->back();\n }\n }", "public function formAddressShipping(Zend_Form $form = null, array $options = array())\n {\n if (isset($options['mode'])){\n $this->_mode = $options['mode'];\n }\n if (isset($options['requiredValidator'])){\n $this->_requiredValidator = $options['requiredValidator'];\n unset($options['requiredValidator']);\n }\n $address = new Cible_Form_SubForm($options);\n $address->setName('addressShipping')\n ->setLegend(Cible_Translation::getCibleText('fieldset_addressShipping'))\n ->setAttrib('class', 'identificationClass subFormClass')\n ->removeDecorator('DtDdWrapper');\n $addr = new Cible_View_Helper_FormAddress($address);\n $addr->duplicateAddress($address);\n $addr->enableFields(array(\n 'firstTel',\n 'secondTel',\n 'firstAddress',\n 'cityTxt',\n 'zipCode',\n 'country',\n 'state',\n ));\n\n $addr->formAddress();\n $address->getElement('AI_FirstAddress')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-12'))));\n $address->setRowDecorator(array($address->getElement('AI_FirstAddress')->getName()), 'addrOne');\n $address->getElement('AI_FirstTel')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('AI_SecondTel')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $secRow = array(\n $address->getElement('AI_FirstTel')->getName(),\n $address->getElement('AI_SecondTel')->getName(),\n );\n $address->setRowDecorator($secRow, 'addrTwo');\n $address->getElement('A_CityTextValue')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('A_StateId')->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $thirdRow = array(\n $address->getElement('A_CityTextValue')->getName(),\n $address->getElement('A_ZipCode')->getName(),\n );\n $address->setRowDecorator($thirdRow, 'addrThree');\n $address->getElement('A_ZipCode')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('A_CountryId')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $fourthRow = array(\n $address->getElement('A_StateId')->getName(),\n $address->getElement('A_CountryId')->getName(),\n );\n $address->setRowDecorator($fourthRow, 'addrFour', array('class' => 'row '));\n $address->setAttrib('class', 'col-md-6');\n $hiddenId = new Zend_Form_Element_Hidden('MP_ShippingAddrId');\n $hiddenId->setDecorators(array('ViewHelper'));\n $address->addElement($hiddenId);\n $form->addSubForm($address, 'addressShipping');\n }", "public function cassAddress()\n {\n //TODO - Figure out what this is doing\n $address = new UpsAddress();\n $address->setAddressLine1($this->shipping_line1);\n $address->setAddressLine2($this->shipping_line2);\n $address->setCity($this->shipping_city);\n $address->setStateProvinceCode($this->shipping_state);\n $address->setPostalCode($this->shipping_zip);\n\n //todo: Refactor to leverage DI so that we can actually test this.\n $mrtk = new Satori();\n $mrtk->create(0);\n try {\n //Just return a success result if service is down\n $mrtk->connect(config('app.host_config.mailRoomToolKit'), 5150, 5);\n $certifyResponse = $mrtk->certifyAddress($address);\n } catch (Exception $e) {\n (new Log())->logError('Core', 'Could not connect to MRTK');\n // setup success response\n $certifyResponse['status'] = 0;\n $certifyResponse['address'] = $address;\n }\n\n if (intval($certifyResponse['status']) > 100 || in_array($certifyResponse['status'], array(92,93))) {\n throw new Exception($certifyResponse['message']);\n } else {\n $this->shipping_line1 = $certifyResponse['address']->getAddressLine1();\n $this->shipping_line2 = $certifyResponse['address']->getAddressLine2();\n $this->shipping_city = $certifyResponse['address']->getCity();\n $this->shipping_state = $certifyResponse['address']->getStateProvinceCode();\n $this->shipping_zip = $certifyResponse['address']->getPostalCode();\n $this->save();\n }\n }", "public function getShipFromAddress()\n {\n return $this->_fields['ShipFromAddress']['FieldValue'];\n }", "public function shippingCost($shipping_cost) {\n $this->data['attachment']['payload']['summary']['shipping_cost'] = $shipping_cost;\n\n return $this;\n }", "public function addAddress($address, $name = '')\n {\n }", "function addShippingToMessage ( ) {\r\n\t\t$methods =& $this->getExtraShipping();\r\n\r\n\t\tif( $methods === false || count($methods) == 0 ) return;\r\n\r\n\t\t$this->glmsg .= '<shipping-methods>';\r\n\r\n\t\t// add the selected method first, because we can't pass a selection index to google.\r\n\t\tif( ($index = $this->getExtraShippingIndex()) >= 0) {\r\n\t\t\t$this->glmsg .= '<flat-rate-shipping name=\"' . htmlspecialchars( $this->getExtraShipping($index), ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t . '<price currency=\"' . $this->getConfig('shopcurrency') . '\">'\r\n\t\t\t\t\t\t . number_format( $this->cart->getShippingHandlingTotal() / 100, 2, '.', '')\r\n\t\t\t\t\t\t . '</price>'\r\n\t\t\t\t\t\t . '</flat-rate-shipping>';\r\n\t\t}\r\n\r\n\tfor( $i = 0; $i < count($methods) ; ++$i ) {\r\n\t\t\tif( $methods[$i]['id'] == $index ) continue;\t\t\t\r\n\t\t\t$this->glmsg .= '<flat-rate-shipping name=\"' . htmlspecialchars( $methods[$i]['description'], ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t . '<price currency=\"' . $this->getConfig('shopcurrency') . '\">'\r\n\t\t\t\t\t\t . number_format( $this->cart->getShippingHandlingTotal( $methods[$i]['id'] ) / 100, 2, '.', '')\r\n\t\t\t\t\t\t . '</price>'\r\n\t\t\t\t\t\t . '</flat-rate-shipping>';\r\n\t\t}\r\n\t\t$this->glmsg .= '</shipping-methods>';\r\n }" ]
[ "0.7252138", "0.7085798", "0.69010854", "0.68710345", "0.67875946", "0.6733391", "0.67072886", "0.6679804", "0.66745394", "0.6672871", "0.6592178", "0.65876204", "0.6569526", "0.65643245", "0.6559468", "0.64622283", "0.64406526", "0.64297533", "0.6396526", "0.63875866", "0.63619906", "0.6358158", "0.63538814", "0.6343098", "0.63402545", "0.6330122", "0.6308205", "0.62983257", "0.6251013", "0.62470186", "0.6237573", "0.62331384", "0.62177515", "0.6205416", "0.6175418", "0.61696464", "0.61479384", "0.61412305", "0.61305714", "0.61204016", "0.612002", "0.609976", "0.6092697", "0.60875845", "0.60547614", "0.60540575", "0.60457486", "0.6024248", "0.6012653", "0.5997727", "0.59911174", "0.5989726", "0.59688413", "0.59646285", "0.5959779", "0.5926732", "0.5925629", "0.5917833", "0.5913904", "0.5898131", "0.58768594", "0.58699447", "0.5868657", "0.5867841", "0.586672", "0.58596414", "0.5856628", "0.5854315", "0.58348477", "0.581821", "0.58180976", "0.58072203", "0.5804092", "0.57958204", "0.57912123", "0.5765658", "0.576145", "0.57523286", "0.575074", "0.5732739", "0.5727977", "0.57245207", "0.5707076", "0.5694638", "0.56903666", "0.56854653", "0.5673865", "0.56698924", "0.56637824", "0.56540084", "0.56438524", "0.56414837", "0.5635796", "0.5635471", "0.5633073", "0.56216985", "0.56158555", "0.56108683", "0.5609313", "0.56066513" ]
0.5794981
74
Test to see if the product carries its own numbers or is calculated based on parent or children
public function isProductCalculated($item) { try { if($item->isChildrenCalculated() && !$item->getParentItem()) { return true; } if(!$item->isChildrenCalculated() && $item->getParentItem()) { return true; } } catch(Exception $e) { } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_on_sale() {\n\t\n\t\tif ( $this->has_child() ) :\n\t\t\n\t\t\t$onsale = false;\n\t\t\t\n\t\t\tforeach ($this->children as $child) :\n\t\t\t\tif ( isset($child->product->data['sale_price']) && $child->product->data['sale_price']==$child->product->price ) :\n\t\t\t\t\treturn true;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\t\n\t\telse :\n\t\t\n\t\t\tif ( isset($this->data['sale_price']) && $this->data['sale_price']==$this->price ) :\n\t\t\t\treturn true;\n\t\t\tendif;\n\t\t\n\t\tendif;\n\n\t\treturn false;\n\t}", "function order_contains_equal_plates_and_engravings($order) {\n if (!empty($order->commerce_line_items)) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $plates = 0;\n $engravings = 0;\n\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n if (!empty($line_item_wrapper->value()->commerce_product) && $line_item_wrapper->commerce_product->value()->type == 'plates') {\n $plates++;\n }\n\n if ($line_item_wrapper->value()->type == 'engraving') {\n $engravings++;\n }\n }\n\n // If there is an equal number\n if (($engravings + $plates == 0) || ($engravings == $plates)) {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "public function hasQuantity(): bool;", "function check_account_products($account, $product)\n{\n $account_data = node_load($account);\n $children = array_keys(taxonomy_get_children($product));\n foreach ($account_data->field_products['und'] as $key => $value) {\n foreach ($value as $product_id => $product_value) {\n if (in_array($product_value, $children)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n}", "protected abstract function isSingleProduct();", "public function hasRealPrice(){\n return $this->_has(21);\n }", "public function hasPrice(){\n return $this->_has(5);\n }", "public function hasParents($product)\n {\n return !empty($product->getTypeInstance()->getParentIdsByChild($product->getId()));\n }", "public function hasPrice(){\n return $this->_has(12);\n }", "function harvest_in_cart() {\n\t\n\tglobal $woocommerce;\n\t\n\t$product_id = 37592;\n\t\n\t$parent_id = wp_get_post_parent_id( $product_id );\n\t\n\t$product_id = $parent_id > 0 ? $parent_id : $product_id;\n\t\n\tforeach ( $woocommerce->cart->get_cart() as $cart_item ) {\n\t \n\t if ( $cart_item['product_id'] === $product_id ) {\n\t \n\t return true;\n\t \n\t } else {\n\t \n\t return false;\n\t \n\t }\n\t\n\t}\n\n}", "public function testGetPriceChildren()\n {\n $value = Yaml::parseFile(__DIR__.'/../../config/contraints/config.yaml');\n $expectedResult = $value['TicketPrice']['prices']['children'];\n\n $reduced = false;\n $halfday = false;\n $birthdate = new DateTime('2015-01-01');\n\n $ticket = new TicketPrice();\n $result = $ticket->getPrice($birthdate, $reduced, $halfday);\n \n $this->assertEquals($expectedResult, $result);\n }", "public function testVoucherOfParent()\n {\n $foundProduct = new ProductEntity();\n $foundProduct->setId('ID-123');\n $foundProduct->setParentId('PARENT-123');\n\n $foundParentProduct = new ProductEntity();\n $foundParentProduct->setId('ID-456');\n $foundParentProduct->setCustomFields([\n 'mollie_payments_product_voucher_type' => VoucherType::TYPE_GIFT,\n ]);\n\n\n $fakeRepoProducts = new FakeProductRepository($foundParentProduct, $foundProduct);\n\n $item = $this->buildProductLineItem('10001');\n\n $vouchers = new VoucherService($fakeRepoProducts, new NullLogger());\n $voucherType = $vouchers->getFinalVoucherType($item, $this->salesChannelContext);\n\n $this->assertEquals(VoucherType::TYPE_GIFT, $voucherType);\n }", "function tep_has_product_subproducts($products_id) {\n\t$subproducts_query = tep_db_query(\"select count(*) as count from \" . TABLE_PRODUCTS . \" where products_parent_id = '\" . (int)$products_id . \"'\");\n\t$subproducts = tep_db_fetch_array($subproducts_query);\n\tif ($subproducts['count'] > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "protected function _isPositiveProductPrice()\n {\n $currentProduct = $this->_getCurrentProduct();\n if ($currentProduct) {\n $productPrice = (float) $currentProduct->getFinalPrice();\n if (empty($productPrice) && !$currentProduct->isGrouped()) {\n return false;\n }\n }\n return true;\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function isIncludedInPrice();", "public function testPriceGroupWithVariants()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => true,\n ]);\n\n /* @var ListProduct $listProduct */\n static::assertEquals(7, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "function _isEligibleQuantity()\r\n {\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.id' => (!empty($this->data[$this->name]['sub_item_id']) ? $this->data[$this->name]['sub_item_id'] : $this->data[$this->name]['item_id']) ,\r\n ) ,\r\n 'fields' => array(\r\n 'Item.item_user_count',\r\n 'Item.max_limit'\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n $newTotal = $item['Item']['item_user_count']+$this->data[$this->name]['quantity'];\r\n if ($item['Item']['max_limit'] <= 0 || $newTotal <= $item['Item']['max_limit']) {\r\n return true;\r\n }\r\n if (preg_match(\"/./\", $item['Item']['max_limit'])) {\r\n return false;\r\n }\r\n return false;\r\n }", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "public function isIncludedInBasePrice();", "public function isQtyUsesDecimals($productId) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if ($manageStock) {\n $isQtyDecimal = $stockItem->getIsQtyDecimal();\n if ($isQtyDecimal == 1) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "function tep_subproducts_parent($products_id) {\n\t$product_sub_product_query = tep_db_query(\"select products_parent_id from \" . TABLE_PRODUCTS . \" p where p.products_id = '\" . (int)$products_id . \"'\");\n\t$product_sub_product = tep_db_fetch_array($product_sub_product_query);\n\tif ($product_sub_product['products_parent_id'] > 0){\n\t\treturn $product_sub_product['products_parent_id'];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function validateSetStock($setCart)\n {\n $setStock = $setCart->qty;\n\n foreach ($setCart->children as $key => $child) {\n if ($child->subproduct_id !== null) {\n $subCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('subproduct_id', $child->subproduct_id)\n ->get()->sum('qty');\n\n $subStock = SubProduct::find($child->subproduct_id)->stoc;\n $stock_qty = ($subStock - $subCartsSum) > 0 ? $subStock - $subCartsSum : 0;\n $qty = ($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }else{\n $prodCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('product_id', $child->product_id)\n ->get()->sum('qty');\n\n\n $prodStock = Product::find($child->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty =($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }\n }\n\n $stock_qty = $setCart->children->min('stock_qty');\n $qty = ($setCart->qty > $stock_qty) || ($setCart->qty === 0) ? $stock_qty : $setCart->qty;\n\n $setCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "public function getHasChild()\n {\n $sql = \"SELECT * FROM \" . TB_USAGE . \" WHERE parent_id = \" . $this->db->sqltext($this->mix_id);\n $this->db->query($sql);\n if ($this->db->num_rows() > 0) {\n $this->hasChild = true;\n } else {\n $this->hasChild = false;\n }\n\n return $this->hasChild;\n }", "public function hasPrecost(){\n return $this->_has(25);\n }", "public function hasProducenum(){\n return $this->_has(35);\n }", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function hasNumber() {\n return $this->_has(2);\n }", "public function check_product_items(){\n\t\t$arr = $this->arr_product_items;\n\t\t//taxper\n\t\tif(isset($arr['taxper']))\n\t\t\t$this->arr_product_items['taxper'] = (float)$arr['taxper'];\n\t\telse\n\t\t\t$this->arr_product_items['taxper'] = 0;\n\t\t//sizew_unit\n\t\tif(!isset($arr['sizew_unit']) || $arr['sizew_unit']=='')\n\t\t\t$this->arr_product_items['sizew_unit'] = 'in';\n\t\t//sizeh_unit\n\t\tif(!isset($arr['sizeh_unit']) || $arr['sizeh_unit']=='')\n\t\t\t$this->arr_product_items['sizeh_unit'] = 'in';\n\t\t//sizew\n\t\tif(isset($arr['sizew']))\n\t\t\t$this->arr_product_items['sizew'] = (float)$arr['sizew'];\n\t\telse\n\t\t\t$this->arr_product_items['sizew'] = 0;\n\t\t//sizeh\n\t\tif(isset($arr['sizeh']))\n\t\t\t$this->arr_product_items['sizeh'] = (float)$arr['sizeh'];\n\t\telse\n\t\t\t$this->arr_product_items['sizeh'] = 0;\n\t\t//quantity\n\t\tif(isset($arr['quantity']))\n\t\t\t$this->arr_product_items['quantity'] = (float)$arr['quantity'];\n\t\telse\n\t\t\t$this->arr_product_items['quantity'] = 0;\n\n\t\t//adj_qty\n\t\t$this->arr_product_items['adj_qty'] = 0;\n\n\t\t//oum\n\t\tif(!isset($arr['oum']))\n\t\t\t$this->arr_product_items['oum'] = 'unit';\n\n\t\t//oum_depend\n\t\tif(!isset($arr['oum_depend']))\n\t\t\t$this->arr_product_items['oum_depend'] = 'unit';\n\t\tif(isset($arr['oum_depend']) && $arr['oum_depend']=='Sq. ft.')\n\t\t\t$this->arr_product_items['oum_depend'] = 'Sq.ft.';\n\n\t\t//sell_price\n\t\tif(isset($arr['sell_price']))\n\t\t\t$this->arr_product_items['sell_price'] = (float)$arr['sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['sell_price'] = 0;\n\n\t\t//plus_sell_price\n\t\tif(isset($arr['plus_sell_price']))\n\t\t\t$this->arr_product_items['plus_sell_price'] = (float)$arr['plus_sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_sell_price'] = 0;\n\n\t\t//plus_price\n\t\tif(isset($arr['plus_unit_price']))\n\t\t\t$this->arr_product_items['plus_unit_price'] = (float)$arr['plus_unit_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_unit_price'] = 0;\n\n\t\t//reset unit_price\n\t\t\t$this->arr_product_items['unit_price'] = 0;\n\t\t//reset sub_total\n\t\t\t$this->arr_product_items['sub_total'] = 0;\n\t\t//reset tax\n\t\t\t$this->arr_product_items['tax'] = 0;\n\t\t//reset amount\n\t\t\t$this->arr_product_items['amount'] = 0;\n\n\t}", "public function isIncludedInDisplayPrice();", "public function _validarProducto()\n {\n $listaProductos = Producto::_traerProductos();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n foreach($listaProductos as $unProducto)\n { \n if($this->_codigo == $unProducto->_codigo)\n {\n if($this->_stock != $unProducto->_stock)\n {\n //Son iguales con distinto stock, se actualiza.\n $unProducto->_stock = $this->_stock;\n Producto::_actualizarProducto($listaProductos);\n $retorno = 0;\n break;\n }\n else\n {\n //Son iguales con mismo stock, no pasa la validación.\n $retorno = 1;\n break;\n }\n \n }\n }\n \n return $retorno;\n }", "public function verifyProduct($product): bool\r\n {\r\n $prod = $this->getProductById($product[\"product-id\"]);\r\n if ($prod[\"price\"] == $product[\"unit-price\"] &&\r\n \\Mpopa\\Helper::compareFloats($product[\"total\"], ($prod[\"price\"] * $product[\"quantity\"]))\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasNum(){\n return $this->_has(17);\n }", "public function testHasChildren()\n {\n $this->assertTrue($this->p1->hasChildren());\n $this->assertTrue($this->p2->hasChildren());\n\n $this->assertTrue($this->c11->hasChildren());\n $this->assertFalse($this->c12->hasChildren());\n\n $this->assertFalse($this->c21->hasChildren());\n $this->assertFalse($this->c22->hasChildren());\n $this->assertFalse($this->c23->hasChildren());\n\n $this->assertFalse($this->c111->hasChildren());\n }", "public function test_quantity_by_product()\n {\n $order1 = \\App\\Order::find(1);\n $product5 = \\App\\Product::find(5);\n $product7 = \\App\\Product::find(7);\n $product8 = \\App\\Product::find(8);\n $product20 = \\App\\Product::find(20);\n\n $this->assertEquals(4, $this->orders_service->getQuantityByProduct($order1, $product5));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product7));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product8));\n $this->assertEquals(1, $this->orders_service->getQuantityByProduct($order1, $product20));\n }", "public function has_qty() {\n\t\treturn $this->get_qty() !== '';\n\t}", "function BuyableCalculatedExcludedFrom(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->ExcludedFrom();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->ExcludedFrom();\n\t}", "public function hasNumberValue(){\n return $this->_has(2);\n }", "public function getAvailChildProds($parentProdId, $fromDate, $toDate, $extendedDays, $defaultFilterArr,$orderedProdsArr=array(),$selectedFilter = 0)\n {\n// echo $parentProdId.'---'.$extendedDays.'<br />';\n// dd($defaultFilterArr);\n $availableProdsArr = array();\n $getChildProdsArr = $this->getChildProducts($parentProdId);\n\n if (!empty($getChildProdsArr)) {\n /*For handicap*/\n if (empty($defaultFilterArr)) {\n $defaultFilterArr = (!empty(session()->get('defaultFilterArr')) ? session()->get('defaultFilterArr') : Config::get('constants.Default_Filter'));\n }\n /*if($selectedFilter == 60 && $defaultFilterArr[0] == 60){\n $defaultFilterArr[1] = 55;\n $defaultFilterArr[2] = 27;\n $defaultFilterArr[3] = 58;\n $defaultFilterArr[4] = 0;\n }*/\n// $HandicapAttribArr = $this->getProdIDByAttributes($defaultFilterArr[4]);\n\n $FlexAttribArr = $this->getProdIDByAttributes($defaultFilterArr[3]);\n\n $HandAttribArr = $this->getProdIDByAttributes($defaultFilterArr[1]);\n\n $ShaftAttribArr = $this->getProdIDByAttributes($defaultFilterArr[2]);\n\n $GenderAttribArr = $this->getProdIDByAttributes($defaultFilterArr[0]);\n $addedProdArr = array();\n if(count($orderedProdsArr)>0){\n foreach ($orderedProdsArr as $orderedProds){\n array_push($addedProdArr, $orderedProds->product_id);\n }\n }\n// in_array($childArr->id, $HandicapAttribArr)&&\n foreach ($getChildProdsArr as $childArr) {\n if (in_array($childArr->id, $FlexAttribArr) && in_array($childArr->id, $HandAttribArr) && in_array($childArr->id, $ShaftAttribArr) && in_array($childArr->id, $GenderAttribArr) && !in_array($childArr->id, $addedProdArr)) {\n\n $CheckProdArr = $this->checkChildForBooking($childArr->id, $fromDate, $toDate, $extendedDays);\n /*if($parentProdId == '123'){\n echo $childArr->id.' --- '.$fromDate.' ---- '.$toDate.' ---- '.$extendedDays;\n echo '<br />';\n print_r($CheckProdArr);\n echo '<br />';\n }*/\n if (empty($CheckProdArr[0])) {\n $ArrtibSetArr = $this->getProdAttribsByProdId($childArr->id);\n if(count($ArrtibSetArr)>0){\n foreach ($ArrtibSetArr as $attrib){\n if($attrib->attrib_name == 'Handicap'){\n $childArr->handicap = $attrib->value;\n }\n }\n }\n array_push($availableProdsArr, $childArr);\n }\n }\n }\n }\n\n return $availableProdsArr;\n }", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "public function isSelf(){\n\t\t$db = new DB_WE();\n\n\t\tif($this->ID){\n\t\t\t$count = 0;\n\t\t\t$parentid = $this->ParentID;\n\t\t\twhile($parentid != 0){\n\t\t\t\tif($parentid == $this->ID){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t$parentid = f('SELECT ParentID FROM ' . escape_sql_query($this->_table) . ' WHERE ID=' . intval($parentid), '', $db);\n\t\t\t\t$count++;\n\t\t\t\tif($count == 9999){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function isChildOnly();", "public function hasDerivationElement(): bool\n {\n return $this->isChildElementSet(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasNewPrice(){\n return $this->_has(16);\n }", "public function hasProductInfos(){\n return $this->_has(1);\n }", "function is_product() {\n\t\treturn is_singular( array( 'product' ) );\n\t}", "public function hasParentChildFilter() {\n return $this->_has(4);\n }", "function _childexists($SuperID, $menuData){\n if (isset($menuData['parents'][$SuperID])) {\n return true;\n }\n return false;\n }", "function get_price_html() {\n\t\t$price = '';\n\t\tif ( $this->has_child() ) :\n\t\t\t\n\t\t\t$min_price = '';\n\t\t\t$max_price = '';\n\t\t\t\n\t\t\tforeach ($this->children as $child) :\n\t\t\t\t$child_price = $child->product->get_price();\n\t\t\t\tif ($child_price<$min_price || $min_price == '') $min_price = $child_price;\n\t\t\t\tif ($child_price>$max_price || $max_price == '') $max_price = $child_price;\n\t\t\tendforeach;\n\t\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($min_price);\t\t\n\t\telseif ($this->is_type('variable')) :\n\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($this->get_price());\t\n\t\t\n\t\telse :\n\t\t\tif ($this->price) :\n\t\t\t\tif ($this->is_on_sale() && isset($this->data['regular_price'])) :\n\t\t\t\t\t$price .= '<del>'.woocommerce_price( $this->data['regular_price'] ).'</del> <ins>'.woocommerce_price($this->get_price()).'</ins>';\n\t\t\t\telse :\n\t\t\t\t\t$price .= woocommerce_price($this->get_price());\n\t\t\t\tendif;\n\t\t\tendif;\n\t\tendif;\n\t\treturn $price;\n\t}", "public function testUnknownParentThrowsException()\n {\n $this->expectException(ProductNotFoundException::class);\n\n $foundProduct = new ProductEntity();\n $foundProduct->setId('ID-123');\n $foundProduct->setParentId('PARENT-123');\n\n $fakeRepoProducts = new FakeProductRepository(null, $foundProduct);\n\n $item = $this->buildProductLineItem('10001');\n\n $vouchers = new VoucherService($fakeRepoProducts, new NullLogger());\n $vouchers->getFinalVoucherType($item, $this->salesChannelContext);\n }", "abstract public function getOriginalQty();", "public function _assertStoreCartHasProductsWithMinimalQuantity()\n {\n }", "public function testInclusiveCostsWithNewChildren()\n {\n $node = new CallTreeNode(\n 'file1', 'func1', self::toCostArray(2, 3, 5, 7)\n );\n $nodeChild = new CallTreeNode(\n 'file2', 'func2', self::toCostArray(11, 14, 17, 19)\n );\n $nodeSubChild = new CallTreeNode(\n 'file3', 'func3', self::toCostArray(1, 3, 7, 29)\n );\n $nodeSubSubChild = new CallTreeNode(\n 'file4', 'func4', self::toCostArray(2, 97, 2, 3)\n );\n\n $node->addChild($nodeChild);\n $nodeChild->addChild($nodeSubChild);\n $nodeChild->addChild($nodeSubSubChild);\n $costs = $node->getInclusiveCosts();\n $this->assertEquals(16, $costs['time']);\n $this->assertEquals(97, $costs['mem']);\n $this->assertEquals(31, $costs['cycles']);\n $this->assertEquals(29, $costs['peakmem']);\n }", "public function hasPopulations() {\n return $this->_has(22);\n }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getNumberDescendants();", "public function hasActdiscount(){\n return $this->_has(34);\n }", "function has_child($id){\n\t\t$rs = $this->db->query('select count(*) from c_dokumen_informasi where parent_id='.$id.'')->result_array();\n\t\t$row = $rs;\n\t\treturn $row[0] > 0 ? true : false;\n\t}", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "public function getCostDetails()\n {\n\n $return = array (\n 'type' => $this->getType(),\n 'extra' => null,\n 'cost' => $this->getCost(),\n 'total' => $this->getCost(),\n 'children' => array(),\n );\n\n //call the children and populate 'children'\n $order = $this->getOrder();//get the order\n $items = $order->getItem();//get all the items in the order\n $children = array();\n foreach ($items as $i => $item) {\n if (is_object($item) && $item->getType() != $this->getType() && is_object($item->getParent())) {\n $p = $item->getParent();//get parent\n if ($p->getId() == $this->getId()) {\n //Parent is same as me, so this is a child of mine, add it to the array of children.\n //remember the function is not static, so cannot use callDisplay() or callUpdate(), need to call\n //the method directly.\n $costResult = $item->getCostDetails();\n if ($costResult !== false) {\n //only add if they do not return bool false\n $children[$item->getId()] = $costResult;\n $return['total'] += $costResult['total']; //add to total we are returning.\n }\n }\n }\n }\n if ($return['total'] == 0) {\n //total is 0, even after going through children! no cost details to return\n return false;\n }\n if (count($children)) {\n //add children to the array\n $return['children'] = $children;\n }\n return $return;\n }", "private function getExistProductRecount() {\n return false;\n }", "public function testPriceGroupWithVariantsAndFirstGraduation()\n {\n $number = __FUNCTION__;\n $context = $this->getContext();\n\n $data = $this->createPriceGroupProduct($number, $context, true);\n\n $this->helper->createArticle($data);\n\n $listProduct = $this->helper->getListProduct($number, $context, [\n 'useLastGraduationForCheapestPrice' => false,\n ]);\n\n static::assertEquals(9, $listProduct->getCheapestPrice()->getCalculatedPrice());\n }", "function calc_value_potion ($level, $alch_perk, $phys_perk, $bene_perk, $pois_perk, $pure_perk) {\n\t\tdb_CRUD::select('ingredient_effect', 'eid, iid, magnitude_modifier, gold_modifier', \"iid in (select iid from effect where specials = 'y')\", 'eid');\n\t\t$nonStandard_data = db_CRUD::get_result();\n\t\t$cost_arr = array();\n\t\tforeach($this->temp_potion as $potion) {\n\t\t\t$cost_arr = array();\n\t\t\t//for each effect in potion: calculate price of effect\n\t\t\tforeach($potion->effect as $eff) {\n\t\t\t\t$select = \"eid, base_cost, base_magnitude, base_duration, poison, specials\";\n\t\t\t\t$where = \"eid = $eff\";\n\t\t\t\tdb_CRUD::select('effect', $select, $where);\n\t\t\t\t$result = db_CRUD::get_result();\n\t\t\t\t$mag_mod = 0;\n\t\t\t\t$gold_mod = 0;\n\t\t\t\t//if ingredient includes special variants: check if ingredient used is non-standard\n\t\t\t\tif($result[5] == 'y') {\n\t\t\t\t\tforeach($nonStandard_data as $nsd) {\n\t\t\t\t\t\tif($potion->ingredient1 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient2 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($potion->ingredient_cnt == 3 && $potion->ingredient3 == $nsd[1] && $eff == $nsd[0]) {\n\t\t\t\t\t\t\tif(($nsd[2] * $nsd[3]) > ($mag_mod * $gold_mod)) {\n\t\t\t\t\t\t\t\t$mag_mod = $nsd[2];\n\t\t\t\t\t\t\t\t$gold_mod = $nsd[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$mag_mod = 1;\n\t\t\t\t\t$gold_mod = 1;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//specialized effect magnitude formulas\n\t\t\t\tif($eff != 30 && $eff != 34 && $eff != 50 && $eff != 49) {\n\t\t\t\t\t$mag = $result[2] * $mag_mod * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($eff == 46 || $eff == 47 || $eff || 48)\n\t\t\t\t\t\t$mag *= (1 + $phys_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$mag *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$dur = $result[3];\n\t\t\t\t}\n\t\t\t\t//common effect duration formulas\n\t\t\t\telse {\n\t\t\t\t\t$dur = $result[3] * 4 * pow(1.5, $level/100) * (1 + $alch_perk/100);\n\t\t\t\t\tif($result[5] == 'y')\n\t\t\t\t\t\t$dur *= (1 + $pois_perk/100);\n\t\t\t\t\telse\n\t\t\t\t\t\t$mag *= (1 + $bene_perk/100);\n\t\t\t\t\t$mag = $result[2];\n\t\t\t\t}\n\t\t\t\tif($mag != 0 && $dur != 0) \n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * pow($mag, 1.1) * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse if($mag == 0)\n\t\t\t\t\t$eff_cost = floor($result[1] * $gold_mod * 0.0794328 * pow($dur, 1.1));\n\t\t\t\telse\n\t\t\t\t\t$eff_cost = floor($result[1] * pow($mag, 1.1));\n\t\t\t\t$cost_arr[] = array($eff_cost, $result[4]);\n\t\t\t} //end foreach $eff\n\t\t\t//if purity perk is active: find most valuable effect to decide potion/poison\n\t\t\tif($pure_perk == 'y') {\n\t\t\t\t$max = 0;\n\t\t\t\t$x = 0;\n\t\t\t\tforeach($cost_arr as $i => $cost) {\n\t\t\t\t\tif($cost[0] > $max) {\n\t\t\t\t\t\t$max = $cost[0];\n\t\t\t\t\t\t$x = $i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$potion->poison = $cost_arr[$x][1];\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\tif($cost[1] == $cost_arr[$x][1]) {\n\t\t\t\t\t\t$total += $cost[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if no purity perk, sum all effect values\n\t\t\telse {\n\t\t\t\t$total = 0;\n\t\t\t\tforeach($cost_arr as $cost) {\n\t\t\t\t\t$total += $cost[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$potion->value = $total;\n\t\t} //end foreach $potion\n\t}", "public function isReduceItem(): bool\n {\n return $this->dotIndex === \\count($this->rule->getComponents());\n }", "public function hasChildren($parent) {\n\t\t// If the left and right are x and x+1, then there is no kids\n\t\tif ($parent['Aco']['rght'] == $parent['Aco']['lft'] +1 ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function harvest_in_order( $order ) {\n\n\t$items = $order->get_items(); \n\n\tforeach ( $items as $item_id => $item ) {\n\n\t\tif ( $item->get_product_id() === 37592 ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\n\t}\n\t\n\treturn false;\n\n}", "#[ReturnTypeWillChange]\n public function hasChildren()\n {\n return $this->iterator->hasChildren();\n }", "function checkQuantity($userid, $recipeid, $ingredient){\n\t if(($recipeid != NULL) && ($userid != NULL) && ($ingredient != NULL)){\n\t\t if($this->checkInventory($userid,$ingredient))\n\t\t\t {\n\t\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t return false;\n\t\t\t\t\t $tmp = @mysql_query(\"SELECT * FROM Inventory WHERE (UserID = '$userid' AND IngredientName='$ingredient')\");\n\t\t\t $tmp1 = mysql_fetch_assoc($tmp);\n\t\t\t\t\t $qty1 = $tmp1['Quantity'];\n\t\t\n\t\t\t\t\t $tmpx = @mysql_query(\"SELECT * FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName='$ingredient')\");\n\t\t\t $tmp2 = mysql_fetch_assoc($tmpx);\n\t\t\t\t\t $qty2 = $tmp2['Quantity'];\n\t\t\t\t\n\t\t\t\t\t if ($qty1 >= $qty2)\n\t\t\t\t\t return true;\n\t\t\t\t else \n\t\t\t\t\t return false;\n\t\t\t }\n\t\t\t else\n\t\t\t return false;\n\t\t }\n\t\t else\n\t\t return false;\n\t}", "public function hasSiblings() {}", "public function isProductTypeWithQty(): ?bool;", "public function hasInitialQuantity()\n {\n return $this->initial_quantity !== null;\n }", "protected function _beforeToHtml()\n {\n $this->_initTotals();\n foreach ($this->getChild() as $child) {\n if (method_exists($child, 'initTotals')) {\n $child->initTotals();\n }\n }\n return parent::_beforeToHtml();\n }", "public function hasIsResell(){\n return $this->_has(7);\n }", "function percentage($collection){\n\n $number = 10;\n $new_number = count_products($collection);\n\n $new_value = $new_number - $number;\n\n $percentage = abs(($new_value / $number) * 100);\n\n \n if ($new_number < $number){\n\n return $percentage . '% decrease';\n\n }else if($new_number == $number){\n\n return $percentage . '%';\n }\n \n else {\n\n return $percentage . '% increase';\n\n }\n \n}", "public function getProductQuantity()\n {\n }", "private function validate_product_ids() {\n\t\tif ( sizeof( $this->product_ids ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\tif ( in_array( $cart_item['product_id'], $this->product_ids ) || in_array( $cart_item['variation_id'], $this->product_ids ) || in_array( $cart_item['data']->get_parent(), $this->product_ids ) ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "public function getFinalPrice($qty=null, $product)\n {\n static $priceCache = array();\n $qtyKey = is_null($qty) ? '' : $qty;\n $cacheKey = $product->getId() . $qty;\n if (isset($priceCache[$cacheKey])) {\n //Mage::log(\"Yay! Returning cached price of: \" . $priceCache[$cacheKey] . \" for key: \" . $cacheKey);\n return $priceCache[$cacheKey];\n }\n\n $childPrices = array();\n foreach($product->getTypeInstance()->getUsedProducts() as $childProduct) {\n if(!$childProduct->isSalable()) {\n continue;\n }\n $childPrices[] = $childProduct->getFinalPrice();\n //Mage::log(\"getFinalPrice, examining child: \" . $childProduct->getId() . \", has price: \" . $childProduct->getFinalPrice());\n }\n //It's possible for a configurable product to have no children if, for\n //example, and admin user is in the process of creating it and hasn't\n //yet added any children but has marked it as enabled. We currently\n //return 0 for the price in this case. This may need reconsidering.\n if (count($childPrices) == 0) {\n $product->setFinalPrice(0);\n $priceCache[$cacheKey] = 0;\n return 0;\n }\n $childPrice = min($childPrices);\n /*\n if (isset($priceCache[$cacheKey])) {\n //Only for debugging. Can't get here if actually returning cached value above\n if ($priceCache[$cacheKey] != $childPrice) {\n Mage::log(\"Bad! Cached price and calculated price don't match!\");\n }\n }\n */\n $priceCache[$cacheKey] = $childPrice;\n $product->setFinalPrice($childPrice);\n return $childPrice;\n }", "function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testIfStockManagementHasProductId()\n {\n $this->assertNotNull($this->stock->getProductId());\n }", "public function canEditQty()\n {\n $item = $this->getItem();\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($item);\n return $this->requisitionListItemProduct->isProductAttached($item)\n || $this->productChangesAvailabilityChecker->isQtyChangeAvailable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "function hasModel(){ return (tep_not_null($this->productInfo['products_model'])); }", "function ppom_is_price_attached_with_fields( $fields_posted ) {\n\t\n\t\n\t$is_price_attached = false;\n\t\n\t$option_price = 0;\n\t$ppom_id = $fields_posted['id'];\n\tforeach($fields_posted as $data_name => $value) {\n\t\t\n\t\t// soon prodcut_id will be removed\n\t\t$product_id = null;\n\t\t$field_meta = ppom_get_field_meta_by_dataname($product_id, $data_name, $ppom_id);\n\t\t$field_type\t= isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\t\n\t\tswitch( $field_type ) {\n\t\t\t\n\t\t\tcase 'checkbox':\n\t\t\t\tif( is_array($value) ) {\n\t\t\t\t\tforeach($value as $cb_value) {\n\t\t\t\t\t\t$option_price \t+= ppom_get_field_option_price($field_meta, $cb_value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$option_price \t+= ppom_get_field_option_price($field_meta, $value);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tif($option_price > 0) {\n\t\t$is_price_attached = true;\n\t}\n\t\n\t// If price matrix attached\n\tif( isset($_POST['ppom']['ppom_pricematrix']) ) {\n\t\t$is_price_attached = true;\n\t}\n\t\n\t// exit;\n\t\n\treturn apply_filters('ppom_option_price_attached', $is_price_attached, $fields_posted, $product_id);\n}", "public function is_parent_available() {\n\t\t$parent = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'name' => $this->theme->get_template(),\n\t\t\t'posts_per_page' => 1,\n\t\t\t'post_type' => 'repopackage',\n\t\t\t'orderby' => 'ID',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$this->theme->post_parent = current( $parent );\n\n\t\treturn ! empty( $parent );\n\t}", "function has_descendants()\n\t{ \n\t\treturn (($this->model->{$this->right_column} - $this->model->{$this->left_column}) > 1);\n\t}", "public function getQuantity()\n {\n return parent::getQuantity();\n }", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function testGetQtyOf()\n {\n $qtyTomato = $this->recipe->fetchQuantityOf('tomato');\n $this->assertEquals(0.5, $qtyTomato->getAmount());\n $this->assertEquals('kg', $qtyTomato->getUnit()->getSymbol());\n $qtySalt = $this->recipe->fetchQuantityOf('salt');\n $this->assertEquals(0.2, $qtySalt->getAmount());\n $this->assertEquals('kg', $qtySalt->getUnit()->getSymbol());\n $qtyPotato = $this->recipe->fetchQuantityOf('potato');\n $this->assertNull($qtyPotato);\n }", "public function getQuantity();", "public function getQuantity();" ]
[ "0.64629644", "0.5895262", "0.5830275", "0.5750999", "0.5561958", "0.55195826", "0.54768384", "0.5463156", "0.5462959", "0.5350509", "0.5348159", "0.53278416", "0.52991056", "0.5298816", "0.5272486", "0.5272486", "0.5272486", "0.5272486", "0.5272486", "0.5258085", "0.522465", "0.5222707", "0.52093136", "0.5206408", "0.52029485", "0.5192724", "0.51925784", "0.5183204", "0.5126338", "0.5111753", "0.5108215", "0.5075603", "0.5064996", "0.5062336", "0.5043535", "0.5038229", "0.502514", "0.5019472", "0.5019134", "0.5016479", "0.501112", "0.49972415", "0.49868935", "0.49778062", "0.49598283", "0.49454314", "0.49406716", "0.49390042", "0.49371347", "0.49371347", "0.49371347", "0.49371347", "0.49371347", "0.4906523", "0.490579", "0.48962593", "0.489477", "0.48728934", "0.48649842", "0.48648798", "0.4864638", "0.4863704", "0.48522192", "0.4845193", "0.4833845", "0.48298815", "0.48296556", "0.48286867", "0.48278815", "0.48278815", "0.48278815", "0.48239934", "0.48163328", "0.48139772", "0.4809968", "0.48089734", "0.4805847", "0.47998574", "0.47963342", "0.47950533", "0.47933775", "0.47921395", "0.47893596", "0.47744778", "0.4774431", "0.47622892", "0.47588384", "0.47573754", "0.47517243", "0.47510895", "0.47489882", "0.4747044", "0.47441602", "0.47425118", "0.47394168", "0.47359216", "0.473542", "0.47323278", "0.47312224", "0.47312224" ]
0.64571077
1
Adds a comment to order history. Method choosen based on Magento version.
protected function _addStatusHistoryComment($order, $comment) { if(method_exists($order, 'addStatusHistoryComment')) { $order->addStatusHistoryComment($comment)->save();; } elseif(method_exists($order, 'addStatusToHistory')) { $order->addStatusToHistory($order->getStatus(), $comment, false)->save();; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "abstract protected function add(Comment $comment);", "public function execute()\n {\n $order = $this->_initOrder();\n if ($order) {\n try {\n $data = $this->getRequest()->getPost('history');\n if (empty($data['comment']) && $data['status'] == $order->getDataByKey('status')) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('The comment is missing. Enter and try again.')\n );\n }\n\n $notify = isset($data['is_customer_notified']) ? $data['is_customer_notified'] : false;\n $visible = isset($data['is_visible_on_front']) ? $data['is_visible_on_front'] : false;\n\n $history = $order->addStatusHistoryComment($data['comment'], $data['status']);\n $history->setIsVisibleOnFront($visible);\n $history->setIsCustomerNotified($notify);\n $history->save();\n\n $comment = trim(strip_tags($data['comment']));\n\n $order->save();\n /** @var OrderCommentSender $orderCommentSender */\n $orderCommentSender = $this->_objectManager\n ->create(\\Magento\\Sales\\Model\\Order\\Email\\Sender\\OrderCommentSender::class);\n\n $orderCommentSender->send($order, $notify, $comment);\n\n return $this->resultPageFactory->create();\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $response = ['error' => true, 'message' => $e->getMessage()];\n } catch (\\Exception $e) {\n $response = ['error' => true, 'message' => __('We cannot add order history.')];\n }\n if (is_array($response)) {\n $resultJson = $this->resultJsonFactory->create();\n $resultJson->setData($response);\n return $resultJson;\n }\n }\n return $this->resultRedirectFactory->create()->setPath('sales/*/');\n }", "public function add_comm()\n {\n $this->comments++;\n }", "public function InsertComment($details)\n {\n $this->comments[] = $details;\n }", "function wap8_trackbacks( $comment ) {\n$GLOBALS['comment'] = $comment; ?>\n<li><?php printf( __( '%s', 'designcrumbs' ), get_comment_author_link() ) ?> <?php edit_comment_link( __( 'Edit', 'designcrumbs' ), '<span>', '</span>' ); ?>\n<?php\n}", "public function record_comment(){\n\t\t\t\n\t\t}", "protected function setOrderNotificationNote($message)\n {\n $note = 'Buckaroo attempted to update this order, but failed: ' . $message;\n try {\n $this->order->addStatusHistoryComment($note);\n $this->order->save();\n } catch (\\Buckaroo\\Magento2\\Exception $e) {\n $this->logging->addDebug($e->getLogMessage());\n }\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function commentCard()\n {\n $action = Mage::getModel('trello/action')->load($this->getId(), 'action_id');\n\n if ($action && $action->getId()) {\n $this->getDataHelper()->log('Action ' . $this->getId() . ' already registered', Zend_Log::DEBUG);\n return false;\n }\n\n $comment = $this->getPayload()['text'];\n $comment = trim(strip_tags($comment));\n\n /** @var Emagedev_Trello_Model_Action $action */\n $action = Mage::getModel('trello/action');\n $action\n ->setText($comment)\n ->parseTextHeader();\n\n if ($action->getHistoryCommentId()) {\n /** @var Mage_Sales_Model_Order_Status_History $commentModel */\n $commentModel = Mage::getModel('sales/order_status_history')->load($action->getHistoryCommentId());\n\n if ($commentModel && $commentModel->getId()) {\n $this->getDataHelper()->log('Comment for action ' . $this->getId() . ' already existing (by header id)', Zend_Log::DEBUG);\n return false;\n } else {\n $this->getDataHelper()->log('Cannot load comment #' . $action->getHistoryCommentId() . ' fetched from header of action', Zend_Log::ERR);\n }\n } else {\n $this->getDataHelper()->log('Not found id in header for comment ' . $this->getId(), Zend_Log::DEBUG);\n }\n\n $member = $this->getActingMember();\n\n /** @var Emagedev_Trello_Model_Card $card */\n $card = Mage::getModel('trello/card');\n\n $card->loadFromTrello($this->getPayload()['card']['id']);\n\n if (!$card || !$card->getId()) {\n $this->getDataHelper()->log('Cannot find card to add comment ' . $this->getPayload()['card']['id'], Zend_Log::ERR);\n return false;\n }\n\n $order = $card->getOrder();\n\n if (!$order || !$order->getId()) {\n $this->getDataHelper()->log('Cannot find order to update comment ' . $this->getPayload()['card']['id'], Zend_Log::ERR);\n return false;\n }\n\n $this->getDataHelper()->log('Add comment to order #' . $order->getIncrementId(), Zend_Log::DEBUG);\n\n /** @var Mage_Sales_Model_Order_Status_History $commentModel */\n $commentModel = $order->addStatusHistoryComment($action->getText(), $order->getStatus());\n\n $commentModel\n ->setIsVisibleOnFront(false)\n ->setIsCustomerNotified(false);\n\n Mage::dispatchEvent(\n 'trello_webhook_comment_order_card_before', array(\n 'member' => $member,\n 'card' => $card,\n 'order' => $order,\n 'status_history' => $commentModel\n ));\n\n $commentModel->save();\n\n Mage::dispatchEvent(\n 'trello_webhook_comment_order_card_after', array(\n 'member' => $member,\n 'card' => $card,\n 'order' => $order,\n 'status_history' => $commentModel\n ));\n\n $action\n ->setStatusHistory($commentModel)\n ->setActionId($this->getId())\n ->setOrder($order)\n ->setOriginExternal(true)\n ->disableSync()\n ->save();\n\n return true;\n }", "public function addComment(Comment $comment)\n {\n $this->comments[] = $comment;\n }", "function addComments($artifact, $comments){\n\t\tforeach($comments as $c){\n\t\t\t$time = strtotime($c['date']);\n\t\t\t$uid = user_get_object_by_name($c['submitter'])->getID();\n\t\t\t$importData = array('time' => $time, 'user' => $uid);\n\t\t\t$artifact->addMessage($c['comment'], $importData);\n\t\t}\n\t}", "public function actionAddVehicleCommentInd(){\t \n\t date_default_timezone_set(\"Europe/London\");\n\t \n\t // Gets basic vehicle info used in the save\n\t $vehicle = Vehicles::model()->getBasicInfo($_POST['vehicle_id']);\n\t \n\t // Adds the vehicle comment\n\t $vC = new VehicleComments();\n\t $vC->added_by = Yii::app()->user->id;\n\t $vC->comment = $_POST['comment'];\n\t $vC->date_added = date(\"Y-m-d H:i:s\");\n\t $vC->vehicle_id = $_POST['vehicle_id'];\n\t $vC->make_model_id = $vehicle['make_model_id'];\n\t $vC->save();\n\t}", "public function logOrder($observer) {\n \n /* @var $order Mage_Sales_Model_Order */\n $order = $observer->getEvent()->getOrder();\n \n //Can log\n if ($this->canLog($order)\n && !$this->resourceTransaction()->checkTransaction($order->getEntityId())){\n \n //Add transaction\n $this->resourceTransaction()\n ->addTransaction($order->getEntityId(), \n $order->getGrandTotal(), \n $this->helper()->getLogDecimalFactor()\n );\n \n if ($this->helper()->canAddComment()){\n $order->addStatusHistoryComment($this->helper()->__(\"Added value %s\", $this->resourceTransaction()->getLastAddedValue()))\n ->save();\n }\n }\n \n return $this;\n }", "public function addComment($comment)\n\t{\n\t\tif(Yii::$app->params['commentNeedApproval'])\n\t\t\t$comment->status=Workflow::STATUS_DRAFT;\n\t\telse\n\t\t\t$comment->status=Workflow::STATUS_APPROVED;\n\t\t$comment->comment_table=Workflow::MODULE_BLOG;\n\t\t$comment->comment_id=$this->id;\n\t\treturn $comment->save();\n\t}", "public function addSmsHistoryBlockToSalesOrderViewTab(Varien_Event_Observer $observer){\n\t\t$block = $observer->getBlock();\n\t\tif (($block->getNameInLayout() == 'order_info') && ($child = $block->getChild('sy.order.info.sms.history'))) {\n\t\t\t$transport = $observer->getTransport();\n\t\t\tif($transport) {\n\t\t\t\t$html = $transport->getHtml();\n\t\t\t\t$html .= $child->toHtml();\n\t\t\t\t$transport->setHtml($html);\n\t\t\t}\n\t\t}\n\t}", "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "public function setComment($comment);", "public function setComment($comment);", "public function add($comment)\n {\n $comments = $this->session->get('comments', []);\n $comments[] = $comment;\n $this->session->set('comments', $comments);\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function trackOrder($trackingNo);", "public function post_order_comment()\n\t{\n\t\tif ($this->checkLogin('A') != '') {\n\t\t\t$product_id = $this->input->post('product_id');\n\t\t\t$comment_from = $this->input->post('comment_from');\n\t\t\t$commentor_id = $this->input->post('commentor_id');\n\t\t\t$deal_code = $this->input->post('deal_code');\n\t\t\t$comment = $this->input->post('comment');\n\t\t\t$data = array('date' => date(\"Y-m-d H:i:s\"),'product_id' => $product_id,'comment_from' => $comment_from,'commentor_id' => $commentor_id,'deal_code' => $deal_code,'comment' => $comment);\n\t\t\t$this->order_model->simple_insert(REVIEW_COMMENTS,$data);\n\t\t}\n\t}", "public function getCustomerOrderComment()\n\t{\n\t\treturn $this->getAurednikOrder()->getData('aurednik_order_comment');\n\t}", "function generateComment(&$eventData, $comment)\n {\n $eventData['comment'] = \"-- $comment --<br>\\n\" . $eventData['comment'];\n }", "public function addComment($id, \\Magento\\Sales\\Api\\Data\\OrderStatusHistoryInterface $statusHistory)\n {\n $order = $this->orderRepository->get($id);\n $order->addStatusHistory($statusHistory);\n $this->orderRepository->save($order);\n $notify = isset($statusHistory['is_customer_notified']) ? $statusHistory['is_customer_notified'] : false;\n $comment = trim(strip_tags($statusHistory->getComment()));\n $this->orderCommentSender->send($order, $notify, $comment);\n return true;\n }", "public function addComment( $comment )\n\t{\n\t\tif ( Yii::app()->params['commentNeedApproval'] )\n\t\t\t$comment->status = Comment::STATUS_PENDING;\n\t\telse\n\t\t\t$comment->status = Comment::STATUS_APPROVED;\n\t\t$comment->howto_id = $this->id;\n\t\treturn $comment->save();\n\t}", "function addcomment($purchase_hash = NULL) {\n\n if ($purchase_hash == NULL) {\n $this->session->set_flashdata('error', 'No comment ID specified to comment on.');\n redirect(\"purchases\");\n }\n\n // Decode hash to purchase ID\n $purchase_id = hashids_decrypt($purchase_hash);\n\n // Get Purchase info\n $purchase = $this->purchases_model->getPurchaseById($purchase_id);\n\n // Verify purchase exists and user has permission.\n if ($purchase == FALSE || !$this->_userCanView($purchase[$purchase_id])) {\n $this->session->set_flashdata('error', 'Purchase does not exist, or you are not allowed to view it.');\n redirect(\"purchases\");\n }\n\n if ($text = htmlspecialchars(trim($this->input->post('commenttext')))) {\n\n // Is it a comment or a dispute?\n // note - $_POST['button_dispute'] will be '' if dispute was pressed.\n $type = (($this->input->post('button_dispute') === '') ? 'dispute' : 'comment');\n\n if ($this->purchases_model->addComment($this->user['user_id'], $purchase_id, $text, $type)) {\n // it worked\n $this->session->set_flashdata('success', \"Your $type was added successfully.\");\n redirect('purchases/view/' . hashids_encrypt($purchase_id));\n } else {\n // comment save failed\n $this->session->set_flashdata('error', \"There was an error saving your $type. Please try again later.\");\n redirect('purchases/view/' . hashids_encrypt($purchase_id));\n }\n } else {\n $this->session->set_flashdata('error', 'No comment data received.');\n redirect(\"purchases\");\n }\n }", "abstract protected function add_comment_call_model_add(array $arguments);", "public function addComment(commentObj $obj) {\n\t\tarray_push($this->arrComments, $obj);\n\t}", "public function add_order_history ($order_id, $status, $customer_notified = 0)\n\t{\n\t\ttep_db_query(\"\n\t\t\tINSERT INTO orders_status_history (orders_id, orders_status_id, comments, date_added, customer_notified)\n\t\t\tVALUES ('\" . tep_db_input($order_id) . \"', '\" . static::get_status_id($status) . \"', '\" . static::$STATUS_MESSAGES[$status] . \"', now(), \".($customer_notified >= 1 ? 1 : 0).\")\n\t\t\");\n\t}", "public function addOrder(Order $order);", "public function addComment($comment, $packageId = null)\n {\n if (null === $this->_htmlHeadEntrySet) {\n throw new Zap_Exception(\n sprintf(\n \"Child class '%s' did not \".\n 'instantiate a HTML head entry set. This should be done in '.\n 'the constructor either by calling parent::__construct() or '.\n 'by creating a new HTML head entry set.', get_class($this)\n )\n );\n }\n\n $this->_htmlHeadEntrySet->addEntry(\n new SwatCommentHtmlHeadEntry($comment, $packageId)\n );\n }", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "public function increaseCommentCount()\n {\n \tif($this->comment_count != null)\n \t\t$this->comment_count++;\n \telse\n \t\t$this->comment_count = 1;\n \t$this->save();\n }", "public function setComment(?WorkbookComment $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function setOrder(\\Magento\\Sales\\Model\\Order $order);", "function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "function action_comment_insert_after( $comment )\n\t{\n\t\tif ( $comment->status == Comment::STATUS_APPROVED ) {\n\t\t\t$this->update_post_modified( $comment->post_id );\n\t\t\tEventLog::log( 'bumped post ' . $comment->post_id, 'info', 'default', 'bumping' );\n\t\t}\n\t}", "public function addComment($user, $comment) {\r\n\r\n $timestamp = date(\"Y-m-d-h-i-s-a\", time());\r\n $sql = \"INSERT INTO RecipeComments(page, comment, username, timestamp) VALUES ('$this->page', '$comment', '$user', '$timestamp')\";\r\n \r\n mysqli_query($this->conn, $sql);\r\n\r\n }", "public function changeComment($comment)\r\n {\r\n\r\n }", "public function addCommentLine( $product_id = null, $combination_id = null, $quantity = 1.0, $params = [] )\n {\n // Do the Mambo!\n $line_type = array_key_exists('line_type', $params) \n ? $params['line_type'] \n : 'comment';\n\n // Customer\n $customer = $this->customer;\n $salesrep = $customer->salesrep;\n \n // Currency\n $currency = $this->document_currency;\n\n // Product\n // Consider \"not coded products\" only\n\n $reference = array_key_exists('reference', $params) \n ? $params['reference'] \n : '';\n\n $name = array_key_exists('name', $params) \n ? $params['name'] \n : $line_type;\n\n $cost_price = array_key_exists('cost_price', $params) \n ? $params['cost_price'] \n : 0.0;\n\n // Tax\n $tax_id = array_key_exists('tax_id', $params) \n ? $params['tax_id'] \n : Configuration::get('DEF_TAX');\n $tax = Tax::findOrFail($tax_id);\n $taxing_address = $this->taxingaddress;\n $tax_percent = $tax->getTaxPercent( $taxing_address );\n\n $sales_equalization = array_key_exists('sales_equalization', $params) \n ? $params['sales_equalization'] \n : 0;\n\n // Price Policy\n $pricetaxPolicy = array_key_exists('prices_entered_with_tax', $params) \n ? $params['prices_entered_with_tax'] \n : Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n // Service Price\n $price = new Price($params['unit_customer_final_price'], $pricetaxPolicy, $currency);\n $price->applyTaxPercent( $tax_percent );\n// if ( $price->currency->id != $currency->id ) {\n// $price = $price->convert( $currency );\n// }\n $unit_price = $price->getPrice();\n\n // Calculate price per $customer_id now!\n // $customer_price = $product->getPriceByCustomer( $customer, $quantity, $currency );\n $customer_price = clone $price;\n\n // Is there a Price for this Customer?\n if (!$customer_price) return null; // Product not allowed for this Customer\n\n // $customer_price->applyTaxPercent( $tax_percent );\n $unit_customer_price = $customer_price->getPrice();\n\n // Customer Final Price\n if ( array_key_exists('prices_entered_with_tax', $params) && array_key_exists('unit_customer_final_price', $params) )\n {\n $unit_customer_final_price = new Price( $params['unit_customer_final_price'], $pricetaxPolicy, $currency );\n\n $unit_customer_final_price->applyTaxPercent( $tax_percent );\n\n } else {\n\n $unit_customer_final_price = clone $customer_price;\n }\n\n // Discount\n $discount_percent = array_key_exists('discount_percent', $params) \n ? $params['discount_percent'] \n : 0.0;\n\n // Final Price\n $unit_final_price = clone $unit_customer_final_price;\n if ( $discount_percent ) \n $unit_final_price->applyDiscountPercent( $discount_percent );\n\n // Sales Rep\n $sales_rep_id = array_key_exists('sales_rep_id', $params) \n ? $params['sales_rep_id'] \n : optional($salesrep)->id;\n \n $commission_percent = array_key_exists('sales_rep_id', $params) && array_key_exists('commission_percent', $params) \n ? $params['commission_percent'] \n : 0.0;\n\n\n\n // Misc\n $measure_unit_id = array_key_exists('measure_unit_id', $params) \n ? $params['measure_unit_id'] \n : Configuration::get('DEF_MEASURE_UNIT_FOR_PRODUCTS');\n\n $line_sort_order = array_key_exists('line_sort_order', $params) \n ? $params['line_sort_order'] \n : $this->getMaxLineSortOrder() + 10;\n\n $notes = array_key_exists('notes', $params) \n ? $params['notes'] \n : '';\n\n\n // Build OrderLine Object\n $data = [\n 'line_sort_order' => $line_sort_order,\n 'line_type' => $line_type,\n 'product_id' => $product_id,\n 'combination_id' => $combination_id,\n 'reference' => $reference,\n 'name' => $name,\n 'quantity' => $quantity,\n 'measure_unit_id' => $measure_unit_id,\n\n 'prices_entered_with_tax' => $pricetaxPolicy,\n \n 'cost_price' => $cost_price,\n 'unit_price' => $unit_price,\n 'unit_customer_price' => $unit_customer_price,\n 'unit_customer_final_price' => $unit_customer_final_price->getPrice(),\n 'unit_customer_final_price_tax_inc' => $unit_customer_final_price->getPriceWithTax(),\n 'unit_final_price' => $unit_final_price->getPrice(),\n 'unit_final_price_tax_inc' => $unit_final_price->getPriceWithTax(), \n 'sales_equalization' => $sales_equalization,\n 'discount_percent' => $discount_percent,\n 'discount_amount_tax_incl' => 0.0, // floatval( $request->input('discount_amount_tax_incl', 0.0) ),\n 'discount_amount_tax_excl' => 0.0, // floatval( $request->input('discount_amount_tax_excl', 0.0) ),\n\n 'total_tax_incl' => $quantity * $unit_final_price->getPriceWithTax(),\n 'total_tax_excl' => $quantity * $unit_final_price->getPrice(),\n\n 'tax_percent' => $tax_percent,\n 'commission_percent' => $commission_percent,\n 'notes' => $notes,\n 'locked' => 0,\n \n // 'customer_order_id',\n 'tax_id' => $tax->id,\n 'sales_rep_id' => $sales_rep_id,\n ];\n\n\n // Finishing touches\n $lineClass = $this->getClassName().'Line';\n $document_line = ( new $lineClass() )->create( $data );\n\n $this->lines()->save($document_line);\n\n\n // Good boy, bye then\n return $document_line;\n }", "abstract public function comment();", "public function setComment(Comment $comment): void;", "public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }", "function register_block_core_comment_date()\n {\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function setCustomerCommentDelivery($observer)\r\n {\r\n try{\r\n $order = $observer->getEvent()->getOrder();\r\n $order_id = $order->getData('increment_id') ;\r\n $orderComment = $this->_getRequest()->getPost('suvery');\r\n if(trim($orderComment)!= 'other'){\r\n $orderComment = trim($orderComment);\r\n }else{\r\n $orderComment = trim($this->_getRequest()->getPost('suvery_other'));\r\n }\r\n //save suvery to database\r\n $resource = Mage::getSingleton('core/resource');\r\n $writeConnection = $resource->getConnection('core_write');\r\n $query = \"INSERT INTO \".Mage::getConfig()->getTablePrefix().\"onepagecheckout_suvery VALUES ('','\".$order_id.\"','\".$orderComment.\"','','')\";\r\n $writeConnection->query($query);\r\n //save delivery to datbase\r\n $delivery_date = $this->_getRequest()->getPost('delivery_date');\r\n $delivery_time = $this->_getRequest()->getPost('delivery_time');\r\n $resource = Mage::getSingleton('core/resource');\r\n $writeConnection = $resource->getConnection('core_write');\r\n $query = \"INSERT INTO \".Mage::getConfig()->getTablePrefix().\"onepagecheckout_delivery VALUES ('','\".$order_id.\"','\".$delivery_date.\"','\".$delivery_time.\"','','')\";\r\n $writeConnection->query($query);\r\n }catch(exception $e){\r\n \r\n }\r\n }", "protected function _getOrderComments($apiOrder) {\n $helper = Mage::helper('channelpilot');\n\n $msg = \"\";\n\n // create a message that state that the order is being imported from ChannelPilot if this feature has been enabled\n if(Mage::getStoreConfigFlag(\"channelpilot_marketplace/channelpilot_marketplace/create_order_comment\", $this->shopId)) {\n $msg = $helper->__(\n \"The order has been imported from ChannelPilot and was placed on %s with the order number %s\",\n $apiOrder->orderHeader->source,\n $apiOrder->orderHeader->orderIdExternal\n );\n }\n\n // create an info message that states that the phone number for the delivery address is empty and changed to the fake one\n if (isset($apiOrder->addressDelivery->phone) && empty($apiOrder->addressDelivery->phone)) {\n if(!empty($msg)) {\n $msg .= \"<br/><br/>\";\n }\n $msg .= $helper->__(\n \"The customer did not enter a phone number for the %s. To prevent import errors, the fake phone number %s has been added instead.\",\n $helper->__(\"delivery address\"),\n self::FAKE_PHONE_NUMBER\n );\n }\n\n // create an info message that states that the phone number for the billing address is empty and changed to the fake one\n if (isset($apiOrder->addressInvoice->phone) && empty($apiOrder->addressInvoice->phone)) {\n if(!empty($msg)) {\n $msg .= \"<br/><br/>\";\n }\n $msg .= $helper->__(\n \"The customer did not enter a phone number for the %s. To prevent import errors, the fake phone number %s has been added instead.\",\n $helper->__(\"billing address\"),\n self::FAKE_PHONE_NUMBER\n );\n }\n\n return $msg;\n }", "public function addTabComment() {\r\n\t\t$tab_comment_model = $this->load_model('TabCommentModel');\r\n\t\t$result = $tab_comment_model->addTabComment($this->params['tab_id'], $_SESSION['user']['ID'], $this->sanitize($this->params['content']));\r\n\r\n\t\tif ($result === true) {\r\n\t\t\t\r\n\t\t\t//give 1 reputation\r\n\t\t\t$user_model = $this->load_model('UserModel');\r\n\t\t\t$user_model->giveReputation($_SESSION['user']['ID'], 1);\r\n\t\t\t\r\n\t\t\t//send notification email\r\n\t\t\t$tab_model = $this->load_model('TabModel');\r\n\t\t\t$tab = $tab_model->getTab($this->params['tab_id']);\r\n\t\t\t\r\n\t\t\tif($tab !== null){\r\n\t\t\t\tif($tab['uploader_ID'] !== $_SESSION['user']['ID']){\r\n\t\t\t\t\t$recipient = $user_model->getUser($tab['uploader_ID']);\r\n\t\t\t\t\tUtils::sendTabCommentEmail($tab, $recipient, $_SESSION['user'], $this->params['content']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->sendResponse(1, $result);\r\n\t\t} else {\r\n\t\t\t$this->sendResponse(0, ErrorCodes::DB_ERROR);\r\n\t\t}\r\n\t}", "public function addComment($photo_uid, $comment) {\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('INSERT INTO tx_cwtcommunity_photo_comments (pid, crdate, cruser_id, photo_uid, text) VALUES ('.tx_cwtcommunity_lib_common::getGlobalStorageFolder().',\"'.time().'\", \"'.tx_cwtcommunity_lib_common::getLoggedInUserUID().'\", \"'.$photo_uid.'\", \"'.$comment.'\");');\r\n\t}", "public function save(Comment $comment)\n {\n $this->add($comment);\n }", "public function add(Comment $comment)\n {\n $sql = \"INSERT INTO comments(idArticle, author, content, publishDate)\n VALUES(:idArticle, :author, :content, NOW())\";\n $query = $this->db->prepare($sql);\n $query->execute([\n 'idArticle' => $comment->idArticle(),\n 'author' => $comment->author(),\n 'content' => $comment->content()\n ]);\n }", "function uc_order_pane_order_comments($op, $order, &$form = NULL, &$form_state = NULL) {\n switch ($op) {\n case 'view':\n $comments = uc_order_comments_load($order->order_id);\n return tapir_get_table('uc_op_order_comments_view_table', $comments);\n\n case 'customer':\n $comments = uc_order_comments_load($order->order_id);\n $header = array(t('Date'), t('Status'), t('Message'));\n $rows[] = array(\n array('data' => format_date($order->created, 'uc_store'), 'class' => array('date')),\n array('data' => '-', 'class' => array('status')),\n array('data' => t('Order created.'), 'class' => array('message')),\n );\n if (count($comments) > 0) {\n foreach ($comments as $comment) {\n $rows[] = array(\n array('data' => format_date($comment->created, 'uc_store'), 'class' => array('date')),\n array('data' => $comment->title, 'class' => array('status')),\n array('data' => check_plain($comment->message), 'class' => array('message')),\n );\n }\n }\n $build = array(\n '#theme' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#attributes' => array('class' => array('uc-order-comments')),\n );\n\n return $build;\n }\n}", "public function created(Comment $comment)\n {\n //\n }", "function tp_comm_add_meta($comment_id) {\r\n\t$tw = tp_get_credentials();\r\n\tif ($tw) {\r\n\t\tupdate_comment_meta($comment_id, 'twuid', $tw->screen_name);\r\n\t}\r\n}", "public function m_added_comments($data){\n\t\t$this->db->insert('comments',$data);\n\t}", "function register_block_core_latest_comments()\n {\n }", "public function saveCustomerComment()\n {\n\t$comment = Mage::app()->getRequest()->getParam('comment', null);\n\tif($comment && strlen(trim($comment))) {\n\t $this->_checkoutSession->setData('customer_comment', $comment);\n\t} else {\n\t $this->_checkoutSession->unsetData('customer_comment');\n\t}\n }", "public function logCartAdd($observer){\r\n\r\n\t\t$company_id=Mage::helper('insync_company')\r\n\t\t->getCustomerCompany(Mage::getSingleton('customer/session')->getCustomer()->getId());\r\n\t\tif($company_id){\r\n\t\t\t$event = $observer->getEvent();\r\n\r\n// \t\t\t$quote_item = $event->getQuoteItem();\r\n\r\n// \t\t\t$website_id=Mage::getModel('core/store')->load($quote_item->getData('store_id'))->getWebsiteId();\r\n\r\n\r\n// \t\t\t$product_id=$quote_item->getProductId();\r\n\r\n// \t\t\t$qty=$quote_item->getQty();\r\n\t\t\t\r\n// \t\t\t$quotePrice='';\r\n// \t\t\tif($quote_item->getPrice() == ''){\r\n// \t\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n// \t\t\t\t$quotePrice = $product->getFinalPrice($quote_item->getQty());\r\n// \t\t\t}else{\r\n// \t\t\t\t$quotePrice = $quote_item->getPrice();\r\n// \t\t\t}\r\n// \t\t\tif(!empty($website_id) && !empty($company_id) && !empty($product_id) && !empty($qty) ){\r\n// \t\t\t\t$new_price=\"\";\r\n// \t\t\t\t// Product specific price\r\n// \t\t\t\t$prod_price = Mage::helper('insync_companyrule')->getNewPrice($website_id,$company_id,$product_id,$qty);\r\n\r\n// \t\t\t\t// Category specific price\r\n// \t\t\t\t$cat_price=Mage::helper('insync_companyrule')->getCategoryPrice($product_id,$quotePrice,$company_id,$website_id);\r\n\r\n// \t\t\t\t// Get applicable price\r\n// \t\t\t\t$new_price=Mage::helper('insync_companyrule')->getMinPrice($prod_price,$cat_price,$quotePrice);\r\n\t\t\t\t\t\r\n// \t\t\t\tif($new_price!=''){\r\n// \t\t\t\t\t//if($new_price < $quotePrice){\r\n// \t\t\t\t\t$quote_item->setOriginalCustomPrice($new_price);\r\n// \t\t\t\t\t//$quote_item->save();\r\n// \t\t\t\t\t//}\r\n// \t\t\t\t}\r\n// \t\t\t}\r\n\t\t\t\r\n\t\t\t/* Product Group wise Qty set */\r\n\t\t\tMage::log('logCartAdd', null, 'arijit.log');\r\n\r\n\t\t\t$quote = Mage::getModel('checkout/cart')->getQuote();\r\n\t\t\t/* Array ( [product_group] => qty ) */\r\n\t\t\t$productGroup_qty = array();\r\n\t\t\tforeach ($quote->getAllItems() as $item) {\r\n\t\t\t\t$_product_group = Mage::getModel('catalog/product')->load($item->getProductId())->getData('product_group');\r\n\t\t\t\tif(array_key_exists($_product_group,$productGroup_qty))\r\n\t\t\t\t\t$productGroup_qty[$_product_group] += $item->getQty();\r\n\t\t\t\telse \r\n\t\t\t\t\t$productGroup_qty[$_product_group] = $item->getQty();\t\t\t\t\r\n\t\t\t}\r\n\t\t\tMage::log($productGroup_qty, null, 'arijit.log');\r\n\t\t\t\r\n\t\t\t/* Set each Quote Item Custom Price as per product_group qty */\r\n\t\t\tforeach ($quote->getAllItems() as $quote_item) {\r\n\t\t\t\tMage::log('forloop', null, 'arijit.log');\r\n// \t\t\t\t$quote_item = $event->getQuoteItem();\r\n\t\r\n\t\t\t\t$website_id=Mage::getModel('core/store')->load($quote_item->getData('store_id'))->getWebsiteId();\r\n\t\r\n\t\t\t\t\r\n\t\t\t\t$product_id=$quote_item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$product_group = Mage::getModel('catalog/product')->load($product_id)->getData('product_group');\r\n\t\t\t\tMage::log('product_group => '.$product_group, null, 'arijit.log');\r\n\t\t\t\t$qty = $productGroup_qty[$product_group];\t//\t$quote_item->getQty();\r\n\t\t\t\tMage::log('qty => '.$qty, null, 'arijit.log');\r\n\t\t\t\t$quotePrice='';\r\n\t\t\t\tif($quote_item->getPrice() == ''){\r\n\t\t\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t\t\t\t$quotePrice = $product->getFinalPrice($quote_item->getQty());\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$quotePrice = $quote_item->getPrice();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/* Tier-Price by product_group */\r\n\t\t\t\tMage::log('quote Price', null, 'arijit.log');\r\n\t\t\t\tMage::log($quotePrice, null, 'arijit.log');\r\n\t\t\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t\t\t$productTierPrice = $product->getTierPrice($qty);\r\n\t\t\t\tif (!empty($productTierPrice)) {\r\n\t\t\t\t\tMage::log('Tier Price', null, 'arijit.log');\r\n\t\t\t\t\tMage::log($productTierPrice, null, 'arijit.log');\r\n// \t\t\t\t\t$quotePrice = min($productTierPrice, $quotePrice);\r\n\t\t\t\t\t$quotePrice = $productTierPrice;\r\n\t\t\t\t}\r\n\t\t\t\t/* ------------------------- */\r\n\t\t\t\t\r\n\t\t\t\tif(!empty($website_id) && !empty($company_id) && !empty($product_id) && !empty($qty) ){\r\n\t\t\t\t\t$new_price=\"\";\r\n\t\t\t\t\t// Product specific price\r\n\t\t\t\t\t$prod_price = Mage::helper('insync_companyrule')->getNewPrice($website_id,$company_id,$product_id,$qty);\r\n\t\r\n\t\t\t\t\t// Category specific price\r\n\t\t\t\t\t$cat_price=Mage::helper('insync_companyrule')->getCategoryPrice($product_id,$quotePrice,$company_id,$website_id);\r\n\t\r\n\t\t\t\t\t// Get applicable price\r\n\t\t\t\t\t$new_price=Mage::helper('insync_companyrule')->getMinPrice($prod_price,$cat_price,$quotePrice);\r\n\t\t\t\t\tMage::log('new_price => '.$new_price, null, 'arijit.log');\r\n\t\t\t\t\tif($new_price!=''){\r\n\t\t\t\t\t\t//if($new_price < $quotePrice){\r\n\t\t\t\t\t\t$quote_item->setOriginalCustomPrice($new_price);\r\n\t\t\t\t\t\t//$quote_item->save();\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tunset($qty, $product_group);\r\n\t\t\t}\r\n\r\n\t\t\t/* !!!!!!!!!!!!!!!!!!!! */\r\n\t\t}\r\n\t}", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function testCreateComment() {\n // Find any active product\n $product = ShopProduct::model()->published()->find();\n $this->assertTrue($product instanceof ShopProduct);\n\n $email = '[email protected]';\n $text = 'this is test comment' . microtime();\n\n // Open product page and post comment\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->type('id=Comment_name', 'tester');\n $this->type('id=Comment_email', $email);\n $this->type('id=Comment_text', $text);\n $this->clickAndWait(\"//input[@value='Отправить']\");\n\n $this->open(Yii::app()->createAbsoluteUrl('/shop/product/view', array('seo_alias' => $product->seo_alias)));\n $this->assertTrue($this->isTextPresent('Ваш комментарий успешно добавлен. Он будет опубликован после проверки администратором.'));\n\n $this->adminLogin();\n $this->open('/admin/shop/products/update?id=' . $product->id);\n $this->click('xpath=//a[contains(.,\"Отзывы\")]');\n $this->assertTrue($this->isTextPresent($email));\n $this->assertTrue($this->isTextPresent($text));\n }", "public function addComment(Comment $comment)\n {\n $comment->setArticle($this);\n $this->comments[] = $comment;\n }", "public function addComment(): void{\n Quizzes::addComment($_SESSION[\"quizID\"], $_SESSION[\"email\"], $_POST[\"commentText\"]);\n\n $qfa = new QuizFinishUser($_SESSION[\"q\"], $_SESSION[\"ua\"], $_SESSION[\"aa\"]);\n $qfa->generateHTML();\n }", "public function addRecipeToHistory($recipe)\n {\n $recipe_ids = $this->getAttribute('recipe_history', array());\n if (!in_array($recipe->getRecipeId(), $recipe_ids))\n {\n\t array_unshift($recipe_ids, $recipe->getRecipeId());\n\t $this->setAttribute('recipe_history', array_slice($recipe_ids, 0, 4));\n }\t\n }", "public function addComment($comment) {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"INSERT INTO comments_table (parent_id, name, comment, create_date) VALUES (\" . $comment['parent_id'] . \", \" . $comment['name'] . \", \" . $comment['comment'] . \", NOW())\";\n $result = mysql_query($sql, $db);\n if($result) {\n $id = mysql_insert_id();\n $sql = \"SELECT * FROM comments_table where id=\" . $id . \";\";\n $result = mysql_query($sql, $db);\n $comment = mysql_result($result, 0);\n return $comment;\n } else {\n return 'save failed';\n }\n }", "public function addReportOnComment($data, $db) \n {\n\n }", "protected function updateCommentForUpdatableVersionsAction() {}", "function simple_history_set_comment_status($comment_id, $new_status) {\n\t// $new_status hold (unapproved), approve, spam, trash\n\t$comment_data = get_commentdata($comment_id, 0, true);\n\t$comment_post_ID = $comment_data[\"comment_post_ID\"];\n\t$post = get_post($comment_post_ID);\n\t$post_title = get_the_title($comment_post_ID);\n\t$excerpt = get_comment_excerpt($comment_id);\n\t$author = get_comment_author($comment_id);\n\n\t$action = \"\";\n\tif (\"approve\" == $new_status) {\n\t\t$action = 'approved';\n\t} elseif (\"hold\" == $new_status) {\n\t\t$action = 'unapproved';\n\t} elseif (\"spam\" == $new_status) {\n\t\t$action = 'marked as spam';\n\t} elseif (\"trash\" == $new_status) {\n\t\t$action = 'trashed';\n\t} elseif (\"0\" == $new_status) {\n\t\t$action = 'untrashed';\n\t}\n\n\t$action = urlencode($action);\n\n\t$str = sprintf( \"$excerpt [\" . __('From %1$s on %2$s') . \"]\", $author, $post_title );\n\t$str = urlencode($str);\n\n\tsimple_history_add(\"action=$action&object_type=comment&object_name=$str&object_id=$comment_id\");\n\n}", "public function the_comment()\n {\n }", "private function _updateOrderItemHist($_id, $status = 'P', $notified = 1, $comment = '')\n {\n $_orderHist = $this->getTable('order_item_histories');\n $_orderHist->virtuemart_order_item_id = $_id;\n $_orderHist->order_status_code = $status;\n $_orderHist->customer_notified = $notified;\n $_orderHist->comments = $comment;\n $_orderHist->store();\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "public function create($comment)\n {\n\n }", "function register_block_core_comment_edit_link()\n {\n }", "public function add(Comment $comments)\n {\n $query = $this->db->pdo->prepare('INSERT INTO comments(idnews, idparent, niveau, moderate, content, membre, addDate) VALUES (:idnews, :idparent, :niveau, :moderate, :content, :membre, NOW())');\n $query->bindValue(':idnews', $comments->idnews(), PDO::PARAM_INT);\n $query->bindValue(':idparent', $comments->idparent(), PDO::PARAM_INT);\n $query->bindValue(':niveau', $comments->niveau(), PDO::PARAM_INT);\n $query->bindValue(':moderate', $comments->moderate(), PDO::PARAM_INT);\n $query->bindValue(':content', $comments->content(), PDO::PARAM_STR);\n $query->bindValue(':membre', $comments->membre(), PDO::PARAM_STR);\n\n $query->execute();\n }", "public function addCommentToTheAlbumAction()\n{\n\t\t$current_user_obj = Auth_UserAdapter::getIdentity();\n\ttry {\n\t\t//getting the album's object.\n\t\t$album_obj = \\Extended\\socialise_album::getRowObject( $this->getRequest()->getParam( 'album_id' ) );\n\n\t\tif( $album_obj )\n\t\t{\n\t\t\t//Making a entry to comment table for album's comment .\n\t\t\t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n\t\t\t$comm_text = $filterObj->filter( $this->getRequest()->getParam( 'comment' ) );\n\t\t\t \n\t\t\t$comment_on_album_id = \\Extended\\comments::addComment( $comm_text, $current_user_obj->getId(), null, NULL, NULL, $album_obj->getId() );\n\t\t\t \n\t\t\t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_album_id );\n\t\t\t \n\t\t\t \n\t\t\t$ret_r = array();\n\t\t\t$ret_r['comm_id'] = $comment_on_album_id;\n\t\t\t$ret_r['comm_text'] = $comm_text;\n\t\t\t$ret_r['commenter_id'] = $current_user_obj->getId();\n\t\t\t$ret_r['commenter_fname'] = $current_user_obj->getFirstname();\n\t\t\t$ret_r['commenter_lname'] = $current_user_obj->getLastname();\n\t\t\t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto($current_user_obj->getId(), 3);\n\t\t\t$ret_r['comment_count'] = $album_obj->getSocialise_albumsComment()->count();\n\t\t\t$ret_r['wp_id'] = $album_obj->getId();\n\t\t\t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n\t\t\t\n\t\t\t//gathering information for sending email to user on whom post, comment is done.\n\t\t\t$subject = \"iLook - User commented on your album\";\n\t\t\t$msg='';\n\t\t\t$msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t\t\t\".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your <a href='\".PROJECT_URL.'/'.PROJECT_NAME.\"profile/photos/uid/\".$album_obj->getSocialise_albumIlook_user()->getId().\"/id/\".$ret_r['wp_id'].\"'>album</a></p>\n\t\t\t<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t\t\t<b>'\".$ret_r['comm_text'].\"'</b>\n\t\t\t</p>\";\n\t\t\t$recipient_name = ucfirst($album_obj->getSocialise_albumIlook_user()->getFirstname()).\" \".ucfirst($album_obj->getSocialise_albumIlook_user()->getLastname());\n\t\t\t$recipient_email = $album_obj->getSocialise_albumIlook_user()->getEmail();\n\t\t\t\n\t\t\t// check if user is not commenting on his own post, only then mail will be sent\n\t\t\tif(Auth_UserAdapter::getIdentity()->getId() != $album_obj->getSocialise_albumIlook_user()->getId())\n\t\t\t{\n\t\t\t\t//sending email to user on whom post comment is done\n\t\t\t\t\\Email_Mailer::sendMail($subject,\n\t\t\t\t\t\t$msg,\n\t\t\t\t\t\t$recipient_name,\n\t\t\t\t\t\t$recipient_email,\n\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\"iLook Team\",\n\t\t\t\t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n\t\t\t\t\t\t\"Hello \",\n\t\t\t\t\t\t\"Thank you\");\n \t\t\n\t\t\t}\n\t\t\techo Zend_Json::encode($ret_r);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Album does not exist anymore.\n\t\t\techo Zend_Json::encode(2);\n\t\t}\n\t}\n\tcatch (Exception $e)\n\t{\n\t\techo Zend_Json::encode(0);\n\t}\n\tdie;\n}", "public function slcr_comment_after() {\n if ( class_exists( 'WooCommerce' )) {\n if ( !is_product() ){\n echo '\n <div class=\"col-md-12 col-sm-12 col-xs-12\">\n <h5 class=\"font-700 mb-30 sub-heading single\">' . esc_html__('Write a comment','moppers') . '</h5>\n </div>\n ';\n }\n }\n }", "public function addComment(\\TYPO3\\Amazingcomments\\Domain\\Model\\Comment $item) {\n\t\t// this is a workaround as the object is sometimes empty with TYPO3 6.0 and then a \"called a member function on a non-object-function\" error shows up\n\t\tif(!$this->comments) {\n\t\t\t#$this->comments = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\t$this->comments = $this->objectManager->create('\\\\TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\t\t}\n\t\t$this->comments->attach($item);\n\t}", "public function appendOrderTracking(\\service\\message\\common\\KeyValueItem $value)\n {\n return $this->append(self::order_tracking, $value);\n }", "public function setComment(?string $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function testUpdateOrder()\n {\n }", "private function createMagentoOrder()\n {\n Mage::register('order_status_changing', true);\n\n /** @var Oyst_OneClick_Model_Magento_Quote $magentoQuoteBuilder */\n $magentoQuoteBuilder = Mage::getModel('oyst_oneclick/magento_quote', $this->orderResponse);\n $magentoQuoteBuilder->buildQuote();\n\n /** @var Oyst_OneClick_Model_Magento_Order $magentoOrderBuilder */\n $magentoOrderBuilder = Mage::getModel('oyst_oneclick/magento_order', $magentoQuoteBuilder->getQuote());\n $magentoOrderBuilder->buildOrder();\n\n $magentoOrderBuilder->getOrder()->addStatusHistoryComment(\n Mage::helper('oyst_oneclick')->__(\n '%s import order id: \"%s\".',\n $this->paymentMethod,\n $this->orderResponse['id']\n )\n )->save();\n\n // Change status of order if need to be invoice\n $this->changeStatus($magentoOrderBuilder->getOrder());\n\n Mage::unregister('order_status_changing');\n\n return $magentoOrderBuilder->getOrder();\n }", "function _wp_dashboard_recent_comments_row(&$comment, $show_date = \\true)\n {\n }", "function register_block_core_comments_title()\n {\n }", "public function addComment($comment)\n\t{\n\t\t$comment->status=Comment::STATUS_APPROVED;\n\t\t$comment->photo_id=$this->id;\n\t\t$comment->author_id=Yii::app()->user->id;\n\t\treturn $comment->save();\n\t}", "function uc_order_pane_admin_comments($op, $order, &$form = NULL, &$form_state = NULL) {\n global $user;\n\n switch ($op) {\n case 'view':\n $comments = uc_order_comments_load($order->order_id, TRUE);\n return tapir_get_table('uc_op_admin_comments_view_table', $comments);\n\n case 'edit-form':\n $form['admin_comment_field'] = array(\n '#type' => 'fieldset',\n '#title' => t('Add an admin comment'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['admin_comment_field']['admin_comment'] = array(\n '#type' => 'textarea',\n '#description' => t('Admin comments are only seen by store administrators.'),\n );\n return $form;\n\n case 'edit-theme':\n $comments = uc_order_comments_load($form['order_id']['#value'], TRUE);\n if (is_array($comments) && count($comments) > 0) {\n foreach ($comments as $comment) {\n $items[] = '[' . theme('uc_uid', array('uid' => $comment->uid)) . '] ' . filter_xss_admin($comment->message);\n }\n }\n else {\n $items = array(t('No admin comments have been entered for this order.'));\n }\n $output = theme('item_list', array('items' => $items)) . drupal_render($form['admin_comment_field']);\n return $output;\n\n case 'edit-process':\n if (!empty($form_state['values']['admin_comment'])) {\n uc_order_comment_save($form_state['values']['order_id'], $user->uid, $form_state['values']['admin_comment']);\n }\n return;\n }\n}", "private function _getHistoryComment(array $statusData)\n {\n $comment = 'Status message not defined.';\n $commentKey = $statusData['status'] . '_' . $statusData['reason'];\n \n if (array_key_exists($commentKey, $this->_commentMessages)) {\n $comment = Mage::helper('sofort')->__($this->_commentMessages[$commentKey]);\n }\n \n $comment = str_replace('[[date]]', date('d.m.Y H:i:s', Mage::getModel('core/date')->timestamp(time())), $comment);\n $comment = str_replace('[[transaction_id]]', $statusData['transaction_id'], $comment);\n \n if (array_key_exists('refunded_amount', $statusData)) {\n $comment = str_replace('[[refunded_amount]]', $statusData['refunded_amount'], $comment);\n }\n \n return $comment;\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function addCommentsAt(string $comments): self\n {\n $this->comments = $comments;\n return $this;\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }" ]
[ "0.63199556", "0.6130298", "0.60438013", "0.5939917", "0.58713245", "0.576634", "0.5742722", "0.5741079", "0.5720515", "0.5720515", "0.5720515", "0.5720515", "0.5720515", "0.5720515", "0.57150096", "0.56724715", "0.5622693", "0.56175095", "0.5589398", "0.55749345", "0.55377746", "0.5525403", "0.55116117", "0.55116117", "0.5497493", "0.549634", "0.54741895", "0.5461231", "0.5433909", "0.54316944", "0.5428533", "0.5421948", "0.5417649", "0.54038537", "0.5387895", "0.5386684", "0.5372492", "0.53677046", "0.53430384", "0.5328903", "0.5324195", "0.53171927", "0.53115785", "0.5309271", "0.5297838", "0.52726537", "0.5272456", "0.52720886", "0.5271339", "0.5263183", "0.5250346", "0.52476", "0.5242562", "0.52413315", "0.52413315", "0.5235482", "0.52317643", "0.5223261", "0.52171284", "0.5215905", "0.52062434", "0.51913625", "0.518478", "0.51830024", "0.5173444", "0.5172869", "0.5168655", "0.5150184", "0.5149592", "0.5145924", "0.51383686", "0.5133249", "0.5129861", "0.5121764", "0.5118805", "0.5118165", "0.51147795", "0.51061594", "0.5103181", "0.50947756", "0.50906765", "0.50881314", "0.5087884", "0.50809574", "0.5078003", "0.5072822", "0.5070607", "0.5065283", "0.5062247", "0.5056552", "0.50361866", "0.50332403", "0.5030666", "0.50068235", "0.50028145", "0.49960816", "0.49937826", "0.49916252", "0.4989157", "0.49852857" ]
0.6569375
0
Register widget with WordPress.
function __construct() { parent::__construct( 'getresponse-widget', __( 'GetResponse Web Form', 'Gr_Integration' ), array( 'description' => __( 'Dispaly a GetResponse Web Form on your site.', 'Gr_Integration' ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\r\n\tregister_widget( 'wpb_widget' );\r\n}", "function register_widget($widget)\n {\n }", "function wpwl_load_widget() {\n register_widget( 'wpwl_widget' );\n}", "function montheme_register_widget() {\n register_widget(YoutubeWidget::class);\n register_sidebar([\n 'id' => 'homepage',\n 'name' => __('Sidebar Accueil', 'montheme'),\n 'before_widget' => '<div class=\"p-4 %2$s\" id=\"%1$s\"',\n 'after_widget' => '</div>',\n 'before_title' => ' <h4 class=\"fst-italic\">',\n 'after_title' => '</h4>'\n ]);\n}", "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "function register()\n {\n // Incluimos el widget en el panel control de Widgets\n wp_register_sidebar_widget( 'widget_ultimosp', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'widget' ) );\n\n // Formulario para editar las propiedades de nuestro Widget\n wp_register_widget_control('widget_ultimos_autor', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'control' ) );\n }", "function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}", "function load_widget() {\n\n\t\tregister_widget( 'WordpressConnectWidgetActivityFeed' );\n\t\tregister_widget( 'WordpressConnectWidgetComments' );\n\t\tregister_widget( 'WordpressConnectWidgetFacepile' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeBox' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeButton' );\n\t\tregister_widget( 'WordpressConnectWidgetLiveStream' );\n\t\tregister_widget( 'WordpressConnectWidgetLoginButton' );\n\t\tregister_widget( 'WordpressConnectWidgetRecommendations' );\n\t\tregister_widget( 'WordpressConnectWidgetSendButton' );\n\n\t}", "public function _register_widgets()\n {\n }", "function load_postmeta_widget(){\n register_widget( 'postmeta_widget' );\n}", "function itstar_widget() {\n register_widget( 'last_video_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'simple_button_widget' );\n}", "function wpb_load_widget()\n{\n register_widget( 'WC_External_API_Widget' );\n}", "function itstar_widget() {\n// register_widget( 'last_products_widget' );\n// register_widget( 'last_projects_widget' );\n register_widget( 'last_posts_by_cat_widget' );\n register_widget( 'contact_info_widget' );\n// register_widget( 'social_widget' );\n}", "function twd_register_widgets() {\r\n\r\n\t$widgets = array(\r\n\r\n\t\t'shortcode'\r\n\r\n\t);\r\n\r\n\tforeach ( $widgets as $widget ) {\r\n\r\n\t\trequire_once get_template_directory() . '/includes/widgets/widget-' . $widget . '.php';\r\n\r\n\t}\r\n\r\n\t register_widget( 'paste_shortcode_widget' );\r\n\r\n}", "function wpzh_load_widget() {\n register_widget( 'sliderHTML2' ); \n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "function ds_social_load_widget() {\n\tregister_widget( 'ds_social_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'recent_post_widget' );\n }", "function bp_media_register_widgets() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Media_Widget\");') );\n}", "function register_dc_widget() {\n\t\tregister_widget( 'dc_linked_image' );\n\t\tregister_widget( 'dc_widget_link_text' );\n\t}", "function load_tag_widget() {\n register_widget( 'custom_tag_widget' );\n}", "function registerWidgets( ) {\r\n\t\t\twp_register_sidebar_widget( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetOutput' ) );\r\n\t\t\twp_register_widget_control( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetControlOutput' ) );\r\n\t\t}", "function load_widget_plugin_name() {\n register_widget( 'widget_plugin_name' );\n}", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "function green_widget_twitter_load() {\n\tregister_widget( 'green_widget_twitter' );\n}", "function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}", "function register_ib_act_widget() {\n\tregister_widget( 'IB_Act_Widget_Widget' );\n}", "function dt_twitter_register() {\n register_widget('DT_Twitter_Widget');\n}", "function aw_add_load_widget() {\r\n\t\tregister_widget( 'AW_AddFeed' );\r\n\t}", "function wpc_load_widget()\n{\n register_widget('expat_category_widget');\n}", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "function custom_register_widget()\n{\n register_widget('oferta_widget');\n register_widget('events_widget');\n register_widget('group_list_widget');\n}", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "function qed_register_widgets() {\r\n\t\t// Make a Wordpress built-in Text widget process shortcodes.\r\n\t\tadd_filter( 'widget_text', 'shortcode_unautop' );\r\n\t\tadd_filter( 'widget_text', 'do_shortcode', 11 );\r\n\r\n\t\tregister_widget( 'QED_Widget_Latest_Posts' );\r\n\t\tregister_widget( 'QED_Widget_Contact_Us' );\r\n\t\tregister_widget( 'QED_Widget_Advanced_Text' );\r\n\r\n\t\t// if ( class_exists( 'woocommerce' ) ) {\r\n\t\t\t// TODO: Widget for woocommerce.\r\n\t\t// }\r\n\r\n\t\tregister_sidebar(array(\r\n\t\t\t'id' => 'sidebar',\r\n\t\t\t'name' => esc_html__( 'Sidebar', 'swishdesign' ),\r\n\t\t\t'description' => esc_html__( 'Sidebar located on the right side of blog page.', 'swishdesign' ),\r\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget block-after-indent %2$s\">',\r\n\t\t\t'after_widget' => '</div>',\r\n\t\t\t'before_title' => '<h3 class=\"widget__title\">',\r\n\t\t\t'after_title' => '</h3>',\r\n\t\t));\r\n\r\n\t\tregister_sidebar(array(\r\n\t\t\t'id' => 'footer1',\r\n\t\t\t'name' => sprintf( esc_html__( 'Footer %s', 'swishdesign' ), 1 ),\r\n\t\t\t'description' => esc_html__( 'Located in 1st column on 4-columns footer layout.', 'swishdesign' ),\r\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget block-after-indent %2$s\">',\r\n\t\t\t'after_widget' => '</div>',\r\n\t\t\t'before_title' => '<h3 class=\"widget__title\">',\r\n\t\t\t'after_title' => '</h3>',\r\n\t\t));\r\n\r\n\t\t$footer_columns_count = qed_get_footer_columns();\r\n\t\tif ( $footer_columns_count >= 2 ) {\r\n\t\t\tregister_sidebar(array(\r\n\t\t\t\t'id' => 'footer2',\r\n\t\t\t\t'name' => sprintf( esc_html__( 'Footer %s', 'swishdesign' ), 2 ),\r\n\t\t\t\t'description' => esc_html__( 'Located in 2nd column on 4-columns footer layout.', 'swishdesign' ),\r\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget block-after-indent %2$s\">',\r\n\t\t\t\t'after_widget' => '</div>',\r\n\t\t\t\t'before_title' => '<h3 class=\"widget__title\">',\r\n\t\t\t\t'after_title' => '</h3>',\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\tif ( $footer_columns_count >= 3 ) {\r\n\t\t\tregister_sidebar(array(\r\n\t\t\t\t'id' => 'footer3',\r\n\t\t\t\t'name' =>sprintf( esc_html__( 'Footer %s', 'swishdesign' ), 3 ),\r\n\t\t\t\t'description' => esc_html__( 'Located in 3rd column on 4-columns footer layout.', 'swishdesign' ),\r\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget block-after-indent %2$s\">',\r\n\t\t\t\t'after_widget' => '</div>',\r\n\t\t\t\t'before_title' => '<h3 class=\"widget__title\">',\r\n\t\t\t\t'after_title' => '</h3>',\r\n\t\t\t));\r\n\t\t}\r\n\r\n\t\tif ( $footer_columns_count >= 4 ) {\r\n\t\t\tregister_sidebar(array(\r\n\t\t\t\t'id' => 'footer4',\r\n\t\t\t\t'name' => sprintf( esc_html__( 'Footer %s', 'swishdesign' ), 4 ),\r\n\t\t\t\t'description' => esc_html__( 'Located in 4th column on 4-columns footer layout.', 'swishdesign' ),\r\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget block-after-indent %2$s\">',\r\n\t\t\t\t'after_widget' => '</div>',\r\n\t\t\t\t'before_title' => '<h3 class=\"widget__title\">',\r\n\t\t\t\t'after_title' => '</h3>',\r\n\t\t\t));\r\n\t\t}\r\n\t}", "function load_twitticker_widgets() {\n\tregister_widget( 'twitticker_widget' );\n}", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "function featured_news_load_widget() {register_widget( 'featured_news_widget' );}", "public function register($widget)\n {\n }", "function portfolio_recent_register_widgets() {\n\tregister_widget( 'blog_recent_post' );\n}", "function register_service_widget() {\n register_widget( 'Services_Widget' );\n}", "function widget_registration($name, $id, $description, $beforeWidget, $afterWidget, $beforeTitle, $afterTitle) {\n register_sidebar(\n array(\n 'name' => $name,\n 'id' => $id,\n 'description' => $description,\n 'before_widget' => $beforeWidget,\n 'after_widget' => $afterWidget,\n 'before_title' => $beforeTitle,\n 'after_title' => $afterTitle,\n )\n );\n}", "function pgnyt_articles_register_widgets() {\n register_widget( 'Pgnyt_Articles_Widget' );\n}", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "function wpcoupon_register_slider_widget() {\r\n register_widget( 'WPCoupon_Slider_Widget' );\r\n}", "function harbour_city_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Footer Widgets', 'harbour-city' ),\n 'id' => 'widgets-footer',\n 'description' => __( 'Appears on the front page', 'harbour-city' ),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget span4 %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "public function registerWidget($id, $widget)\n {\n add_action('widgets_init', function () use ($id, $widget) {\n global $wp_widget_factory;\n $this->plugin->activateLoader();\n register_widget($widget['uses']);\n //get latest create widget in widget factory\n $wdg = end($wp_widget_factory->widgets);\n // pre init latest widget.\n $wdg->initializeWidget($id, $widget, $this->plugin);\n });\n }", "function register_coupons_widget() {\n register_widget( 'CouponsWidget' );\n}", "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "function ebay_feeds_for_wordpress_Widget() {\n // curl need to be installed\n\tregister_widget( 'ebay_feeds_for_wordpress_Widget_class' );\n}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Hello_World() );\n\t}", "function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}", "function sbc_connect_widget() {\n\n class connect_widget extends WP_Widget {\n\n function __construct() {\n parent::__construct(\n\n // Base ID of your widget\n 'connect_widget',\n\n // Widget name will appear in UI\n __('Connect', 'connect_widget_domain'),\n\n // Widget description\n array( 'description' => __( 'Insert your connect links with this widget', 'connect_widget_domain' ), )\n );\n }\n\n // Creating widget output\n public function widget( $args, $instance ) {\n $title = apply_filters( 'widget_title', $instance['title'] );\n\n // echo Title if Title\n echo $args['before_widget'];\n echo '<div class=\"connect-widget\">';\n if ( ! empty( $title ) ):\n echo $args['before_title'] . $title . $args['after_title'];\n endif;\n\n // echo social links if social links available in theme options\n if( have_rows('_about', 'option') ):\n while( have_rows('_about', 'option') ): the_row();\n if( have_rows('connect_media') ):\n// echo 'Follow Us: ';\n while( have_rows('connect_media') ): the_row();\n $link = get_sub_field('link');\n $platform = get_sub_field('platform');\n $icon = '<a href=\"' . $link . '\">' .\n '<i class=\"' . $platform . '\"></i>' .\n '</a>';\n echo $icon;\n endwhile;\n endif;\n endwhile;\n endif;\n\n // This is where you run the code and display the output\n// echo __( 'Hello, World!', 'connect_widget_domain' );\n echo $args['after_widget'];\n echo '</div>';\n }\n\n // Widget Backend\n public function form( $instance ) {\n if ( isset( $instance[ 'title' ] ) ) {\n $title = $instance[ 'title' ];\n }\n else {\n $title = __( 'New title', 'connect_widget_domain' );\n }\n // Widget admin form\n ?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n </p>\n <?php\n }\n\n // Updating widget replacing old instances with new\n public function update( $new_instance, $old_instance ) {\n $instance = array();\n $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';\n return $instance;\n }\n\n } // close class\n\n // Register the widget\n register_widget( 'connect_widget' );\n\n}", "function custom_widgets_register() {\n register_post_type('custom_widgets', array(\n 'labels' => array(\n 'name' => __('Custom Widgets'),\n 'singular_name' => __('Custom Widget'),\n ),\n 'public' => false,\n 'show_ui' => true,\n 'has_archive' => false,\n 'exclude_from_search' => true,\n ));\n}", "function register_port_posts_widget() {\n register_widget( 'port_posts' );\n}", "function register_Zappy_Feed_Burner_Widget() {\n register_widget('Zappy_Feed_Burner_Widget');\n}", "function wpb_carousel_widget() {\n\t register_widget( 'wpb_widget' );\n\t}", "public static function register()\n {\n register_sidebar( array(\n 'name' => 'Widget Area 1',\n 'id' => 'widget_1',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n }", "function mytheme_load_widget() {\n register_widget( 'mytheme_widget_text' );\n \n // Allow to execute shortcodes on mytheme_widget_text\n add_filter('mytheme_widget_text', 'do_shortcode');\n}", "function pb18_article_also_widget() {\n register_widget( 'pb18_article_also_widget' );\n}", "function funct_Sandy_RSS() {\r\n register_widget( 'WP_Sandy_RSS' );\r\n}", "function wuss_scoring_widgets() {\r\n\tregister_widget( 'wuss_scoring_widget' );\r\n}", "function RSSPhotoWidgetInit() \n{\n register_widget('RSSPhotoWidget');\n wp_enqueue_script('jquery');\n wp_enqueue_script('rssphoto_javascript','/wp-content/plugins/rssphoto/rssphoto.js');\n wp_enqueue_style('rssphoto_stylesheet','/wp-content/plugins/rssphoto/rssphoto.css');\n}", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "function ds_social_links_load_widget() {\n\tregister_widget( 'ds_social_links_widget' );\n}", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "function register_page_bpposts_widget() {\n\tadd_action('widgets_init', create_function('', 'return register_widget(\"BP_Paginated_Posts_Widget\");') );\n}", "function avhamazon_widgets_init ()\n{\n\tregister_widget( 'WP_Widget_AVHAmazon_Wishlist' );\n}", "function instagram_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Instagram',\n\t\t'id' => 'instagram',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n}", "function pts_widget_init() {\n\n register_sidebar( array(\n\t\t'name' => 'Top Widget',\n\t\t'id' => 'top_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s top-widgs\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Sidebar Widget',\n\t\t'id' => 'sidebar_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s sidebar-widgs\">',\n\t\t'after_widget' => '</div></div>',\n\t\t'before_title' => '<div class=\"widget_title_wrapper\"><h5 class=\"widgets_titles_sidebar\">',\n\t\t'after_title' => '</h5></div><div class=\"wca\">',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Single Post Widget',\n\t\t'id' => 'single_post_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s sidebar-widgs\">',\n\t\t'after_widget' => '</div></div>',\n\t\t'before_title' => '<div class=\"widget_title_wrapper\"><h5 class=\"widgets_titles_sidebar\">',\n\t\t'after_title' => '</h5></div><div class=\"wca\">',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'First Footer Widget',\n\t\t'id' => 'first_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Second Footer Widget',\n\t\t'id' => 'second_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Third Footer Widget',\n\t\t'id' => 'third_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Fourth Footer Widget',\n\t\t'id' => 'fourth_footer_widget',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"footer-widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h5 class=\"widgets_titles\">',\n\t\t'after_title' => '</h5>',\n\t) );\n\n register_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Dropdown() );\n\t}", "public function action_widgets_init() {\n\n // Our widgets\n register_widget( '\\Pedestal\\Widgets\\Recent_Content_Widget' );\n register_widget( '\\Pedestal\\Widgets\\Recent_Video_Widget' );\n\n if ( PEDESTAL_ENABLE_INSTAGRAM_OF_THE_DAY ) {\n register_widget( '\\Pedestal\\Widgets\\Daily_Insta_Widget' );\n }\n\n // Unregister core widgets we won't be using\n unregister_widget( 'WP_Widget_Archives' );\n unregister_widget( 'WP_Widget_Calendar' );\n unregister_widget( 'WP_Widget_Categories' );\n unregister_widget( 'WP_Widget_Custom_HTML' );\n unregister_widget( 'WP_Widget_Links' );\n unregister_widget( 'WP_Widget_Media_Audio' );\n unregister_widget( 'WP_Widget_Media_Gallery' );\n unregister_widget( 'WP_Widget_Media_Image' );\n unregister_widget( 'WP_Widget_Media_Video' );\n unregister_widget( 'WP_Widget_Meta' );\n unregister_widget( 'WP_Widget_Pages' );\n unregister_widget( 'WP_Widget_Recent_Comments' );\n unregister_widget( 'WP_Widget_Recent_Posts' );\n unregister_widget( 'WP_Widget_RSS' );\n unregister_widget( 'WP_Widget_Search' );\n unregister_widget( 'WP_Widget_Tag_Cloud' );\n unregister_widget( 'WP_Widget_Text' );\n\n // Unregister widgets added by plugins\n unregister_widget( 'P2P_Widget' );\n }", "function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}", "static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}", "function adelle_footer_widgets_instagram_init() {\r\n register_sidebar( array(\r\n 'name' => __( 'Instagram Widget', 'adelle-theme' ),\r\n 'id' => 'footer-widget-instagram',\r\n 'class' => '',\r\n 'description' => 'Instagram widget area.',\r\n 'before_widget' => '<article id=\"%1$s\" class=\"footer-instagram-widget %2$s\">',\r\n 'after_widget' => '</article>',\r\n 'before_title' => '<h4>',\r\n 'after_title' => '</h4>',\r\n ) );\r\n}", "function load_type_widget() {\n register_widget( 'custom_type_widget' );\n}", "function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}", "function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }", "function register_Zappy_Lates_Comment_Widget() {\n register_widget('Zappy_Lates_Comment_Widget');\n}", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "public static function init()\n {\n add_action( 'widgets_init', array(__CLASS__, 'register') );\n }", "function wp_listings_register_widgets() {\n\n\t$widgets = array( 'WP_Listings_Featured_Listings_Widget', 'WP_Listings_Search_Widget' );\n\n\tforeach ( (array) $widgets as $widget ) {\n\t\tregister_widget( $widget );\n\t}\n\n}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function register_widget_scripts() {\n\n wp_enqueue_script( $this->get_widget_slug().'-script', plugins_url( 'js/widget.js', __FILE__ ), array('jquery') );\n\n }", "function widget_init() {\r\n if ( !function_exists('wp_register_sidebar_widget') || !function_exists('register_widget_control') ) return;\r\n function widget($args) {\r\n extract($args);\r\n $wpca_settings = get_option('wpcareers');\r\n echo $before_widget;\r\n echo $before_title . $wpca_settings['widget_title'] . $after_title;\r\n\r\n $fieldsPre=\"wpc_\";\r\n $before_tag=stripslashes(get_option($fieldsPre.'before_Tag'));\r\n $after_tag=stripslashes(get_option($fieldsPre.'after_Tag'));\r\n echo '<p><ul>' . widget_display($wpca_settings['widget_format']) . '</ul></p>'; \r\n }\r\n\r\n function widget_control() {\r\n $wpca_settings = $newoptions = get_option('wpcareers');\r\n if ( $_POST[\"wpCareers-submit\"] ) {\r\n $newoptions['widget_title'] = strip_tags(stripslashes($_POST['widget_title']));\r\n $newoptions['widget_format'] = $_POST['widget_format'];\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Classifieds Ads';\r\n }\r\n if ( $wpca_settings != $newoptions ) {\r\n $wpca_settings = $newoptions;\r\n update_option('wpcareers', $wpca_settings);\r\n }\r\n $title = htmlspecialchars($wpca_settings['widget_title'], ENT_QUOTES);\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Careers Posts';\r\n if ( empty($newoptions['widget_format']) ) $newoptions['widget_format'] = 'y';\r\n ?>\r\n <label for=\"wpCareers-widget_title\"><?php _e('Title:'); ?><input style=\"width: 200px;\" id=\"widget_title\" name=\"widget_title\" type=\"text\" value=\"<?php echo htmlspecialchars($wpca_settings['widget_title']); ?>\" /></label></p>\r\n <br />\r\n <label for=\"wpCareers-widget_format\">\r\n <input class=\"checkbox\" id=\"widget_format\" name=\"widget_format\" type=\"checkbox\" value=\"y\"<?php echo ($wpca_settings['widget_format']=='y')?\" checked\":\"\";?>>Small Format Output</label><br />\r\n <input type=\"hidden\" id=\"wpCareers-submit\" name=\"wpCareers-submit\" value=\"1\" />\r\n <?php\r\n }\r\n \r\n function widget_display() {\r\n $wpca_settings = get_option('wpcareers');\r\n //$out = wpcaLastPosts($wpca_settings['widget_format']);\r\n return $out;\r\n }\r\n \r\n wp_register_sidebar_widget('wpCareers', 'widget', null, 'wpCareers');\r\n register_widget_control('wpCareers', 'widget_control');\r\n }", "function urbanfitness_widgets()\n{\n //registering widget must write php code to show it\n register_sidebar([\n 'name' => 'Sidebar', //widget name on wordpress panel\n 'id' => 'sidebar', //we are passing this id to dynamic_widget('sidebar') must be unique for wordpress to identify\n 'before_widget' => '<div class=\"widget\">', //html before widget\n 'after_widget' => '</div>', //html after widget\n 'before_title' => '<h3 class=\"text-primary\">', //html before title\n 'after_title' => '</h3>', //html after title\n ]);\n}", "function widget_sparkplug_register() {\n\twp_register_sidebar_widget( 'sparkplug', 'Sparkplug', 'widget_sparkplug', array( 'description' => 'Display a sparkline chart showing post frequency for the current author/tag/category/blog.' ) );\n\twp_register_widget_control( 'sparkplug', 'Sparkplug', 'widget_sparkplug_control' );\n}", "public function register_dashboard_widgets() {\n\t\t$widget_render = array( &$this, 'render_widget' );\n\n\t\tif ( false !== $this->option( 'widget_id' ) && false !== $this->option( 'widget_name' ) ) {\n\t\t\t$wid = $this->option( 'widget_id' );\n\t\t\t$wname = $this->option( 'widget_name' );\n\t\t\t$save_widget = ( ! empty( $this->fields() ) ) ? array( &$this, 'save_widget' ) : false;\n\t\t\twp_add_dashboard_widget( $wid, $wname, $widget_render, $save_widget );\n\t\t}\n\t}", "function aidtransparency_widgets_init() {\r\n\r\n $widgetDefaults = array(\r\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n 'after_widget' => \"</aside>\",\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>'\r\n );\r\n\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Home Page Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-3',\r\n 'description' => __( 'The Home Page widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Page Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-1',\r\n 'description' => __( 'The Sidebar widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Blog Sidebar', 'aidtransparency' ),\r\n 'id' => 'sidebar-2',\r\n 'description' => __( 'The Blog Sidebar widgetized area', 'aidtransparency')\r\n )\r\n )\r\n );\r\n\r\n register_sidebar(\r\n array_merge(\r\n $widgetDefaults,\r\n array(\r\n 'name' => __( 'Footer', 'aidtransparency' ),\r\n 'id' => 'footer-1',\r\n 'description' => __( 'The Footer widgetized area', 'aidtransparency' )\r\n )\r\n )\r\n );\r\n}", "function reg_wp_footer_widget() {\n\t // First Footer Widget.\n\t$template_uri = get_template_directory_uri();\n\t$args = array(\n\t\t'name' => sprintf( __( 'Footer Widget One' ), 'wpthemes1' ),\n\t\t'id' => 'footer-widget-1',\n\t\t'description' => '',\n\t\t'class' => '',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s p-3\">',\n\t\t'after_widget' => \"</li>\\n\",\n\t\t'before_title' => '<h4 class=\"widgettitle mb-3\"><img class=\"mr-3\" src=\"' . $template_uri . '/assets/img/bulb.jpg\" alt=\"Icon\">',\n\t\t'after_title' => \"</h3>\\n\",\n\t);\n\tregister_sidebar( $args );\n\t// Second Footer Widget.\n\t$args = array(\n\t\t'name' => sprintf( __( 'Footer Widget Two' ), 'wpthemes1' ),\n\t\t'id' => 'footer-widget-2',\n\t\t'description' => '',\n\t\t'class' => '',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s p-3\">',\n\t\t'after_widget' => \"</li>\\n\",\n\t\t'before_title' => '<h4 class=\"widgettitle mb-3\"><img class=\"mr-3\" src=\"' . $template_uri . '/assets/img/recent_post_icon.jpg\" alt=\"Icon\">',\n\t\t'after_title' => \"</h4>\\n\",\n\t);\n\tregister_sidebar( $args );\n\t// Third Footer Widget.\n\t$args = array(\n\t\t'name' => sprintf( __( 'Footer Widget Three' ), 'wpthemes1' ),\n\t\t'id' => 'footer-widget-3',\n\t\t'description' => '',\n\t\t'class' => '',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s p-3\">',\n\t\t'after_widget' => \"</li>\\n\",\n\t\t'before_title' => '<h4 class=\"widgettitle mb-3\"><img class=\"mr-3\" src=\"' . $template_uri . '/assets/img/contact_us_icons.jpg\" alt=\"Icon\">',\n\t\t'after_title' => \"</h4>\\n\",\n\t);\n\tregister_sidebar( $args );\n\t// Fourth Footer Widget.\n\t$args = array(\n\t\t'name' => sprintf( __( 'Page Sidebar' ), 'wpthemes1' ),\n\t\t'id' => 'sidebar1',\n\t\t'description' => '',\n\t\t'class' => '',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</li>\\n\",\n\t\t'before_title' => '<h2 class=\"widgettitle\">',\n\t\t'after_title' => \"</h2>\\n\",\n\t);\n\tregister_sidebar( $args );\n}", "function sparcwp_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'sparcwp' ),\n\t\t'id' => 'sidebar-1',\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' => __( 'Footer Widget 4 Column', 'sparcwp' ),\n\t\t'id' => 'footer-widgets-four-column',\n\t\t'description' => __( 'Each widget added will be 25% width', 'sparcwp' ),\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget footer-widget %2$s four-column\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Footer Widget Full Width', 'sparcwp' ),\n\t\t'id' => 'footer-widgets-full-width',\n\t\t'description' => __( 'Wrap footer blocks in cols if needed', 'sparcwp' ),\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget footer-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}", "function mythemepost_widgets(){ \n register_sidebar( array(\n 'name' => 'Lavel Up New Widget Area',\n 'id' => 'level_up_new_widget_area',\n 'before_widget' => '<aside>',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n \n ));\n}", "function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Widget oben rechts',\n 'id' => 'widget_top_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget mitte rechts',\n 'id' => 'widget_center_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget unten rechts',\n 'id' => 'widget_bottom_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Newsletter Widget',\n 'id' => 'newsletter_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Custom Footer Widget',\n 'id' => 'footer_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n\n}", "function twentyfifteen_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Widget Area', 'twentyfifteen' ),\n\t\t'id' => 'sidebar-1',\n\t\t'description' => __( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ),\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}" ]
[ "0.8390025", "0.83101994", "0.82505625", "0.82505625", "0.82282835", "0.80624324", "0.79771596", "0.7901524", "0.7809308", "0.77684814", "0.77520776", "0.7727257", "0.7609239", "0.75666004", "0.75445676", "0.75443226", "0.7522003", "0.75196254", "0.75170845", "0.7512498", "0.7447794", "0.7446988", "0.74403644", "0.73797035", "0.7377074", "0.7355821", "0.73377615", "0.7337268", "0.73335594", "0.7328682", "0.73182005", "0.73169446", "0.7298888", "0.7290922", "0.7250272", "0.72397614", "0.7228767", "0.7226242", "0.7219717", "0.7201903", "0.7187676", "0.7166757", "0.71408266", "0.7139097", "0.7133043", "0.7121191", "0.7116391", "0.70914453", "0.7086108", "0.70773035", "0.7073097", "0.70627826", "0.7054209", "0.7047725", "0.7043728", "0.70430505", "0.70393866", "0.70383275", "0.7036506", "0.7034996", "0.70253414", "0.70248973", "0.7024256", "0.70237195", "0.70200586", "0.7008153", "0.6998476", "0.6996311", "0.699286", "0.69875365", "0.6987385", "0.69862676", "0.698265", "0.69741976", "0.696835", "0.69600004", "0.69569546", "0.6948305", "0.6945937", "0.69412565", "0.6935894", "0.693448", "0.6932985", "0.6923548", "0.69225895", "0.69146496", "0.6908146", "0.6907732", "0.6890926", "0.6890926", "0.68861413", "0.6874315", "0.68732387", "0.6858937", "0.68582195", "0.6840389", "0.6823092", "0.6816244", "0.6809824", "0.680631", "0.68060595" ]
0.0
-1
Frontend display of widget.
public function widget( $args, $instance ) { $webform_id = $instance['select']; $variants_id = $instance['variants']; $style_id = $instance['style']; $center = $instance['center']; $center_margin = $instance['center_margin']; $version = $instance['version']; $web_forms = json_decode(get_option($this->GrOptionDbPrefix . 'web_forms'), true); if ( isset($web_forms[$webform_id]) ) { $webform = $web_forms[$webform_id]; } else { $api_key = get_option($this->GrOptionDbPrefix . 'api_key'); if ( !empty($api_key)) { $api = new GetResponseIntegration($api_key); $w = ($version == 'old') ? $api->getWebForm($webform_id) : $api->getForm($webform_id); $webform['scriptUrl'] = $w->scriptUrl; $webform['status'] = $w->status; $webform_option = array(); $webform_option[$instance['select']] = (array)$w; update_option($this->GrOptionDbPrefix . 'web_forms', json_encode($webform_option)); } } // css styles Webform/Wordpress $css = ($style_id == 1 && $version == 'old') ? '&css=1' : null; $variant = ( $variants_id >= 0 && $version == 'new') ? '&v=' . (int)$variants_id : null; if ( !empty($webform) && isset($webform['scriptUrl']) && in_array($webform['status'], array('enabled', 'published'))) { $style = ($center == '1') ? 'style="margin-left: auto; margin-right: auto; width: ' . $center_margin . 'px;"' : ''; $webform['scriptUrl'] = Gr_Integration::replaceHttpsToHttpIfSslOn($webform['scriptUrl']); $form = '<div ' . $style .'>'; $form .= '<script type="text/javascript" src="' . htmlspecialchars($webform['scriptUrl'] . $css . $variant) .'"></script>'; $form .= '</div>'; } if (!empty($form)) { echo $args['before_widget']; echo __( $form, 'text_domain' ); echo $args['after_widget']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}", "public function render_widget() {\n\n return Widget::render($this->settings);\n\n }", "public static function widget() {\n \n\t\t$start = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t$remaining_days = self::get_dashboard_widget_option(self::wid, 'starting_conversion');\n\t\t\n\t\t// Display Dashboard widget\n\t\trequire_once( 'red-flag-parking-display.php' );\n }", "public function frontend_render()\n {\n $user_selected_language = get_user_lang();\n $widget_saved_values = $this->get_settings();\n\n $widget_title = $widget_saved_values['widget_title_' . $user_selected_language] ?? '';\n\n $output = $this->widget_before(); //render widget before content\n\n if (!empty($widget_title)) {\n $output .= '<h4 class=\"widget-title\">' . purify_html($widget_title) . '</h4>';\n }\n $output .='<div class=\"widget widget_search\">\n <form action=\"'.route('frontend.blog.search').'\" method=\"get\" class=\"search-form\">\n <div class=\"form-group\">\n <input type=\"text\" class=\"form-control\" name=\"search\" placeholder=\"'.__('Write your keyword...').'\">\n </div>\n <button class=\"submit-btn\" type=\"submit\"><i class=\"fa fa-search\"></i></button>\n </form>\n </div>';\n\n $output .= $this->widget_after(); // render widget after content\n\n return $output;\n }", "public function run() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\t$contents=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($this->activeDataProvider === null) {\r\n\t\t\techo $contents;\r\n\t\t} else {\r\n\t\t\tif(($this->hideOnEmpty === true) && ($this->activeDataProvider->totalItemCount == 0)) {\r\n\t\t\t\techo $contents;\r\n\t\t\t} else {\r\n\t\t\t\t$this->render('TableWidget', array(\r\n\t\t\t\t\t'activeDataProvider' => $this->activeDataProvider,\r\n\t\t\t\t\t'fields' => $this->getFields(),\r\n\t\t\t\t\t'title' => $this->title,\r\n\t\t\t\t\t'pagination' => $this->enablePagination,\r\n\t\t\t\t\t'catalog' => $this->getCatalog(),\r\n\t\t\t\t\t'htmlOptions' => $this->htmlOptions,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getWidget();", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "public static function widget() {\n\t\t$username = self::get_dashboard_widget_option(self::wid, 'username');\n\t\t$apikey = self::get_dashboard_widget_option(self::wid, 'apikey');\n\t\t$project_id = self::get_dashboard_widget_option(self::wid, 'project_id');\n\t\t$ref_url = 'http://go.endcore.64905.digistore24.com/';\n\t\t$check = ($username && $apikey && $project_id ? true : false);\n \n\t\tif(!$check) {\n\t\t\techo '<h4 style=\"text-align:right; padding-right: 40px; padding-top: 10px\">' . __( 'Bitte prüfe die Einstellungen &and;', 'affiliatetheme-backend' ) . '</h4>&nbsp;';\n ?>\n <div class=\"rankalyst-text\">\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\"><img src=\"<?php echo get_template_directory_uri(); ?>/_/img/rankalyst.png\"></a>\n <p><?php printf(__('Mit <a href=\"%s\" target=\"_blank\">Rankalyst</a> kannst du 10 Keywords kostenlos tracken!', 'affiliatetheme-backend'), $ref_url); ?></p>\n <a href=\"<?php echo $ref_url; ?>\" target=\"_blank\" class=\"button button-primary\"><?php _e('Kostenlos starten', 'affiliatetheme-backend'); ?></a>\n </div>\n <?php\n\t\t}\n\t\t\n\t\t/* @TODO Rankingchange <span class=\"plus\">+</span> bzw Minus ausgeben, jenachdem ob Change positiv oder negativ. */\n\n ?>\n <div class=\"rankalyst-data\">\n <ul class=\"rankalyst-tabs\">\n <li><a href=\"#\" data-type=\"organic\" class=\"active\"><?php _e('Organic', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"mobile\"><?php _e('Mobile', 'affiliatetheme-backend'); ?></a></li>\n <li><a href=\"#\" data-type=\"local\"><?php _e('Local', 'affiliatetheme-backend'); ?></a></li>\n </ul>\n\n <div class=\"rankalyst-tab active\" data-type=\"organic\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 1);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"mobile\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 2);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n\n <div class=\"rankalyst-tab\" data-type=\"local\">\n <?php\n $rankalyst = new AT_Rankalyst_API($username, $apikey, $project_id, 3);\n if($rankalyst) {\n\t $response = $rankalyst->data();\n\t if($response) {\n\t\t if ( $response->status != 'success' ) {\n\t\t\t echo '<div class=\"rankalyst-text\"><p style=\"color: #c01313; margin-top: 10px\">' . $response->message . '</p></div>';\n\t\t } else {\n\t\t\t if ( $response->data ) {\n\t\t\t\t $data = $response->data->items;\n\t\t\t\t $rankalyst->output( $data );\n\t\t\t }\n\t\t }\n\t }\n }\n ?>\n </div>\n </div>\n <?php\n }", "function getDisplay() {\n\t\t$content = \"<h3>\" . $this->widgetTitle . \"</h3>\";\n\n\t\tif (!empty($this->facebookUrl) && \n\t\t\ttrim($this->facebookUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-facebook\"><a href=\"' . $this->facebookUrl . '\" ><i class=\"fa fa-facebook\"></i></a></span>';\n\t\t}\n\t\tif (!empty($this->twitterUrl) && \n\t\t\t\ttrim($this->twitterUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-twitter\"><a href=\"' . $this->twitterUrl . '\" ><i class=\"fa fa-twitter\"></i></a></span>';\n\t\t}\n\t\tif (!empty($this->googleplusUrl) && \n\t\t\ttrim($this->googleplusUrl) !== '') {\n\t\t\t$content .= '<span class=\"social-pages-icon social-page-google\"><a href=\"' . $this->googleplusUrl . '\" ><i class=\"fa fa-google\"></i></a></span>';\n\t\t}\n\n\t\treturn $content;\n\t}", "public function renderWidgets()\r\n {\r\n foreach ($this->_widgets as $widget)\r\n {\r\n echo current($widget);\r\n }\r\n\r\n }", "public function dashboard_widget_content() {\n\t\t$is_authed = ( MonsterInsights()->auth->is_authed() || MonsterInsights()->auth->is_network_authed() );\n\n\t\tif ( ! $is_authed ) {\n\t\t\t$this->widget_content_no_auth();\n\t\t} else {\n\t\t\tmonsterinsights_settings_error_page( 'monsterinsights-dashboard-widget', '', '0' );\n\t\t\tmonsterinsights_settings_inline_js();\n\t\t}\n\n\t}", "public function render( ){\n\t\treturn $this->__childWidget->render();\n\t}", "public function output(WidgetInterface $widget);", "public function render_content() {\n\t\t?>\n\t\t\t<input\n\t\t\t\tid=\"_customize-input-gutenberg_widget_blocks\"\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tvalue=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t<?php $this->link(); ?>\n\t\t\t/>\n\t\t<?php\n\t\tthe_gutenberg_widgets( 'gutenberg_customizer' );\n\t}", "public function renderWidget()\n {\n $id = $this->attr['id'];\n $name = $this->attr['name'];\n $contents = '';\n $values = $this->getValue();\n foreach ( $this->params['choices'] as $key => $label )\n {\n $options = $this->params;\n $options['attr'] = $this->attr;\n $options['attr']['id'] = $id . \"_$key\";\n $options['attr']['name'] = $name . \"[$key]\";\n $options['attr']['value'] = $key;\n if ( isset( $values[$key] ) && $values[$key] )\n {\n $options['attr']['checked'] = 'checked';\n }\n $widget = new InputCheckboxWidget( $options );\n $contents .= HtmlToolkit::buildTag( 'label', array(), false, $widget->render() . ' ' . $label );\n }\n\n return $contents;\n }", "private function _render()\n {\n $content = '';\n\n if (is_array($this->widgets)) {\n // clean path vars\n self::_clean_paths();\n\n foreach ($this->widgets as $parts) {\n\n $content = '';\n\n $type = (array_key_exists('type', $parts)) ? $parts['type'] : '';\n $src = (array_key_exists('src', $parts)) ? $parts['src'] : '';\n $title = (array_key_exists('title', $parts)) ? $parts['title'] : '';\n $alt = (array_key_exists('alt', $parts)) ? $parts['alt'] : 1;\n $cols = (array_key_exists('cols', $parts)) ? $parts['cols'] : 1;\n\n // process action commands (these don't follow the convention of standard widgets)\n switch ($type) {\n case 'clear':\n // push content directly into dashboard array\n $content = \"<div style='clear:both'></div>\";\n $this->_dashboard[] = $content;\n continue 2;\n break;\n }\n\n // check if individual keys supplied instead of an array of values\n if (array_key_exists('src', $parts)) {\n\n // individual keys supplied so construct appropriate array\n $parts = array(array('type'=>$type, 'src'=>$src, 'alt'=>$alt));\n }\n\n // process each part\n foreach ($parts as $part) {\n\n if (! is_array($part)) continue;\n\n // add any part-specific sub-headings as <H3>\n $content .= (array_key_exists('title', $part)) ? \"<\".$this->widget_subheading.\">\".$part['title'].\"</\".$this->widget_subheading.\">\" : '';\n\n switch ($part['type']) {\n //======================================\n case 'oop':\n //======================================\n\n // run an external controller to produce widget contents\n if ($this->oop_alt) {\n // alternative location will be:\n // [oop_path]/[dashboard_folder]/[dashboard_name]/[controller_name].[ext]\n // eg. [application/controllers]/[dashboard]/[safety]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash_fldr, $this->dash).$part['src'].EXT;\n\n } else {\n\n // normal location will be\n // [oop_path]/[dashboard_name]/[dashboard_folder]/[controller_name].[ext]\n // eg. [application/controllers]/[safety]/[dashboard]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash, $this->dash_fldr).$part['src'].EXT;\n }\n\n if (file_exists($file_name)) {\n\n include_once $file_name;\n\n // create an instance of the controller so we can run it\n $cname = ucfirst($part['src']);\n $c = new $cname;\n\n // always run the index() method to build content\n $content .= $c->index();\n\n } else {\n\n $content .= 'WARNING: Unable to find controller: '.$file_name;\n }\n\n break;\n\n //======================================\n case 'html':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $part['src'];\n\n break;\n\n //======================================\n case 'curl':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $this->_curl_response($part['src']);\n\n break;\n\n //======================================\n case 'img':\n //======================================\n\n // create an <img> tag widget referencing an external image file\n // $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path.PS.$this->dash.PS.$this->dash_fldr.PS.$part['src'] : '';\n $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n $img_alt = (array_key_exists('alt', $part)) ? $part['alt'] : '';\n\n if (file_exists(FCPATH.$img_file)) {\n\n $content .= \"<img src='\".$img_file.\"' width='100%' alt='{$img_alt}' title='{$img_alt}' class='modalview' type='image' />\";\n\n } else {\n\n $content = 'WARNING: Unable to find img: '.FCPATH.$img_file;\n }\n\n break;\n\n //======================================\n case 'file':\n //======================================\n\n // pull widget contents directly from an external file\n $file_name = (array_key_exists('src', $part)) ? $this->_makepath(FCPATH.$this->asset_path, $this->file_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n\n if (file_exists($file_name)) {\n $content .= file_get_contents($file_name);\n\n } else {\n\n $content .= 'WARNING: Unable to find file: '.$file_name;\n }\n\n break;\n }\n }\n\n // add this widget to dashboard\n $this->_dashboard[] = $this->_widget($title, $content, $cols);\n }\n }\n\n return $content;\n }", "public function fetchWidget() {\n $html = '';\n $in_dashboard = $readonly = true;\n $store_in_session = false;\n $html .= $this->fetchCharts($this->report->getMatchingIds(), $in_dashboard, $readonly, $store_in_session);\n $html .= $this->fetchWidgetGoToReport();\n return $html;\n }", "public function Show(){\n\t\techo(\"\n\t\t<div class='$this->claseCSS'>\n\t\t<div class='WidgetTitle'><a id='TitleBlock' href='$this->masURL'><div id='TitleText'>$this->Titulo</div></a></div>\n\t\t\t$this->Contenido\n\t\t\t<div class='footer'><a href='$this->masURL'>Ver m&aacute;s...</a></div>\n\t\t</div>\n\t\t\");\n\t}", "public function indexAction()\n {\n $this->view->widget = $this->_getWidget();\n }", "function display() {\r\n\t\tparent::display ();\r\n\t}", "abstract public function getWidget() : string;", "public function view() {\n \n // Get the user's plan\n $user_plan = get_user_option( 'plan', $this->CI->user_id );\n \n // Get plan end\n $plan_end = get_user_option( 'plan_end', $this->CI->user_id );\n \n // Get plan data\n $plan_data = $this->CI->plans->get_plan( $user_plan );\n \n // Set widgets\n $widgets = array();\n \n // Get default widgets\n $default_widgets = array();\n \n if ( get_option('app_dashboard_left_side_position') && get_option('app_dashboard_enable_default_widgets') ) {\n\n $full_size = 'col-xl-5';\n\n $plan_data[0]['size'] = 6;\n\n } else {\n\n $full_size = 'col-xl-12';\n\n $plan_data[0]['size'] = 3;\n\n } \n\n if ( get_option('app_dashboard_enable_default_widgets') ) {\n \n foreach ( glob(MIDRUB_DASHBOARD_APP_PATH . '/widgets/*.php') as $filename ) {\n\n $className = str_replace( array( MIDRUB_DASHBOARD_APP_PATH . '/widgets/', '.php' ), '', $filename );\n\n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n 'Dashboard',\n 'Widgets',\n ucfirst($className)\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->display_widget( $this->CI->user_id, $plan_end, $plan_data );\n\n // Add widget to $default_widgets array\n $default_widgets[$response['order']] = $response['widget'];\n\n }\n\n arsort($default_widgets);\n \n if ( $default_widgets ) {\n \n $widgets[0] = '<div class=\"' . $full_size . ' col-lg-12 col-md-12 stats\">'\n . '<div class=\"row\">';\n\n $i = 0;\n \n foreach ( $default_widgets as $widget ) {\n \n if ( get_option('app_dashboard_left_side_position') && $i % 1 ) {\n \n $widgets[0] .= '</div><div class=\"row\">';\n \n }\n \n $widgets[0] .= $widget;\n \n $i++;\n \n }\n \n $widgets[0] .= '</div>'\n . '</div>';\n \n }\n \n }\n \n $apps_widgets = array();\n \n foreach ( glob( MIDRUB_APPS_PATH . '/collection/*') as $directory ) {\n\n $dir = str_replace( MIDRUB_APPS_PATH . '/collection/', '', $directory );\n \n if ( !get_option('app_' . $dir . '_enable') || !plan_feature('app_' . $dir) ) {\n continue;\n }\n\n if ( $dir === 'dashboard' ) {\n \n continue;\n \n } else {\n \n // Create an array\n $array = array(\n 'MidrubApps',\n 'Collection',\n ucfirst($dir),\n 'Main'\n ); \n\n // Implode the array above\n $cl = implode('\\\\',$array);\n\n // Instantiate the class\n $response = (new $cl())->widgets( $this->CI->user_id, $plan_end, $plan_data );\n \n foreach ( $response as $key => $value ) {\n \n // Add widget to $apps_widgets array\n $apps_widgets[$key] = $value;\n \n }\n \n }\n\n }\n\n if ( $apps_widgets ) {\n \n arsort($apps_widgets);\n \n $e = 0;\n \n foreach ( $apps_widgets as $key_w => $value_w ) {\n\n if ( $full_size === 'col-xl-5' && $e === 0 ) {\n\n if ( !isset($widgets[0]) ) {\n $widgets[0] = '';\n }\n \n $widgets[0] .= str_replace( '[xl]', '7', $value_w['widget'] );\n \n } else {\n \n $widgets[$key_w] = str_replace( '[xl]', '12', $value_w['widget'] );\n \n }\n \n if ( $value_w['styles_url'] && !in_array( $value_w['styles_url'], $this->css_urls_widgets ) ) {\n $this->css_urls_widgets[] = $value_w['styles_url'];\n }\n \n if ( $value_w['js_url'] && !in_array( $value_w['js_url'], $this->js_urls_widgets ) ) {\n $this->js_urls_widgets[] = $value_w['js_url'];\n } \n \n $e++;\n \n }\n \n }\n \n $this->CI->user_header = user_header();\n \n $this->CI->user_header['app'] = 'dashboard';\n \n $expired = 0;\n \n $expires_soon = 0;\n \n if ( $plan_end ) {\n \n if ( strtotime($plan_end) < time() ) {\n \n $this->CI->plans->delete_user_plan($this->CI->user_id);\n redirect('user/app/dashboard');\n \n } elseif ( strtotime($plan_end) < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n // Making temlate and send data to view.\n $this->CI->template['header'] = $this->CI->load->view('user/layout/header', array('app_styles' => $this->assets_css(), 'title' => $this->CI->lang->line('dashboard')), true);\n $this->CI->template['left'] = $this->CI->load->view('user/layout/left', $this->CI->user_header, true);\n $this->CI->template['body'] = $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views', 'main', array('widgets' => $widgets, 'expired' => $expired, 'expires_soon' => $expires_soon), true);\n $this->CI->template['footer'] = $this->CI->load->view('user/layout/footer', array('app_scripts' => $this->assets_js()), true);\n $this->CI->load->ext_view( MIDRUB_DASHBOARD_APP_PATH . '/views/layout', 'index', $this->CI->template);\n \n }", "public function display() {\n echo $this->render();\n }", "function dashboard_widget_display() {\n\t\techo '<div class=\"escalate-dashboard-loading\">Loading Stats</div>';\n\t}", "public static function widget() {\n //require_once( 'widget.php' );\n require_once get_stylesheet_directory() . '/inc/templates/statistics_widget.php';\n }", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function display()\n {\n parent::display();\n }", "function display()\n {\n parent::display();\n }", "function display()\n {\n parent::display();\n }", "function dashboard_widget() {\n\t\tif(!empty($this->options['stats_last_cache'])):\n\t\t\t$last_cache = '<em>Last Updated ' . date(\"m/d/y @ h:i:s\", $this->options['stats_last_cache']) . '</em>';\n\t\telse:\n\t\t\t$last_cache = '';\n\t\tendif;\n\t\twp_add_dashboard_widget('escalate_network_stats', 'Escalate Network Stats'.$last_cache, array($this,'dashboard_widget_display'));\t\n\t}", "public function run()\n {\n $categories = \\App\\Models\\Category::with('categories')->where('id_parent', 0)->where('status', 1)->orderBy('sort')->get();\n\n return view(\"widgets.catalog_widget\", [\n 'config' => $this->config, 'categories' => $categories\n ]);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "function widget($args, $instance) {\n $feedData = $this->_collect_data($instance);\n $this->_print_widget($args, $instance, $feedData);\n }", "function widget( $args, $instance ) {\n\n\t\t\textract( $args );\n\n\t\t\tstatic $counters = array();\n\n\t\t\t$label = $instance['type'].'-'.$instance['rsr-id'];\n\n\n\n\t\t\t/* reset offset counter if rsr-id or type has changed */\n\t\t\tif (!isset($counters[$label])) {\n \t\t\t$counters[$label] = 0;\n \t\t}\n\n\n\n \t\tif(!isset($instance['type-text'])){\n \t\t\t$instance['type-text'] = '';\n \t\t}\n\n \t\t$instance['offset'] = $counters[$label];\n\n \t\t/* get the ajax url for the card widget */\n \t\t$akvo_card_obj = new Akvo_Card;\n \t\t$url = $akvo_card_obj->get_ajax_url('akvo_card', $instance, array('panels_info'));\n\n\n \t\techo \"<div data-behaviour='reload-html' data-url='\".$url.\"'></div>\";\n\n \t\t$counters[$label]++;\n\t\t}", "public function widget( $args, $instance ){}", "protected function retrieve_widgets()\n {\n }", "protected function retrieve_widgets()\n {\n }", "function ssl_widget() {\r\n $widget_ops = array('classname' => 'ssl_widget', 'description' => __('widget that display a slideshow from all attachments','ssl-plugin') ); \r\n $this->WP_Widget('ssl_widget', __('Siteshow Widget','ssl-plugin'), $widget_ops);\r\n }", "function docuemtation_dashboard_widget_function() {\n\t// Display whatever it is you want to show\n\techo 'Make sure you watch the videos in 720p resolution.<br/>\n<a href=\"http://youtu.be/vA3fXuhbmjg\" target=\"_blank\">Welcome and Workflow</a> (1:32)<br/>\n<a href=\"http://youtu.be/1EYJ2xuJOB4\" target=\"_blank\">Resize Images</a> (3:55)<br/>\n<a href=\"http://youtu.be/KVGK5FKm-Ng\" target=\"_blank\">Upload Images to Dropbox</a> (1:10)<br/>\n<a href=\"http://youtu.be/g_XfK9iLv7s\" target=\"_blank\">The Dashboard</a> (3:53)<br/>\n<a href=\"http://youtu.be/ZntfnFEocn8\" target=\"_blank\">Writing and Saving a Draft</a> (6:10)<br/>\n<a href=\"http://youtu.be/vSx0xOQms78\" target=\"_blank\">Changing Post Status</a> (0:34)<br/>\n<a href=\"http://youtu.be/GZvMRQlP-9c\" target=\"_blank\">Upload to and Crop Images on Website</a> (5:46)<br/>\n<a href=\"http://youtu.be/zrBjk92WQB4\" target=\"_blank\">Publish Cat Profile</a> (1:12)<br/>\nCreate a PDF of profile (later, I have to make a few modifications first)';\n}", "public function render_content()\n\t\t{ ?>\n\t\t\t<label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->description ); ?></span>\n <p class=\"description\">\n <span class=\"typography-size-label\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\"><input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "function widget( $args, $instance ) {\n\n\t\t$cache = wp_cache_get( $this->plugin_name, 'widget' );\n\n\t\tif ( ! is_array( $cache ) ) {\n\n\t\t\t$cache = array();\n\n\t\t}\n\n\t\tif ( ! isset ( $args['widget_id'] ) ) {\n\n\t\t\t$args['widget_id'] = $this->plugin_name;\n\n\t\t}\n\n\t\tif ( isset ( $cache[ $args['widget_id'] ] ) ) {\n\n\t\t\treturn print $cache[ $args['widget_id'] ];\n\n\t\t}\n\n\t\textract( $args, EXTR_SKIP );\n\n\t\t$widget_string = $before_widget;\n\n\t\t// Manipulate widget's values based on their input fields here\n\n\t\tob_start();\n\n\t\tinclude( plugin_dir_path( __FILE__ ) . 'partials/job-search-display-widget.php' );\n\n\t\t$widget_string .= ob_get_clean();\n\t\t$widget_string .= $after_widget;\n\n\t\t$cache[ $args['widget_id'] ] = $widget_string;\n\n\t\twp_cache_set( $this->plugin_name, $cache, 'widget' );\n\n\t\tprint $widget_string;\n\n\t}", "public function render_content() {\n?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "function widgetControlOutput( ) {\r\n\t\t\t$options = get_option( 'ILuvWalking.com Widget' );\r\n\t\t\tif( isset( $_POST[ \"iluvwalking-com-submit\" ] ) ) {\r\n\t\t\t\t$options[ 'title' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-title' ] ) );\r\n\t\t\t\t$options[ 'name' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-name' ] ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_option( 'ILuvWalking.com Widget', $options );\r\n\t\t\t\r\n\t\t\t$title = attribute_escape( $options[ 'title' ] );\r\n\t\t\t$name = attribute_escape( $options[ 'name' ] );\r\n\t\t\t\r\n\t\t\tinclude ( 'views/widget-control.php' );\r\n\t\t}", "public function index()\n {\n $widgetsFrontend = Widgets::frontend()->all();\n $widgetsBackend = Widgets::backend()->all();\n\n return view_backend('widget.index', compact('widgetsFrontend', 'widgetsBackend'));\n }", "public function show() {\n echo $this->mountElement();\n }", "public function renderWidget()\n {\n if ($this->data !== null) {\n $this->htmlAttributes['value'] = $this->data;\n }\n\n // And to be sure to generate a proper html text input with the proper name...\n $this->htmlAttributes['type'] = $this->type;\n $this->htmlAttributes['name'] = $this->name;\n $this->htmlAttributes['id'] = $this->getId();\n\n $output = '<input ';\n\n $output .= $this->renderHtmlAttributes();\n\n $output .= '/>';\n\n return $output;\n }", "public function get_display() {\n return $this->view->display_handler;\n }", "public function displayEventWidget($attrs) {\n $widget = new EventsWidget();\n \n ob_start();\n $widget->widget([], $attrs);\n return ob_get_clean();\n }", "public function tally_rendered_widgets($widget)\n {\n }", "public function getWidget()\n\t{\n\t\treturn $this->widget;\n\t}", "function wp_render_widget_control($id)\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "function widget( $args, $instance ) {\n\n \textract($args);\n \t$title = apply_filters('widget_title', $instance['title'] );\n \t$num_articles = $instance['num_articles'];\n \t$display_image = $instance['display_image'];\n\n \t$options = get_option('pgnyt_articles');\n \t$pgnyt_results = $options['pgnyt_results'];\n\n \trequire ('inc/front-end.php');\n }", "function rad_widget_content(){\n\t//show an RSS feed\n\twp_widget_rss_output( 'http://wordpress.melissacabral.com/feed/', array(\n\t\t'items' \t\t=> 7,\n\t\t'show_summary' \t=> true,\n\t\t'show_date'\t\t=> true,\n\t\t'show_author'\t=> true,\n\t) );\n}", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "function box_widget(){\n\t$CI=& get_instance();\n\treturn $CI->parser->parse('layout/ddi/box_widget.html', $CI->data,true);\n}", "function display() {\r parent::display();\r }", "public function render_content() { ?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">&percnt;</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "protected function get_widgets()\n {\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "function display()\r\n\t {\r\n\t parent::display();\r\n\t }", "function widget( $args, $instance ) {\r\n extract( $args );\r\n /* Our variables from the widget settings. */\r\n $title = apply_filters('widget_name', $instance['title'] );\r\n $type = $instance['type'];\r\n $style = $instance['style'];\r\n $limit = $instance['limit'];\r\n echo $before_widget;\r\n echo $this->showWidget($title, $type, $style, $limit);\r\n echo $after_widget;\r\n }", "public abstract function display();", "public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}", "public function _settings_field_webwidget_display() {\n global $zendesk_support;\n ?>\n <select name=\"zendesk-settings[webwidget_display]\" id=\"zendesk_webwidget_display\">\n <option\n value=\"none\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'none' ); ?> ><?php _e( 'Do not display the Zendesk Widget anywhere', 'zendesk' ); ?></option>\n <option\n value=\"auto\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'auto' ); ?> ><?php _e( 'Display the Zendesk Widget on all posts and pages', 'zendesk' ); ?></option>\n <option\n value=\"manual\" <?php selected( $zendesk_support->settings['webwidget_display'] == 'manual' ); ?> ><?php _e( 'I will decide where the Zendesk Widget displays using a template tag', 'zendesk' ); ?></option>\n </select>\n\n <?php\n }", "abstract public function widget_markup( $args, $instance );", "public function actionIndex()\n {\n return $this->render('@gilek/gtreetable/views/widget', ['options'=>[\n 'manyroots' => true,\n 'draggable' => true\n ]]);\n }", "public function render()\n {\n return view('components.covid-widget');\n }", "public function display() {\n\n\t\t// Register WP built-in Thickbox for popup.\n\t\tadd_thickbox();\n\n\t\tparent::display();\n\t}", "public function widgets() {\r\n\t\t// Make sure the user has capability.\r\n\t\tif ( Permission::user_can( 'analytics' ) || ! is_admin() ) {\r\n\t\t\t// Most popular contents.\r\n\t\t\tregister_widget( Widgets\\Popular::instance() );\r\n\t\t}\r\n\t}", "public function output_widget_control_templates()\n {\n }", "public function widget($args, $instance){\n $this->coreWidget->renderWidget($args, $instance);\n }", "public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }", "function wf_template_widget($retData=false) {\n\t\tglobal $post;\n\t\t\n\t\t$error = 'Error while adding the widget, please report to <a href=\"http://blog.wanderfly.com/wordpress-plugin/\">http://blog.wanderfly.com/wordpress-plugin/</a>.';\n\t\t$widgetHTML = false;\n\t\t\n\t\tif($post) {\n\t\t\t//Get the Destination ID from the post's metas,\n\t\t\t$wf_meta = get_post_meta($post->ID, \"wf_destination\", true);\n\t\t\t\n\t\t\t//Display the wanderfly widget,\n\t\t\tif($wf_meta) {\n\t\t\t\t$wf_metas = explode(':', $wf_meta);\n\t\t\t\t$widgetHTML = wf_widget($wf_metas[0]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Echo the widget,\n\t\tif($widgetHTML !== false) {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $widgetHTML; }\n\t\t}\n\t\t//Return the widget's HTML,\n\t\telse {\n\t\t\tif($retData) { return $widgetHTML; }\n\t\t\telse { echo $error; }\n\t\t}\n\t\t\n\t}", "public function dashboard_widget_control() {\n\t\tif ( !$widget_options = get_option( 'vfb_dashboard_widget_options' ) )\n\t\t\t$widget_options = array();\n\n\t\tif ( !isset( $widget_options['vfb_dashboard_recent_entries'] ) )\n\t\t\t$widget_options['vfb_dashboard_recent_entries'] = array();\n\n\t\tif ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['vfb-widget-recent-entries'] ) ) {\n\t\t\t$number = absint( $_POST['vfb-widget-recent-entries']['items'] );\n\t\t\t$widget_options['vfb_dashboard_recent_entries']['items'] = $number;\n\t\t\tupdate_option( 'vfb_dashboard_widget_options', $widget_options );\n\t\t}\n\n\t\t$number = isset( $widget_options['vfb_dashboard_recent_entries']['items'] ) ? (int) $widget_options['vfb_dashboard_recent_entries']['items'] : '';\n\n\t\techo sprintf(\n\t\t\t'<p>\n\t\t\t<label for=\"comments-number\">%1$s</label>\n\t\t\t<input id=\"comments-number\" name=\"vfb-widget-recent-entries[items]\" type=\"text\" value=\"%2$d\" size=\"3\" />\n\t\t\t</p>',\n\t\t\t__( 'Number of entries to show:', 'visual-form-builder-pro' ),\n\t\t\t$number\n\t\t);\n\t}", "function widget($args, $instance) {\n extract( $args, EXTR_SKIP );\n //echo $before_widget;\n include(plugin_dir_path(__FILE__) . '/views/'. $instance['display'] .'.php' );\n// echo $after_widget;\n}", "public function widget($hArgs, $hInstance)\n {\n echo $this->generateWidget($hArgs, $hInstance);\n\t}", "public function toHtml()\n {\n\n return access()->content ? view('admin.widgets.quick')->render() : null;\n\n }", "function widget( $args, $instance ) {\n extract( $args );\n\n /* Before widget (defined by themes). */\n echo $before_widget;\n\n echo $before_title . 'thunderstorm-stream' . $after_title;\n thunderstorm_stream_box();\n\n /* After widget (defined by themes). */\n echo $after_widget;\n }", "public function display() {}", "public function display() {}", "public function dashboard_widget() {\n\t\tglobal $wpdb;\n\n\t\t// Get the date/time format that is saved in the options table\n\t\t$date_format = get_option( 'date_format' );\n\t\t$time_format = get_option( 'time_format' );\n\n\t\t$widgets = get_option( 'vfb_dashboard_widget_options' );\n\t\t$total_items = isset( $widgets['vfb_dashboard_recent_entries'] ) && isset( $widgets['vfb_dashboard_recent_entries']['items'] ) ? absint( $widgets['vfb_dashboard_recent_entries']['items'] ) : 5;\n\n\t\t$forms = $wpdb->get_var( \"SELECT COUNT(*) FROM {$this->form_table_name}\" );\n\n\t\tif ( !$forms ) :\n\t\t\techo sprintf(\n\t\t\t\t'<p>%1$s <a href=\"%2$s\">%3$s</a></p>',\n\t\t\t\t__( 'You currently do not have any forms.', 'visual-form-builder-pro' ),\n\t\t\t\tesc_url( admin_url( 'admin.php?page=vfb-add-new' ) ),\n\t\t\t\t__( 'Get started!', 'visual-form-builder-pro' )\n\t\t\t);\n\n\t\t\treturn;\n\t\tendif;\n\n\t\t$entries = $wpdb->get_results( $wpdb->prepare( \"SELECT forms.form_title, entries.entries_id, entries.form_id, entries.sender_name, entries.sender_email, entries.date_submitted FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id ORDER BY entries.date_submitted DESC LIMIT %d\", $total_items ) );\n\n\t\tif ( current_user_can( 'vfb_edit_entries' ) )\n\t\t\t$action = 'edit';\n\t\telseif ( current_user_can( 'vfb_view_entries' ) )\n\t\t\t$action = 'view';\n\n\t\tif ( !$entries ) :\n\t\t\techo sprintf( '<p>%1$s</p>', __( 'You currently do not have any entries.', 'visual-form-builder-pro' ) );\n\t\telse :\n\n\t\t\t$content = '';\n\n\t\t\tforeach ( $entries as $entry ) :\n\n\t\t\t\t$content .= sprintf(\n\t\t\t\t\t'<li><a href=\"%1$s\">%4$s</a> via <a href=\"%2$s\">%5$s</a> <span class=\"rss-date\">%6$s</span><cite>%3$s</cite></li>',\n\t\t\t\t\tesc_url( add_query_arg( array( 'action' => $action, 'entry' => absint( $entry->entries_id ) ), admin_url( 'admin.php?page=vfb-entries' ) ) ),\n\t\t\t\t\tesc_url( add_query_arg( 'form-filter', absint( $entry->form_id ), admin_url( 'admin.php?page=vfb-entries' ) ) ),\n\t\t\t\t\tesc_html( $entry->sender_name ),\n\t\t\t\t\tesc_html( $entry->sender_email ),\n\t\t\t\t\tesc_html( $entry->form_title ),\n\t\t\t\t\tdate( \"$date_format $time_format\", strtotime( $entry->date_submitted ) )\n\t\t\t\t);\n\n\t\t\tendforeach;\n\n\t\t\techo \"<div class='rss-widget'><ul>$content</ul></div>\";\n\n\t\tendif;\n\t}", "function scoreboard_widget() {\r\n\r\n\techo\"<div class='widget'><h2>Scoreboard</h2><img src='http://www.bollywoodjalwa.com/cricket-widget.php'></div>\";\r\n\r\n}", "function render_frontend(){\r\n if ($this -> type == 'textelement' || $this -> type == 'menu' || $this -> type == 'socialicons' || $this -> type == 'copyright' ) {\r\n if ($this -> text_align == 'left') {\r\n $text_align_class = 'align-left';\r\n }elseif ($this -> text_align == 'center'){\r\n $text_align_class = 'align-center';\r\n }elseif ($this -> text_align == 'right'){\r\n $text_align_class = 'align-right';\r\n }\r\n }else { $text_align_class = ''; } \r\n $type = $this -> type;\r\n echo '<div class=\"' . $this -> type . ' ' . $text_align_class . ' ' . LBRenderable::$words[ $this -> element_columns ] . ' columns\">';\r\n call_user_func( array ( $this, \"render_frontend_$type\" ) );\r\n echo '</div>';\r\n }", "private function showDisplay() {\n\t\twp_enqueue_style('pokamodule-settings');\n//\t\twp_enqueue_script('pokamodule-settings');\n\t\t\n\t\trequire_once $this->sPath . '/tpl/template/display.php';\n\t}", "function showWidget($login) {\n\t\t\n\t\t$window = HeadsUpWidget::Create($login);\n\t\t$window->setSize($this->config->width, 50);\n\t\t$window->setText($this->config->text);\n\t\t$window->setUrl($this->config->url);\n\t\t$pos = explode(\",\", $this->config->pos);\n\t\t$window->setPosition($pos[0], $pos[1]);\n\t\t$window->show();\n\t}", "public function dashboard_widget_control() {\n if (!$widget_options = get_option('swpm_dashboard_widget_options'))\n $widget_options = array();\n\n if (!isset($widget_options['swpm_dashboard_recent_entries']))\n $widget_options['swpm_dashboard_recent_entries'] = array();\n\n if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['swpm-widget-recent-entries'])) {\n $number = absint($_POST['swpm-widget-recent-entries']['items']);\n $widget_options['swpm_dashboard_recent_entries']['items'] = $number;\n update_option('swpm_dashboard_widget_options', $widget_options);\n }\n\n $number = isset($widget_options['swpm_dashboard_recent_entries']['items']) ? (int) $widget_options['swpm_dashboard_recent_entries']['items'] : '';\n\n echo sprintf(\n '<p>\n\t\t\t<label for=\"comments-number\">%1$s</label>\n\t\t\t<input id=\"comments-number\" name=\"swpm-widget-recent-entries[items]\" type=\"text\" value=\"%2$d\" size=\"3\" />\n\t\t\t</p>', __('Number of entries to show:', 'swpm-form-builder'), $number\n );\n }", "function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}", "public function getWidget(): \\WP_Widget{\n return $this->widget;\n }", "function widget( $args, $instance ) {\n // kick things off\n extract( $args );\n echo $before_widget; \n echo $before_title . $after_title; \n\n ?>\n <?php //Example html markup to show on the website ?>\n <ul class=\"infopage-list\">\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_phone.svg\" alt=\"\">\n </div>\n <div>\n Llámanos<br><a href=\"tel:<?php echo $instance[\"phone\"]; ?>\"><?php echo $instance[\"phone\"]; ?></a>\n </div>\n </li>\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_mail.svg\" alt=\"\">\n </div>\n <div>\n Escríbenos<br><a href=\"mailto:<?php echo $instance[\"email\"]; ?>\"><?php echo $instance[\"email\"]; ?></a>\n </div>\n </li>\n <li>\n <div>\n <img src=\"<?php echo get_stylesheet_directory_uri(); ?>/dist/img/ico_direccion.svg\" alt=\"\">\n </div>\n <div>\n Encuéntranos<br><a target=\"_blank\" href=\"<?php echo $instance[\"gmaps_link\"]; ?>\"><?php echo $instance[\"address\"]; ?></a>\n </div>\n </li>\n </ul>\n\t <?php\n\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t</label>\n\t\t\t<div class=\"wds-customize-text-editor\">\n\t\t\t\t<?php\n\t\t\t\t// Setttings for the editor.\n\t\t\t\t$settings = array(\n\t\t\t\t\t'textarea_name' => $this->id,\n\t\t\t\t\t'textarea_rows' => 4,\n\t\t\t\t\t'media_buttons' => true,\n\t\t\t\t);\n\n\t\t\t\t// Add the editor.\n\t\t\t\twp_editor( $this->value(), $this->id, $settings );\n\n\t\t\t\t// Only enqueue scripts once.\n\t\t\t\tif ( 0 === self::$count ) {\n\t\t\t\t\t$this->enqueue_scripts();\n\t\t\t\t}\n\n\t\t\t\t// add the footer scripts.\n\t\t\t\t$this->add_footer_scripts();\n\n\t\t\t\t// Increment count.\n\t\t\t\t++self::$count;\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"slider-custom-control\">\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span><input type=\"number\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-slider-value\" <?php $this->link(); ?> />\n\t\t\t\t<div class=\"slider\" slider-min-value=\"<?php echo esc_attr( $this->input_attrs['min'] ); ?>\" slider-max-value=\"<?php echo esc_attr( $this->input_attrs['max'] ); ?>\" slider-step-value=\"<?php echo esc_attr( $this->input_attrs['step'] ); ?>\"></div><span class=\"slider-reset dashicons dashicons-image-rotate\" slider-reset-value=\"<?php echo esc_attr( $this->value() ); ?>\"></span>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function run()\n {\n $this->render('search-triple-widget');\n }", "abstract protected function show();", "public function widgetPopupHtml()\n {\n $widgetId = ipRequest()->getQuery('widgetId');\n $widgetRecord = \\Ip\\Internal\\Content\\Model::getWidgetRecord($widgetId);\n $widgetData = $widgetRecord['data'];\n\n // Populate form with proper fields\n switch ($widgetRecord['name']) {\n case 'ContentSection':\n //create form prepopulated with current widget data\n $form = $this->contentSectionManagementForm($widgetData);\n break;\n case 'ThreeItemListSection':\n $form = $this->threeItemManagementForm($widgetData);\n break;\n\n case 'Slider':\n $form = $this->sliderManagementForm($widgetData);\n break;\n case 'TopThreeSection':\n $form = $this->topThreeSectionManagementForm($widgetData);\n break;\n case 'ThumbnailCard':\n $form = $this->cardManagementForm($widgetData);\n break;\n default:\n $err = new \\Ip\\Response\\Json([\n 'error' => 'Unknown widget',\n 'widget' => $widgetRecord\n ]);\n $err->setStatusCode(400);\n return $err;\n }\n\n //Render form and popup HTML\n $viewData = array(\n 'form' => $form\n );\n $popupHtml = ipView('view/editPopup.php', $viewData)->render();\n $data = array(\n 'popup' => $popupHtml\n );\n //Return rendered widget management popup HTML in JSON format\n return new \\Ip\\Response\\Json($data);\n }", "public function index()\n\t{\n $widget = Widget::first();\n\n\t\treturn view('admin.widget', compact('widget'));\n\t}", "public function getDisplay() {\n\t\treturn parent::getDisplay();\n\t}", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\n }" ]
[ "0.7524064", "0.7413105", "0.7272697", "0.72208834", "0.7036302", "0.70204395", "0.7010869", "0.6995074", "0.683868", "0.68118656", "0.6790951", "0.67549556", "0.6734825", "0.6704948", "0.66814053", "0.6669506", "0.6665668", "0.6655077", "0.66512096", "0.6646191", "0.6637128", "0.66127425", "0.65866536", "0.6586404", "0.6580947", "0.6580006", "0.6580006", "0.6574912", "0.6574912", "0.6574912", "0.6568189", "0.65594476", "0.65426874", "0.6524418", "0.65195596", "0.6518087", "0.6511776", "0.6511776", "0.6500713", "0.6489075", "0.64836603", "0.6464372", "0.64413303", "0.6439259", "0.6435139", "0.6428434", "0.6428129", "0.64227027", "0.64223784", "0.641638", "0.6394556", "0.6384451", "0.6383907", "0.63833535", "0.6381979", "0.63784987", "0.6368427", "0.63673633", "0.6365912", "0.6362644", "0.63485885", "0.63452977", "0.6340031", "0.6336824", "0.63277334", "0.6310838", "0.6308045", "0.63062584", "0.62972593", "0.62956023", "0.6294409", "0.62888587", "0.6286509", "0.6286112", "0.6283861", "0.62782305", "0.6278109", "0.62742704", "0.62688386", "0.6267677", "0.62622607", "0.62622607", "0.62584406", "0.6255653", "0.62526745", "0.6251485", "0.6237678", "0.6221574", "0.6220449", "0.6220011", "0.6199815", "0.61995596", "0.61965907", "0.61955094", "0.6193952", "0.61873806", "0.6183237", "0.61774004", "0.6173375", "0.6173375", "0.6172835" ]
0.0
-1
Sanitize widget form values as they are saved.
public function update( $new_instance, $old_instance ) { $instance = array(); $instance['select'] = !empty($new_instance['select']) ? strip_tags($new_instance['select']) : null; $instance['variants'] = $new_instance['variants'] !== '-' ? strip_tags($new_instance['variants']) : null; $instance['style'] = strip_tags($new_instance['style']); $instance['center'] = strip_tags($new_instance['center']); $instance['center_margin'] = (int)strip_tags($new_instance['center_margin']); $instance['version'] = (in_array(strip_tags($new_instance['version']), array('old','new'))) ? strip_tags($new_instance['version']) : 'old'; $api_key = get_option($this->GrOptionDbPrefix . 'api_key'); if ( !empty($api_key) ) { $api = new GetResponseIntegration($api_key, get_option($this->GrOptionDbPrefix . 'api_url'), get_option($this->GrOptionDbPrefix . 'api_domain')); $webform = ($instance['version'] == 'old') ? $api->getWebForm($instance['select']) : $api->getForm($instance['select']); $web_forms = json_decode(get_option($this->GrOptionDbPrefix . 'web_forms'), true); if ( !empty($web_foms) ) { $web_forms = array(); } $web_forms[$instance['select']] = (array)$webform; if ( function_exists( 'is_customize_preview' ) == false || is_customize_preview() == false) { update_option($this->GrOptionDbPrefix . 'web_forms', json_encode($web_forms)); } } return $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }", "public function sanitize_input_fields()\n {\n }", "protected function sanitize() {}", "public function sanitize($value);", "protected function clean_saved_value() {\n\t\tif ( $this->saved_value !== '' ) {\n\t\t\tif ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) {\n\t\t\t\tFrmAppHelper::unserialize_or_decode( $this->saved_value );\n\t\t\t}\n\n\t\t\tif ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) {\n\t\t\t\t$this->saved_value = '';\n\t\t\t}\n\t\t}\n\t}", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function sanitize($value)\n {\n }", "public function sanitize(){\r\n\t\t$post = array();\r\n\t\tforeach($_POST as $key => $val){\r\n\t\t\tif(!get_magic_quotes_gpc()){\r\n\t\t\t\t$post[$key] = mysql_real_escape_string($val);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $post;\r\n\t}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "abstract public function sanitize();", "public function sanitize() {\n }", "public function sanitize()\n {\n $purifier = $this->_purifier;\n $this->_sanitized_data = array_map(\n function ($field) use ($purifier) {\n return $purifier->purify($field);\n },\n $this->_data\n );\n }", "public function sanitizeValueOnSave(): bool\n {\n return true;\n }", "function sanitize($cleanFramewerkTags)\n {\n if ( $cleanFramewerkTags == true )\n {\n $this->value = preg_replace('/({(@|%|!i18n:)([^{}]*((?1)[^{}]*)*)})/', $this->value);\n }\n }", "private function sanitize($form_data) {\n $sanitized_data = filter_var_array($form_data, FILTER_SANITIZE_STRING);\n \n // Return the sanitized datas\n return $sanitized_data;\n }", "function sanitize($dirty){\n return htmlentities($dirty,ENT_QUOTES,\"UTF-8\");\n}", "function sanitize_post_field($field, $value, $post_id, $context = 'display')\n {\n }", "function sanitize($val){\n return htmlentities(stripslashes(trim($val)), ENT_QUOTES);\n}", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "function clean_input( $value ) {\n if ( is_numeric( $value ) ) {\n return( $value );\n }\n // Strip slashes if necessary\n if ( get_magic_quotes_gpc( ) ) {\n $value = stripslashes( $value );\n }\n // Make sure no sql-dangerous code gets through\n $value = mysql_real_escape_string( $value );\n // Strip HTML tags, to be sure\n // May need another routine to allow input of HTML\n $value = strip_tags( $value );\n \n return( $value );\n }", "public function sanitize( $input ){\n\n\t\t// IMPORTANT : set empty value to unset fields (fixe issue for default value on checkbox items - see custom_get_options())\n\t\tforeach ($this->fields as $field){\n\t\t\tif (!isset($input[$field]))\n\t\t\t\t$input[$field] = '';\n\t\t}\n\n\t\t$input = apply_filters(\"custom_config_options_sanitize_fields\", $input);\n\n\t\treturn $input;\n\t}", "function sanitation($postVal){\n\t$rawinfo= $postVal;\n\t$removeSpecial = htmlspecialchars($rawinfo);\n\t$finalForm = escapeshellcmd($removeSpecial);\n\treturn $finalForm;\n}", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }", "public static function sanitize_textfield( $value ) {\n\t\tif ( is_object( $value ) || is_array( $value ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$value = (string) $value;\n\t\t$filtered = wp_check_invalid_utf8( $value );\n\n\t\tif ( strpos( $filtered, '<' ) !== false ) {\n\t\t\t$filtered = wp_pre_kses_less_than( $filtered );\n\t\t\t// This will strip extra whitespace for us.\n\t\t\t$filtered = wp_strip_all_tags( $filtered, false );\n\n\t\t\t// Use html entities in a special case to make sure no later\n\t\t\t// newline stripping stage could lead to a functional tag!\n\t\t\t$filtered = str_replace( \"<\\n\", \"&lt;\\n\", $filtered );\n\t\t}\n\t\t$filtered = preg_replace( '/[\\r\\n\\t ]+/', ' ', $filtered );\n\t\t$filtered = trim( $filtered );\n\n\t\t$found = false;\n\t\twhile ( preg_match( '/%[0-9]{2}/i', $filtered, $match ) ) {\n\t\t\t$filtered = str_replace( $match[0], '', $filtered );\n\t\t\t$found = true;\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t// Strip out the whitespace that may now exist after removing the octets.\n\t\t\t$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );\n\t\t}\n\n\t\treturn apply_filters( 'sanitize_text_field', $filtered, $value );\n\t}", "function sanitize_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "public function sanitize_cmb_fields() {\n\t\t$cmb = $this->get_cmb_object();\n\n\t\t$cmb->data_to_save = $_REQUEST;\n\t\t$object_id = $cmb->object_id( $this->button_slug );\n\t\t$cmb->object_type( 'options-page' );\n\n\t\t$cmb->process_fields();\n\n\t\t// output buffer on the action so we don't pollute our JSON response\n\t\tob_start();\n\t\t// Preserve CMB action\n\t\tdo_action( 'cmb2_save_options-page_fields', $object_id, $cmb->cmb_id, $cmb->updated, $cmb );\n\t\tob_end_clean();\n\n\t\t$updated_fields = cmb2_options( $object_id )->get_options();\n\t\t$cmb_config = $this->get_cmb_config();\n\n\t\t$whitelist_keys = wp_list_pluck( $cmb_config['fields'], 'id' );\n\t\t$whitelist = array();\n\t\t// Keep only the form values that correspond to the CMB2 fields\n\t\tforeach ( $whitelist_keys as $key ) {\n\t\t\t$value = isset( $updated_fields[ $key ] ) && ! empty( $updated_fields[ $key ] ) ? $updated_fields[ $key ] : '';\n\n\t\t\t// Don't keep empty values\n\t\t\tif ( $value ) {\n\t\t\t\t// Make checkbox values boolean\n\t\t\t\t$whitelist[ $key ] = 'on' == $value ? true : $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->filter_form_fields( $whitelist, $updated_fields );\n\t}", "function cmh_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['textarea_one'] = wp_filter_nohtml_kses($input['textarea_one']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['txt_one'] = wp_filter_nohtml_kses($input['txt_one']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\treturn $input;\r\n}", "public static function sanitize($value)\n {\n if (is_array($value) OR is_object($value))\n {\n foreach ($value as $key => $val)\n {\n // Recursively clean each value\n $value[$key] = Kohana::sanitize($val);\n }\n }\n elseif (is_string($value))\n {\n if (Kohana::$magic_quotes === TRUE)\n {\n // Remove slashes added by magic quotes\n $value = stripslashes($value);\n }\n\n if (strpos($value, \"\\r\") !== FALSE)\n {\n // Standardize newlines\n $value = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $value);\n }\n\n //Added strip tags\n $value = strip_tags($value);\n }\n\n return $value;\n }", "function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }", "protected function sanitize_posted_field( $value ) {\r\n\t\t// Santize value\r\n\t\t$value = is_array( $value ) ? array_map( array( $this, 'sanitize_posted_field' ), $value ) : sanitize_text_field( stripslashes( trim( $value ) ) );\r\n\r\n\t\treturn $value;\r\n\t}", "function postedValues($dirtyPost) {\n $cleanPost = [];\n foreach ($dirtyPost as $key => $value) {\n $cleanValue = sanitize($value);\n $cleanPost[$key] = $cleanValue;\n }\n return $cleanPost;\n}", "public function sanitizeFormValues ($formValues) {\n \n if (is_array($formValues)) {\n foreach ($formValues as $key => $value) {\n // array of values or a value, make a recursive call to handle each array entry\n $formValues[$key] = $this->sanitizeFormValues($value);\n }\n \n // the formValues provided was a single value not an array\n } else {\n // odd special characters from Word 2010 with Firefox\n $formValues = str_replace(chr(226).chr(128).chr(152), \"'\", $formValues);\n $formValues = str_replace(chr(226).chr(128).chr(153), \"'\", $formValues);\n \n // escape all the HTML characters\n $formValues = htmlentities($formValues);\n }\n \n return $formValues;\n \n }", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitizeInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n return $data;\n}", "public function sanitise($value, $isWysiwyg = false);", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize_category_field($field, $value, $cat_id, $context)\n {\n }", "public function sanitize_widget_instance($value, $id_base = \\null)\n {\n }", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\t}", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function sanitize( $input ) {\n }", "function sanitize($data){\n$data=trim($data);\n$data=htmlspecialchars($data);\n$data=mysql_real_escape_string($data);\nreturn $data;\n}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\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}", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "function tc_sanitize_textarea( $value) {\r\n $value = esc_html( $value);\r\n return $value;\r\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize_text_field($str)\n {\n }", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "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}", "function sanitizeHTMLValue($value) \n{ \treturn (isset($value) ? trim(htmlentities(stripslashes($value), ENT_QUOTES, 'UTF-8')) : NULL);\n}", "function clean_input($data){\r\n\t$data = trim($data);\r\n\t$data = stripslashes($data);\r\n\t$data = htmlspecialchars($data);\r\n\treturn $data;\t\r\n}", "public static function sanitize($value)\n\t{\n\t\tif (is_array($value) OR is_object($value))\n\t\t{\n\t\t\tforeach ($value as $key => $val)\n\t\t\t{\n\t\t\t\t// Recursively clean each value\n\t\t\t\t$value[$key] = self::sanitize($val);\n\t\t\t}\n\t\t}\n\t\telseif (is_string($value))\n\t\t{\n\t\t\tif (self::$magic_quotes === TRUE)\n\t\t\t{\n\t\t\t\t// Remove slashes added by magic quotes\n\t\t\t\t$value = stripslashes($value);\n\t\t\t}\n\n\t\t\tif (strpos($value, \"\\r\") !== FALSE)\n\t\t\t{\n\t\t\t\t// Standardize newlines\n\t\t\t\t$value = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $value);\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function sanitize_form_input_values(array $fields): array\n{\n $filter_params = [];\n\n foreach ($fields['fields'] as $field_key => $field) {\n $filter_params[$field_key] = $field['filter'] ?? FILTER_SANITIZE_SPECIAL_CHARS;\n }\n\n return filter_input_array(INPUT_POST, $filter_params);\n}", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "function sanitize($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function sanitize($data) {\n return htmlentities(strip_tags(mysql_real_escape_string($data)));\n }", "function sanitize($data) \n{\n\treturn htmlentities(strip_tags(mysql_real_escape_string($data)));\n}", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "function cleanInput($data)\n\t{\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function ATsanitize($input)\n{\n $user_input = trim($input);\n \n if (get_magic_quotesgpc())\n {\n $input = stripslashes($input);\n }\n}", "function cleaninput($value, $DB) {\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\t$value = stripslashes( $value );\n\t\t}\n\t\t\n\t\treturn mysql_real_escape_string( $value, $DB );\n\t}", "function cleanInput($data) { \r\n return htmlspecialchars(stripslashes(trim($data)));\r\n }", "function sanitize($input) {\n\t\t$cleaning = $input;\n\t\t\n\t\tswitch ($cleaning) {\n\t\t\tcase trim($cleaning) == \"\":\n\t\t\t\t$clean = false;\n\t\t\t\tbreak;\n\t\t\tcase is_array($cleaning):\n\t\t\t\tforeach($cleaning as $key => $value) {\n\t\t\t\t\t$cleaning[] = sanitize($value);\n\t\t\t\t}\n\t\t\t\t$clean = implode(\",\", $cleaning);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(get_magic_quotes_gpc()) {\n\t\t\t\t\t$cleaning = stripslashes($cleaning);\n\t\t\t\t}\n\t\t\t\t$cleaning = strip_tags($cleaning);\n\t\t\t\t$clean = trim($cleaning);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $clean;\n\t}", "public function sanitizeFreeText()\n {\n $this->label = AdapterUtil::reencode($this->label);\n $this->street = AdapterUtil::reencode($this->street);\n $this->locality = AdapterUtil::reencode($this->locality);\n $this->region = AdapterUtil::reencode($this->region);\n $this->country = AdapterUtil::reencode($this->country);\n }", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function ffw_port_settings_sanitize( $input = array() ) {\n\n global $ffw_port_settings;\n\n parse_str( $_POST['_wp_http_referer'], $referrer );\n\n $output = array();\n $settings = ffw_port_get_registered_settings();\n $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';\n $post_data = isset( $_POST[ 'ffw_port_settings_' . $tab ] ) ? $_POST[ 'ffw_port_settings_' . $tab ] : array();\n\n $input = apply_filters( 'ffw_port_settings_' . $tab . '_sanitize', $post_data );\n\n // Loop through each setting being saved and pass it through a sanitization filter\n foreach( $input as $key => $value ) {\n\n // Get the setting type (checkbox, select, etc)\n $type = isset( $settings[ $key ][ 'type' ] ) ? $settings[ $key ][ 'type' ] : false;\n\n if( $type ) {\n // Field type specific filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize_' . $type, $value, $key );\n }\n\n // General filter\n $output[ $key ] = apply_filters( 'ffw_port_settings_sanitize', $value, $key );\n }\n\n\n // Loop through the whitelist and unset any that are empty for the tab being saved\n if( ! empty( $settings[ $tab ] ) ) {\n foreach( $settings[ $tab ] as $key => $value ) {\n\n // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work\n if( is_numeric( $key ) ) {\n $key = $value['id'];\n }\n\n if( empty( $_POST[ 'ffw_port_settings_' . $tab ][ $key ] ) ) {\n unset( $ffw_port_settings[ $key ] );\n }\n\n }\n }\n\n // Merge our new settings with the existing\n $output = array_merge( $ffw_port_settings, $output );\n\n // @TODO: Get Notices Working in the backend.\n add_settings_error( 'ffw_port-notices', '', __( 'Settings Updated', 'ffw_port' ), 'updated' );\n\n return $output;\n\n}", "function clean_input( $dirty_data ){\n\t//use the DB connection already established\n\tglobal $db;\n\t//clean the data and 'return' it so we can continue working with it\n\treturn mysqli_real_escape_string($db, strip_tags( $dirty_data ));\n}", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function sanitize($input) {\n return htmlspecialchars(strip_tags(trim($input)));\n }", "function sanitize($data)\n{\n$data = trim($data);\n \n// apply stripslashes if magic_quotes_gpc is enabled\nif(get_magic_quotes_gpc())\n{\n$data = stripslashes($data);\n}\n \n// a mySQL connection is required before using this function\n$data = mysql_real_escape_string($data);\n \nreturn $data;\n}", "function clean($value) {\r\n\r\n\t/*$str = @trim($str);\r\n\r\n\tif(get_magic_quotes_gpc()) {\r\n\r\n\t\t$str = stripslashes($str);\r\n\r\n\t}\r\n\r\n\treturn mysql_real_escape_string($str);*/\r\n\r\n\t\r\n\r\n\t\t//function to check for both sql injection and cross site scripting\r\n\r\n\t\t //Trim the value\r\n\r\n\t\t $value = trim($value);\r\n\r\n\t\t \r\n\r\n\t\t// Stripslashes\r\n\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\r\n\t\t\t$value = stripslashes($value);\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t\t // Convert all &lt;, &gt; etc. to normal html and then strip these\r\n\r\n\t\t $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES)));\r\n\r\n\t\t\r\n\r\n\t\t // Strip HTML Tags\r\n\r\n\t\t $value = strip_tags($value);\r\n\r\n\t\t\r\n\r\n\t\t// Quote the value\r\n\r\n\t\t$value = mysql_real_escape_string($value);\r\n\r\n\t\t$value = htmlspecialchars ($value);\r\n\r\n\t\treturn $value;\r\n\r\n}", "public function sanitize($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_STRING);\n\t}", "function getSanitizedValues() {\r\n //TODO: actually clean the values. Could probably put it in the \r\n // case above...\r\n //\r\n //TDOD: consider using $_POST instead of $_GET!\r\n //\r\n // Also, this is probably overkill when we could just copy the\r\n // entirety of $_POST...not that we can guarantee people won't\r\n // jam malicious data into it.\r\n $cleanVals = array();\r\n $cleanVals['datetime'] = date(GlApp::DATE_FORMAT, strtotime($_REQUEST['datetime']));\r\n $cleanVals['mileage'] = $_REQUEST['mileage'];\r\n $cleanVals['location'] = $_REQUEST['location'];\r\n $cleanVals['pricepergallon'] = $_REQUEST['pricepergallon'];\r\n $cleanVals['gallons'] = $_REQUEST['gallons'];\r\n $cleanVals['grade'] = $_REQUEST['grade'];\r\n $cleanVals['pumpprice'] = $_REQUEST['pumpprice'];\r\n $cleanVals['notes'] = htmlspecialchars($_REQUEST['notes']);\r\n \r\n return $cleanVals;\r\n}", "function sanitizeData($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\n\t\treturn $data;\n\t}", "public static function sanitize() {\n\n $new_input = self::get_options();\n $default_options = self::default_options();\n $parts = parse_url($_POST['_wp_http_referer']);\n parse_str($parts['query'], $query);\n $tab = (array_key_exists('tab', $query)) ? $query['tab'] : 'general';\n\n switch ($tab) {\n case 'general':\n default:\n $new_input['cris_org_nr'] = isset($_POST[self::option_name]['cris_org_nr']) ? sanitize_text_field($_POST[self::option_name]['cris_org_nr']) : 0;\n break;\n\n case 'layout':\n $new_input['cris_pub_order'] = isset($_POST[self::option_name]['cris_pub_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_order'])) : $default_options['cris_pub_order'];\n $new_input['cris_pub_subtypes_order'] = isset($_POST[self::option_name]['cris_pub_subtypes_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_subtypes_order'])) : $default_options['cris_pub_subtypes_order'];\n $new_input['cris_univis'] = in_array($_POST[self::option_name]['cris_univis'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_univis'] : $default_options['cris_univis'];\n $new_input['cris_bibtex'] = isset($_POST[self::option_name]['cris_bibtex']) ? 1 : 0;\n $new_input['cris_url'] = isset($_POST[self::option_name]['cris_url']) ? 1 : 0;\n $new_input['cris_doi'] = isset($_POST[self::option_name]['cris_doi']) ? 1 : 0;\n $new_input['cris_oa'] = isset($_POST[self::option_name]['cris_oa']) ? 1 : 0;\n $new_input['cris_name_order_plugin'] = (isset($_POST[self::option_name]['cris_name_order_plugin'])\n && $_POST[self::option_name]['cris_name_order_plugin'] == 'lastname-firstname') ? 'lastname-firstname' : 'firstname-lastname';\n $new_input['cris_award_order'] = isset($_POST[self::option_name]['cris_award_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_award_order'])) : $default_options['cris_award_order'];\n $new_input['cris_award_link'] = in_array($_POST[self::option_name]['cris_award_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_award_link'] : $default_options['cris_award_link'];\n $new_input['cris_fields_num_pub'] = isset($_POST[self::option_name]['cris_fields_num_pub']) ? sanitize_text_field($_POST[self::option_name]['cris_fields_num_pub']) : 0;\n\t $new_input['cris_field_link'] = in_array($_POST[self::option_name]['cris_field_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_field_link'] : $default_options['cris_field_link'];\n\t $new_input['cris_project_order'] = isset($_POST[self::option_name]['cris_project_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_project_order'])) : $default_options['cris_project_order'];\n $new_input['cris_project_link'] = in_array($_POST[self::option_name]['cris_project_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_project_link'] : $default_options['cris_project_link'];\n $new_input['cris_patent_order'] = isset($_POST[self::option_name]['cris_patent_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_patent_order'])) : $default_options['cris_patent_order'];\n $new_input['cris_patent_link'] = in_array($_POST[self::option_name]['cris_patent_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_patent_link'] : $default_options['cris_patent_link'];\n $new_input['cris_activities_order'] = isset($_POST[self::option_name]['cris_activities_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_activities_order'])) : $default_options['cris_activities_order'];\n $new_input['cris_activities_link'] = in_array($_POST[self::option_name]['cris_activities_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_activities_link'] : $default_options['cris_activities_link'];\n $new_input['cris_standardizations_order'] = isset($_POST[self::option_name]['cris_standardizations_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_standardizations_order'])) : $default_options['cris_standardizations_order'];\n $new_input['cris_standardizations_link'] = in_array($_POST[self::option_name]['cris_standardizations_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_standardizations_link'] : $default_options['cris_standardizations_link'];\n break;\n case 'sync':\n $new_input['cris_sync_check'] = isset($_POST[self::option_name]['cris_sync_check']) ? 1 : 0;\n if(is_array($_POST[self::option_name]['cris_sync_shortcode_format'])) {\n /*foreach ($_POST[self::option_name]['cris_sync_shortcode_format'] as $_check){\n foreach ($_check as $_k => $_v) {\n $new_input['cris_sync_shortcode_format'][$_k] = $_v;\n }\n }*/\n $new_input['cris_sync_shortcode_format'] = $_POST[self::option_name]['cris_sync_shortcode_format'];\n }\n break;\n }\n return $new_input;\n }", "function widgetopts_sanitize_array( &$array ) {\n foreach ($array as &$value) {\n if( !is_array($value) ) {\n\t\t\t// sanitize if value is not an array\n $value = sanitize_text_field( $value );\n\t\t}else{\n\t\t\t// go inside this function again\n widgetopts_sanitize_array($value);\n\t\t}\n }\n\n return $array;\n}", "function clean($value) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n if (!is_numeric($value)) $value = addslashes($value);\n return $value;\n}", "public function sanitize($value)\n\t{\n\t\treturn null;\n\t}", "function sanitation($value) {\n\treturn strip_tags($value);\n}", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "public function sanitize()\n {\n return false;\n }", "public function sanitize()\n {\n return false;\n }", "public function sanitize()\n {\n return false;\n }", "function sanitizeString($str_input) {\r\n $str_input = strip_tags($str_input);\r\n $str_input = htmlentities($str_input);\r\n $str_input = stripslashes($str_input);\r\n return $str_input;\r\n}", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function filter_mydata($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function sanitize_validate_input($data){\n\t\t \t \t$data = filter_var($data, FILTER_SANITIZE_STRING);\n\t\t \t \t//$data = filter_var($data, FILTER_VALIDATE_EMAIL);\n\t\t \t \t$data = stripcslashes($data);\n\t\t \t \t$data = trim($data);\n\t\t \t \t$data = htmlspecialchars($data);\n\t\t \t \t\n\t\t \t \treturn $data; }", "function sanitize($input){\n $input = strip_tags($input);\n $input = htmlspecialchars($input);\n $input = trim($input);\n return $input;\n}", "public static function sanitize($value, $sanitizer = 'string', $extraOptions = [])\n {\n switch ($sanitizer) {\n case 'string':\n $value = sanitize_text_field($value);\n break;\n\n case 'html':\n $value = wp_kses_post($value);\n break;\n\n case 'slug':\n $value = sanitize_title($value);\n break;\n\n case 'id':\n $value = sanitize_key($value);\n break;\n\n case 'email':\n $value = sanitize_email($value);\n break;\n\n case 'int':\n $value = absint($value);\n break;\n\n case 'intnull':\n $value = absint($value);\n if (empty($value)) {\n $value = null;\n }\n break;\n\n case 'float':\n $value = floatval($value);\n break;\n\n case 'url':\n $value = esc_url($value, array('http', 'https'));\n break;\n\n case 'bool':\n $value = (is_string($value) ? ($value == 'true' || $value == '1' ? true : false) : ($value ? true : false));\n break;\n\n case 'bool_null':\n if ($value !== null) $value = (is_string($value) ? ($value == 'true' || $value == '1' ? true : false) : ($value ? true : false));\n break;\n\n case 'bool_string':\n $value = (is_string($value) ? ($value == 'true' || $value == '1' ? 'true' : 'false') : ($value ? 'true' : 'false'));\n break;\n\n case 'textarea':\n $value = explode(\"\\r\\n\", $value);\n foreach ($value as $val) {\n $values[] = sanitize_text_field($val);\n }\n $value = implode(\"<br>\", $values);\n break;\n\n case 'logo':\n $value = wp_check_filetype($value);\n if (in_array($value['ext'], array('jpg', 'jpeg', 'png'))) {\n $value = true;\n } else {\n $value = false;\n }\n break;\n\n case 'datetime':\n if ($value instanceof DateTime === false) {\n $result = false;\n try {\n $result = new DateTime($value);\n } catch (Exception $e) {\n }\n $value = $result;\n }\n break;\n\n case 'phone':\n if (class_exists('\\libphonenumber\\PhoneNumberUtil')) {\n $country = isset($extraOptions['country']) ? $extraOptions['country'] : 'FR';\n try {\n $phoneUtil = \\libphonenumber\\PhoneNumberUtil::getInstance();\n $number = $phoneUtil->parse($value, $country);\n if ($phoneUtil->isValidNumber($number)) {\n $number = $phoneUtil->formatInOriginalFormat($number, $country);\n $value = implode('.', explode(' ', $number));\n }\n } catch (Exception $e) {\n // Exception\n }\n }\n break;\n\n case false:\n break;\n }\n return $value;\n }", "public function sanitize_input_fields(array $args)\n {\n }", "function sanitize_term_field($field, $value, $term_id, $taxonomy, $context)\n {\n }", "static function clean_input($dirty)\n\t{\n\t\t//$input = get_magic_quotes_gpc() ? $dirty : addslashes($dirty);\n\n\t\tif( !is_array($dirty) )\n\t\t{\n\t\t\t$dirty = strtr( $dirty, array('<script>'=>'', '</script>'=>'') );\n\t\t\t$dirty = trim( strip_tags( htmlspecialchars($dirty, ENT_QUOTES), '' ) );\n\t\t}else if( is_array($dirty) )\n\t\t{\n\t\t\tforeach($dirty as $k=>$v)\n\t\t\t{\n\t\t\t\tif( is_array($v) )\n\t\t\t\t{\n\t\t\t\t\tforeach($v as $k2=>$v2)\n\t\t\t\t\t{\n\t\t\t\t\t\tif( is_array($v2) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($v2 as $k3=>$v3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v3 = strtr( $v3, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t\t\t\t$dirty[ $k ][ $k2 ][ $k3 ] = trim( strip_tags( htmlspecialchars($v3, ENT_QUOTES), '' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$v2 = strtr( $v2, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t\t\t$dirty[ $k ][ $k2 ] = trim( strip_tags( htmlspecialchars($v2, ENT_QUOTES), '' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$v = strtr( $v, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t$dirty[ $k ] = trim( strip_tags( htmlspecialchars($v, ENT_QUOTES), '' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn $dirty;\n\t}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}" ]
[ "0.7181779", "0.7148718", "0.6940822", "0.68380964", "0.68105626", "0.664147", "0.6583722", "0.6505763", "0.64504373", "0.64504373", "0.6431753", "0.64263475", "0.64247", "0.63831073", "0.6376312", "0.62935954", "0.62705755", "0.6258476", "0.6255714", "0.6251819", "0.6230945", "0.6212928", "0.6192733", "0.61698526", "0.61684346", "0.61665606", "0.61568314", "0.6135341", "0.6131438", "0.61174643", "0.611685", "0.61111975", "0.60986084", "0.60941035", "0.60785574", "0.6074596", "0.60739547", "0.6046275", "0.6042235", "0.6041424", "0.6035352", "0.602449", "0.60178554", "0.6006806", "0.59987944", "0.597834", "0.5975308", "0.59728587", "0.59714836", "0.59714836", "0.59699136", "0.59668714", "0.5964552", "0.5955522", "0.59417474", "0.5940446", "0.59217507", "0.59186757", "0.59019", "0.59019", "0.5896893", "0.5895886", "0.5895335", "0.5895082", "0.5871777", "0.58642757", "0.5863653", "0.58589315", "0.5852344", "0.5844765", "0.5843614", "0.5830264", "0.58290285", "0.58286947", "0.5819458", "0.5814504", "0.58138216", "0.58129334", "0.58122784", "0.58022857", "0.5798406", "0.5794318", "0.57916224", "0.5775158", "0.5774516", "0.57740074", "0.57734835", "0.57584125", "0.57584125", "0.57584125", "0.575634", "0.5755181", "0.57524735", "0.5751186", "0.57492155", "0.5748961", "0.5746206", "0.57452124", "0.57434887", "0.5740472", "0.57404345" ]
0.0
-1
PUBLIC Set date format for "minutes" file output
public static function setDateFormatMinutes() { self::$settings[0] = 'Y-m-d H:i:s'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function setFormat();", "public function dateTimeFormat();", "public static function setDateFormatMonth()\n {\n self::$settings[0] = 'Y-m';\n }", "function set_date_format ($date_format)\r\n {\r\n $_SESSION[\"date_format\"] = $date_format;\r\n }", "public function dateFormat();", "public function setFormat($value) {}", "public function timeFormat();", "public function testFormat(): void\n\t{\n\t\t$datetime = $this->grid->addColumnDateTime('date', 'Date');\n\t\tAssert::same('15. 12. 2015', $this->render($datetime));\n\n\t\t$datetime->setFormat('H:i:s');\n\t\tAssert::same('22:58:42', $this->render($datetime));\n\t}", "public function formatDate($date = null);", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "public function setFormat($format);", "public function setFormat($format);", "public function setFormat($format);", "public function testLoggerFormatterNewFormatFormatsDateCorrectly()\n {\n $fileName = newFileName('log', 'log');\n\n $logger = new PhTLoggerAdapterFile($this->logPath . $fileName);\n\n $formatter = new PhLoggerFormatterLine('%type%|%date%|%message%');\n\n $logger->setFormatter($formatter);\n $logger->log('Hello');\n $logger->close();\n\n $contents = file($this->logPath . $fileName);\n $message = explode('|', $contents[0]);\n cleanFile($this->logPath, $fileName);\n\n $date = new \\DateTime($message[1]);\n\n $expected = date('Y-m-d H');\n $actual = $date->format('Y-m-d H');\n\n $this->assertEquals(\n $expected,\n $actual,\n 'Date format not set properly'\n );\n }", "public function setFormattedDate():self\n {\n $date = mb_substr($this->getAnswerDate(), 0, 10);\n $time = mb_substr($this->getAnswerDate(), 11, 19);\n\n $m = (int)mb_substr($date, 5,2);\n $month = Requestor::monthOfADate($m);\n $parts = array_reverse(explode('-', $date));\n unset($parts[1]);\n $date = implode(' '.$month.' ', $parts);\n\n $t = new DateTime($time);\n $h = $t->format('H');\n $m = $t->format('i');\n \n\n $this->dateFormatted = \"Postée le \".$date. \" à \".$hour = $h.\"h \".$m.\"'\"; \n\n return $this;\n }", "function monthFormat() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_monthFormat = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_monthFormat;\n\t}", "function smarty_modifier_datetime_format($date, $format)\n{\n\tif (isset($date))\n\t{\n\t\treturn date_format($date, $format);\n\t}\n}", "private function format()\n {\n return config('app.locale') != 'en' ? 'd/m/Y' : 'm/d/Y';\n }", "public function setFormat($format) { $this->_format = $format; }", "function carton_time_format() {\n\treturn apply_filters( 'carton_time_format', get_option( 'time_format' ) );\n}", "public static function setDateFormatDay()\n {\n self::$settings[0] = 'Y-m-d';\n }", "public function setDateFormat($format = null, $dateIntervalFormat = null)\n {\n if (null !== $format) {\n $this->dateFormats[0] = $format;\n }\n if (null !== $dateIntervalFormat) {\n $this->dateFormats[1] = $dateIntervalFormat;\n }\n }", "public function getDateFormat(){\n\t\t$this->_dateFormat = $date;\n\t}", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.u0';\n }", "protected function getDateFormat()\n {\n return 'Y-m-d H:i:s';\n }", "function set_format($do_newlines=true)\n\t{\n\t\t$this->do_newlines = $do_newlines;\n\t}", "function setData($data, $format = DATE_FORMAT_ISO)\r\n {\r\n switch($format) {\r\n case DATE_FORMAT_ISO:\r\n if (preg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})/i\",$data,$regs)) {\r\n $this->ano = $regs[1];\r\n $this->mes = $regs[2];\r\n $this->dia = $regs[3];\r\n $this->hora = $regs[4];\r\n $this->minuto = $regs[5];\r\n $this->segundo = $regs[6];\r\n } else {\r\n $this->ano = 0;\r\n $this->mes = 1;\r\n $this->dia = 1;\r\n $this->hora = 0;\r\n $this->minuto = 0;\r\n $this->segundo = 0;\r\n }\r\n break;\r\n case DATE_FORMAT_TIMESTAMP:\r\n if (preg_match(\"/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/i\",$data,$regs)) {\r\n $this->ano = $regs[1];\r\n $this->mes = $regs[2];\r\n $this->dia = $regs[3];\r\n $this->hora = $regs[4];\r\n $this->minuto = $regs[5];\r\n $this->segundo = $regs[6];\r\n } else {\r\n $this->ano = 0;\r\n $this->mes = 1;\r\n $this->dia = 1;\r\n $this->hora = 0;\r\n $this->minuto = 0;\r\n $this->segundo = 0;\r\n }\r\n break;\r\n case DATE_FORMAT_UNIXTIME:\r\n $this->setData(date(\"Y-m-d H:i:s\", intval($data)));\r\n break;\r\n }\r\n }", "function time($format, $date = null) {\n\t\treturn CaracoleI18n::strftime($format, strtotime($date));\n\t}", "public static function setDateFormat($format)\n {\n static::$dateFormat = $format;\n }", "public function getTimeFormatter();", "public function getDateFormat()\n {\n return 'Y-m-d H:i:sP';\n }", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.uO';\n }", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.uO';\n }", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat',$value,'dd-MM-yyyy');\n\t}", "public function setDateFormat($date_format)\n\t{\n\t\tself::$__date_format = $date_format;\n\t}", "public function setFormat($format){\n\t\t$this->_format = $format;\n\t}", "public function getTimeFormat($type = null);", "public function getTimeFormat($type = null);", "public function date_format($nagios_format_name=false)\n\t{\n\t\tif (empty($nagios_format_name)) {\n\t\t\t$date_format_id = 'date_format';\n\t\t\t# try config helper first (includes session check)\n\t\t\t$nagios_format_name = config::get('config.'.$date_format_id);\n\t\t\tif (empty($nagios_format_name)) {\n\t\t\t\t# check nagios.cfg file\n\t\t\t\t$nagios_config = System_Model::parse_config_file('nagios.cfg');\n\t\t\t\t$nagios_format_name = $nagios_config[$date_format_id];\n\t\t\t\t# save to session\n\t\t\t\tSession::instance()->set('config.'.$date_format_id, $nagios_format_name);\n\n\t\t\t\t# save setting to db\n\t\t\t\tNinja_setting_Model::save_page_setting('config.'.$date_format_id, '*', $nagios_format_name);\n\t\t\t}\n\t\t}\n\t\t$nagios_format_name = trim($nagios_format_name);\n\t\tif (empty($nagios_format_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$date_format = false;\n\t\tswitch (strtolower($nagios_format_name)) {\n\t\t\tcase 'us': # MM-DD-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'm-d-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'euro': # DD-MM-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'd-m-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'iso8601': # YYYY-MM-DD HH:MM:SS\n\t\t\t\t$date_format = 'Y-m-d H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'strict-iso8601': # YYYY-MM-DDTHH:MM:SS\n\t\t\t\t$date_format = 'Y-m-dTH:i:s';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $date_format;\n\t}", "public function format($format)\n {\n if (preg_match(\"/^.*[f]+.*$/\", $format)) {\n $format = str_replace('f', 'F', $format);\n \n $date = parent::format($format);\n \n $english = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); \n \n return str_replace($english, self::$polish_months, $date);\n }\n \n return parent::format($format);\n }", "function get_date_format ()\r\n {\r\n return $_SESSION[\"date_format\"];\r\n }", "public function format($format) {\n \t$spf = str_replace(array(\"d\",\"m\",\"Y\"),array(\"%3$02d\",\"%2$02d\",\"%1$04d\"),$format);\n \t\treturn sprintf($spf, $this->dt[0], $this->dt[1], $this->dt[2]);\n\t}", "public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }", "function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}", "function format($date, $type, $format){\r\n\tif($type&DATE){\r\n\t\t$y=substr($date,0,4);\r\n\t\t$M=substr($date,4,2);\r\n\t\t$d=substr($date,6,2);\r\n\t\tif($type & TIME){\r\n\t\t\t$h=substr($date,8,2);\r\n\t\t\t$m=substr($date,10,2);\r\n\t\t\t$s=substr($date,12,2);\r\n\t\t}\r\n\t}else{\r\n\t\t$h=substr($date,0,2);\r\n\t\t$m=substr($date,2,2);\r\n\t\t$s=substr($date,4,2);\r\n\t}\r\n\t\r\n\treturn $date==''?'':str_replace('s',$s,\r\n\t\t\t\t\t\tstr_replace('m',$m,\r\n\t\t\t\t\t\tstr_replace('H',$h,\r\n\t\t\t\t\t\tstr_replace('D',$d,\r\n\t\t\t\t\t\tstr_replace('M',$M,\r\n\t\t\t\t\t\tstr_replace('Y',$y,$format))))));\r\n}", "public function getTimeFormat()\n\t{\n\t\treturn isset($this->config['time-format']) ? $this->config['time-format'] : NULL;\n\t}", "function CIR_setDateAndTimeTemorarily()\n{\n\t$date = date('mdHiY.s');\n\techo(\"\\ndate $date\\n\");\n}", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "public function getPattern()\n {\n// if ($this->getOption('pattern')) {\n// return $this->getOption('pattern');\n// }\n\n $pattern = $this->formatter->getPattern();\n\n // set right order with respect to locale (e.g.: de_DE=dd.MM.yy; en_US=M/d/yy)\n // lookup various formats at http://userguide.icu-project.org/formatparse/datetime\n if (preg_match('/^([yMd]+).+([yMd]+).+([yMd]+)$/', $pattern)) {\n return preg_replace(array('/y+/', '/M+/', '/d+/'), array('{{ year }}', '{{ month }}', '{{ day }}'), $pattern);\n }\n\n // default fallback\n return '{{ year }}-{{ month }}-{{ day }}';\n }", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "public function parmDate($date = null, $format = self::datePattern) {\r\n if($date != null)\r\n { \r\n $this->date = new DateTime($date); \r\n }\r\n return $this->date->format($format);\r\n }", "function format_time($mode='Y-m-d H:i:s')\r\n {\r\n\t\treturn date($mode,$_SERVER['REQUEST_TIME']);\r\n }", "function the_modified_time($format = '')\n {\n }", "private function _format($mod = FALSE)\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate the date to work with\n\t\t// --------------------------------------\n\n\t\t$this->_init_date();\n\n\t\t// --------------------------------------\n\t\t// What are we going to display?\n\t\t// --------------------------------------\n\n\t\t$unit = $this->EE->TMPL->fetch_param('unit', $this->date->given());\n\n\t\t// --------------------------------------\n\t\t// Do we need to modify the date given\n\t\t// --------------------------------------\n\n\t\tif ($mod && $unit)\n\t\t{\n\t\t\t$this->date->$mod($unit);\n\n\t\t\t// Log it\n\t\t\t$this->_log(\"Modify date: {$mod} {$unit} to \".$this->date->date());\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Check in what format\n\t\t// --------------------------------------\n\n\t\t// Get format=\"\" param\n\t\t$format = $this->EE->TMPL->fetch_param('format');\n\n\t\t// Check for year_format=\"\", month_format=\"\" or day_format=\"\"\n\t\t$format = $this->EE->TMPL->fetch_param($unit.'_format', $format);\n\n\t\tif ( ! $format)\n\t\t{\n\t\t\tswitch ($unit)\n\t\t\t{\n\t\t\t\tcase 'week':\n\t\t\t\t\t$this->return_data = $this->date->week_url();\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'month':\n\t\t\t\t\t$this->return_data = $this->date->month_url();\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'year':\n\t\t\t\t\t$this->return_data = $this->date->year();\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->return_data = $this->date->date();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->return_data = $this->date->ee_format($format);\n\t\t}\n\n\t\treturn $this->return_data;\n\t}", "function time_compact_ap_format($hours,$minutes,$meridien){\r\n\t$patterns = array(\"am\",\"pm\",\"AM\",\"PM\");\r\n\t$replacements = array(\"a.m.\",\"p.m.\",\"A.M.\",\"P.M.\");\r\n\t\r\n\t$meridien = str_replace($patterns,$replacements,$meridien);\r\n\t\r\n\tif($minutes == \"00\") return sprintf(\"%s %s\",$hours,$meridien);\r\n\telse return sprintf(\"%s:%s %s\",$hours,$minutes,$meridien);\r\n}", "function minutes($args) {\r\n\t\t$this->validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$journal =& Request::getJournal();\r\n\t\t$journalId = $journal->getId();\r\n\t\t$user =& Request::getUser();\r\n\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$meetings =& $meetingDao->getMeetingsOfSection($user->getSecretaryCommitteeId());\r\n\r\n\t\t$templateMgr =& TemplateManager::getManager();\r\n\t\t$templateMgr->assign_by_ref('meetings', $meetings);\r\n\t\t$templateMgr->assign('pageToDisplay', $page);\r\n\t\t$templateMgr->assign('sectionEditor', $user->getFullName());\r\n\t\t$templateMgr->display('sectionEditor/minutes/minutes.tpl');\r\n\t}", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "public function setModDate($date) {}", "public function formatDate() {\n\t\t\tif(!empty($this->review_date)) {\n\t\t\t\t$date = new dateTime($this->review_date);\n\t\t\t\treturn $date->format('M jS, Y - H:i');\n\t\t\t}\n\t\t}", "public function getDateFormat(): string\n {\n return 'Y-m-d H:i:s';\n }", "public function setTimeFormat(?string $value): void {\n $this->getBackingStore()->set('timeFormat', $value);\n }", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "function iu_readable_date($datetime, $format = 'normal'){\n\t$date = New DateTime($datetime);\n\tif($format == 'normal'){\n\t\t$updatedDate = date_format($date,'F j, Y'); //January 15, 2015\n\t}else if($format == 'short'){\n\t\t$updatedDate = date_format($date,'M j, Y'); // Jan 15, 2015\n\t}else if($format == 'numbered'){\n\t\t$updatedDate = date_format($date,'n/j/y'); // 01/15/15\n\t}\n\t\n\treturn $updatedDate;\n\n}", "private function _default_date_time_units()\n {\n $this->seconds = '00';\n $this->minutes = '00';\n $this->hours = '00';\n\n \n $this->days = date('d');\n $this->months = date('m');\n $this->years = date('Y');\n $this->ampm = 'am';\n }", "function getDefaultFormat() {\n return MYSQL_DATETIME_FORMAT;\n }", "abstract public function jdateFormat($format = null, array &$attributes = array());", "public function format($format);", "function DateFormat($time, $format = 'Y-m-d H:i')\n{\n\n if ($format == 'auto') {\n if (date('Ymd') == date('Ymd', $time))\n return date(\"H:i\", $time);\n else\n return date(\"y-m-d H:i\", $time);\n } else {\n return date($format, $time);\n }\n}", "abstract function format();", "public function getTimeDateFormat()\n {\n return $this->dateTimeFormat;\n }", "function formatDate()\n\t{\n\t\techo date(\"m/d/y\");\n\t}", "public function getDateFormatter();", "protected function getFormat()\n {\n return 'FORMAT: 1A';\n }", "public function saveFormat($event)\n {\n foreach ($this->properties as $property) {\n if ($this->owner->$property !== null) {\n $this->owner->$property = Yii::$app->formatter->asTime($this->owner->$property, $this->saveFormat);\n }\n }\n }", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function setFormat(Format $format)\n\t{\n\t\t$this->format=$format; \n\t\t$this->keyModified['format'] = 1; \n\n\t}", "public function timeFormat($value) {\n return $this->setProperty('timeFormat', $value);\n }", "public function format_date_save($date){ \n\t\t$exp_date = explode('/', $date); \n\t\treturn $exp_date[2].'-'.$exp_date[1].'-'.$exp_date[0];\n\t}", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public static function setDateTimeFormat($val) {\n self::$_sDateTimeFormat = $val;\n }", "public function formatData($date) {\n\t\t return date('F j, Y, g:i:a', strtotime($date));\n\t }", "public function setFormat( $format ) {\n\t\t\t$this->_format = $format;\n\t\t\t$this->_data['format'] = $this->_format;\n\t\t}", "function _format_time($date, $time, &$params)\n\t{\n\t\t$time = strftime( $params->get('formattime', '%H:%M'), strtotime( $date.' '.$time ));\n\n\t\treturn $time;\n\t}", "public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }", "public function getFormat() {}", "public function getFormat() {}", "public function getFormat() {}", "function jtpl_modifier_common_dateLong ($_zInputDate)\n{\n\n\t\t $tab1 = explode(\" \",$_zInputDate) ;\n\t\t $tab2 = explode(\"-\",$tab1[0]);\n\t\t $tab3 = explode(\":\",$tab1[1]);\n\t\t $zOutputDate = $tab2[2].\"/\".$tab2[1].\"/\".$tab2[0].\" - \".$tab3[0].\":\".$tab3[1];\n \n return $zOutputDate ;\n\n}", "public function setFormat($format) {\n\t\tif ($format !== 'raw') {\n\t\t\t$format = 'parsed';\n\t\t}\n\t\t$this->format = $format;\n\t}", "function datetime_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "public static function getTimeFormats()\n {\n return array( 'g:i A' => '7:30 PM', 'H:i' => '19:30' );\n }", "public function formatTime($time = null);", "function format_date($p_id, $p_name, $p_value, $p_width = '', $p_fmt_short = false){\n\t$t_width = ($p_width != '') ? 'width:' . $p_width . ' !important' : '';\n\t$t_date_prop = 'data-picker-locale=\"' . lang_get_current_datetime_locale() . '\" data-picker-format=\"' . convert_date_format_to_momentjs($p_fmt_short ? config_get('short_date_format') : config_get('normal_date_format')) . '\"';\n\n\treturn format_text($p_id, $p_name, $p_value, '', 'input-xs inline-page-datetime', $t_width, $t_date_prop);\n}", "function _custom_date_time($date, $format = 'Y-m-d'){ \t\n return date_format(date_create($date),$format);\n}", "public function stdWrap_strftimeReturnsFormattedStringDataProvider() {}", "protected function getDateFormat()\n {\n return \\MUtil_Model_Bridge_FormBridge::getFixedOption('datetime', 'dateFormat');\n }", "function sm_the_time() {\n\tthe_time( crf_get_theme_mod_value( 'blog-dateformat' ) );\n}", "public function setDateFormat(?string $value): void {\n $this->getBackingStore()->set('dateFormat', $value);\n }" ]
[ "0.6238504", "0.5967557", "0.59593093", "0.5641609", "0.55545413", "0.55327445", "0.5517266", "0.5508308", "0.54306304", "0.5411498", "0.54016", "0.54016", "0.54016", "0.5387879", "0.5375522", "0.53324187", "0.5328571", "0.5327865", "0.53097457", "0.5291934", "0.5266202", "0.52512956", "0.5240279", "0.52364963", "0.52108794", "0.5203893", "0.52017784", "0.5197101", "0.5188431", "0.5187454", "0.51817703", "0.51750445", "0.51750445", "0.51178265", "0.5109652", "0.5105661", "0.51035976", "0.51035976", "0.50777537", "0.5057806", "0.5037412", "0.50341874", "0.50308675", "0.5028985", "0.50284886", "0.50274247", "0.502113", "0.5016755", "0.50123644", "0.5010661", "0.5010104", "0.50092715", "0.49985817", "0.49820936", "0.49765715", "0.49594414", "0.49502122", "0.49436212", "0.49390626", "0.49342877", "0.49333182", "0.49306998", "0.4918705", "0.49153736", "0.49046585", "0.49032617", "0.49028626", "0.49001473", "0.4891643", "0.48910108", "0.4882331", "0.4878181", "0.48692515", "0.48583314", "0.4850494", "0.48379636", "0.48379636", "0.4834473", "0.48287484", "0.48244768", "0.4815063", "0.48129752", "0.48088533", "0.47969368", "0.47943413", "0.47858146", "0.47841159", "0.47841159", "0.47841159", "0.47826412", "0.47799477", "0.47797015", "0.47772706", "0.47755858", "0.47609258", "0.47552174", "0.47548005", "0.47392488", "0.4733308", "0.47325626" ]
0.7238904
0
Set date format for "day" file output
public static function setDateFormatDay() { self::$settings[0] = 'Y-m-d'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatDate($date = null);", "public function dateTimeDefaultFormat($astep) {\r\n return ($astep <= 1) ?\r\n \"d/m/y\" : \"d/m/y\";\r\n }", "function set_date_format ($date_format)\r\n {\r\n $_SESSION[\"date_format\"] = $date_format;\r\n }", "public function getDateFormatter();", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat',$value,'dd-MM-yyyy');\n\t}", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "function formatDate()\n\t{\n\t\techo date(\"m/d/y\");\n\t}", "public function getDateFormat(){\n\t\t$this->_dateFormat = $date;\n\t}", "public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }", "function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}", "private function format()\n {\n return config('app.locale') != 'en' ? 'd/m/Y' : 'm/d/Y';\n }", "public function dateTimeFormat();", "public function format_date_save($date){ \n\t\t$exp_date = explode('/', $date); \n\t\treturn $exp_date[2].'-'.$exp_date[1].'-'.$exp_date[0];\n\t}", "function dayNumberFormat() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_dayNumberFormat = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_dayNumberFormat;\n\t}", "public function dateFormat();", "public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function getUsingFormatDefault(){\n\t\t$config = CoreConfig::readAppConfig();\n\t\t$format = strtolower($config->application->dbdate);\n\t\t$dateFormat = new DateFormat($format, $this);\n\t\treturn $dateFormat->getDate();\n\t}", "public function setDateFormat($date_format)\n\t{\n\t\tself::$__date_format = $date_format;\n\t}", "public function toDayDateTimeString()\n {\n return $this->format('D, M j, Y g:i A');\n }", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "function format_date_YYYYMMDD($filename = '')\n{\n $dff = date_from_filename($filename);\n if (count($dff) == 0) return '';\n return join('', $dff);\n}", "abstract protected function setFormat();", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "public function formatData($date) {\n\t\t return date('F j, Y, g:i:a', strtotime($date));\n\t }", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "function get_date_format ()\r\n {\r\n return $_SESSION[\"date_format\"];\r\n }", "public static function setDateFormatMonth()\n {\n self::$settings[0] = 'Y-m';\n }", "function helper_format_date($date, $format = APP_DATE_TIME_FORMAT){\n return date( $format, strtotime($date) );\n }", "public function format($format) {\n \t$spf = str_replace(array(\"d\",\"m\",\"Y\"),array(\"%3$02d\",\"%2$02d\",\"%1$04d\"),$format);\n \t\treturn sprintf($spf, $this->dt[0], $this->dt[1], $this->dt[2]);\n\t}", "public static function setDateFormat($format)\n {\n static::$dateFormat = $format;\n }", "public static function formatDateYmd2Dmy($date){\n\t\t$newdate = new DateTime($date);\n\t\treturn $newdate->format('d/m/Y');\n\t}", "public function format_date_save($date){\n\t\tif(!empty($date)){\n\t\t\t$exp_date = explode('/', $date); \n\t\t\treturn $exp_date[2].'-'.$exp_date[1].'-'.$exp_date[0];\n\t\t}\n\t}", "function formatDate($matchDay) {\n\treturn date(\"d.m.\", strtotime($matchDay));\n}", "function erp_format_date( $date, $format = false ) {\n if ( ! $format ) {\n $format = erp_get_option( 'date_format', 'erp_settings_general', 'd-m-Y' );\n }\n\n if ( ! is_numeric( $date ) ) {\n $date = strtotime( $date );\n }\n\n if ( function_exists('wp_date') ) {\n return wp_date( $format, $date );\n }\n\n return date_i18n( $format, $date );\n}", "public function date_format($nagios_format_name=false)\n\t{\n\t\tif (empty($nagios_format_name)) {\n\t\t\t$date_format_id = 'date_format';\n\t\t\t# try config helper first (includes session check)\n\t\t\t$nagios_format_name = config::get('config.'.$date_format_id);\n\t\t\tif (empty($nagios_format_name)) {\n\t\t\t\t# check nagios.cfg file\n\t\t\t\t$nagios_config = System_Model::parse_config_file('nagios.cfg');\n\t\t\t\t$nagios_format_name = $nagios_config[$date_format_id];\n\t\t\t\t# save to session\n\t\t\t\tSession::instance()->set('config.'.$date_format_id, $nagios_format_name);\n\n\t\t\t\t# save setting to db\n\t\t\t\tNinja_setting_Model::save_page_setting('config.'.$date_format_id, '*', $nagios_format_name);\n\t\t\t}\n\t\t}\n\t\t$nagios_format_name = trim($nagios_format_name);\n\t\tif (empty($nagios_format_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$date_format = false;\n\t\tswitch (strtolower($nagios_format_name)) {\n\t\t\tcase 'us': # MM-DD-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'm-d-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'euro': # DD-MM-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'd-m-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'iso8601': # YYYY-MM-DD HH:MM:SS\n\t\t\t\t$date_format = 'Y-m-d H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'strict-iso8601': # YYYY-MM-DDTHH:MM:SS\n\t\t\t\t$date_format = 'Y-m-dTH:i:s';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $date_format;\n\t}", "function formatDate($date){\n $newDate = strtotime($date);\n $newFormat = date('D j/n Y', $newDate);\n echo $newFormat;\n}", "function dateFormatView($date)\n{\n $date_formated = '---';\n if($date!='0000-00-00' and $date!='')\n {\n $date_formated = date('m/d/Y',strtotime($date)); \n }\n return $date_formated; \n}", "function render_daytitle($date){\n\t\t//returns a formatted date and time for an event\n\t\t$return_string= date (\"D\", $date->get_unix_time());\n\t\t$return_string=$return_string.\"<br />\";\n\t\t$return_string=$return_string.date(\"M d\", $date->get_unix_time());\n\t\treturn $return_string;\n\t}", "function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}", "function _elastic_email_format_date($date_field) {\n $data = sprintf('%d/%d/%d', $date_field['month'], $date_field['day'], $date_field['year']);\n $time = sprintf('%s:%s %s', $date_field['hour'], $date_field['minute'], $date_field['ampm']);\n\n return $data . ' ' . $time;\n}", "function dateFormat($date){\n return strftime(\"%d. %m. %Y\", strtotime($date));\n}", "public function formatDate($value)\n {\n \tif($value !== NULL):\n\t \tif(strpos($value, '/') !== false)\n\t \t\t$value = AFormatter::revertDate($value);\n\t\t\t\t\n\t //if(!is_numeric($value)) $value=strtotime ($value);\n\t //return date($this->dateFormat,$value);\n\t \n\t \n\t //LO: To format date that falls outside of 32 bit integer range \n\t if(DateTime::createFromFormat('Y-m-d',$value))\n\t \t\treturn DateTime::createFromFormat('Y-m-d',$value)->format($this->dateFormat);\n\t\t\telse if(DateTime::createFromFormat('Y-m-d G:i:s',$value))\n\t\t\t\treturn DateTime::createFromFormat('Y-m-d G:i:s',$value)->format($this->dateFormat);\t\n\t\t\telse if(DateTime::createFromFormat('Y/m/d',$value))\n\t\t\t\treturn DateTime::createFromFormat('Y/m/d',$value)->format($this->dateFormat);\n\t\t\telse if(DateTime::createFromFormat('d-m-Y',$value))\n\t\t\t\treturn DateTime::createFromFormat('d-m-Y',$value)->format($this->dateFormat);\n\t\t\telse \n\t\t\t\treturn $value;\n\n\t\telse:\n\t\t\treturn $value;\n\t\tendif;\n }", "private function datepicker_format($format) {\n\t\treturn str_replace(\n\t\t\tarray(\n\t\t\t\t'd', 'j', 'l', 'z', // Day.\n\t\t\t\t'F', 'M', 'n', 'm', // Month.\n\t\t\t\t'Y', 'y' // Year.\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'dd', 'd', 'DD', 'o',\n\t\t\t\t'MM', 'M', 'm', 'mm',\n\t\t\t\t'yy', 'y'\n\t\t\t),\n\t\t\t$format);\n\t}", "static public function formatDate($date)\n {\n $objDate = new DateTime($date);\n return $objDate->format('d/m/Y');\n }", "function shwThaiDate($dte) { //where $dte is a Date format\r\n\t\treturn date(\"d-m-Y\",strtotime($dte));//formulate date format for displaying\r\n\t}", "public function setDateFormat(?string $value): void {\n $this->getBackingStore()->set('dateFormat', $value);\n }", "private function _radius_format_date($d){\n $arr_date = explode('/',$d);\n $month = intval($arr_date[0]);\n $m_arr = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');\n $day = intval($arr_date[1]);\n $year = intval($arr_date[2]);\n return \"$day \".$m_arr[($month-1)].\" $year\";\n }", "public function date_format_func($date,$format)\n\t{\n\t\t$date = str_replace(\"/\",\"-\",$date);\n\t\t$date_output = date($format,strtotime($date));\n\t\treturn $date_output;\n\t}", "function dateFormat($D) {\n $D = date('d-m-Y', strtotime($D));\n return $D;\n }", "public function formatDate($value)\n\t{\n\t\treturn $value;\n\t}", "public function date_format_pedido($data) {\n if($data!=\"\" || $data!=NULL) {\n return date(\"d/m/Y - H:i\", strtotime($data));\n }\n }", "public function testLoggerFormatterNewFormatFormatsDateCorrectly()\n {\n $fileName = newFileName('log', 'log');\n\n $logger = new PhTLoggerAdapterFile($this->logPath . $fileName);\n\n $formatter = new PhLoggerFormatterLine('%type%|%date%|%message%');\n\n $logger->setFormatter($formatter);\n $logger->log('Hello');\n $logger->close();\n\n $contents = file($this->logPath . $fileName);\n $message = explode('|', $contents[0]);\n cleanFile($this->logPath, $fileName);\n\n $date = new \\DateTime($message[1]);\n\n $expected = date('Y-m-d H');\n $actual = $date->format('Y-m-d H');\n\n $this->assertEquals(\n $expected,\n $actual,\n 'Date format not set properly'\n );\n }", "public function formatDate() {\n\t\t\tif(!empty($this->review_date)) {\n\t\t\t\t$date = new dateTime($this->review_date);\n\t\t\t\treturn $date->format('M jS, Y - H:i');\n\t\t\t}\n\t\t}", "public function formatDate($date){\n return date('F j, Y, g: i a', strtotime($date));\n }", "public function date_display_format($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$c_d = date('d/m/Y', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "function atkFormatDate($date, $format, $weekday=false)\n{\n\tstatic $langcache = array();\n\n\tif (!is_array($date))\n\t{\n\t\t$date = getdate($date);\n\t}\n\n\t/* format month */\n\t$format = str_replace(\"M\", \"%-%\", $format);\n\t$format = str_replace(\"F\", \"%=%\", $format);\n\n\t/* format day */\n\t$format = str_replace(\"D\", \"%&%\", $format);\n\t$format = str_replace(\"l\", \"%*%\", $format);\n\n\tif ($weekday && strpos($format, '%&%') === FALSE && strpos($format, '%*%') === FALSE)\n\t{\n\t\t$format = str_replace(\"d\", \"%*% d\", $format);\n\t\t$format = str_replace(\"j\", \"%*% j\", $format);\n\t}\n\n\t/* get date string */\n\trequire_once(atkconfig('atkroot').\"atk/utils/adodb-time.inc.php\");\n\t$str_date = adodb_date($format, $date[0]);\n\n\t$month = $date['month'];\n\t$shortmonth = substr(strtolower($date[\"month\"]), 0, 3);\n\n\t/* store the text calls */\n\tif(!isset($langcache[$month]))\n\t{\n\t\t$langcache[$month]= atktext(strtolower($month),\"atk\");\n\t}\n\n\tif(!isset($langcache[$shortmonth]))\n\t{\n\t\t$langcache[$shortmonth] = atktext($shortmonth);\n\t}\n\n\t/* replace month/week name */\n\t$str_date = str_replace(\"%-%\", $langcache[$shortmonth], $str_date);\n\t$str_date = str_replace(\"%=%\", $langcache[$month], $str_date);\n\t$str_date = str_replace(\"%*%\", atktext(strtolower($date[\"weekday\"]),\"atk\"), $str_date);\n\t$str_date = str_replace(\"%&%\", atktext(substr(strtolower($date[\"weekday\"]), 0, 3),\"atk\"), $str_date);\n\n\t/* return string */\n\treturn $str_date;\n}", "function format_date($date) {\n return substr($date, 8, 2) . '/' . substr($date, 5, 2) . '/' . substr($date, 0, 4);\n }", "public function dateDisplayFormat($date)\n\t{\n\t\t$day = substr($date,6,2);\n\t\t$month = substr($date,4,2);\n\t\t$year = substr($date,0,4);\n\t\tif ($year=='0000')\n\t\t\treturn '?';\n\t\tif ($month=='00')\n\t\t\treturn '~ ' . $year;\n\t\tif ($day=='00')\n\t\t\treturn '~ ' . $month . '.' . $year;\n\t\t$displayDate = '' . $day . '.' . $month . '.' . $year;\n\t\treturn $displayDate;\n\t\t\n\t}", "public static function format_date($date,$format) {\n \n return Yii::app()->dateFormatter->format($format, $date);\n }", "public static function rfcDate()\n {\n }", "private function formatDay($num)\n {\n if ($num == 0) {\n return \"Mon\";\n } else if ($num == 1) {\n return \"Tue\";\n } else if ($num == 2) {\n return \"Wed\";\n } else if ($num == 3) {\n return \"Thu\";\n } else if ($num == 4) {\n return \"Fri\";\n } else if ($num == 5) {\n return \"Sat\";\n } else if ($num == 6) {\n return \"Sun\";\n }\n return $num;\n }", "function getFormattedCreatedDateExtended()\r\n {\r\n return $this->created_at->format('d').\" de \".$this->getMes_ptBR((int) $this->created_at->format('m') ).\" de \".$this->created_at->format('Y') ;\r\n }", "function getSystemDateFormat($getdate){\n\t\t\n\t\t$systemformat\t=\t$this->getSystemSettingValue('DATE_FORMAT');\n\t\tif(isset($getdate) && $getdate!=\"\"){\n\t\t\n\t\t\t$systemdate\t\t\t=\tdate(\"$systemformat\",strtotime($getdate));\n\t\t}\n\t\telse {\n\t\t\t$systemdate \t\t= \t\"Invlid Date Input\";\n\t\t}\n\t\treturn $systemdate;\n\t}", "public function date_as_string ()\n {\n $f = $this->parent_folder ();\n return $f->format_date ($this->date);\n }", "function iu_readable_date($datetime, $format = 'normal'){\n\t$date = New DateTime($datetime);\n\tif($format == 'normal'){\n\t\t$updatedDate = date_format($date,'F j, Y'); //January 15, 2015\n\t}else if($format == 'short'){\n\t\t$updatedDate = date_format($date,'M j, Y'); // Jan 15, 2015\n\t}else if($format == 'numbered'){\n\t\t$updatedDate = date_format($date,'n/j/y'); // 01/15/15\n\t}\n\t\n\treturn $updatedDate;\n\n}", "function acf_format_date($value, $format)\n{\n}", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "public function setDateFormat($format = null, $dateIntervalFormat = null)\n {\n if (null !== $format) {\n $this->dateFormats[0] = $format;\n }\n if (null !== $dateIntervalFormat) {\n $this->dateFormats[1] = $dateIntervalFormat;\n }\n }", "function my_grid_date( $format, $params ) {\n\t/**\n\t * Example returning 0-padded date, e.g. 07.\n\t */\n\n\treturn 'd';\n}", "function get_mnt_strt_day($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return format \"0\" (Sunday) to \"6\" (Saturday)\n return date(\"w\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='2'){\n // Return Fri format \n return date(\"D\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n elseif ($type=='3'){\n // Return Friday format\n return date(\"l\",mktime (0,0,0,$date_split[1],1,$date_split[2]));}\n }", "function userdate($date, $format='', $fixday = false) { // TBD: false???\n $timezone = 99;\n if ($user_record = get_record('user', 'id', $this->userid)) {\n //determine the user's timezone\n $timezone = php_report::get_user_timezone($user_record, $user_record->timezone);\n }\n\n //perform the formatting\n return userdate($date, $format, $timezone, $fixday);\n }", "function date_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "function sc_date_format($date){\n\t$CI =& get_instance();\n\tif($CI->session->userdata('locale') =='uk'){\n\t\treturn date('d/m/Y', $date);\n\t}else{\n\t\treturn date('m/d/Y', $date);\n\t}\n}", "function convert_date($date, $format = DATE_FORMAT)\r\n{ \r\n // $date_format is defined in config.inc.php.\r\n if (empty($date)) return;\r\n\r\n switch ($format) {\r\n case 'us12':\r\n return date('m/d/y g:i a', strtotime($date));\r\n break;\r\n case 'us24':\r\n\t\t\treturn date('m/d/y H:i', strtotime($date));\r\n break;\r\n case 'eu12':\r\n return date('d/m/y g:i a', strtotime($date));\r\n break;\r\n case 'eu24':\r\n return date('d/m/y H:i', strtotime($date)); \r\n break;\r\n case 'verbose':\r\n return date('D M jS, Y @ g:ia', strtotime($date));\r\n break;\r\n case 'mysql':\r\n return date('Y-m-d H:i:s', strtotime($date));\r\n break;\r\n case 'mysql_hours':\r\n return date('H:i a', strtotime($date));\r\n break;\r\n\t\tcase 'unix':\r\n return date('U', strtotime($date));\r\n break;\r\n default:\r\n // none specified, just return us12.\r\n return date('m/d/y h:i a', strtotime($date));\r\n }\r\n\r\n}", "function formatDate($date){\n\tif(validateDate($date)){\n\t\t$year = substr($date,0,4);\n\t\t$month = substr($date,4,2);\n\t\t$day = substr($date,6,2);\n\t\treturn $year.C('STR_YEAR').$month.C('STR_MONTH').$day.C('STR_DAY');\n\t}\n\telse\n\t\treturn C('STR_FORMAT_DATE_FAIL');\n}", "public function format($format)\n {\n if (preg_match(\"/^.*[f]+.*$/\", $format)) {\n $format = str_replace('f', 'F', $format);\n \n $date = parent::format($format);\n \n $english = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); \n \n return str_replace($english, self::$polish_months, $date);\n }\n \n return parent::format($format);\n }", "function get_feed_build_date($format)\n {\n }", "public function formatDate($date){\n\n return date('F j,Y,g:i a', strtotime($date));\n }", "protected function getDateFormat()\n {\n return 'Y-m-d H:i:s';\n }", "function setGoodDate ($time){\n $time = strtotime ($time);\n $days = date (\"D\",$time);\n switch ($days){\n \n case \"Sun\";\n $day = \"Ahad\";\n break;\n case \"Mon\";\n $day = \"Senin\";\n break;\n case \"Tue\";\n $day = \"Selasa\";\n break;\n case \"Wed\";\n $day = \"Rabu\";\n break;\n case \"Thu\";\n $day = \"Kamis\";\n break;\n case \"Fri\";\n $day = \"Jumat\";\n break;\n case \"Sat\";\n $day = \"Sabtu\";\n break;\n }\n $result = $day.\", \".date (\"d-M-Y\",$time);\n return $result;\n}", "function smarty_modifier_datetime_format($date, $format)\n{\n\tif (isset($date))\n\t{\n\t\treturn date_format($date, $format);\n\t}\n}", "public function getDateFormat()\n {\n return $this->dateFormats;\n }", "function get_date_textual($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', 'yyyy', $format);\n\t$format = str_replace('m', 'mm', $format);\n\t$format = str_replace('d', 'dd', $format);\n\treturn $format;\n}", "function dateExcelFormat ( $w ) {\n\t$w=explode(\"-\",$w);\n\t$y= $w[0];\n\t$m= $w[1];\n\t$d= $w[2];\n\treturn \"$m/$d/$y\";\n}", "function format_day_short($fmt='')\n\t{\n\t\t$d = 'D';\n\t\t$fmt = trim(str_replace(array('D', 'l'), array($d, $d), (empty($fmt) ? $this->format_medium : $fmt)));\n\t\treturn (strpos(' ' . $fmt, $d) ? '' : $d . ' ') . $fmt;\n\t}", "function setDate($date = null)\r\n\t{\t\r\n\t\t$day = substr($date ,8, 2);\r\n\t\t$month = substr($date ,5, 2);\r\n\t\t$year = substr($date ,0, 4);\r\n\t\t\r\n\t\t$newDate = $day.'-'.$month.'-'.$year;\r\n\t\t\r\n\t\treturn $newDate;\r\n\t}", "public function getDateFormat()\n {\n return 'Y-m-d';\n }", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "function classiera_entry_date( $echo = true ) {\r\n\tif ( has_post_format( array( 'chat', 'status' ) ) )\r\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'classiera' );\r\n\telse\r\n\t\t$format_prefix = '%2$s';\r\n\r\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\r\n\t\tesc_url( get_permalink() ),\r\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'classiera' ), the_title_attribute( 'echo=0' ) ) ),\r\n\t\tesc_attr( get_the_date( 'c' ) ),\r\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\r\n\t);\r\n\r\n\tif ( $echo )\r\n\t\techo $date;\r\n\r\n\treturn $date;\r\n}", "private function dateDuJour(){\n return date(\"Y-m-d\");\n }", "function thememount_entry_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\"><span class=\"thememount-entry-date\"><time class=\"entry-date\" datetime=\"%1$s\" >%2$s<span class=\"entry-month entry-year\">%3$s<span class=\"entry-year\">%4$s</span></span></time></span><div class=\"thememount-entry-icon\">%5$s</div></div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( 'Y' ),\n\t\t\tthememount_entry_icon()\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}", "private function changeDateFormat($val,$format){\n \n if($val != \"\" && count($this->dbConfigs) > 0){\n switch ($this->dbConfigs['driver']){\n case \"mysql\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\", strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\", strtotime($val));\n }\n break;\n case \"sqlsrv\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\",strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\",strtotime($val));\n }\n break;\n }\n return $val;\n }\n }", "public function setDay($day){\n\t\t$this->_day = (int) $day;\n\t\t$monthDays = self::$_monthTable[$this->_month-1];\n\t\tif($this->isLeapYear()==true&&$this->_month==2){\n\t\t\t++$monthDays;\n\t\t}\n\t\tif($this->_day>$monthDays){\n\t\t\t$this->_day = self::$_monthTable[$this->_month-1];\n\t\t}\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "function format_date($date, $date_format = false)\n{\n if ($date_format == false) {\n\n if(function_exists('get_option')){\n $date_format = get_option('date_format', 'website');\n }\n if ($date_format == false) {\n $date_format = \"Y-m-d H:i:s\";\n }\n }\n\n $date = date($date_format, strtotime($date));\n return $date;\n}" ]
[ "0.6323084", "0.620864", "0.6169787", "0.61058915", "0.6031912", "0.598269", "0.5981413", "0.59437716", "0.59344715", "0.593169", "0.5909878", "0.58930355", "0.58328193", "0.57859284", "0.57304966", "0.5728", "0.57247776", "0.5719202", "0.5719202", "0.57098025", "0.5707863", "0.57048315", "0.5698019", "0.5697588", "0.5659617", "0.56561935", "0.56379724", "0.56069964", "0.56062603", "0.5601014", "0.55809623", "0.55495614", "0.5540758", "0.5527996", "0.5518386", "0.54827744", "0.5481663", "0.54700625", "0.5464851", "0.5452103", "0.54489315", "0.542585", "0.53997564", "0.53855556", "0.5383454", "0.5380105", "0.53782463", "0.53606886", "0.5346674", "0.5342442", "0.534188", "0.5340393", "0.53396165", "0.5339024", "0.5327218", "0.5322099", "0.5320334", "0.5318137", "0.5315358", "0.5307033", "0.53046715", "0.52866864", "0.5279099", "0.5274537", "0.52657056", "0.52584636", "0.5256267", "0.5255075", "0.525218", "0.5248545", "0.5246474", "0.5242955", "0.5238558", "0.5236144", "0.5236133", "0.52351874", "0.52269787", "0.5223665", "0.52202827", "0.52178097", "0.5211769", "0.52093416", "0.52046496", "0.5201108", "0.5198879", "0.51982206", "0.5186181", "0.5184881", "0.51830953", "0.51826984", "0.5180551", "0.51712495", "0.5170552", "0.5170552", "0.51672673", "0.5166554", "0.516572", "0.5162833", "0.51626635", "0.5159771" ]
0.73532283
0
Set date format for "month" file output
public static function setDateFormatMonth() { self::$settings[0] = 'Y-m'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function monthFormat() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_monthFormat = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_monthFormat;\n\t}", "function set_date_format ($date_format)\r\n {\r\n $_SESSION[\"date_format\"] = $date_format;\r\n }", "public function format($format)\n {\n if (preg_match(\"/^.*[f]+.*$/\", $format)) {\n $format = str_replace('f', 'F', $format);\n \n $date = parent::format($format);\n \n $english = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); \n \n return str_replace($english, self::$polish_months, $date);\n }\n \n return parent::format($format);\n }", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public function setDateFormat($date_format)\n\t{\n\t\tself::$__date_format = $date_format;\n\t}", "function smarty_modifier_month_format($month)\n{\n\t$month = preg_replace('/^0/', '', $month);\n\tswitch($month) {\n\tcase 1:\n\t\treturn \"January\";\n\t\tbreak;\n\tcase 2:\n\t\treturn \"February\";\n\t\tbreak;\n\tcase 3:\n\t\treturn \"March\";\n\t\tbreak;\n\tcase 4:\n\t\treturn \"April\";\n\t\tbreak;\n\tcase 5:\n\t\treturn \"May\";\n\t\tbreak;\n\tcase 6:\n\t\treturn \"June\";\n\t\tbreak;\n\tcase 7:\n\t\treturn \"July\";\n\t\tbreak;\n\tcase 8:\n\t\treturn \"August\";\n\t\tbreak;\n\tcase 9:\n\t\treturn \"September\";\n\t\tbreak;\n\tcase 10:\n\t\treturn \"October\";\n\t\tbreak;\n\tcase 11:\n\t\treturn \"November\";\n\t\tbreak;\n\tcase 12:\n\t\treturn \"December\";\n\t\tbreak;\n\t}\n}", "function date_month($month) {\n\tswitch ($month) {\n\t\tcase 1:\n\t\t\techo \"Януари\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\techo \"Февруари\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\techo \"Март\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\techo \"Април\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\techo \"Май\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\techo \"Юни\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\techo \"Юли\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\techo \"Август\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\techo \"Септември\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\techo \"Октомври\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\techo \"Ноември\";\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\techo \"Декември\";\n\t\t\tbreak;\n\t}\n}", "function format_month_long($fmt='')\n\t{\n\t\t$m = 'F';\n\t\t$y = 'Y';\n\t\treturn trim(str_replace(array('m', 'M', 'n', 'F', 'y', 'Y'), array($m, $m, $m, $m, $y, $y), (empty($fmt) ? $this->format_medium : $fmt)));\n\t}", "function getMonthDir() {\n return date(\"Y_m\");\n }", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat',$value,'dd-MM-yyyy');\n\t}", "abstract protected function setFormat();", "function setMonth($m)\r\n {\r\n if($m < 1 || $m > 12) {\r\n $this->mes = 1;\r\n } else {\r\n $this->mes = $m;\r\n }\r\n }", "private function setMonthNames()\n\t{\n\t\t$range = range(1,12);\n\t\t$return = array();\n\t\tforeach($range AS $key => $monthNum)\n\t\t{\n\t\t $fmt = datefmt_create ($this->locale, null, null, null, IntlDateFormatter::GREGORIAN, 'MMMM');\n\t\t\t$return[$monthNum] = datefmt_format( $fmt , mktime(12,0,0,$monthNum,1,date('Y')));\n\t\t}\n\n\t\treturn $return;\n\t}", "protected function _formatDate($month, $year)\n {\n return sprintf(\n '%02d/%02d', \n substr($month, -2, 2),\n substr($year, -2, 2)\n );\n }", "public function getDateFormat(){\n\t\t$this->_dateFormat = $date;\n\t}", "public static function setDateFormat($format)\n {\n static::$dateFormat = $format;\n }", "public static function setDateFormatDay()\n {\n self::$settings[0] = 'Y-m-d';\n }", "public function writeDataToFile($date = null, $fileName = NULL, $period = null)\r\n {\r\n // Check whether the parameters were supplied and if not, set sensible defaults\r\n if (is_null($date)) {\r\n $date = (new DateTime())->format('Y-m-d');\r\n }\r\n if (is_null($fileName)) {\r\n $fileName = date('ymd') . '_Upcast_Monthly_Schedule.csv';\r\n }\r\n if (is_null($period)) {\r\n $period = 6;\r\n }\r\n // Construct a new DateTime object\r\n try {\r\n $date = new DateTime($date);\r\n // Open a file for writing in the same directory where this script is located\r\n $fb = fopen($fileName, 'w');\r\n echo \"Starting Export...\\n\\n\";\r\n // Create a header row\r\n $headerRow = array(\r\n 'Month',\r\n 'Mid Month Meeting Date',\r\n 'End of Month Testing Date'\r\n );\r\n // Output the header row to standard output\r\n echo implode(\"\\t\", $headerRow);\r\n echo \"\\n\";\r\n // Put the header row into the file\r\n fputcsv($fb, $headerRow, \",\", \"\\\"\");\r\n \r\n // Get current month from the supplied date\r\n $currentMonth = $date->format('m');\r\n // Go through the period given and generate the data for the subsequent months by adding as many months as the set period, starting from the supplied month onwards\r\n for ($i = 0; $i < $period; $i ++) {\r\n /** Get a timestamp of the given month as it is easier to generate the data that way\r\n * $monthTimestamp = strtotime('+' . $i . ' months', strtotime(date('Y-M' . '-01')));\r\n */\r\n // Generate the month based on the period and format it accordingly\r\n $generatedMonth = (new DateTime($date->format('Y') . '-' . $date->format('m') . '-' . $date->format('d')))->modify('+' . $i . ' months');\r\n // Extract day, month and year variables from the generated date\r\n $day = $generatedMonth->format('d');\r\n $month = $generatedMonth->format('m');\r\n $monthNameAndYear = $generatedMonth->format('F Y');\r\n $year = $generatedMonth->format('Y');\r\n // Generate the two dates for the actual export by executing the related methods with the generated month\r\n $midMonthMeetingDate = self::determineMidMonthMeetingDate($year . '-' . $month . '-14')->format('l, d.m.Y');\r\n $endOfMonthTestingDate = Self::determineEndOfMonthTestingDate($year . '-' . $month . '-1')->format('l, d.m.Y');\r\n // Add the whole row into an array in order to pass it onto the fputcsv function\r\n $row = array(\r\n $monthNameAndYear,\r\n $midMonthMeetingDate,\r\n $endOfMonthTestingDate\r\n );\r\n // Write the data into the file\r\n fputcsv($fb, $row, \",\", \"\\\"\");\r\n // Output the data to standard output\r\n echo $monthNameAndYear . \"\\t\" . $midMonthMeetingDate . \"\\t\" . $endOfMonthTestingDate . \"\\n\";\r\n }\r\n // Put a blank line at the end of the records\r\n echo \"\\n\";\r\n // Close the file\r\n fclose($fb);\r\n echo \"File exported successfully.\\n\";\r\n } catch (Exception $e) {\r\n echo 'Exception: ', $e->getMessage(), \"\\n\";\r\n }\r\n \r\n }", "public function setMonth($month){\n\t\tif($month>12){\n\t\t\t$this->_month = $month%12;\n\t\t\t$this->_year += ((int)($month/12));\n\t\t} else {\n\t\t\tif($month<1){\n\t\t\t\t$this->_month = 13-(abs($month)%12);\n\t\t\t\t$this->_year -= (((int)(abs($month)/12))+1);\n\t\t\t} else {\n\t\t\t\t$this->_month = (int) $month;\n\t\t\t}\n\t\t}\n\t\t$monthDays = self::$_monthTable[$this->_month-1];\n\t\tif($this->isLeapYear()==true&&$this->_month==2){\n\t\t\t++$monthDays;\n\t\t}\n\t\tif($this->_day>$monthDays){\n\t\t\t$this->_day = self::$_monthTable[$this->_month-1];\n\t\t}\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function formatDate($date = null);", "function dateFormat($date){\n return strftime(\"%d. %m. %Y\", strtotime($date));\n}", "private function format()\n {\n return config('app.locale') != 'en' ? 'd/m/Y' : 'm/d/Y';\n }", "function getMonth(){\r\n return date('F',$this->timestamp);\r\n }", "function formatDate()\n\t{\n\t\techo date(\"m/d/y\");\n\t}", "public function dateFormat();", "function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}", "function monthCreator($from,$to){\n\n$month='';\nforeach (h_many_M($from,$to) as $i) {\n\n$d = DateTime::createFromFormat('!m', $i);\n$m = $d->format('F').' '.$i;\n\n $month.=' \n<th class=\"planning_head_month\" colspan=\"28\">'.$m.'</th>\n ';\n}\necho $month;\n}", "public function export_sales_monthwise(){\n $tenant_id = $this->tenant_id;\n $yearVal = $this->input->get('yearVal');\n $monthVal = $this->input->get('monthVal');\n $result = $this->reportsModel->salessummary_monthwise($tenant_id,$yearVal,$monthVal);\n $this->load->helper('export_helper');\n export_tms_report_sales_monthwise($result);\n }", "function customDateFormat($date)\n{\n $MyDate = Carbon::parse($date)->format('j/M');\n\n return $MyDate;\n}", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "public function monthControl(){\n\t\t$month = date('m', time());\n\t\t\t\t\n\t\t//remakes $month to the month's name\n\t\tswitch ($month) {\n\t\t\tcase 1:\t$month = \"Januari\";\t\tbreak;\n\t\t\tcase 2:\t$month = \"Februari\";\tbreak;\n\t\t\tcase 3:\t$month = \"Mars\";\t\tbreak;\n\t\t\tcase 4:\t$month = \"April\";\t\tbreak;\n\t\t\tcase 5:\t$month = \"Maj\";\t\t\tbreak;\n\t\t\tcase 6:\t$month = \"Juni\";\t\tbreak;\n\t\t\tcase 7:\t$month = \"Juli\";\t\tbreak;\n\t\t\tcase 8:\t$month = \"Augusti\";\t\tbreak;\n\t\t\tcase 9:\t$month = \"September\";\tbreak;\n\t\t\tcase 10:$month = \"Oktober\";\t\tbreak;\n\t\t\tcase 11:$month = \"November\";\tbreak;\t\n\t\t\tcase 12:$month = \"December\";\tbreak;\n\t\t}\n\t\t\n\t\treturn $month;\n\t}", "public static function formMonthFld($field): string\n\t{\n\t\treturn Formatter::setMonthformat($field);\n\t}", "public function getMonthName()\r\n\t{\r\n\t\treturn $this->format('F');\r\n\t}", "private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}", "public function dateTimeFormat();", "function print_month_option_list( $p_month = 0 ) {\n\tfor( $i = 1;$i <= 12;$i++ ) {\n\t\t$t_month_name = date( 'F', mktime( 0, 0, 0, $i, 1, 2000 ) );\n\t\tif( $i == $p_month ) {\n\t\t\techo '<option value=\"' . $i . '\" selected=\"selected\">' . lang_get( 'month_' . strtolower( $t_month_name ) ) . '</option>';\n\t\t} else {\n\t\t\techo '<option value=\"' . $i . '\">' . lang_get( 'month_' . strtolower( $t_month_name ) ) . '</option>';\n\t\t}\n\t}\n}", "protected function month(){\n return $this->now->format('m');\n }", "function get_month($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return January format\n return $this->translate_month($this->cal_lang,date(\"F\",mktime(0,0,0,$date_split[1],$date_split[0],$date_split[2])));}\n elseif ($type=='2'){\n // Return Jan format\n return date(\"M\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='3'){\n // Return 01 format\n return date(\"m\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='4'){\n // Return 1 format\n return date(\"n\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "public function format($format) {\n \t$spf = str_replace(array(\"d\",\"m\",\"Y\"),array(\"%3$02d\",\"%2$02d\",\"%1$04d\"),$format);\n \t\treturn sprintf($spf, $this->dt[0], $this->dt[1], $this->dt[2]);\n\t}", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "public function setMonth($month) {\n\t\t$this->month = $month;\n\t}", "public function __construct() {\r\n $this->setMode(self::$modeMonth);\r\n }", "function monthNames($format='long')\n {\n $formats = array('one'=>'%b', 'two'=>'%b', 'short'=>'%b', 'long'=>'%B');\n if (!array_key_exists($format,$formats)) {\n $format = 'long';\n }\n $months = array();\n for ($i=1; $i<=12; $i++) {\n $stamp = mktime(0, 0, 0, $i, 1, 2003);\n $month = strftime($formats[$format], $stamp);\n switch($format) {\n case 'one':\n $month = substr($month, 0, 1);\n break;\n case 'two':\n $month = substr($month, 0, 2);\n break;\n }\n $months[$i] = $month;\n }\n return $months;\n }", "function genMonth_Text($m) { \n switch ($m) { \n case '01': $month_text = \"Enero\"; break; \n case '02': $month_text = \"Febrero\"; break; \n case '03': $month_text = \"Marzo\"; break; \n case '04': $month_text = \"Abril\"; break; \n case '05': $month_text = \"Mayo\"; break; \n case '06': $month_text = \"Junio\"; break; \n case '07': $month_text = \"Julio\"; break; \n case '08': $month_text = \"Agosto\"; break; \n case '09': $month_text = \"Septiembre\"; break; \n case '10': $month_text = \"Octubre\"; break; \n case '11': $month_text = \"Noviembre\"; break; \n case '12': $month_text = \"Diciembre\"; break; \n } \n return ($month_text); \n }", "function dateformat($date)\n{\n\tif($date != \"0000-00-00\")\n\t{\n\t$ndate = explode(\"-\",$date);\n\t$year = $ndate[0];\n\t$day = $ndate[2];\n\t$month = intval($ndate[1])-1;\n\t$montharr = array(\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n\t$month1 = $montharr[$month];\n\t\n\t\n\treturn $day . \" \" . $month1 . \" \" . $year;\n\t}\n\telse\n\treturn \"\";\n}", "function monthdate($date) {\n #print \"monthdate($date)<br>\\n\";\n return trim(substr($date, 5, 2) . substr($date, 8, 2));\n }", "function changejpmonth($month)\n{\n\n $jpmonth=\"\";\n switch($month) {\n case \"jan\":\n $jpmonth=\"1月 JAN\";\n break;\n\n case \"feb\":\n $jpmonth=\"2月 FEB\";\n break;\n\n case \"mar\":\n $jpmonth=\"3月 MAR\";\n break;\n\n case \"apr\":\n $jpmonth=\"4月 APR\";\n break;\n\n case \"may\":\n $jpmonth=\"5月 MAY\";\n break;\n\n case \"jun\":\n $jpmonth=\"6月 JUN\";\n break;\n\n case \"jul\":\n $jpmonth=\"7月 JUL\";\n break;\n\n case \"aug\":\n $jpmonth=\"8月 AUG\";\n break;\n\n case \"sep\":\n $jpmonth=\"9月 SEP\";\n break;\n\n case \"oct\":\n $jpmonth=\"10月 OCT\";\n break;\n\n case \"nov\":\n $jpmonth=\"11月 NOV\";\n break;\n\n case \"dec\":\n $jpmonth=\"12月 DEC\";\n break;\n }\n return $jpmonth;\n}", "public function getMonth() : string\n {\n return date('m', $this->getUnixTimestamp());\n }", "public function setMonth($month)\n\t{\n\t\t$this->month = $month;\n\t}", "public function month($value) {\n return $this->setProperty('month', $value);\n }", "function format_date_YYYYMMDD($filename = '')\n{\n $dff = date_from_filename($filename);\n if (count($dff) == 0) return '';\n return join('', $dff);\n}", "private function _sql_yearmonth() {\n\t\tglobal $wpdb;\n\t\tif ( !$this->yearmonth ) {\n\t\t\treturn '';\n\t\t}\n\t\t// e.g. AND DATE_FORMAT(wp_posts.post_modified, '%Y%m') = '201102'\n\t\treturn sprintf(\"%s DATE_FORMAT(%s.%s, '%%Y%%m') = %s\" // note the double percentage to placate sprintf \n\t\t\t, $this->join_rule\n\t\t\t, $wpdb->posts\n\t\t\t, $this->date_column\n\t\t\t, $wpdb->prepare('%s', $this->yearmonth)\n\t\t);\n\t}", "public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }", "public function get_month_permastruct()\n {\n }", "function get_date_format ()\r\n {\r\n return $_SESSION[\"date_format\"];\r\n }", "function exportMintDates($silent=false) {\n exportAll('getMintDates', 'exportMintDate', $silent);\n}", "public function setMonth($month)\n {\n $this->month = $month;\n }", "function _reformat_date($inDate) {\n $outDate = $inDate;\n $months = array(\n \"Maa\" => \"Mar\",\n \"Mei\" => \"May\",\n \"Okt\" => \"Oct\"\n );\n if (empty($inDate)) {\n return $outDate;\n }\n $parts = explode(\"-\", $inDate);\n if (!isset($parts[1]) || !isset($parts[2])) {\n return $outDate;\n } else {\n $newMonth = CRM_Utils_Array::value($parts[1], $months);\n if (!empty($newMonth)) {\n $outDate = $parts[0].\"-\".$newMonth.\"-\".$parts[2];\n }\n }\n return $outDate;\n}", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "public function setDateFormat($format = null, $dateIntervalFormat = null)\n {\n if (null !== $format) {\n $this->dateFormats[0] = $format;\n }\n if (null !== $dateIntervalFormat) {\n $this->dateFormats[1] = $dateIntervalFormat;\n }\n }", "public function setDateFormat(?string $value): void {\n $this->getBackingStore()->set('dateFormat', $value);\n }", "function smarty_modifier_datetime_format($date, $format)\n{\n\tif (isset($date))\n\t{\n\t\treturn date_format($date, $format);\n\t}\n}", "public function formatData($date) {\n\t\t return date('F j, Y, g:i:a', strtotime($date));\n\t }", "public function is_month()\n {\n }", "function monthFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_MONTH_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function getMonth4String($date=null, $type=null){\n\t\tif(!empty($type)){\n\t\t\treturn $this->getMonthLang(date_format($this->createDate($date),\"F\"));\n\t\t}else{\n\t\t\treturn $this->getMonthLang(date_format($this->createDate($date),\"M\"));\n\t\t}\n\t}", "function changeShortDateFromPageCombosToMySQLFormat($month, $year) {\t\n\t\t$pagedate = $month.\"-\".$year;\n\t\t//There is no month or year selected\n\t\tif (trim($month)== \"\" || trim($year)== \"\") {\n\t\t\t$mysqldate = \"0000-00-00\";\n\t\t} else {\n\t\t\t$mysqldate = \"'\".date(\"Y-m-d\", strtotime($pagedate)).\"'\";\n\t\t}\t\t\n\t\treturn $mysqldate;\t\n\t}", "public function ajax_get_reports_by_month() {\n $month = $this->input->post('month');\n $month = (!empty($month))? $month: date('Y-m');\n\n $data['month'] = (!empty($month))? date('F', strtotime($month)): date('F');\n $data['month_digit'] = (!empty($month))? date('Y-m', strtotime($month)): date('Y-m');\n\n $data['result'] = $this->Report_Model->get_membership_payments($month . '-%');\n\n echo json_encode($data);\n }", "public function writeParsedEntriesPerMonth($month, $monthlyEntries) {\n $entryContents = [];\n foreach ($monthlyEntries as $dailyEntry) {\n $source = $this->config->pathToEntries.DIRECTORY_SEPARATOR.$dailyEntry['file'];\n $entryContents[] = sprintf(\n \"## %s%s\\n\\n%s\\n\\n\",\n $dailyEntry['date'],\n $dailyEntry['author'],\n file_get_contents($source)\n );\n }\n \n $destination = $this->docPath.DIRECTORY_SEPARATOR.'Contents'\n .DIRECTORY_SEPARATOR.$month.'.md';\n file_put_contents($destination, implode('', $entryContents));\n }", "public function setFormat($format);", "public function setFormat($format);", "public function setFormat($format);", "function format_date($d) {\r\n\t$month = array(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\r\n\t$date = explode(\"-\",$d);\r\n\tif(($date[1]-1) != 10) $index = str_replace(\"0\",\"\",$date[1]-1);\r\n\telse $index = $date[1]-1;\r\n\treturn $date[2].\" \".$month[$index].\" \".$date[0];\r\n}", "public function getDateFormatter();", "public function setFormat($format) { $this->_format = $format; }", "function _monthToString($month, $abbr = false)\n\t{\n\t\tswitch ($month)\n\t\t{\n\t\t\tcase 1: return $abbr ? WText::_('WANUARY_SHORT') : WText::_('JANUARY');\n\t\t\tcase 2: return $abbr ? WText::_('FEBRUARY_SHORT') : WText::_('FEBRUARY');\n\t\t\tcase 3: return $abbr ? WText::_('MARCH_SHORT') : WText::_('MARCH');\n\t\t\tcase 4: return $abbr ? WText::_('APRIL_SHORT') : WText::_('APRIL');\n\t\t\tcase 5: return $abbr ? WText::_('MAY_SHORT') : WText::_('MAY');\n\t\t\tcase 6: return $abbr ? WText::_('JUNE_SHORT') : WText::_('JUNE');\n\t\t\tcase 7: return $abbr ? WText::_('JULY_SHORT') : WText::_('JULY');\n\t\t\tcase 8: return $abbr ? WText::_('AUGUST_SHORT') : WText::_('AUGUST');\n\t\t\tcase 9: return $abbr ? WText::_('SEPTEMBER_SHORT') : WText::_('SEPTEMBER');\n\t\t\tcase 10: return $abbr ? WText::_('OCTOBER_SHORT') : WText::_('OCTOBER');\n\t\t\tcase 11: return $abbr ? WText::_('NOVEMBER_SHORT') : WText::_('NOVEMBER');\n\t\t\tcase 12: return $abbr ? WText::_('DECEMBER_SHORT') : WText::_('DECEMBER');\n\t\t}\n\t}", "public function getMonthAttribute(): string\n {\n return $this->created_at->format('M');\n }", "public function format_date_save($date){ \n\t\t$exp_date = explode('/', $date); \n\t\treturn $exp_date[2].'-'.$exp_date[1].'-'.$exp_date[0];\n\t}", "public function monthName($month) {\n return date('F', mktime(0,0,0, $month,1));\n }", "function display_month($month, $year) {\n\techo '<br/>';\n\techo \"month = $month, year = $year<br/>\"; \n\t//demo mktime, get unix timestamp for a date\n\t// mktime syntax: mktime($hour, $minute, $second, $month, $day, $year)\n\t$first_day_of_month = mktime(0, 0, 0, $month, 1, $year);\n\n\techo '<br/>';\n\n\techo \" \\n \\r The day's Unix time stamp is: \" . $first_day_of_month . \". &nbsp &nbsp This way of showing time is not user friendly!\";\n\techo '<br/>';\n\t// To display the timestamp in a user readable form \n\n\techo \" The first day of the \" . $month . \"&nbsp month of the year &nbsp\" . $year . \" is: &nbsp\" . date('Y-M-d', $first_day_of_month) . \"!\";\n\techo '<br/>';\n\techo \" The day is: \" . date('Y-M-d H:i:sa', $first_day_of_month) . \"!\";\n\n}", "public function setMonth($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}", "public function getMonthName($month = \"\"){\n\t\t//if a month is provided - otherwise, use current\n\t\t$month = ($month == \"\")? $this->getMonth(): $month; \n\t\t$month = intval($month);\n\t\t$month_name = date('F', mktime(0, 0, 0, $month, 1, $this->getYear()));\n\t\treturn $month_name;\n\t}", "public function getMonth($date=null){\n\t\treturn date_format($this->createDate($date),\"m\");\n\t}", "public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }", "public function get_month($month_number)\n {\n }", "function set_format($do_newlines=true)\n\t{\n\t\t$this->do_newlines = $do_newlines;\n\t}", "public static function stripMonthFromFormat(string $format) : string\n {\n return preg_replace('/[FmMn][ \\/,-]*/', '', $format);\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "function yourls_l10n_months(){\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\treturn $yourls_locale_formats->month;\n}", "function formatDate($date){\n $newDate = strtotime($date);\n $newFormat = date('D j/n Y', $newDate);\n echo $newFormat;\n}", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "public function convertDate($format) {\n\n\n\n $temp = strtotime($format);\n\n echo date('M d Y', $temp);\n }", "function single_month_title($prefix = '', $display = \\true)\n {\n }", "function mkMonthTitle(){\n\tif (!$this->monthNav){\n\t\t$out=\"<tr><td class=\\\"\".$this->cssMonthTitle.\"\\\" colspan=\\\"\".$this->monthSpan.\"\\\">\";\n\t\t$out.=$this->getMonthName().$this->monthYearDivider.$this->actyear;\n\t\t$out.=\"</td></tr>\\n\";\n\t}\n\telse{\n\t\t$out=\"<tr><td class=\\\"\".$this->cssMonthNav.\"\\\" colspan=\\\"2\\\">\";\n\t\tif ($this->actmonth==1) $out.=$this->mkUrl($this->actyear-1,\"12\");\n\t\telse $out.=$this->mkUrl($this->actyear,$this->actmonth-1);\n\t\t$out.=$this->monthNavBack.\"</a></td>\";\n\t\t$out.=\"<td class=\\\"\".$this->cssMonthTitle.\"\\\" colspan=\\\"\".($this->monthSpan-4).\"\\\">\";\n\t\t$out.=$this->getMonthName().$this->monthYearDivider.$this->actyear.\"</td>\";\n\t\t$out.=\"<td class=\\\"\".$this->cssMonthNav.\"\\\" colspan=\\\"2\\\">\";\n\t\tif ($this->actmonth==12) $out.=$this->mkUrl($this->actyear+1,\"1\");\n\t\telse $out.=$this->mkUrl($this->actyear,$this->actmonth+1);\n\t\t$out.=$this->monthNavForw.\"</a></td></tr>\\n\";\n\t}\nreturn $out;\n}" ]
[ "0.6700176", "0.60218817", "0.5979629", "0.59673524", "0.5932227", "0.5884007", "0.5881708", "0.5863357", "0.58482254", "0.58474714", "0.582277", "0.581795", "0.5797204", "0.57677215", "0.5755361", "0.57449156", "0.5741313", "0.57356787", "0.5696618", "0.56556606", "0.5617476", "0.55768746", "0.55768746", "0.556655", "0.55104065", "0.55091864", "0.55073845", "0.5504755", "0.54981536", "0.54672223", "0.5459047", "0.54529744", "0.5448708", "0.5442613", "0.5435519", "0.5421569", "0.539533", "0.5387853", "0.53767735", "0.53736204", "0.5368154", "0.53640884", "0.5360595", "0.5336002", "0.53348523", "0.532327", "0.53140956", "0.5310736", "0.52998936", "0.5281043", "0.5276991", "0.52709925", "0.5266634", "0.52655965", "0.5258553", "0.5258515", "0.52579695", "0.5249637", "0.5249625", "0.52450955", "0.52438796", "0.52327704", "0.5210323", "0.5207048", "0.51986766", "0.5194401", "0.5193466", "0.5191907", "0.5189073", "0.5176122", "0.51749", "0.51720065", "0.5168354", "0.5164275", "0.5164275", "0.5164275", "0.51626456", "0.5150051", "0.5146947", "0.5145065", "0.5135267", "0.51343405", "0.51338196", "0.51308984", "0.5130579", "0.512993", "0.51295495", "0.512916", "0.5129101", "0.5123385", "0.5119052", "0.51110363", "0.51106375", "0.51105666", "0.51088464", "0.5098021", "0.5092939", "0.5091945", "0.50890136", "0.50861955" ]
0.75792706
0
Set date format for output
public static function getDateFormat() { return self::$settings[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatDate($date = null);", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "public function getDateFormat(){\n\t\t$this->_dateFormat = $date;\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat',$value,'dd-MM-yyyy');\n\t}", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "public function formatDate() {\n\t\t\tif(!empty($this->review_date)) {\n\t\t\t\t$date = new dateTime($this->review_date);\n\t\t\t\treturn $date->format('M jS, Y - H:i');\n\t\t\t}\n\t\t}", "private function format()\n {\n return config('app.locale') != 'en' ? 'd/m/Y' : 'm/d/Y';\n }", "public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }", "public function setDateFormat($date){\n\t\t$this->_dateFormat = $date;\n\t}", "function set_date_format ($date_format)\r\n {\r\n $_SESSION[\"date_format\"] = $date_format;\r\n }", "function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}", "public function getDateFormatter();", "public function dateTimeFormat();", "public static function setDateFormatDay()\n {\n self::$settings[0] = 'Y-m-d';\n }", "public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }", "public function setDateFormat($date_format)\n\t{\n\t\tself::$__date_format = $date_format;\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function setDateFormat($value)\n\t{\n\t\t$this->setViewState('DateFormat', $value, '');\n\t}", "public function dateFormat();", "public static function format_date($date,$format) {\n \n return Yii::app()->dateFormatter->format($format, $date);\n }", "function formatDate()\n\t{\n\t\techo date(\"m/d/y\");\n\t}", "function smarty_modifier_datetime_format($date, $format)\n{\n\tif (isset($date))\n\t{\n\t\treturn date_format($date, $format);\n\t}\n}", "function helper_format_date($date, $format = APP_DATE_TIME_FORMAT){\n return date( $format, strtotime($date) );\n }", "public function toFormattedDateString()\n {\n return $this->format('M j, Y');\n }", "public function format($format) {\n \t$spf = str_replace(array(\"d\",\"m\",\"Y\"),array(\"%3$02d\",\"%2$02d\",\"%1$04d\"),$format);\n \t\treturn sprintf($spf, $this->dt[0], $this->dt[1], $this->dt[2]);\n\t}", "protected function getDateFormat()\n {\n return 'Y-m-d H:i:s';\n }", "function erp_format_date( $date, $format = false ) {\n if ( ! $format ) {\n $format = erp_get_option( 'date_format', 'erp_settings_general', 'd-m-Y' );\n }\n\n if ( ! is_numeric( $date ) ) {\n $date = strtotime( $date );\n }\n\n if ( function_exists('wp_date') ) {\n return wp_date( $format, $date );\n }\n\n return date_i18n( $format, $date );\n}", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "public function date() {\n\n\t\t\t$output = '';\n\n\t\t\t$output['date'] = mysql2date(get_option('date_format'), $this->post->post_date);\n\t\t\t$output['time'] = mysql2date(get_option('time_format'), $this->post->post_date);\n\t\t\t$output['posted'] = sprintf(__('Posted %1$s at %2$s', 'theme translation'), mysql2date(get_option('date_format'), $this->post->post_date), mysql2date(get_option('time_format'), $this->post->post_date));\n\t\t\t$output['datetime'] = mysql2date('c', $this->post->post_date);\n\n\t\t\treturn $output;\n\t\t}", "public function formatDate($value)\n\t{\n\t\treturn $value;\n\t}", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "public function formatDate($date){\n return date('F j, Y, g: i a', strtotime($date));\n }", "public function formatDate($date){\n\n return date('F j,Y,g:i a', strtotime($date));\n }", "public function formatData($date) {\n\t\t return date('F j, Y, g:i:a', strtotime($date));\n\t }", "abstract protected function setFormat();", "function dateFormat($date, $format=\"m/d/Y h:i:s A\") {\n if (empty($date)) {\n return \"\";\n }\n Zend_Date::setOptions(array('format_type' => 'php'));\n $zdate = new Zend_Date(strtotime($date));\n $str_date = $zdate->toString($format);\n Zend_Date::setOptions(array('format_type' => 'iso'));\n return $str_date;\n }", "function format_date($date, $date_format = false)\n{\n if ($date_format == false) {\n\n if(function_exists('get_option')){\n $date_format = get_option('date_format', 'website');\n }\n if ($date_format == false) {\n $date_format = \"Y-m-d H:i:s\";\n }\n }\n\n $date = date($date_format, strtotime($date));\n return $date;\n}", "function wp_ajax_date_format()\n {\n }", "public static function setDateFormatMonth()\n {\n self::$settings[0] = 'Y-m';\n }", "public static function setDateFormat($format)\n {\n static::$dateFormat = $format;\n }", "function dateFormatView($date)\n{\n $date_formated = '---';\n if($date!='0000-00-00' and $date!='')\n {\n $date_formated = date('m/d/Y',strtotime($date)); \n }\n return $date_formated; \n}", "public function getDateFormat()\n {\n return 'Y-m-d H:i:sP';\n }", "public function getDateFormat()\n {\n return 'Y-m-d';\n }", "function get_date_format ()\r\n {\r\n return $_SESSION[\"date_format\"];\r\n }", "public function setFormattedDate():self\n {\n $date = mb_substr($this->getAnswerDate(), 0, 10);\n $time = mb_substr($this->getAnswerDate(), 11, 19);\n\n $m = (int)mb_substr($date, 5,2);\n $month = Requestor::monthOfADate($m);\n $parts = array_reverse(explode('-', $date));\n unset($parts[1]);\n $date = implode(' '.$month.' ', $parts);\n\n $t = new DateTime($time);\n $h = $t->format('H');\n $m = $t->format('i');\n \n\n $this->dateFormatted = \"Postée le \".$date. \" à \".$hour = $h.\"h \".$m.\"'\"; \n\n return $this;\n }", "function acf_format_date($value, $format)\n{\n}", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "protected function _formatDate($date_obj) {\n if (is_string($date_obj)) {\n $date_obj = DateTime::createFromFormat('Y-m-d H:i:s', $date_obj);\n }\n return $date_obj->format('d/m/Y');\n }", "public function date_format($date, $type = 0) {\n\t\tif ($date == '' || $date == \"0000-00-00\") {\n\t\t\treturn \"\";\n\t\t}\n\t\t$st = Yii::$app->getTable;\n\n\t\t$df = $st->settings('local', 'date_format');\n\t\tsetlocale(LC_TIME, 'en_US');\n\t\tif ($type == 1) {\n\t\t\t$result = date(\"$df\", $date); // date($df,strtotime($date));\n\t\t} else {\n\t\t\t$result = date(\"$df\", strtotime($date)); // date($df,strtotime($date));\n\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.u0';\n }", "public function __toString()\r\n\t{\r\n\t\treturn $this->format('l, jS F, Y');\r\n\t}", "public function toFormattedDateString()\n {\n return $this->toLocalizedString('MMM d, yyyy');\n }", "public function display_date(){\n\t\t$display = date('d-m-Y');\n\t\treturn $display;\n\t}", "function formatDate($date,$dateOpt=null) {\n\n\t if (defined(\"DATE_FORMAT\")) $layout = DATE_FORMAT;\n\t else $layout = \"mm/dd/yyyy\";\n\n\t $layout = str_replace(\"mm\",\"m\",$layout);\n\t $layout = str_replace(\"dd\",\"d\",$layout);\n\t $layout = str_replace(\"yyyy\",\"Y\",$layout);\n\n\t\t$dateArray = explode(\"-\",$date);\n\n\t\tif ($dateOpt==\"full\") date(\"M d, Y\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\telse $date = date(\"$layout\",mktime(0,0,0,$dateArray[1],$dateArray[2],$dateArray[0]));\n\t\t\n\t\treturn $date;\n\t\t\n}", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.uO';\n }", "public function getDateFormat()\n {\n return 'Y-m-d H:i:s.uO';\n }", "function sc_date_format($date){\n\t$CI =& get_instance();\n\tif($CI->session->userdata('locale') =='uk'){\n\t\treturn date('d/m/Y', $date);\n\t}else{\n\t\treturn date('m/d/Y', $date);\n\t}\n}", "private function changeDateFormat($val,$format){\n \n if($val != \"\" && count($this->dbConfigs) > 0){\n switch ($this->dbConfigs['driver']){\n case \"mysql\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\", strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\", strtotime($val));\n }\n break;\n case \"sqlsrv\":\n if($format == \"date\"){\n $val = date(\"Y-m-d\",strtotime($val));\n }\n elseif($format == \"datetime\"){\n $val = date(\"Y-m-d H:i:s\",strtotime($val));\n }\n break;\n }\n return $val;\n }\n }", "protected function getDateFormat()\n {\n return \\MUtil_Model_Bridge_FormBridge::getFixedOption('datetime', 'dateFormat');\n }", "public function dateViewHelperFormatsDateLocalizedDataProvider() {}", "public static function getDateFormats()\n {\n return array( 'm/d/y' => 'mm/dd/yy', 'd/m/y' => 'dd/mm/yy' );\n }", "static public function formatDate($date)\n {\n $objDate = new DateTime($date);\n return $objDate->format('d/m/Y');\n }", "private function datepicker_format($format) {\n\t\treturn str_replace(\n\t\t\tarray(\n\t\t\t\t'd', 'j', 'l', 'z', // Day.\n\t\t\t\t'F', 'M', 'n', 'm', // Month.\n\t\t\t\t'Y', 'y' // Year.\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'dd', 'd', 'DD', 'o',\n\t\t\t\t'MM', 'M', 'm', 'mm',\n\t\t\t\t'yy', 'y'\n\t\t\t),\n\t\t\t$format);\n\t}", "public function dateDisplayFormat($date)\n\t{\n\t\t$day = substr($date,6,2);\n\t\t$month = substr($date,4,2);\n\t\t$year = substr($date,0,4);\n\t\tif ($year=='0000')\n\t\t\treturn '?';\n\t\tif ($month=='00')\n\t\t\treturn '~ ' . $year;\n\t\tif ($day=='00')\n\t\t\treturn '~ ' . $month . '.' . $year;\n\t\t$displayDate = '' . $day . '.' . $month . '.' . $year;\n\t\treturn $displayDate;\n\t\t\n\t}", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "public function setDateFormat($date_format)\n\t{\n\t\t$this->date_format = $date_format;\n\t\treturn $this;\n\t}", "function format_date($p_id, $p_name, $p_value, $p_width = '', $p_fmt_short = false){\n\t$t_width = ($p_width != '') ? 'width:' . $p_width . ' !important' : '';\n\t$t_date_prop = 'data-picker-locale=\"' . lang_get_current_datetime_locale() . '\" data-picker-format=\"' . convert_date_format_to_momentjs($p_fmt_short ? config_get('short_date_format') : config_get('normal_date_format')) . '\"';\n\n\treturn format_text($p_id, $p_name, $p_value, '', 'input-xs inline-page-datetime', $t_width, $t_date_prop);\n}", "public function formatDate(\n $date = null,\n $format = \\Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface::FORMAT_TYPE_SHORT,\n $showTime = false\n );", "function date_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "function _elastic_email_format_date($date_field) {\n $data = sprintf('%d/%d/%d', $date_field['month'], $date_field['day'], $date_field['year']);\n $time = sprintf('%s:%s %s', $date_field['hour'], $date_field['minute'], $date_field['ampm']);\n\n return $data . ' ' . $time;\n}", "public function toDateString()\n {\n return $this->format('Y-m-d');\n }", "public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }", "function getSystemDateFormat($getdate){\n\t\t\n\t\t$systemformat\t=\t$this->getSystemSettingValue('DATE_FORMAT');\n\t\tif(isset($getdate) && $getdate!=\"\"){\n\t\t\n\t\t\t$systemdate\t\t\t=\tdate(\"$systemformat\",strtotime($getdate));\n\t\t}\n\t\telse {\n\t\t\t$systemdate \t\t= \t\"Invlid Date Input\";\n\t\t}\n\t\treturn $systemdate;\n\t}", "public function display_date(){\n\t\t$display = date('d/m/Y');\n\t\treturn $display;\n\t}", "function getFormattedCreatedDateExtended()\r\n {\r\n return $this->created_at->format('d').\" de \".$this->getMes_ptBR((int) $this->created_at->format('m') ).\" de \".$this->created_at->format('Y') ;\r\n }", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "function format_date(string $date_string = null, $format = 'd/m/Y') {\n return date_format(new \\DateTime($date_string), $format);\n }", "public function getDateFormat(): string\n {\n return 'Y-m-d H:i:s';\n }", "public function format($format)\n {\n if (preg_match(\"/^.*[f]+.*$/\", $format)) {\n $format = str_replace('f', 'F', $format);\n \n $date = parent::format($format);\n \n $english = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); \n \n return str_replace($english, self::$polish_months, $date);\n }\n \n return parent::format($format);\n }", "public function date($date=null)\n {\n if(is_null($date)) { \t\n\t\t\t$date = $this->publication; \n }\n\n return $date;\n //date_format($date, 'g:ia \\o\\n l jS F Y');;\n }", "public function toDateString()\n {\n return $this->toLocalizedString('yyyy-MM-dd');\n }", "function formatDate($date){\n $newDate = strtotime($date);\n $newFormat = date('D j/n Y', $newDate);\n echo $newFormat;\n}", "public function date_format_func($date,$format)\n\t{\n\t\t$date = str_replace(\"/\",\"-\",$date);\n\t\t$date_output = date($format,strtotime($date));\n\t\treturn $date_output;\n\t}", "public function getDateFormat()\n\t{\n\t\treturn $this->date_format;\n\t}", "public function getDateFormat()\n\t{\n\t\treturn isset($this->config['date-format']) ? $this->config['date-format'] : NULL;\n\t}", "public function date_display_format($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$c_d = date('d/m/Y', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "protected function _format_date($date)\n {\n $dateTime = new DateTime($date);\n return $dateTime->format(\"Y-m-d H:i:s\");\n }", "private function formatDate($date)\n {\n if (!$date instanceof \\DateTime) {\n return date(self::DATE_FORMAT, strtotime($date));\n }\n\n return $date->format(self::DATE_FORMAT);\n }", "public function getDateFormat()\n {\n return $this->dateFormats;\n }", "function the_date($format = '', $before = '', $after = '', $display = \\true)\n {\n }", "public function toSite()\n {\n return $this->format(Config::get('settings.site_datetime_format'));\n }", "public function getHTMLDatePickerFormatValue(): string\n {\n return Carbon::parse($this->value)->format('Y-m-d');\n }", "public function parmDate($date = null, $format = self::datePattern) {\r\n if($date != null)\r\n { \r\n $this->date = new DateTime($date); \r\n }\r\n return $this->date->format($format);\r\n }", "public function date_format($nagios_format_name=false)\n\t{\n\t\tif (empty($nagios_format_name)) {\n\t\t\t$date_format_id = 'date_format';\n\t\t\t# try config helper first (includes session check)\n\t\t\t$nagios_format_name = config::get('config.'.$date_format_id);\n\t\t\tif (empty($nagios_format_name)) {\n\t\t\t\t# check nagios.cfg file\n\t\t\t\t$nagios_config = System_Model::parse_config_file('nagios.cfg');\n\t\t\t\t$nagios_format_name = $nagios_config[$date_format_id];\n\t\t\t\t# save to session\n\t\t\t\tSession::instance()->set('config.'.$date_format_id, $nagios_format_name);\n\n\t\t\t\t# save setting to db\n\t\t\t\tNinja_setting_Model::save_page_setting('config.'.$date_format_id, '*', $nagios_format_name);\n\t\t\t}\n\t\t}\n\t\t$nagios_format_name = trim($nagios_format_name);\n\t\tif (empty($nagios_format_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$date_format = false;\n\t\tswitch (strtolower($nagios_format_name)) {\n\t\t\tcase 'us': # MM-DD-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'm-d-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'euro': # DD-MM-YYYY HH:MM:SS\n\t\t\t\t$date_format = 'd-m-Y H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'iso8601': # YYYY-MM-DD HH:MM:SS\n\t\t\t\t$date_format = 'Y-m-d H:i:s';\n\t\t\t\tbreak;\n\t\t\tcase 'strict-iso8601': # YYYY-MM-DDTHH:MM:SS\n\t\t\t\t$date_format = 'Y-m-dTH:i:s';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $date_format;\n\t}", "function template_date_format($timestamp,$showtime = FALSE)\n {\n if ($showtime == TRUE) {\n $date = date_format($timestamp,TRUE);\n } else {\n $date = date_format($timestamp,FALSE);\n }\n return $date;\n }", "public function setFormat($value) {}", "function getFormattedCreatedDate()\r\n {\r\n return $this->created_at->format('d/m/y');\r\n }", "public function formatDate ($date)\n\t{\n\t\tif (!$date) {\n\t\t\treturn '';\n\t\t}\n\t\treturn date('m/d/Y', strtotime($date));\n\t}", "function dateFormat($date){\n return strftime(\"%d. %m. %Y\", strtotime($date));\n}", "private function _format($mod = FALSE)\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate the date to work with\n\t\t// --------------------------------------\n\n\t\t$this->_init_date();\n\n\t\t// --------------------------------------\n\t\t// What are we going to display?\n\t\t// --------------------------------------\n\n\t\t$unit = $this->EE->TMPL->fetch_param('unit', $this->date->given());\n\n\t\t// --------------------------------------\n\t\t// Do we need to modify the date given\n\t\t// --------------------------------------\n\n\t\tif ($mod && $unit)\n\t\t{\n\t\t\t$this->date->$mod($unit);\n\n\t\t\t// Log it\n\t\t\t$this->_log(\"Modify date: {$mod} {$unit} to \".$this->date->date());\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Check in what format\n\t\t// --------------------------------------\n\n\t\t// Get format=\"\" param\n\t\t$format = $this->EE->TMPL->fetch_param('format');\n\n\t\t// Check for year_format=\"\", month_format=\"\" or day_format=\"\"\n\t\t$format = $this->EE->TMPL->fetch_param($unit.'_format', $format);\n\n\t\tif ( ! $format)\n\t\t{\n\t\t\tswitch ($unit)\n\t\t\t{\n\t\t\t\tcase 'week':\n\t\t\t\t\t$this->return_data = $this->date->week_url();\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'month':\n\t\t\t\t\t$this->return_data = $this->date->month_url();\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'year':\n\t\t\t\t\t$this->return_data = $this->date->year();\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->return_data = $this->date->date();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->return_data = $this->date->ee_format($format);\n\t\t}\n\n\t\treturn $this->return_data;\n\t}", "public function getDateFormat()\n {\n return $this->dateFormat ?: 'Y-m-d H:i:s';\n }" ]
[ "0.7418608", "0.72170687", "0.69547254", "0.6947656", "0.6903181", "0.68597245", "0.6841", "0.6836626", "0.6835623", "0.67824215", "0.6774161", "0.67707443", "0.67600024", "0.66217047", "0.6568642", "0.65624654", "0.6547455", "0.6547455", "0.65277505", "0.6509671", "0.6502453", "0.64019686", "0.6397858", "0.6396537", "0.63858217", "0.6371692", "0.6349118", "0.63458943", "0.63304", "0.6316105", "0.6308585", "0.6286874", "0.62838864", "0.6283446", "0.62516993", "0.62485194", "0.6238521", "0.6232276", "0.62266433", "0.62258935", "0.6206283", "0.6203435", "0.617965", "0.6174528", "0.6173727", "0.61734885", "0.6163924", "0.6162547", "0.6157021", "0.6148732", "0.6142504", "0.61403877", "0.6132754", "0.6118973", "0.6117407", "0.6117407", "0.6098569", "0.6090637", "0.608279", "0.6062188", "0.6061201", "0.60566276", "0.60530907", "0.60460407", "0.60431415", "0.60373044", "0.60342497", "0.6013991", "0.60125476", "0.6004445", "0.60032135", "0.5999185", "0.59918815", "0.5985076", "0.59816927", "0.59804803", "0.59804803", "0.597854", "0.5973293", "0.59730804", "0.5960178", "0.59547764", "0.5943748", "0.5943572", "0.59422594", "0.59418935", "0.5932963", "0.5929938", "0.5921212", "0.59138477", "0.5912104", "0.58964574", "0.5895829", "0.58957714", "0.5895532", "0.58861715", "0.5882655", "0.58784693", "0.5876013", "0.58550465", "0.5853726" ]
0.0
-1
Set timestamp offset to consider for output
public static function setTimestampOffset($value) { self::$settings[1] = +$value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOffset($offset) {\n\t\t$this->_offset = 3600 * $offset;\n\t}", "public static function setTimeCorrectionOffset($offset = 0)\n\t{\n\t\tif ($offset == 0)\n\t\t{\n\t\t\t$rest = new S3Request('HEAD');\n\t\t\t$rest = $rest->getResponse();\n\t\t\t$awstime = $rest->headers['date'];\n\t\t\t$systime = time();\n\t\t\t$offset = $systime > $awstime ? -($systime - $awstime) : ($awstime - $systime);\n\t\t}\n\t\tself::$__timeOffset = $offset;\n\t}", "function setTimezoneOffset($offset=null){\r\n\t\tif(!empty($offset)){\r\n\t\t\t$this->timezone_offset = $offset;\r\n\t\t}\r\n\t\telse if(!empty($_SESSION['timezone_offset'])){\r\n\t\t\t$this->timezone_offset = $_SESSION['timezone_offset'];\r\n\t\t}\r\n\t\telse{\r\n\t\t\t// don't set any offset \r\n\t\t\t// default is server time\r\n\t\t}\r\n\t}", "function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }", "public static function getTimestampOffset()\n {\n return self::$settings[1];\n }", "function wp_timezone_override_offset()\n {\n }", "function setOffset($value) {\n $this->offset = $value;\n }", "public function setOffset($offset) {}", "public function setOffset($offset) { $this->_offset = $offset; }", "function getTimeOffset()\n {\n return $this->_props['TimeOffset'];\n }", "function set_time_zone()\n {\n $this->set_date_to_now();\n $offset = $GLOBALS['time_diff'] - $GLOBALS['server_time_offset'];\n $this->timestamp+=($offset*3600);\n }", "public function setTimestamp( $timestamp ) {\n\n $this->timestamp = $this->offsetTimestampForWordPressTimezone(\n $timestamp );\n }", "private function offsetTimestampForWordPressTimezone( $timestamp )\n {\n return $timestamp;\n \n // Get timezone offset in seconds for configured timezone.\n $offset = timezone_offset_get(\n new \\DateTimezone( get_option('timezone_string') ),\n new \\DateTime( date(\"c\", $timestamp ))\n );\n\n return $timestamp + $offset;\n }", "public function delegateSetTimezoneOffset(string $offset) : void;", "function setOffset($offset) {\n if ($offset !== ($oldOffset = $this->offset)) {\n $this->offset = $offset;\n $this->updateDataControlRecords();\n }\n }", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public static function setTimeCorrectionOffset($offset = 0)\n\t{\n\t\t// TODO: Implement setTimeCorrectionOffset() method.\n\t}", "public function setOffset($offset) {\n\t\t$this->offset = $offset;\n\t}", "public function setOffset($offset);", "public function setOffset($offset);", "function setTimestamp($timestamp) {\r\r\n\t\t$this->timestamp = $timestamp;\r\r\n\t}", "public function setTimestamp($timestamp);", "public function setOffset($offset) {\n $this->offset = (int)$offset;\n }", "public function setAttributes_price_factor_onetime_offset( $attributes_price_factor_onetime_offset ) {\n\t\t$this->attributes_price_factor_onetime_offset = $attributes_price_factor_onetime_offset;\n\t}", "public function setOffset($offset)\r\n {\r\n $this->offset = intval($offset);\r\n }", "public function updateCASTimestamps(int $timestampOffset = 0): void\n {\n $now = time() + $timestampOffset;\n foreach ($this->itemReflection->getCasProperties() as $propertyName => $casType) {\n if ($casType == Field::CAS_TIMESTAMP) {\n $this->itemReflection->updateProperty($this->item, $propertyName, $now);\n }\n }\n }", "static public function setClientOffset($numClientOffset) {\n\t\t\tself::getInstance()->intClientOffset = $numClientOffset * 3600;\n\t\t}", "public function action_getTimeStamp()\n\t{\n\t\t$offset_sec = date(\"Z\"); // offset in seconds depends on timezone\n\t\t$curtime = time() + $offset_sec; // current time depends on timezone\n\t\t$this->response->body(json_encode(array(\"unix_timestamp\" => time(),\"offset\" => $offset_sec,\"curtime\" => $curtime)));\n\t}", "function setTimestamp($time_stamp) {\n $this->checkChange(TRUE);\n\n if (variable_get('userpoints_transaction_timestamp', 1)) {\n return $this;\n }\n $this->time_stamp = $time_stamp;\n return $this;\n }", "public function addOffset($offset) {}", "public function viewHelperRespectsDefaultTimezoneForIntegerTimestampDataProvider() {}", "public function setEmittedAtAttribute($value)\n {\n $this->attributes['emitted_at'] = DataHelper::setDateTime($value);\n }", "protected static function _offset( $ts, $dir=1 ) { return $ts + ( $dir * get_option( 'gmt_offset', 0 ) * HOUR_IN_SECONDS ); }", "protected function interval_offset() {\n\t\t// Run two minutes later.\n\t\treturn 120;\n\t}", "public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }", "public function setOffset($var)\n {\n GPBUtil::checkInt64($var);\n $this->offset = $var;\n }", "function move_to_start_of_day()\n {\n $hour=0;\n $minute=0;\n $second=0;\n $day=$this->get_day();\n $month=$this->get_month();\n $year=$this->get_year();\n $newtimestamp=mktime( $hour, $minute, $second, $day, $month, $year);\n }", "protected function __construct() {\n\t\t\t$objSystemTimezone = new DateTimeZone(date_default_timezone_get());\n\t\t\t$this->intSystemOffset = $objSystemTimezone->getOffset(new DateTime('now', new DateTimeZone('Europe/London'))) - (date('I') * 3600);\n\t\t}", "function setOffset ($offSet, $newOffset) {\r\n $offSet = $offSet + $newOffset; \r\n return $offSet;\r\n}", "public function viewHelperRespectsDefaultTimezoneForStringTimestampDataProvider() {}", "private function setOffset()\n {\n $this->offset = ($this->limit * $this->currentPage) - $this->limit;\n }", "public function delegateSetFieldTimezoneOffsetSql(string &$field, int $offset) : void;", "public function enableOffset();", "public function setVerbosityOffset( $verbosity_offset ) {\n\t\t$this->verbosity_offset = (int) $verbosity_offset;\n\t}", "public function setDateOffAttribute($value, $offset)\n\t{\n//\t\t$dateUTC = Carbon::parse($date, 'UTC');\n\t\t$date_offset = timezone_name_from_abbr(\"\", $offset, 1);\t\t\t//Находит ближайшую (указанную в кавычках - если не указано ищет по смещению) аббревиатуру часового пояса в формате 'Europe/Kiev' по смещению в секундах, \"1\" - учитывает переход на летнее время\n\t\t$date = new DateTime($value, new DateTimeZone($date_offset));\n\t\t$date->format('Y-m-d H:i:sP');\n\t\t$date->setTimezone(new DateTimeZone('UTC'));\n\t\t$this->attributes['date_off'] = $date;\n\t\t$this->save();\n\t}", "function getOffset(){\r\n $t=time()+microtime()-$this->api->start_time;\r\n $res=$t-$this->offset;\r\n $this->offset=$t;\r\n return $res;\r\n }", "function date_tz_offset($timestamp, $from_tz, $to_tz='') {\n\tif($to_tz == '') $to_tz = $GLOBALS['env']['timezone'];\n\n\tif(function_exists('date_offset_get')) {\n\t\t$from_dtz = new DateTimeZone($from_tz);\n\t\t$to_dtz = new DateTimeZone($to_tz);\n\t\t$from_dt = new DateTime(app_date('Y-m-d H:i', $timestamp), $from_dtz);\n\t\t$to_dt = new DateTime('now', $to_dtz);\n\t\t$offset = $from_dtz->getOffset($from_dt) - $to_dtz->getOffset($to_dt);\n\t} else { // PHP version 4\n\t\t$timezone_offsets = array (\n\t\t\t'-43200' => ' Etc/GMT+12',\n\t\t\t'-39600' => ' Etc/GMT+11, MIT, Pacific/Apia, Pacific/Midway, Pacific/Niue, Pacific/Pago Pago, Pacific/Samoa, US/Samoa',\n\t\t\t'-36000' => ' -America/Adak, -America/Atka, Etc/GMT+10, HST, Pacific/Fakaofo, Pacific/Honolulu, Pacific/Johnston, Pacific/Rarotonga, Pacific/Tahiti, SystemV/HST10, -US/Aleutian, US/Hawaii',\n\t\t\t'-34200' => ' Pacific/Marquesas',\n\t\t\t'-32400' => ' -AST, -America/Anchorage, -America/Juneau, -America/Nome, -America/Yakutat, Etc/GMT+9, Pacific/Gambier, SystemV/YST9, -SystemV/YST9YDT, -US/Alaska',\n\t\t\t'-28800' => ' -America/Dawson, -America/Ensenada, -America/Los Angeles, -America/Tijuana, -America/Vancouver, -America/Whitehorse, -Canada/Pacific, -Canada/Yukon, Etc/GMT+8, -Mexico/BajaNorte, -PST, -PST8PDT, Pacific/Pitcairn, SystemV/PST8, -SystemV/PST8PDT, -US/Pacific, -US/Pacific-New',\n\t\t\t'-25200' => ' -America/Boise, -America/Cambridge Bay, -America/Chihuahua, America/Dawson Creek, -America/Denver, -America/Edmonton, America/Hermosillo, -America/Inuvik, -America/Mazatlan, America/Phoenix, -America/Shiprock, -America/Yellowknife, -Canada/Mountain, Etc/GMT+7, -MST, -MST7MDT, -Mexico/BajaSur, -Navajo, PNT, SystemV/MST7, -SystemV/MST7MDT, US/Arizona, -US/Mountain',\n\t\t\t'-21600' => ' America/Belize, -America/Cancun, -America/Chicago, America/Costa Rica, America/El Salvador, America/Guatemala, America/Managua, -America/Menominee, -America/Merida, America/Mexico City, -America/Monterrey, -America/North Dakota/Center, -America/Rainy River, -America/Rankin Inlet, America/Regina, America/Swift Current, America/Tegucigalpa, -America/Winnipeg, -CST, -CST6CDT, -Canada/Central, Canada/East-Saskatchewan, Canada/Saskatchewan, -Chile/EasterIsland, Etc/GMT+6, Mexico/General, -Pacific/Easter, Pacific/Galapagos, SystemV/CST6, -SystemV/CST6CDT, -US/Central',\n\t\t\t'-18000' => ' America/Bogota, America/Cayman, -America/Detroit, America/Eirunepe, America/Fort Wayne, -America/Grand Turk, America/Guayaquil, -America/Havana, America/Indiana/Indianapolis, America/Indiana/Knox, America/Indiana/Marengo, America/Indiana/Vevay, America/Indianapolis, -America/Iqaluit, America/Jamaica, -America/Kentucky/Louisville, -America/Kentucky/Monticello, America/Knox IN, America/Lima, -America/Louisville, -America/Montreal, -America/Nassau, -America/New York, -America/Nipigon, America/Panama, -America/Pangnirtung, America/Port-au-Prince, America/Porto Acre, America/Rio Branco, -America/Thunder Bay, Brazil/Acre, -Canada/Eastern, -Cuba, -EST, -EST5EDT, Etc/GMT+5, IET, Jamaica, SystemV/EST5, -SystemV/EST5EDT, US/East-Indiana, -US/Eastern, US/Indiana-Starke, -US/Michigan',\n\t\t\t'-14400' => ' America/Anguilla, America/Antigua, America/Aruba, -America/Asuncion, America/Barbados, America/Boa Vista, America/Caracas, -America/Cuiaba, America/Curacao, America/Dominica, -America/Glace Bay, -America/Goose Bay, America/Grenada, America/Guadeloupe, America/Guyana, -America/Halifax, America/La Paz, America/Manaus, America/Martinique, America/Montserrat, America/Port of Spain, America/Porto Velho, America/Puerto Rico, -America/Santiago, America/Santo Domingo, America/St Kitts, America/St Lucia, America/St Thomas, America/St Vincent, America/Thule, America/Tortola, America/Virgin, -Antarctica/Palmer, -Atlantic/Bermuda, -Atlantic/Stanley, Brazil/West, -Canada/Atlantic, -Chile/Continental, Etc/GMT+4, PRT, SystemV/AST4, -SystemV/AST4ADT',\n\t\t\t'-12600' => ' -America/St Johns, -CNT, -Canada/Newfoundland',\n\t\t\t'-10800' => ' AGT, -America/Araguaina, America/Belem, America/Buenos Aires, America/Catamarca, America/Cayenne, America/Cordoba, -America/Fortaleza, -America/Godthab, America/Jujuy, -America/Maceio, America/Mendoza, -America/Miquelon, America/Montevideo, America/Paramaribo, -America/Recife, America/Rosario, -America/Sao Paulo, -BET, -Brazil/East, Etc/GMT+3',\n\t\t\t '-7200' => ' America/Noronha, Atlantic/South Georgia, Brazil/DeNoronha, Etc/GMT+2',\n\t\t\t '-3600' => ' -America/Scoresbysund, -Atlantic/Azores, Atlantic/Cape Verde, Etc/GMT+1',\n\t\t\t '0' => ' Africa/Abidjan, Africa/Accra, Africa/Bamako, Africa/Banjul, Africa/Bissau, Africa/Casablanca, Africa/Conakry, Africa/Dakar, Africa/El Aaiun, Africa/Freetown, Africa/Lome, Africa/Monrovia, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao Tome, Africa/Timbuktu, America/Danmarkshavn, -Atlantic/Canary, -Atlantic/Faeroe, -Atlantic/Madeira, Atlantic/Reykjavik, Atlantic/St Helena, -Eire, Etc/GMT, Etc/GMT+0, Etc/GMT-0, Etc/GMT0, Etc/Greenwich, Etc/UCT, Etc/UTC, Etc/Universal, Etc/Zulu, -Europe/Belfast, -Europe/Dublin, -Europe/Lisbon, -Europe/London, -GB, -GB-Eire, GMT, GMT0, Greenwich, Iceland, -Portugal, UCT, UTC, Universal, -WET, Zulu',\n\t\t\t '3600' => ' Africa/Algiers, Africa/Bangui, Africa/Brazzaville, -Africa/Ceuta, Africa/Douala, Africa/Kinshasa, Africa/Lagos, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Ndjamena, Africa/Niamey, Africa/Porto-Novo, Africa/Tunis, -Africa/Windhoek, -Arctic/Longyearbyen, -Atlantic/Jan Mayen, -CET, -ECT, Etc/GMT-1, -Europe/Amsterdam, -Europe/Andorra, -Europe/Belgrade, -Europe/Berlin, -Europe/Bratislava, -Europe/Brussels, -Europe/Budapest, -Europe/Copenhagen, -Europe/Gibraltar, -Europe/Ljubljana, -Europe/Luxembourg, -Europe/Madrid, -Europe/Malta, -Europe/Monaco, -Europe/Oslo, -Europe/Paris, -Europe/Prague, -Europe/Rome, -Europe/San Marino, -Europe/Sarajevo, -Europe/Skopje, -Europe/Stockholm, -Europe/Tirane, -Europe/Vaduz, -Europe/Vatican, -Europe/Vienna, -Europe/Warsaw, -Europe/Zagreb, -Europe/Zurich, -MET, -Poland',\n\t\t\t '7200' => ' -ART, Africa/Blantyre, Africa/Bujumbura, -Africa/Cairo, Africa/Gaborone, Africa/Harare, Africa/Johannesburg, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka, Africa/Maputo, Africa/Maseru, Africa/Mbabane, Africa/Tripoli, -Asia/Amman, -Asia/Beirut, -Asia/Damascus, -Asia/Gaza, -Asia/Istanbul, -Asia/Jerusalem, -Asia/Nicosia, -Asia/Tel Aviv, CAT, -EET, -Egypt, Etc/GMT-2, -Europe/Athens, -Europe/Bucharest, -Europe/Chisinau, -Europe/Helsinki, -Europe/Istanbul, -Europe/Kaliningrad, -Europe/Kiev, -Europe/Minsk, -Europe/Nicosia, -Europe/Riga, -Europe/Simferopol, -Europe/Sofia, Europe/Tallinn, -Europe/Tiraspol, -Europe/Uzhgorod, Europe/Vilnius, -Europe/Zaporozhye, -Israel, Libya, -Turkey',\n\t\t\t '10800' => ' Africa/Addis Ababa, Africa/Asmera, Africa/Dar es Salaam, Africa/Djibouti, Africa/Kampala, Africa/Khartoum, Africa/Mogadishu, Africa/Nairobi, Antarctica/Syowa, Asia/Aden, -Asia/Baghdad, Asia/Bahrain, Asia/Kuwait, Asia/Qatar, Asia/Riyadh, EAT, Etc/GMT-3, -Europe/Moscow, Indian/Antananarivo, Indian/Comoro, Indian/Mayotte, -W-SU',\n\t\t\t '11224' => ' Asia/Riyadh87, Asia/Riyadh88, Asia/Riyadh89, Mideast/Riyadh87, Mideast/Riyadh88, Mideast/Riyadh89',\n\t\t\t '12600' => ' -Asia/Tehran, -Iran',\n\t\t\t '14400' => ' -Asia/Aqtau, -Asia/Baku, Asia/Dubai, Asia/Muscat, -Asia/Tbilisi, -Asia/Yerevan, Etc/GMT-4, -Europe/Samara, Indian/Mahe, Indian/Mauritius, Indian/Reunion, -NET',\n\t\t\t '16200' => ' Asia/Kabul',\n\t\t\t '18000' => ' -Asia/Aqtobe, Asia/Ashgabat, Asia/Ashkhabad, -Asia/Bishkek, Asia/Dushanbe, Asia/Karachi, Asia/Samarkand, Asia/Tashkent, -Asia/Yekaterinburg, Etc/GMT-5, Indian/Kerguelen, Indian/Maldives, PLT',\n\t\t\t '19800' => ' Asia/Calcutta, IST',\n\t\t\t '20700' => ' Asia/Katmandu',\n\t\t\t '21600' => ' Antarctica/Mawson, Antarctica/Vostok, -Asia/Almaty, Asia/Colombo, Asia/Dacca, Asia/Dhaka, -Asia/Novosibirsk, -Asia/Omsk, Asia/Thimbu, Asia/Thimphu, BST, Etc/GMT-6, Indian/Chagos',\n\t\t\t '23400' => ' Asia/Rangoon, Indian/Cocos',\n\t\t\t '25200' => ' Antarctica/Davis, Asia/Bangkok, Asia/Hovd, Asia/Jakarta, -Asia/Krasnoyarsk, Asia/Phnom Penh, Asia/Pontianak, Asia/Saigon, Asia/Vientiane, Etc/GMT-7, Indian/Christmas, VST',\n\t\t\t '28800' => ' Antarctica/Casey, Asia/Brunei, Asia/Chongqing, Asia/Chungking, Asia/Harbin, Asia/Hong Kong, -Asia/Irkutsk, Asia/Kashgar, Asia/Kuala Lumpur, Asia/Kuching, Asia/Macao, Asia/Manila, Asia/Shanghai, Asia/Singapore, Asia/Taipei, Asia/Ujung Pandang, Asia/Ulaanbaatar, Asia/Ulan Bator, Asia/Urumqi, Australia/Perth, Australia/West, CTT, Etc/GMT-8, Hongkong, PRC, Singapore',\n\t\t\t '32400' => ' Asia/Choibalsan, Asia/Dili, Asia/Jayapura, Asia/Pyongyang, Asia/Seoul, Asia/Tokyo, -Asia/Yakutsk, Etc/GMT-9, JST, Japan, Pacific/Palau, ROK',\n\t\t\t '34200' => ' ACT, -Australia/Adelaide, -Australia/Broken Hill, Australia/Darwin, Australia/North, -Australia/South, -Australia/Yancowinna',\n\t\t\t '36000' => ' -AET, Antarctica/DumontDUrville, -Asia/Sakhalin, -Asia/Vladivostok, -Australia/ACT, Australia/Brisbane, -Australia/Canberra, -Australia/Hobart, Australia/Lindeman, -Australia/Melbourne, -Australia/NSW, Australia/Queensland, -Australia/Sydney, -Australia/Tasmania, -Australia/Victoria, Etc/GMT-10, Pacific/Guam, Pacific/Port Moresby, Pacific/Saipan, Pacific/Truk, Pacific/Yap',\n\t\t\t '37800' => ' -Australia/LHI, -Australia/Lord Howe',\n\t\t\t '39600' => ' -Asia/Magadan, Etc/GMT-11, Pacific/Efate, Pacific/Guadalcanal, Pacific/Kosrae, Pacific/Noumea, Pacific/Ponape, SST',\n\t\t\t '41400' => ' Pacific/Norfolk',\n\t\t\t '43200' => ' -Antarctica/McMurdo, -Antarctica/South Pole, -Asia/Anadyr, -Asia/Kamchatka, Etc/GMT-12, Kwajalein, -NST, -NZ, -Pacific/Auckland, Pacific/Fiji, Pacific/Funafuti, Pacific/Kwajalein, Pacific/Majuro, Pacific/Nauru, Pacific/Tarawa, Pacific/Wake, Pacific/Wallis',\n\t\t\t '45900' => ' -NZ-CHAT, -Pacific/Chatham',\n\t\t\t '46800' => ' Etc/GMT-13, Pacific/Enderbury, Pacific/Tongatapu',\n\t\t\t '50400' => ' Etc/GMT-14, Pacific/Kiritimati, null, localize/timezone'\n\t\t);\n\n\t\t$from_offset = 0;\n\t\t$to_offset = 0;\n\t\tforeach($timezone_offsets as $offset => $zones) {\n\n\t\t\tif($from_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($from_tz)) !== false) $from_offset = $offset;\n\t\t\t}\n\n\t\t\tif($to_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($to_tz)) !== false) $to_offset = $offset;\n\t\t\t}\n\t\t}\n\n\t\t$old_tz = @ini_get('date.timezone');\n\t\tif($old_tz == '') $old_tz = $GLOBALS['env']['timezone'];\n\t\t@ini_set('date.timezone', $from_tz);\n\t\t@putenv('TZ='.$from_tz);\n\n\t\tif(app_date('I', $timestamp)) $from_offset += 3600;\n\n\t\t@ini_set('date.timezone', $old_tz);\n\t\t@putenv('TZ='.$old_tz);\n\n\t\t$offset = ($from_offset - $to_offset);\n\t}\n\n\treturn $offset;\n}", "public function refreshTimestamp();", "function getUTCOffset($value, $timestamp = null)\n {\n if ($value === null) {\n return 0;\n } else {\n list($sign, $hours, $minutes) = sscanf($value, '%1s%2d%2d');\n return ($sign == '+' ? 1 : -1) * ($hours * 60 * 60) + ($minutes * 60);\n }\n }", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n }", "public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n }", "public function addOffset($offset);", "public function setTimeZoneOffset($mins){\n $sgn = ($mins < 0 ? 1 : -1); //convert the sign opposite (it's comes from the client usually!)\n $mins = abs($mins);\n $hrs = floor($mins / 60);\n $mins -= $hrs * 60;\n $offset = sprintf('%+d:%02d', $hrs*$sgn, $mins);\n\n $sql = \"SET time_zone ='$offset';\";\n $result = $this->execute($sql);\n }", "public function setOffset($var)\n {\n GPBUtil::checkInt32($var);\n $this->offset = $var;\n }", "public function setTimestamp($timestamp, $reassign = false);", "function date_timezone( $format, $timestamp ) {\r\n $gmt_offset = get_option( 'gmt_offset' );\r\n if ( false === $gmt_offset ) {\r\n $timestamp = $timestamp;\r\n } else {\r\n $timestamp = $timestamp + $gmt_offset * 3600;\r\n }\r\n return date( $format, $timestamp );\r\n }", "public function getUtcOffset(){\n $datetime = new DateTime('now', 'UTC');\n return parent::getOffset($datetime);\n }", "public function disableOffset();", "private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}", "function setOffset($localVarName, $value) {\n $this->setSessionVariable($localVarName, \"offset\", $value);\n}", "function mygetdate($date,$offset,$showdateformat){\r\n if($offset==0)return date(\"$showdateformat\",strtotime($date));\r\n $_date = new DateTime($date);\r\n if(abs($offset) == 1)$offset_t = ($offset > 0)?'+1 hour':'-1 hour';\r\n else $offset_t = ($offset > 0)?'+'.$offset.' hours':'-'.abs($offset).' hour';\r\n $_date -> modify($offset_t);\r\n return date(\"$showdateformat\",strtotime($_date->format('Y-m-d H:i:s')));\r\n}", "public function setOffsetFor($objectId, $generation, $offset) {}", "function formatTimezoneOffset($offset=false) {\n\t\t$tzoffset = false;\n\t\tif (preg_match('/^[\\-+]?[0-9\\.]+$/',$offset)>0) { //must be a number\n\t\t\t//convert seconds to hours:min\n\t\t\t$n=false;\n\t\t\tif ($offset > 12 || $offset < -12) {\n\t\t\t\t$noffset = $offset/3600;\n\t\t\t} else {\n\t\t\t\t$noffset = $offset;\n\t\t\t}\n\t\t\t$n = strpos($noffset,'.');\n\t\t\tif ($n !== false) {\n\t\t\t\t$offset_hrs = substr($noffset,0,$n);\n\t\t\t\t$offset_min = (int)substr($noffset,$n+1)*6;\n\t\t\t} else {\n\t\t\t\t$offset_hrs = $noffset;\n\t\t\t\t$offset_min = 0;\n\t\t\t}\n\t\t\tif ($offset < 0) {\n\t\t\t\t$tzoffset = sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t}\n\t\t} elseif (preg_match('/^([\\-+])?(\\d{1,2})?\\:(\\d{2})/',$offset,$match)>0) {\n\t\t\tif (empty($match[2])) $match[2] = \"0\";\n\t\t\tif (!empty($match[1]) && $match[1]==\"-\") {\n\t\t\t\t$tzoffset = \"-\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t}\n\t\t}\n\t\treturn $tzoffset;\n\t}", "public function setOffset($value){\n \n $this->offset = $value;\n\n return $this;\n\n }", "public static function timestamp() {}", "public function setOffset($offset, $value, $container = 'default');", "function utc2local($timestamp = null) {\n\t\tif(!$timestamp) {\n\t\t\t$timestamp = time();\n\t\t}\n\n\t\t$f3 = \\Base::instance();\n\n\t\tif($f3->exists(\"site.timeoffset\")) {\n\t\t\t$offset = $f3->get(\"site.timeoffset\");\n\t\t} else {\n\t\t\t$tz = $f3->get(\"site.timezone\");\n\t\t\t$dtzLocal = new \\DateTimeZone($tz);\n\t\t\t$dtLocal = new \\DateTime(\"now\", $dtzLocal);\n\t\t\t$offset = $dtzLocal->getOffset($dtLocal);\n\t\t\t$f3->set(\"site.timeoffset\", $offset);\n\t\t}\n\n\t\treturn $timestamp + $offset;\n\t}", "public function offsetsUpdated() {}", "public function setCustomOffset($offset){\n try{\n if($offset<0){\n $this->customOffset = 0;\n return true;\n }\n $this->customOffset= (int)$offset;\n }catch (Exception $ex){\n $errorObj = new ErrorObj();\n\n $errorObj->params = \"offset\";\n $errorObj->msg = \"offset int required\";\n\n array_push($this->errorManager->errorObj,$errorObj);\n return false;\n }\n\n }", "public function timestampsTz($precision = 0)\n {\n $this->timestamp(Config::get('modelling.model.timestamps.created_at'), $precision)->nullable();\n $this->timestamp(Config::get('modelling.model.timestamps.updated_at'), $precision)->nullable();\n }", "function getOffset() {\n\t\treturn ((float) $this->_offset) / 3600.0;\n\t}", "protected function setReadTimeStamp($value)\n\t{\n\t\t$this->ReadTimeStamp = strToDatetime($value);\n\t}", "private function setTimeZone() {\n $companySettings = Store::get('company_settings');\n $timezone = $companySettings->time_zone;\n if ($timezone) {\n\n $dt = new \\DateTime('now', new \\DateTimeZone($timezone));\n $abbreviation = $dt->format('T');\n\n config(['app.timezone' => $timezone]);\n view()->share('time_zone', [\n 'name' => $timezone,\n 'abbr' => $abbreviation\n ]);\n\n $offsetToFormat = new \\DateTime('now', new \\DateTimeZone($timezone));\n $timezoneOffset = $offsetToFormat->format('P');\n\n DB::statement(\"SET time_zone = '\".$timezoneOffset.\"'\");\n }\n }", "public function setTimestamp($timestamp)\r\n {\r\n if (!is_null($timestamp))\r\n {\r\n $timestamp = (int) $timestamp;\r\n }\r\n $this->clearCachedValueIf($this->_timestamp != $timestamp);\r\n $this->_timestamp = $timestamp;\r\n }", "public function offsetSet($offset, $value) \n {\n //argument 1 must be scalar, null or bool\n Argument::i()->test(1, 'scalar', 'null', 'bool');\n\n $this->set($offset, $value, strtotime('+10 years'));\n }", "public function setTstamp($tstamp) {\n\t\t$this->tstamp = $tstamp;\n\t}", "function setAuthTimestamp($AuthTimestamp)\n {\n \t$this->_authTimestamp =$AuthTimestamp;\n }", "function mOFFSET(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OFFSET;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:191:3: ( 'offset' ) \n // Tokenizer11.g:192:3: 'offset' \n {\n $this->matchString(\"offset\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function set($offset, $value = null);", "public function setTimestampValues($event)\r\n\t{\r\n\t\tif($this->owner instanceof ActiveRecord)\r\n\t\t{\r\n\t\t\t$now = $this->getValue($event);\r\n\t\t\tif($this->owner->getIsNewRecord())\r\n\t\t\t{\r\n\t\t\t\tif($this->owner->hasAttribute($this->createdAtAttribute)) $this->owner->setAttribute($this->createdAtAttribute, $now);\r\n\t\t\t}\r\n\t\t\tif($this->owner->hasAttribute($this->updatedAtAttribute)) $this->owner->setAttribute($this->updatedAtAttribute, $now);\r\n\t\t}\r\n\t}", "public function renderAppliesCorrectTimestampConversionDataProvider() {}", "public function setUpdatedAt($timestamp);", "public function setTimeZone($offsetValue)\r\n\t\t{\r\n\t\t\t\t$serverTimeZoneOffset = (date('O') / 100 * 60 * 60);\r\n\t\t\t\t$clientTimeZoneOffset = $offsetValue;\r\n\t\t\t\t$serverTime = time();\r\n\t\t\t\t$serverClientTimeDifference = $clientTimeZoneOffset - $serverTimeZoneOffset;\r\n\t\t\t\t$finalHourDifference = $serverClientTimeDifference / (60 * 60);\r\n\t\t\t\t$this->set('timeZone', $finalHourDifference);\r\n\t\t}", "function getTime($offset = 0, $format = 'H:i:s')\n {\n return date($format, strtotime($offset.' minutes'));\n }", "function formatTimestamp($time, $format = \"l\", $timeoffset = null)\n {\n global $xoopsConfig, $xoopsUser;\n\n $format_copy = $format;\n $format = strtolower($format);\n\n if ($format == 'rss' || $format == 'r') {\n return parent::formatTimestamp($time, \"rss\", $timeoffset);\n }\n\n if (($format == 'elapse' || $format == 'e') && $time < time()) {\n return XoopsLocaleJalali::Convertnumber2farsi(parent::formatTimestamp($time, \"elapse\", $timeoffset));\n }\n // disable user timezone calculation and use default timezone,\n // for cache consideration\n if ($timeoffset === null) {\n $timeoffset = ($xoopsConfig['default_TZ'] == '') ? '0.0' : $xoopsConfig['default_TZ'];\n }\n $usertimestamp = xoops_getUserTimestamp($time, $timeoffset);\n switch ($format) {\n case 's':\n $datestring = _SHORTDATESTRING;\n break;\n\n case 'm':\n $datestring = _MEDIUMDATESTRING;\n break;\n\n case 'mysql':\n $datestring = 'Y-m-d H:i:s';\n break;\n\n case 'l':\n $datestring = _DATESTRING;\n break;\n\n case 'c':\n case 'custom':\n static $current_timestamp, $today_timestamp, $monthy_timestamp;\n if (!isset($current_timestamp)) {\n $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset);\n }\n if (!isset($today_timestamp)) {\n $today_timestamp = mktime(0, 0, 0, date('m', $current_timestamp), date('d', $current_timestamp), date('Y', $current_timestamp));\n }\n\n if (abs($elapse_today = $usertimestamp - $today_timestamp) < 24 * 60 * 60) {\n $datestring = ($elapse_today > 0) ? _TODAY : _YESTERDAY;\n } else {\n if (!isset($monthy_timestamp)) {\n $monthy_timestamp[0] = mktime(0, 0, 0, 0, 0, date('Y', $current_timestamp));\n $monthy_timestamp[1] = mktime(0, 0, 0, 0, 0, date('Y', $current_timestamp) + 1);\n }\n if ($usertimestamp >= $monthy_timestamp[0] && $usertimestamp < $monthy_timestamp[1]) {\n $datestring = _MONTHDAY;\n } else {\n $datestring = _YEARMONTHDAY;\n }\n }\n break;\n\n default:\n if ($format != '') {\n $datestring = $format_copy;\n } else {\n $datestring = _DATESTRING;\n }\n break;\n }\n\n\t// Start hacked by irmtfan for show hegira date in persian and other languages www.jadoogaran.org\n\tif (_JDF_USE_HEGIRADATE && $format != 'mysql' ){\n\t return XoopsLocaleJalali::jdate($datestring,$usertimestamp);\n\t} else {\n\t\treturn ucfirst(date($datestring,$usertimestamp));\n }\n\t// End hacked by irmtfan for show hegira date in persian and other languages www.jadoogaran.org\n\t}", "#[ReturnTypeWillChange]\n public function setTimestamp($timestamp)\n {\n $time = date('Y-m-d H:i:s', $timestamp);\n\n return self::parse($time, $this->timezone, $this->locale);\n }", "public function setTimeStamp($value)\n\t{\n\t\tif($value===null || (is_string($value) && trim($value)===''))\n\t\t\t$this->setText('');\n\t\telse\n\t\t{\n\t\t\t$date = TPropertyValue::ensureFloat($value);\n\t\t\t$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());\n\t\t\t$this->setText($formatter->format($date));\n\t\t}\n\t}", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "public function reset_offset() {\n\t\t$this->_offset = NULL;\n\n\t\treturn $this;\n\t}", "public function setLeaderLineOffset($offset) {}", "private function _mktime(){\n\t\t$this->_timestamp = self::mktime($this->_month, $this->_day, $this->_year);\n\t}", "public function timestampableOnPreUpdate()\n {\n return $this->fulfillUTCNow();\n }", "public function setTimezone($_timezone);", "public function setStartDateTime($timestamp);", "public function get_start_offset()\n {\n }", "private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }", "public function writeTimestamp($v)\n {\n $this->writeLongLong($v);\n }", "public function setTimestamp($value)\n {\n return $this->set('Timestamp', $value);\n }", "public function setTimestamp($v = null)\n { return $this->set('timestamp', $v ? $v : JSONMessage::timestamp()); }" ]
[ "0.69863075", "0.6933939", "0.6656472", "0.64588314", "0.61438996", "0.60986936", "0.607311", "0.5939923", "0.59325695", "0.59277666", "0.5917974", "0.5884528", "0.58098793", "0.5803052", "0.57961464", "0.5787568", "0.577886", "0.5756603", "0.5752351", "0.5752351", "0.56181055", "0.5617138", "0.5588397", "0.5584448", "0.5582447", "0.55471164", "0.5526018", "0.5522646", "0.5516601", "0.5513455", "0.550413", "0.549425", "0.5480237", "0.5462021", "0.539228", "0.5376197", "0.53754485", "0.53643256", "0.53619474", "0.53211963", "0.53210115", "0.53179926", "0.5287525", "0.527501", "0.526688", "0.52425724", "0.52365726", "0.5228327", "0.5224396", "0.522054", "0.5211279", "0.5211279", "0.5205453", "0.51927334", "0.51868856", "0.518415", "0.5182089", "0.5159725", "0.51509994", "0.51457304", "0.513731", "0.51326495", "0.5129563", "0.5114356", "0.5113925", "0.50969195", "0.5093455", "0.5085325", "0.508223", "0.5076427", "0.5075511", "0.5071356", "0.5058745", "0.5057412", "0.5053679", "0.504517", "0.50404817", "0.503069", "0.5029602", "0.50098485", "0.49954143", "0.49904156", "0.49853513", "0.49808463", "0.49805984", "0.4980351", "0.49782676", "0.49781817", "0.4974321", "0.49715963", "0.49614516", "0.49598208", "0.49585664", "0.4954759", "0.4944226", "0.4938238", "0.49303758", "0.49284023", "0.49241337", "0.4924044" ]
0.70902646
0
Get timestamp offset to consider for output
public static function getTimestampOffset() { return self::$settings[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTimeOffset()\n {\n return $this->_props['TimeOffset'];\n }", "function getOffset(){\r\n $t=time()+microtime()-$this->api->start_time;\r\n $res=$t-$this->offset;\r\n $this->offset=$t;\r\n return $res;\r\n }", "function getOffset() {\n\t\treturn ((float) $this->_offset) / 3600.0;\n\t}", "function get_time_offset()\n {\n \t$r = 0;\n \t\n \t$r = ( (isset($this->member['time_offset']) AND $this->member['time_offset'] != \"\") ? $this->member['time_offset'] : $this->vars['time_offset'] ) * 3600;\n\t\t\t\n\t\tif ( $this->vars['time_adjust'] )\n\t\t{\n\t\t\t$r += ($this->vars['time_adjust'] * 60);\n\t\t}\n\t\t\n\t\tif ( isset($this->member['dst_in_use']) AND $this->member['dst_in_use'] )\n\t\t{\n\t\t\t$r += 3600;\n\t\t}\n \t\n \treturn $r;\n }", "public function getUtcOffset(){\n $datetime = new DateTime('now', 'UTC');\n return parent::getOffset($datetime);\n }", "private function get_offset() {\n\t\treturn ( (time() - $this->skew) % ($this->lifetime + $this->skew) );\n\t}", "private function offsetTimestampForWordPressTimezone( $timestamp )\n {\n return $timestamp;\n \n // Get timezone offset in seconds for configured timezone.\n $offset = timezone_offset_get(\n new \\DateTimezone( get_option('timezone_string') ),\n new \\DateTime( date(\"c\", $timestamp ))\n );\n\n return $timestamp + $offset;\n }", "public function getTimezoneOffset()\n\t{\n\t\t$user_tz = date_default_timezone_get();\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\tif ($viewer -> getIdentity())\n\t\t{\n\t\t\t$user_tz = $viewer -> timezone;\n\t\t}\n\t\t//user time zone\n\t\tdate_default_timezone_set($user_tz);\n\n\t\t$t1 = strtotime('2010-10-10 00:00:00');\n\t\tdate_default_timezone_set('UTC');\n\t\t$t2 = strtotime('2010-10-10 00:00:00');\n\t\treturn (int)(($t2 - $t1) / 3600);\n\t}", "public function getOffset() {}", "public function getOffset() {}", "public function getOffset() {}", "function getUTCOffset($value, $timestamp = null)\n {\n if ($value === null) {\n return 0;\n } else {\n list($sign, $hours, $minutes) = sscanf($value, '%1s%2d%2d');\n return ($sign == '+' ? 1 : -1) * ($hours * 60 * 60) + ($minutes * 60);\n }\n }", "function get_system_gmt_offset() {\n static $offset = null;\n\n if($offset === null) {\n $timezone_offset = ConfigOptions::getValue('time_timezone');\n $dst = ConfigOptions::getValue('time_dst');\n\n $offset = $dst ? $timezone_offset + 3600 : $timezone_offset;\n } // if\n\n return $offset;\n }", "public function get_start_offset()\n {\n }", "function getOffset() ;", "public function offset()\n {\n if ($this->timezone) {\n return (new DateTime(Chronos::now()->format('Y-m-d H:i:s'), new DateTimeZone($this->timezone)))->getOffset() / 60 / 60;\n }\n\n return 0;\n }", "function date_tz_offset($timestamp, $from_tz, $to_tz='') {\n\tif($to_tz == '') $to_tz = $GLOBALS['env']['timezone'];\n\n\tif(function_exists('date_offset_get')) {\n\t\t$from_dtz = new DateTimeZone($from_tz);\n\t\t$to_dtz = new DateTimeZone($to_tz);\n\t\t$from_dt = new DateTime(app_date('Y-m-d H:i', $timestamp), $from_dtz);\n\t\t$to_dt = new DateTime('now', $to_dtz);\n\t\t$offset = $from_dtz->getOffset($from_dt) - $to_dtz->getOffset($to_dt);\n\t} else { // PHP version 4\n\t\t$timezone_offsets = array (\n\t\t\t'-43200' => ' Etc/GMT+12',\n\t\t\t'-39600' => ' Etc/GMT+11, MIT, Pacific/Apia, Pacific/Midway, Pacific/Niue, Pacific/Pago Pago, Pacific/Samoa, US/Samoa',\n\t\t\t'-36000' => ' -America/Adak, -America/Atka, Etc/GMT+10, HST, Pacific/Fakaofo, Pacific/Honolulu, Pacific/Johnston, Pacific/Rarotonga, Pacific/Tahiti, SystemV/HST10, -US/Aleutian, US/Hawaii',\n\t\t\t'-34200' => ' Pacific/Marquesas',\n\t\t\t'-32400' => ' -AST, -America/Anchorage, -America/Juneau, -America/Nome, -America/Yakutat, Etc/GMT+9, Pacific/Gambier, SystemV/YST9, -SystemV/YST9YDT, -US/Alaska',\n\t\t\t'-28800' => ' -America/Dawson, -America/Ensenada, -America/Los Angeles, -America/Tijuana, -America/Vancouver, -America/Whitehorse, -Canada/Pacific, -Canada/Yukon, Etc/GMT+8, -Mexico/BajaNorte, -PST, -PST8PDT, Pacific/Pitcairn, SystemV/PST8, -SystemV/PST8PDT, -US/Pacific, -US/Pacific-New',\n\t\t\t'-25200' => ' -America/Boise, -America/Cambridge Bay, -America/Chihuahua, America/Dawson Creek, -America/Denver, -America/Edmonton, America/Hermosillo, -America/Inuvik, -America/Mazatlan, America/Phoenix, -America/Shiprock, -America/Yellowknife, -Canada/Mountain, Etc/GMT+7, -MST, -MST7MDT, -Mexico/BajaSur, -Navajo, PNT, SystemV/MST7, -SystemV/MST7MDT, US/Arizona, -US/Mountain',\n\t\t\t'-21600' => ' America/Belize, -America/Cancun, -America/Chicago, America/Costa Rica, America/El Salvador, America/Guatemala, America/Managua, -America/Menominee, -America/Merida, America/Mexico City, -America/Monterrey, -America/North Dakota/Center, -America/Rainy River, -America/Rankin Inlet, America/Regina, America/Swift Current, America/Tegucigalpa, -America/Winnipeg, -CST, -CST6CDT, -Canada/Central, Canada/East-Saskatchewan, Canada/Saskatchewan, -Chile/EasterIsland, Etc/GMT+6, Mexico/General, -Pacific/Easter, Pacific/Galapagos, SystemV/CST6, -SystemV/CST6CDT, -US/Central',\n\t\t\t'-18000' => ' America/Bogota, America/Cayman, -America/Detroit, America/Eirunepe, America/Fort Wayne, -America/Grand Turk, America/Guayaquil, -America/Havana, America/Indiana/Indianapolis, America/Indiana/Knox, America/Indiana/Marengo, America/Indiana/Vevay, America/Indianapolis, -America/Iqaluit, America/Jamaica, -America/Kentucky/Louisville, -America/Kentucky/Monticello, America/Knox IN, America/Lima, -America/Louisville, -America/Montreal, -America/Nassau, -America/New York, -America/Nipigon, America/Panama, -America/Pangnirtung, America/Port-au-Prince, America/Porto Acre, America/Rio Branco, -America/Thunder Bay, Brazil/Acre, -Canada/Eastern, -Cuba, -EST, -EST5EDT, Etc/GMT+5, IET, Jamaica, SystemV/EST5, -SystemV/EST5EDT, US/East-Indiana, -US/Eastern, US/Indiana-Starke, -US/Michigan',\n\t\t\t'-14400' => ' America/Anguilla, America/Antigua, America/Aruba, -America/Asuncion, America/Barbados, America/Boa Vista, America/Caracas, -America/Cuiaba, America/Curacao, America/Dominica, -America/Glace Bay, -America/Goose Bay, America/Grenada, America/Guadeloupe, America/Guyana, -America/Halifax, America/La Paz, America/Manaus, America/Martinique, America/Montserrat, America/Port of Spain, America/Porto Velho, America/Puerto Rico, -America/Santiago, America/Santo Domingo, America/St Kitts, America/St Lucia, America/St Thomas, America/St Vincent, America/Thule, America/Tortola, America/Virgin, -Antarctica/Palmer, -Atlantic/Bermuda, -Atlantic/Stanley, Brazil/West, -Canada/Atlantic, -Chile/Continental, Etc/GMT+4, PRT, SystemV/AST4, -SystemV/AST4ADT',\n\t\t\t'-12600' => ' -America/St Johns, -CNT, -Canada/Newfoundland',\n\t\t\t'-10800' => ' AGT, -America/Araguaina, America/Belem, America/Buenos Aires, America/Catamarca, America/Cayenne, America/Cordoba, -America/Fortaleza, -America/Godthab, America/Jujuy, -America/Maceio, America/Mendoza, -America/Miquelon, America/Montevideo, America/Paramaribo, -America/Recife, America/Rosario, -America/Sao Paulo, -BET, -Brazil/East, Etc/GMT+3',\n\t\t\t '-7200' => ' America/Noronha, Atlantic/South Georgia, Brazil/DeNoronha, Etc/GMT+2',\n\t\t\t '-3600' => ' -America/Scoresbysund, -Atlantic/Azores, Atlantic/Cape Verde, Etc/GMT+1',\n\t\t\t '0' => ' Africa/Abidjan, Africa/Accra, Africa/Bamako, Africa/Banjul, Africa/Bissau, Africa/Casablanca, Africa/Conakry, Africa/Dakar, Africa/El Aaiun, Africa/Freetown, Africa/Lome, Africa/Monrovia, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao Tome, Africa/Timbuktu, America/Danmarkshavn, -Atlantic/Canary, -Atlantic/Faeroe, -Atlantic/Madeira, Atlantic/Reykjavik, Atlantic/St Helena, -Eire, Etc/GMT, Etc/GMT+0, Etc/GMT-0, Etc/GMT0, Etc/Greenwich, Etc/UCT, Etc/UTC, Etc/Universal, Etc/Zulu, -Europe/Belfast, -Europe/Dublin, -Europe/Lisbon, -Europe/London, -GB, -GB-Eire, GMT, GMT0, Greenwich, Iceland, -Portugal, UCT, UTC, Universal, -WET, Zulu',\n\t\t\t '3600' => ' Africa/Algiers, Africa/Bangui, Africa/Brazzaville, -Africa/Ceuta, Africa/Douala, Africa/Kinshasa, Africa/Lagos, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Ndjamena, Africa/Niamey, Africa/Porto-Novo, Africa/Tunis, -Africa/Windhoek, -Arctic/Longyearbyen, -Atlantic/Jan Mayen, -CET, -ECT, Etc/GMT-1, -Europe/Amsterdam, -Europe/Andorra, -Europe/Belgrade, -Europe/Berlin, -Europe/Bratislava, -Europe/Brussels, -Europe/Budapest, -Europe/Copenhagen, -Europe/Gibraltar, -Europe/Ljubljana, -Europe/Luxembourg, -Europe/Madrid, -Europe/Malta, -Europe/Monaco, -Europe/Oslo, -Europe/Paris, -Europe/Prague, -Europe/Rome, -Europe/San Marino, -Europe/Sarajevo, -Europe/Skopje, -Europe/Stockholm, -Europe/Tirane, -Europe/Vaduz, -Europe/Vatican, -Europe/Vienna, -Europe/Warsaw, -Europe/Zagreb, -Europe/Zurich, -MET, -Poland',\n\t\t\t '7200' => ' -ART, Africa/Blantyre, Africa/Bujumbura, -Africa/Cairo, Africa/Gaborone, Africa/Harare, Africa/Johannesburg, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka, Africa/Maputo, Africa/Maseru, Africa/Mbabane, Africa/Tripoli, -Asia/Amman, -Asia/Beirut, -Asia/Damascus, -Asia/Gaza, -Asia/Istanbul, -Asia/Jerusalem, -Asia/Nicosia, -Asia/Tel Aviv, CAT, -EET, -Egypt, Etc/GMT-2, -Europe/Athens, -Europe/Bucharest, -Europe/Chisinau, -Europe/Helsinki, -Europe/Istanbul, -Europe/Kaliningrad, -Europe/Kiev, -Europe/Minsk, -Europe/Nicosia, -Europe/Riga, -Europe/Simferopol, -Europe/Sofia, Europe/Tallinn, -Europe/Tiraspol, -Europe/Uzhgorod, Europe/Vilnius, -Europe/Zaporozhye, -Israel, Libya, -Turkey',\n\t\t\t '10800' => ' Africa/Addis Ababa, Africa/Asmera, Africa/Dar es Salaam, Africa/Djibouti, Africa/Kampala, Africa/Khartoum, Africa/Mogadishu, Africa/Nairobi, Antarctica/Syowa, Asia/Aden, -Asia/Baghdad, Asia/Bahrain, Asia/Kuwait, Asia/Qatar, Asia/Riyadh, EAT, Etc/GMT-3, -Europe/Moscow, Indian/Antananarivo, Indian/Comoro, Indian/Mayotte, -W-SU',\n\t\t\t '11224' => ' Asia/Riyadh87, Asia/Riyadh88, Asia/Riyadh89, Mideast/Riyadh87, Mideast/Riyadh88, Mideast/Riyadh89',\n\t\t\t '12600' => ' -Asia/Tehran, -Iran',\n\t\t\t '14400' => ' -Asia/Aqtau, -Asia/Baku, Asia/Dubai, Asia/Muscat, -Asia/Tbilisi, -Asia/Yerevan, Etc/GMT-4, -Europe/Samara, Indian/Mahe, Indian/Mauritius, Indian/Reunion, -NET',\n\t\t\t '16200' => ' Asia/Kabul',\n\t\t\t '18000' => ' -Asia/Aqtobe, Asia/Ashgabat, Asia/Ashkhabad, -Asia/Bishkek, Asia/Dushanbe, Asia/Karachi, Asia/Samarkand, Asia/Tashkent, -Asia/Yekaterinburg, Etc/GMT-5, Indian/Kerguelen, Indian/Maldives, PLT',\n\t\t\t '19800' => ' Asia/Calcutta, IST',\n\t\t\t '20700' => ' Asia/Katmandu',\n\t\t\t '21600' => ' Antarctica/Mawson, Antarctica/Vostok, -Asia/Almaty, Asia/Colombo, Asia/Dacca, Asia/Dhaka, -Asia/Novosibirsk, -Asia/Omsk, Asia/Thimbu, Asia/Thimphu, BST, Etc/GMT-6, Indian/Chagos',\n\t\t\t '23400' => ' Asia/Rangoon, Indian/Cocos',\n\t\t\t '25200' => ' Antarctica/Davis, Asia/Bangkok, Asia/Hovd, Asia/Jakarta, -Asia/Krasnoyarsk, Asia/Phnom Penh, Asia/Pontianak, Asia/Saigon, Asia/Vientiane, Etc/GMT-7, Indian/Christmas, VST',\n\t\t\t '28800' => ' Antarctica/Casey, Asia/Brunei, Asia/Chongqing, Asia/Chungking, Asia/Harbin, Asia/Hong Kong, -Asia/Irkutsk, Asia/Kashgar, Asia/Kuala Lumpur, Asia/Kuching, Asia/Macao, Asia/Manila, Asia/Shanghai, Asia/Singapore, Asia/Taipei, Asia/Ujung Pandang, Asia/Ulaanbaatar, Asia/Ulan Bator, Asia/Urumqi, Australia/Perth, Australia/West, CTT, Etc/GMT-8, Hongkong, PRC, Singapore',\n\t\t\t '32400' => ' Asia/Choibalsan, Asia/Dili, Asia/Jayapura, Asia/Pyongyang, Asia/Seoul, Asia/Tokyo, -Asia/Yakutsk, Etc/GMT-9, JST, Japan, Pacific/Palau, ROK',\n\t\t\t '34200' => ' ACT, -Australia/Adelaide, -Australia/Broken Hill, Australia/Darwin, Australia/North, -Australia/South, -Australia/Yancowinna',\n\t\t\t '36000' => ' -AET, Antarctica/DumontDUrville, -Asia/Sakhalin, -Asia/Vladivostok, -Australia/ACT, Australia/Brisbane, -Australia/Canberra, -Australia/Hobart, Australia/Lindeman, -Australia/Melbourne, -Australia/NSW, Australia/Queensland, -Australia/Sydney, -Australia/Tasmania, -Australia/Victoria, Etc/GMT-10, Pacific/Guam, Pacific/Port Moresby, Pacific/Saipan, Pacific/Truk, Pacific/Yap',\n\t\t\t '37800' => ' -Australia/LHI, -Australia/Lord Howe',\n\t\t\t '39600' => ' -Asia/Magadan, Etc/GMT-11, Pacific/Efate, Pacific/Guadalcanal, Pacific/Kosrae, Pacific/Noumea, Pacific/Ponape, SST',\n\t\t\t '41400' => ' Pacific/Norfolk',\n\t\t\t '43200' => ' -Antarctica/McMurdo, -Antarctica/South Pole, -Asia/Anadyr, -Asia/Kamchatka, Etc/GMT-12, Kwajalein, -NST, -NZ, -Pacific/Auckland, Pacific/Fiji, Pacific/Funafuti, Pacific/Kwajalein, Pacific/Majuro, Pacific/Nauru, Pacific/Tarawa, Pacific/Wake, Pacific/Wallis',\n\t\t\t '45900' => ' -NZ-CHAT, -Pacific/Chatham',\n\t\t\t '46800' => ' Etc/GMT-13, Pacific/Enderbury, Pacific/Tongatapu',\n\t\t\t '50400' => ' Etc/GMT-14, Pacific/Kiritimati, null, localize/timezone'\n\t\t);\n\n\t\t$from_offset = 0;\n\t\t$to_offset = 0;\n\t\tforeach($timezone_offsets as $offset => $zones) {\n\n\t\t\tif($from_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($from_tz)) !== false) $from_offset = $offset;\n\t\t\t}\n\n\t\t\tif($to_tz != '') {\n\t\t\t\tif(strpos(strtolower($zones), strtolower($to_tz)) !== false) $to_offset = $offset;\n\t\t\t}\n\t\t}\n\n\t\t$old_tz = @ini_get('date.timezone');\n\t\tif($old_tz == '') $old_tz = $GLOBALS['env']['timezone'];\n\t\t@ini_set('date.timezone', $from_tz);\n\t\t@putenv('TZ='.$from_tz);\n\n\t\tif(app_date('I', $timestamp)) $from_offset += 3600;\n\n\t\t@ini_set('date.timezone', $old_tz);\n\t\t@putenv('TZ='.$old_tz);\n\n\t\t$offset = ($from_offset - $to_offset);\n\t}\n\n\treturn $offset;\n}", "private function getTimeZoneOffset()\n {\n if (null === $this->offset) {\n $time = new \\DateTime('now', new \\DateTimeZone($this->localeSettings->getTimeZone()));\n $this->offset = $time->format('P');\n }\n\n return $this->offset;\n }", "public function getStartTimeOffset()\n {\n return $this->start_time_offset;\n }", "public function getUtcOffset()\n {\n return $this->utcOffset;\n }", "function getTimezoneOffset() {\n\t\tglobal $wpdb;\n\t\t//calculate mysql timezone offset by converting MySQL's \n\t\t// NOW() to a timestamp and subtracting UTC current time\n\t\t// from it. Note: conversion to timestamp is affected by\n\t\t// PHP TZ setting, so remove that offset from calculation\n\t\t$tzoffset=false;\n\t\t$mysql_now = $wpdb->get_var(\"SELECT NOW() AS mysql_now\");\n\t\t$now = ((int)(time()/1800))*1800; //truncate to 1/2 hour\n\t\tif ($mysql_now!=\"\") {\n\t\t\tif (function_exists('date_timestamp_get')) {\n\t\t\t\t$mysql_dt = new DateTime($mysql_now);\n\t\t\t\t$mysql_time = $mysql_dt->getTimestamp();\n\t\t\t\t$adjust = $mysql_dt->getOffset();\n\t\t\t} else {\n\t\t\t\t$mysql_time = strtotime($mysql_now);\n\t\t\t\t$adjust = (int)date('Z');\n\t\t\t}\n\t\t\t$tzoffset = ((int)($mysql_time/1800))*1800 - $now;\n\t\t\tif (is_numeric($adjust)) $tzoffset += $adjust;\n\t\t}\n\t\treturn $tzoffset;\n\t}", "public function getOffset() {\n return $this->offset;\n }", "function get_display_offset( $pUser = FALSE ) {\n\t\treturn $this->mServerTimestamp->get_display_offset( $pUser );\n\t}", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "public function getOffset()\n {\n return $this->offset;\n }", "protected function interval_offset() {\n\t\t// Run two minutes later.\n\t\treturn 120;\n\t}", "protected static function _offset( $ts, $dir=1 ) { return $ts + ( $dir * get_option( 'gmt_offset', 0 ) * HOUR_IN_SECONDS ); }", "public function get_offset()\n {\n }", "public function getAttributes_price_factor_onetime_offset() {\n\t\treturn $this->attributes_price_factor_onetime_offset;\n\t}", "public function action_getTimeStamp()\n\t{\n\t\t$offset_sec = date(\"Z\"); // offset in seconds depends on timezone\n\t\t$curtime = time() + $offset_sec; // current time depends on timezone\n\t\t$this->response->body(json_encode(array(\"unix_timestamp\" => time(),\"offset\" => $offset_sec,\"curtime\" => $curtime)));\n\t}", "public function getOffset() { return $this->_offset; }", "public function getDSTOffset();", "abstract public function getTstamp();", "protected static function _offset_str() {\n // get the offset\n $offset = get_option( 'gmt_offset', 0 );\n\n // get the sign of the offset\n $sign = $offset < 0 ? '-' : '+';\n\n // get the suffix, either :00 or :30\n $offset = abs( $offset );\n $floored = floor( $offset );\n $suffix = $offset == $floored ? ':00' : ':30';\n\n return sprintf( '%s%02s%s', $sign, $offset, $suffix );\n }", "public function getOffset() {\n return $this->offset;\n }", "private function getGMTOffset() {\n $utcOffset = get_option('gmt_offset', null);\n return $utcOffset != null ? ($utcOffset * 60 * 60) : 0;\n }", "function get_offset_time($offset_str, $factor=1)\n {\n if (preg_match('/^([0-9]+)\\s*([smhdw])/i', $offset_str, $regs))\n {\n $amount = (int)$regs[1];\n $unit = strtolower($regs[2]);\n }\n else\n {\n $amount = (int)$offset_str;\n $unit = 's';\n }\n \n $ts = mktime();\n switch ($unit)\n {\n case 'w':\n $amount *= 7;\n case 'd':\n $amount *= 24;\n case 'h':\n $amount *= 60;\n case 'm':\n $amount *= 60;\n case 's':\n $ts += $amount * $factor;\n }\n\n return $ts;\n}", "function getOffset() {\n return $this->offset;\n }", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "function formatTimezoneOffset($offset=false) {\n\t\t$tzoffset = false;\n\t\tif (preg_match('/^[\\-+]?[0-9\\.]+$/',$offset)>0) { //must be a number\n\t\t\t//convert seconds to hours:min\n\t\t\t$n=false;\n\t\t\tif ($offset > 12 || $offset < -12) {\n\t\t\t\t$noffset = $offset/3600;\n\t\t\t} else {\n\t\t\t\t$noffset = $offset;\n\t\t\t}\n\t\t\t$n = strpos($noffset,'.');\n\t\t\tif ($n !== false) {\n\t\t\t\t$offset_hrs = substr($noffset,0,$n);\n\t\t\t\t$offset_min = (int)substr($noffset,$n+1)*6;\n\t\t\t} else {\n\t\t\t\t$offset_hrs = $noffset;\n\t\t\t\t$offset_min = 0;\n\t\t\t}\n\t\t\tif ($offset < 0) {\n\t\t\t\t$tzoffset = sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t}\n\t\t} elseif (preg_match('/^([\\-+])?(\\d{1,2})?\\:(\\d{2})/',$offset,$match)>0) {\n\t\t\tif (empty($match[2])) $match[2] = \"0\";\n\t\t\tif (!empty($match[1]) && $match[1]==\"-\") {\n\t\t\t\t$tzoffset = \"-\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t}\n\t\t}\n\t\treturn $tzoffset;\n\t}", "function readTimestamp(): int;", "public function getTimestamp()\n {\n if (empty($this->timezone)) {\n $this->timezone = 'UTC';\n }\n $utcOffset = self::extractUtcOffset($this->timezone);\n if ($utcOffset !== false) {\n return (int)($this->timestamp - $utcOffset * 3600);\n }\n // The following code seems clunky - I thought the DateTime php class would allow to return timestamps\n // after applying the timezone offset. Instead, the underlying timestamp is not changed.\n // I decided to get the date without the timezone information, and create the timestamp from the truncated string.\n // Unit tests pass (@see Date.test.php) but I'm pretty sure this is not the right way to do it\n date_default_timezone_set($this->timezone);\n $dtzone = timezone_open('UTC');\n $time = date('r', $this->timestamp);\n $dtime = date_create($time);\n\n date_timezone_set($dtime, $dtzone);\n $dateWithTimezone = date_format($dtime, 'r');\n $dateWithoutTimezone = substr($dateWithTimezone, 0, -6);\n $timestamp = strtotime($dateWithoutTimezone);\n date_default_timezone_set('UTC');\n\n return (int) $timestamp;\n }", "private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }", "function wp_timezone_override_offset()\n {\n }", "public function getGMTOffset();", "function utc2local($timestamp = null) {\n\t\tif(!$timestamp) {\n\t\t\t$timestamp = time();\n\t\t}\n\n\t\t$f3 = \\Base::instance();\n\n\t\tif($f3->exists(\"site.timeoffset\")) {\n\t\t\t$offset = $f3->get(\"site.timeoffset\");\n\t\t} else {\n\t\t\t$tz = $f3->get(\"site.timezone\");\n\t\t\t$dtzLocal = new \\DateTimeZone($tz);\n\t\t\t$dtLocal = new \\DateTime(\"now\", $dtzLocal);\n\t\t\t$offset = $dtzLocal->getOffset($dtLocal);\n\t\t\t$f3->set(\"site.timeoffset\", $offset);\n\t\t}\n\n\t\treturn $timestamp + $offset;\n\t}", "static public function getSystemOffset() {\n\t\t\treturn self::getInstance()->intSystemOffset;\n\t\t}", "public function getPresentationTimestamp() {}", "public function getEventTimestamp();", "function date_local_to_sys($timestamp, $local_tz='') {\n\tif($local_tz == '') $local_tz = @$_SESSION['cms']['user']['timezone'];\n\tif($local_tz == '') return $timestamp;\n\n\t$offset = date_tz_offset($timestamp, $local_tz);\n\treturn $timestamp - $offset;\n}", "public function getOffset(): int\n {\n return $this->offset;\n }", "function getTime($offset = 0, $format = 'H:i:s')\n {\n return date($format, strtotime($offset.' minutes'));\n }", "public static function setTimeCorrectionOffset($offset = 0)\n\t{\n\t\tif ($offset == 0)\n\t\t{\n\t\t\t$rest = new S3Request('HEAD');\n\t\t\t$rest = $rest->getResponse();\n\t\t\t$awstime = $rest->headers['date'];\n\t\t\t$systime = time();\n\t\t\t$offset = $systime > $awstime ? -($systime - $awstime) : ($awstime - $systime);\n\t\t}\n\t\tself::$__timeOffset = $offset;\n\t}", "public function get_offset() {\n\t\treturn ( $this->step - 1 ) * $this->per_step;\n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "function getTimeZoneOffset($timezone = 'GMT') {\r\r\n \r\r\n /** TimeZone Information */\r\r\n $_WorldTimeZoneInformation = array (\r\r\n \r\r\n 'Australian Central Daylight Time' => array (\r\r\n 'offset' => '+10.30', \r\r\n 'timezone' => 'ACDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ashmore and Cartier Islands Time' => array (\r\r\n 'offset' => '+8.00', \r\r\n 'timezone' => 'ACIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Standard Time' => array (\r\r\n 'offset' => '+9.30', \r\r\n 'timezone' => 'ACST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Acre Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'ACT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Western Daylight Time' => array (\r\r\n 'offset' => '+9.45', \r\r\n 'timezone' => 'ACWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Central Western Standard Time' => array (\r\r\n 'offset' => '+8.45', \r\r\n 'timezone' => 'ACWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Arabia Daylight Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'ADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Atlantic Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Eastern Daylight Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'AEDT',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Australian Eastern Standard Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'AEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Afghanistan Time' => array (\r\r\n 'offset' => '+4.30', \r\r\n 'timezone' => 'AFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Alaska Daylight Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'AKDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Alaska Standard Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'AKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Armenia Daylight Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'AMDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Armenia Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'AMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Anadyr’ Summer Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'ANAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Anadyr’ Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'ANAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Apo Island Time' => array (\r\r\n 'offset' => '+8.15', \r\r\n 'timezone' => 'APO',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Argentina Daylight Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'ARDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Argentina Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ART',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Al Manamah Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Arabia Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Arabic Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Atlantic Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'AST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Western Daylight Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'AWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Australian Western Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'AWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azores Daylight Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'AZODT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azores Standard Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'AZOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azerbaijan Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'AZST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Azerbaijan Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'AZT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Baker Island Time' => array (\r\r\n 'offset' => '-12', \r\r\n 'timezone' => 'BIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bangladesh Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Eastern Standard Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'BEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brunei Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'BDT',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'British Indian Ocean Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BIOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bolivia Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'BOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazilia Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'BRST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazilia Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'BRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'British Summer Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'BST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Bhutan Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'BTT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Western Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'BWDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Brazil Western Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'BWST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chinese Antarctic Standard Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'CAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Africa Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'CAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cocos Islands Time' => array (\r\r\n 'offset' => '+6.30', \r\r\n 'timezone' => 'CCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Daylight Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'CDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Europe Summer Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'CEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Europe Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'CET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Greenland Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'CGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Greenland Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'CGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chatham Island Daylight Time' => array (\r\r\n 'offset' => '+13.45', \r\r\n 'timezone' => 'CHADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chatham Island Standard Time' => array (\r\r\n 'offset' => '+12.45', \r\r\n 'timezone' => 'CHAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chamorro Standard Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'ChST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Clipperton Island Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'CIST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cook Island Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'CKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chile Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'CLDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Chile Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'CLST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Colombia Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'COT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Central Standard Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'CST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'China Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'CST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Cape Verde Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'CVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Christmas Island Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'CXT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Davis Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'DAVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'District de Terre Adélie Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'DTAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Easter Island Daylight Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'EADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Easter Island Standard Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'EAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Africa Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'EAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ecuador Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'ECT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Daylight Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'EDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Europe Summer Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'EEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Europe Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'EET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Greenland Time' => array (\r\r\n 'offset' => '-1', \r\r\n 'timezone' => 'EGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Greenland Summer Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'EGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Kazakhstan Standard Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'EKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Eastern Standard Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'EST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Fiji Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'FJT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Falkland Island Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'FKDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Falkland Island Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'FKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Galapagos Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'GALT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Georgia Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'GET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'French Guiana Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'GFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gilbert Island Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'GILT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gambier Island Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'GIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Greenwich Meantime' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'GMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Gulf Standard Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'GST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'South Georgia and the South Sandwich Islands' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'GST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Guyana Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'GYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hawaii - Aleutian Daylight Time' => array (\r\r\n 'offset' => '-9', \r\r\n 'timezone' => 'HADT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hawaii - Aleutian Standard Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'HAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Hong Kong Standard Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'HKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Heard and McDonald Islands Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'HMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îles Crozet Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'ICT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Indochina Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'ICT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ireland Daylight Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'IDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Israel Daylight Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'IDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îran Daylight Time' => array (\r\r\n 'offset' => '+4.30', \r\r\n 'timezone' => 'IRDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Irkutsk Summer Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'IRKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Irkutsk Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'IRKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Îran Standard Time' => array (\r\r\n 'offset' => '+3.30', \r\r\n 'timezone' => 'IRST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Indian Standard Time' => array (\r\r\n 'offset' => '+5.30', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Ireland Standard Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Israel Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'IST',\r\r\n 'enabled' => false,\r\r\n ),\r\r\n 'Juan Fernandez Islands Daylight Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'JFDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Juan Fernandez Islands Standard Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'JFST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Japan Standard Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'JST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kyrgyzstan Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'KGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kyrgyzstan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'KGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Krasnoyarsk Summer Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'KRAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Krasnoyarsk Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'KRAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Kosrae Standard Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'KOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Khovd Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'KOVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Khovd Summer Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'KOVST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Korea Standard Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'KST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Lord Howe Daylight Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'LHDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Lord Howe Standard Time' => array (\r\r\n 'offset' => '+10.30', \r\r\n 'timezone' => 'LHST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Line Island Time' => array (\r\r\n 'offset' => '+14', \r\r\n 'timezone' => 'LINT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Sri Lanka Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'LKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Magadan Island Summer Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'MAGST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Magadan Island Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'MAGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mawson Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'MAWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Macclesfield Bank Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MBT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mountain Daylight Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'MDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Marquesas Islands Time' => array (\r\r\n 'offset' => '-9.30', \r\r\n 'timezone' => 'MIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Marshall Islands Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'MHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Myanmar Time' => array (\r\r\n 'offset' => '+6.30', \r\r\n 'timezone' => 'MMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mongolia Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MNT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mongolia Summer Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'MNST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Moscow Summer Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'MSD',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Moscow Standard Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'MSK',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mountain Standard Time' => array (\r\r\n 'offset' => '-7', \r\r\n 'timezone' => 'MST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mauritius Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'MUST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Mauritius Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'MUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Maldives Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'MVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Malaysia Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'MYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Caledonia Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'NCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Newfoundland Daylight Time' => array (\r\r\n 'offset' => '-2.30', \r\r\n 'timezone' => 'NDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Norfolk Time' => array (\r\r\n 'offset' => '+11.30', \r\r\n 'timezone' => 'NFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Nepal Time' => array (\r\r\n 'offset' => '+5.45', \r\r\n 'timezone' => 'NPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Nauru Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'NRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Novosibirsk Summer Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'NOVST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Novosibirsk Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'NOVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Newfoundland Standard Time' => array (\r\r\n 'offset' => '-3.30', \r\r\n 'timezone' => 'NST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Niue Time' => array (\r\r\n 'offset' => '-11', \r\r\n 'timezone' => 'NUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Zealand Daylight Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'NZDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'New Zealand Standard Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'NZST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Omsk Summer Time' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'OMSK',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Omsk Standard Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'OMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pacific Daylight Time' => array (\r\r\n 'offset' => '-7', \r\r\n 'timezone' => 'PDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Petropavlovsk Summer Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'PETST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Peru Time' => array (\r\r\n 'offset' => '-5', \r\r\n 'timezone' => 'PET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Petropavlovsk Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'PETT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Papua New Guinea Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'PGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Phoenix Island Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'PHOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Philippines Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paracel Islands Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Peter Island Time' => array (\r\r\n 'offset' => '-6', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pratas Islands' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'PIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pakistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'PKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pakistan Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'PKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pierre & Miquelon Daylight Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'PMDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pierre & Miquelon Standard Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'PMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pohnpei Standard Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'PONT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pacific Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'PST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Pitcairn Standard Time' => array (\r\r\n 'offset' => '-8', \r\r\n 'timezone' => 'PST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Palau Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'PWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paraguay Summer Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'PYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Paraguay Time' => array (\r\r\n 'offset' => '-4', \r\r\n 'timezone' => 'PYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Réunion Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'RET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Rothera Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'ROTT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samara Summer Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'SAMST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samara Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'SAMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'South Africa Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'SAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Solomon Island Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'SBT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Santa Claus Delivery Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'SCDT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Santa Claus Standard Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'SCST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Seychelles Time' => array (\r\r\n 'offset' => '+4', \r\r\n 'timezone' => 'SCT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Singapore Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SGT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Spratly Islands Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Sierra Leone Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'SLT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Suriname Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'SRT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Samoa Standard Time' => array (\r\r\n 'offset' => '-11', \r\r\n 'timezone' => 'SST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Scarborough Shoal Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'SST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Syrian Summer Time' => array (\r\r\n 'offset' => '+3', \r\r\n 'timezone' => 'SYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Syrian Standard Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'SYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tahiti Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'AHT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'French Southern and Antarctic Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tajikistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TJT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tokelau Time' => array (\r\r\n 'offset' => '-10', \r\r\n 'timezone' => 'TKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Turkmenistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'TMT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tonga Time' => array (\r\r\n 'offset' => '+13', \r\r\n 'timezone' => 'TOT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'East Timor Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'TPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Truk Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'TRUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Tuvalu Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'TVT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Taiwan Time' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'TWT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Universal Coordinated Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'UTC',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uruguay Standard Time' => array (\r\r\n 'offset' => '-3', \r\r\n 'timezone' => 'UYT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uruguay Summer Time' => array (\r\r\n 'offset' => '-2', \r\r\n 'timezone' => 'UYST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Uzbekistan Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'UZT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vladivostok Summer Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'VLAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vladivostok Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'VLAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vostok Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'VOST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Venezuela Standard Time' => array (\r\r\n 'offset' => '-4.30', \r\r\n 'timezone' => 'VST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Vanuatu Time' => array (\r\r\n 'offset' => '+11', \r\r\n 'timezone' => 'VUT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Africa Summer Time' => array (\r\r\n 'offset' => '+2', \r\r\n 'timezone' => 'WAST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Africa Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'WAT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Europe Summer Time' => array (\r\r\n 'offset' => '+1', \r\r\n 'timezone' => 'WEST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Western Europe Time' => array (\r\r\n 'offset' => '0', \r\r\n 'timezone' => 'WET',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Wallis and Futuna Time' => array (\r\r\n 'offset' => '+12', \r\r\n 'timezone' => 'WFT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Barat' => array (\r\r\n 'offset' => '+7', \r\r\n 'timezone' => 'WIB',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Timur' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'WIT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Waktu Indonesia Bagian Tengah' => array (\r\r\n 'offset' => '+8', \r\r\n 'timezone' => 'WITA',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'West Kazakhstan Standard Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'WKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yakutsk Summer Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'YAKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yakutsk Time' => array (\r\r\n 'offset' => '+9', \r\r\n 'timezone' => 'YAKT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yap Time' => array (\r\r\n 'offset' => '+10', \r\r\n 'timezone' => 'YAPT',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yekaterinburg Summer Time' => array (\r\r\n 'offset' => '+6', \r\r\n 'timezone' => 'YEKST',\r\r\n 'enabled' => true,\r\r\n ),\r\r\n 'Yekaterinburg Time' => array (\r\r\n 'offset' => '+5', \r\r\n 'timezone' => 'YEKT',\r\r\n 'enabled' => true,\r\r\n ), \r\r\n );\r\r\n \r\r\n\r\r\n /** Find Timezone Offset */\r\r\n foreach ($_WorldTimeZoneInformation as $timezone_name => $timezone_info) {\r\r\n if ($timezone_info['enabled']) {\r\r\n if ($timezone_info['timezone'] == strtoupper($timezone)) {\r\r\n return $timezone_info['offset'];\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n return 0;\r\r\n }", "public function getStartTimestamp() {}", "public function getOffset(): int;", "function getTimestamp() {\n return $this->time_stamp;\n }", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "public static function timestamp() {}", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function getTimestamp()\n {\n }", "public function getStringOffset() {}", "public function getTimezoneOffset($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getEndTimeOffset()\n {\n return $this->end_time_offset;\n }", "function date_sys_to_local($timestamp, $local_tz='') {\n\tif($local_tz == '') $local_tz = @$_SESSION['cms']['user']['timezone'];\n\tif($local_tz == '') return $timestamp;\n\t\n\t$offset = date_tz_offset($timestamp, $local_tz);\n\treturn $timestamp + $offset;\n}", "public function getOffset($value);", "public function getUpdateTimeWindowUtcOffsetInMinutes()\n {\n if (array_key_exists(\"updateTimeWindowUtcOffsetInMinutes\", $this->_propDict)) {\n return $this->_propDict[\"updateTimeWindowUtcOffsetInMinutes\"];\n } else {\n return null;\n }\n }", "public function getOffsetStart()\n\t{\n\t\treturn $this->start + 1;\n\t}", "public function getTimestamp() { \n\t\tif ($this->change) {\n\t\t\t$this->_calc();\n\t\t}\n\t\t\n\t\treturn $this->timestamp; \n\t}", "function getFormattedOffset($separator = ':') {\n if($this->offset == 0) {\n return '';\n } // if\n \n $sign = $this->offset > 0 ? '+' : '-';\n $hours = abs($this->offset) / 3600;\n if($hours < 10) {\n $hours = '0' . floor($hours);\n } // if\n $minutes = (abs($this->offset) % 3600) / 60;\n if($minutes < 10) {\n $minutes = '0' . $minutes;\n } // if\n \n return $sign . $hours . $separator . $minutes;\n }", "function get_local_iso_8601_date($int_date, $server_offset_time)\n{\n // $int_date: current date in UNIX timestamp\n $GMT_value = get_local_GMT_offset($server_offset_time);\n $local_date = date(\"Y-m-d\\TH:i:s\", $int_date + $server_offset_time);\n $local_date .= $GMT_value;\n return $local_date;\n}", "function getTime($offset){\n $hours = date('h');\n $minutes = (date('i') > 30) ? '30' : '00';\n $minutes = $minutes + $offset;\n if($minutes >= 60){\n $hours = $hours + (int)($minutes / 60);\n if($hours > 12)\n $hours -= 12;\n $minutes = $minutes % 60;\n }\n $minutes = ($minutes==0) ? '00' : $minutes;\n return \"$hours:$minutes\" . date('A');\n}", "public function getOffsets() {}", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "public function get_offset(){\r\n return $this->$new_offset;\r\n }", "function mygetdate($date,$offset,$showdateformat){\r\n if($offset==0)return date(\"$showdateformat\",strtotime($date));\r\n $_date = new DateTime($date);\r\n if(abs($offset) == 1)$offset_t = ($offset > 0)?'+1 hour':'-1 hour';\r\n else $offset_t = ($offset > 0)?'+'.$offset.' hours':'-'.abs($offset).' hour';\r\n $_date -> modify($offset_t);\r\n return date(\"$showdateformat\",strtotime($_date->format('Y-m-d H:i:s')));\r\n}", "public function getStartOffset() {}", "public static function time_offset($t, $f = 'h:ma M. j Y T'){\n\t$o = time() - $t;\n\tswitch($o){\n\t\tcase($o <= 1): return \"just now\"; break;\n\t\tcase($o < 20): return $o . \" seconds ago\"; break;\n\t\tcase($o < 40): return \"half a minute ago\"; break;\n\t\tcase($o < 60): return \"less than a minute ago\"; break;\n\t\tcase($o <= 90): return \"1 minute ago\"; break;\n\t\tcase($o <= 59*60): return round($o / 60) . \" minutes ago\"; break;\n\t\tcase($o <= 60*60*1.5): return \"1 hour ago\"; break;\n\t\tcase($o <= 60*60*24): return round($o / 60 / 60) . \" hours ago\"; break;\n\t\tcase($o <= 60*60*24*1.5): return \"1 day ago\"; break;\n\t\tcase($o < 60*60*24*7): return round($o / 60 / 60 / 24) . \" days ago\"; break;\n\t\tcase($o <= 60*60*24*9): return \"1 week ago\"; break;\n\t\tdefault: return date($f, $t);\n\t}\n }", "public function getTimestamp()\n {\n return $this->proxyBase->timestamp;\n }", "public static function timestamp()\n {\n //$mt = microtime();\n list($mt, $tm) = explode(\" \", microtime());\n return sprintf(\"%d%03d\",$tm,(int)($mt*1000%1000));\n }", "public function getOffset($value)\r\n\t{\r\n\t}", "public function getLeaderLineOffset() {}", "public function getLastTimestamp()\n\t{\n\t\tif (!$this->isFlv())\n\t\t\treturn 0;\n\t\t\t\n\t\tfseek($this->fh, -4 , SEEK_END); // go back 4 bytes\n\t\t\n\t\t$prev_tag_size_raw = fread ($this->fh, 4);\n\t\t$tag_size = unpack(\"N\", $prev_tag_size_raw);\n\t\t\n\t\t// go back 4 bytes AND the size of the tag + 4 bytes to get to the timestamp\n\t\tfseek ($this->fh, -$tag_size[1], SEEK_END);\n\t\t\n\t\t$data = fread ($this->fh, 4);\n\t\t$data = $data[3].substr($data, 0, 3);\n\t\t$res = unpack(\"N\", $data);\n\t\treturn $res[1];\n\t}", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "function mOFFSET(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$OFFSET;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:191:3: ( 'offset' ) \n // Tokenizer11.g:192:3: 'offset' \n {\n $this->matchString(\"offset\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }" ]
[ "0.7591326", "0.72070146", "0.7070877", "0.7030504", "0.6814839", "0.6706907", "0.6685663", "0.66501784", "0.6498625", "0.6498625", "0.6498625", "0.6471507", "0.6450553", "0.64366716", "0.64347166", "0.6423658", "0.64154106", "0.63833", "0.6376252", "0.6307125", "0.62729055", "0.6269953", "0.62567025", "0.61510897", "0.61510897", "0.61510897", "0.6121186", "0.61123896", "0.61123896", "0.61123896", "0.61123896", "0.61123896", "0.61123896", "0.61123896", "0.6109046", "0.61085397", "0.6108082", "0.61029", "0.6087086", "0.6063268", "0.60557336", "0.60485893", "0.6043489", "0.60244864", "0.6019347", "0.6013126", "0.6006375", "0.6001399", "0.6001399", "0.5967051", "0.5958729", "0.59189904", "0.5913388", "0.5906648", "0.58940005", "0.58843344", "0.5862763", "0.5842662", "0.579074", "0.5785236", "0.5776082", "0.57696927", "0.57674956", "0.5762379", "0.5721273", "0.5721273", "0.5721273", "0.5716052", "0.5685279", "0.56805587", "0.56525004", "0.56478876", "0.5645047", "0.563947", "0.56366444", "0.56208014", "0.5619847", "0.56103456", "0.5607041", "0.56015235", "0.5598822", "0.558974", "0.55882967", "0.5562639", "0.55624896", "0.5555008", "0.55537176", "0.5546125", "0.55117834", "0.55081373", "0.5496765", "0.5491766", "0.548939", "0.54780555", "0.5475678", "0.54720145", "0.546753", "0.54674757", "0.5466369", "0.5458404" ]
0.7834279
0
Convert an timestamp into local time,
public static function localTimestamp($timestamp) { // Transfor to timestamp if required return date( 'Y-m-d H:i:s', self::asTimestamp($timestamp) + self::$settings[1] * 3600 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utc2local($timestamp = null) {\n\t\tif(!$timestamp) {\n\t\t\t$timestamp = time();\n\t\t}\n\n\t\t$f3 = \\Base::instance();\n\n\t\tif($f3->exists(\"site.timeoffset\")) {\n\t\t\t$offset = $f3->get(\"site.timeoffset\");\n\t\t} else {\n\t\t\t$tz = $f3->get(\"site.timezone\");\n\t\t\t$dtzLocal = new \\DateTimeZone($tz);\n\t\t\t$dtLocal = new \\DateTime(\"now\", $dtzLocal);\n\t\t\t$offset = $dtzLocal->getOffset($dtLocal);\n\t\t\t$f3->set(\"site.timeoffset\", $offset);\n\t\t}\n\n\t\treturn $timestamp + $offset;\n\t}", "function date_sys_to_local($timestamp, $local_tz='') {\n\tif($local_tz == '') $local_tz = @$_SESSION['cms']['user']['timezone'];\n\tif($local_tz == '') return $timestamp;\n\t\n\t$offset = date_tz_offset($timestamp, $local_tz);\n\treturn $timestamp + $offset;\n}", "function date_local_to_sys($timestamp, $local_tz='') {\n\tif($local_tz == '') $local_tz = @$_SESSION['cms']['user']['timezone'];\n\tif($local_tz == '') return $timestamp;\n\n\t$offset = date_tz_offset($timestamp, $local_tz);\n\treturn $timestamp - $offset;\n}", "function GmtTimeToLocalTime($time) {\n date_default_timezone_set('UTC');\n $new_date = new DateTime($time);\n $new_date->setTimeZone(new DateTimeZone('Europe/Berlin'));\n return $new_date->format(\"d.m.Y H:i:s\");\n}", "function getUserLocalTime($datetime, $format='M d g:i a'){\r\n $server_dt = new DateTime($datetime, new DateTimeZone($this->app_config['server_timezone_offset']));\r\n\t// if timezone is not set\r\n\t// return server time\r\n\tif(empty($this->timezone_offset)){\r\n\t\t$local_dt_string = $server_dt->format($format);\r\n\t\treturn $local_dt_string;\r\n\t}\r\n\r\n\t// example value ot $this->timezone_offset\r\n //$this->timezone_offset = '+0800';\r\n $user_offset = $this->timezone_offset;\r\n\r\n $offset_hr = intval($user_offset/100);\r\n $offset_min = $user_offset%100;\r\n $offset_sec = $offset_hr * 3600 + $offset_min * 60;\r\n\r\n //get offset\r\n $gmt_offset = $server_dt->getOffset();\r\n //modify time to first get GMT\r\n $server_dt->modify(\"-$gmt_offset second\");\r\n\r\n // now modify time again to get local time \r\n\r\n $server_dt->modify(\"$offset_sec second\");\r\n\r\n //formatted string\r\n $local_dt_string = $server_dt->format($format);\r\n return $local_dt_string;\r\n}", "function convert_timestamp($timestamp)\n\t{\n\t\t$timestamp_bits = explode('T', $timestamp);\n\n\t\tif(isset($timestamp_bits[0], $timestamp_bits[0])):\n\t\t\t$date_bits = explode('-', $timestamp_bits[0]);\n\t\t\t$time_bits = explode(':', $timestamp_bits[1]);\n\t\t\t$year = $date_bits[0];\n\t\t\t$month = $date_bits[1];\n\t\t\t$day = $date_bits[2];\n\t\t\t$hour = $time_bits[0];\n\t\t\t$minute = $time_bits[1];\n\t\t\t$second = $time_bits[2];\n\n\t\t\treturn mktime($hour,$minute,$second, $month, $day, $year);\n\t\tendif;\n\n\t\treturn false;\n\n\t}", "function convert_local_date_to_unix( $time=array() )\n {\n \t//-----------------------------------------\n \t// Get the local offset\n \t//-----------------------------------------\n \t\n \t$offset = $this->get_time_offset();\n \t$time = gmmktime( intval($time['hour']), intval($time['minute']), 0, intval($time['month']), intval($time['day']), intval($time['year']) );\n \t\n \treturn $time - $offset;\n }", "function local_to_gmt($time = '')\n{\nif ($time == '')\n$time = time();\nreturn mktime( gmdate(\"H\", $time), gmdate(\"i\", $time), gmdate(\"s\", $time), gmdate(\"m\", $time), gmdate(\"d\", $time), gmdate(\"Y\", $time));\n}", "public static function getUserLocalTimezone($timestamp = null, $format = 'h:m A - M d Y')\n {\n return \\Carbon\\Carbon::createFromFormat('Y-m-d H:i:s', $timestamp, 'GMT')->setTimeZone(Helper::getUserTimezone())->format($format);\n }", "protected function convert_time_stamp($timestamp) {\n return $timestamp ? gmdate('Y-m-d h:i:s a', $timestamp) : null;\n }", "function timeStampToDateFR($timestamp) {\n return date('Y-m-d H:i:s', $timestamp);\n}", "function convertTimestamp($timestamp, $timezone = \"-0000\"){\r\n \treturn \"/Date($timestamp$timezone)/\";\r\n }", "function tstotime($timestamp){\n return date(\"Y-m-d H:i:s\", $timestamp);\n}", "public static function normalizedTime() {\n\t\t$offset = 0;\n\t\ttry {\n\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_ntp', false);\n\t\t\tif ($offset === false) {\n\t\t\t\t$offset = wfWAF::getInstance()->getStorageEngine()->getConfig('timeoffset_wf', false);\n\t\t\t\tif ($offset === false) { $offset = 0; }\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t//Ignore\n\t\t}\n\t\treturn time() + $offset;\n\t}", "public static function getLocalTime(array $array, $time_format) {\n if (isset($array['scheduledTime'])) {\n $time = strtotime($array['scheduledTime']);\n\n $settings = [];\n if (isset($array['airport']) && isset($array['airport']['utcOffset']) && isset($array['airport']['utcOffset']['iso'])) {\n $settings = ['timezone' => $array['airport']['utcOffset']['iso']];\n }\n\n return DrupalDateTime::createFromTimestamp($time)->format($time_format, $settings);\n }\n\n return '';\n }", "function GetTimeNow($Local)\n{\n\tif (!$Local) return(time()); //Torno tempo in UTC\n\treturn(time()+date(\"Z\")); //Torno tempo locale\n}", "public static function timestamp($time=false) {\n\t\tglobal $db; //TODO: REMOVE GLOBAL REFERENCE\n\t\treturn pudl::convert_tz(\n\t\t\tself::from_unixtime($time !== false ? $time : $db->time()),\n\t\t\tnew pudlGlobal('time_zone'),\n\t\t\t'UTC'\n\t\t);\n\t}", "function time_2_timestamp(&$time) {\r\n if ($time instanceof \\DateTime)\r\n $time = $time->getTimestamp();\r\n else\r\n $time = strtotime($time);\r\n}", "function gmtToLocal($gmtdatetime, $timezone, \n $returnTimestamp=false, \n $dateFormat = MYSQL_DATETIME_FORMAT) \n {\n if (empty($gmtdatetime)) {\n return null;\n } else {\n // save old timezone\n $oldtimezone = date_default_timezone_get();\n\n date_default_timezone_set('GMT');\n $timestamp = strtotime($gmtdatetime);\n\n if ($returnTimestamp) {\n $result = $timestamp;\n } else { // convert to local time\n date_default_timezone_set($timezone);\n $result = date($dateFormat, $timestamp);\n }\n\n // reset to old timezone\n date_default_timezone_set($oldtimezone);\n\n return $result;\n }\n }", "public function toISOLocalTime() : string\n {\n if ($this->timezoneIsLocal) {\n return $this->format('H:i:s');\n }\n return $this->cloneToMutable()->setTimezone(static::$timezoneLocal)->format('H:i:s');\n }", "public function hasLocalTime(){\n return $this->_has(1);\n }", "function timestampToUTCString($time) {\n\t$timezone = date_default_timezone_get();\n\t//date_default_timezone_set('UTC');\n\t$result = date('Y-m-d H:i:s', $time);\n\t//date_default_timezone_set($timezone);\n\treturn $result;\n}", "public abstract function fromUnixtime ($timestamp);", "function _convert_to_unix_timestamp($timestamp)\n\t{\n\t\tlist($time, $date) = explode('.', $timestamp);\n\t\t\n\t\t// breakdown time\n\t\t$hour = substr($time, 0, 2);\n\t\t$minute = substr($time, 2, 2);\n\t\t$second = substr($time, 4, 2);\n\t\t\n\t\t// breakdown date\n\t\t$day = substr($date, 0, 2);\n\t\t$month = substr($date, 2, 2);\n\t\t$year = substr($date, 4, 2);\n\t\t\n\t\treturn gmmktime($hour, $minute, $second, $month, $day, $year);\n\t}", "public static function timestamp($time) {\n\t\treturn pudl::convert_tz(\n\t\t\tstatic::from_unixtime(\n\t\t\t\tis_object($time) ? $time->time() : ((int)$time)\n\t\t\t),\n\t\t\tnew pudlGlobal('time_zone'),\n\t\t\t'UTC'\n\t\t);\n\t}", "function crystal_sqlite_from_unixtime($timestamp)\n {\n $timestamp = trim($timestamp);\n if (!preg_match(\"/^[0-9]+$/is\", $timestamp))\n $ret = strtotime($timestamp);\n else\n $ret = $timestamp;\n \n $ret = date(\"Y-m-d H:i:s\", $ret);\n crystal_sqlite_debug(\"FROM_UNIXTIME ($timestamp) = $ret\");\n return $ret;\n }", "function tstamptotime($tstamp) {\n // 1984-09-01T14:21:31Z\n sscanf($tstamp,\"%u-%u-%uT%u:%u:%uZ\",$year,$month,$day,\n $hour,$min,$sec);\n $newtstamp=mktime($hour,$min,$sec,$month,$day,$year);\n return $newtstamp;\n }", "public function localTime(LocationDataSource $locationDataSource)\n {\n $timezone = $locationDataSource->location->timezone;\n\n return Carbon::now($timezone)->toIso8601String();\n }", "function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}", "#[ReturnTypeWillChange]\n public function setTimestamp($timestamp)\n {\n $time = date('Y-m-d H:i:s', $timestamp);\n\n return self::parse($time, $this->timezone, $this->locale);\n }", "function converToTz($time=\"\",$toTz='',$fromTz='')\n\n\t{\n\n\t\t$date = new DateTime($time, new DateTimeZone($fromTz));\n\n\t\t$date->setTimezone(new DateTimeZone($toTz));\n\n\t\t$time= $date->format('Y-m-d H:i:s');\n\n\t\treturn $time;\n\n\t}", "private function format_time( $timestamp ) {\n\t if ( empty( $timestamp) ) {\n\t\t return __( 'never' , 'slp-premier' );\n\t }\n\t return date(\"d F Y H:i:s\",$timestamp);\n }", "private function convertTimestampFormat($timestamp)\n {\n return str_replace('T', ' ', substr($timestamp, 0, 19));\n }", "private static function timestamp(){\n date_default_timezone_set('Africa/Nairobi');\n $time = time();\n return date(\"Y-m-d G:i:s\", $time);\n }", "private function offsetTimestampForWordPressTimezone( $timestamp )\n {\n return $timestamp;\n \n // Get timezone offset in seconds for configured timezone.\n $offset = timezone_offset_get(\n new \\DateTimezone( get_option('timezone_string') ),\n new \\DateTime( date(\"c\", $timestamp ))\n );\n\n return $timestamp + $offset;\n }", "function convert_time($time) {\n\t$date = date('g:i A', strtotime($time));\n\n\treturn $date;\n}", "function utime2timestamp($string2format) {\n \t\treturn date(\"YmdHis\",$string2format);\n \t}", "private function convertToUtc(string $timestamp): string\n {\n $datetime = new \\DateTime($timestamp, new \\DateTimeZone('Asia/Kuala_Lumpur'));\n $datetime->setTimeZone(new \\DateTimeZone('UTC'));\n\n return $datetime->format('Y-m-d H:i:s');\n }", "function ldate($format, $timestamp = null) {\n\tif (1 === func_num_args( )) {\n\t\t$timestamp = time( );\n\t}\n\n\tif ( ! is_numeric($timestamp)) {\n\t\t$timestamp = strtotime($timestamp);\n\t}\n\n\tdate_default_timezone_set($GLOBALS['_TZ']);\n\t$date = date($format, $timestamp);\n\tdate_default_timezone_set('UTC');\n\n\treturn $date;\n}", "static public function toDatetime($timestamp) {\r\n\t\tif ($timestamp === null) return null;\r\n\t\telse return \\date('Y-m-d H:i:s', $timestamp);\r\n\t}", "function sys_time($timestamp)\n\t{\n\t\treturn call_user_func_array('gmmktime', explode(', ', date('H, i, s, m, d, Y', $timestamp - intval($this->timeshift()))));\n\t}", "static public function fromTimestamp($timestamp){\n\t\treturn self::getDatefromTimestamp($timestamp);\n\t}", "private function timestampToTimecode($timestamp)\n {\n $datetime = \\DateTime::createFromFormat('H:i:s', '00:00:00');\n $datetime->add(new \\DateInterval(sprintf('PT%sS', (int)$timestamp)));\n\n return $datetime->format('H:i:s');\n }", "private function user_local_request_time()\n\t{\n\t\t$formatted = sprintf(\n\t\t\t'%s-%s-%s %s:%s %s',\n\t\t\tdate('Y', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('m', $_SERVER['REQUEST_TIME']),\n\t\t\tdate('d', $_SERVER['REQUEST_TIME']),\n\t\t\t$this->input->post('timecard_hour'),\n\t\t\t$this->input->post('timecard_min'),\n\t\t\t$this->input->post('timecard_pmam')\n\t\t);\n\n\t\treturn Carbon::createFromFormat('Y-m-d h:i A', $formatted);\n\t}", "function timestampToDate($t) {\n return date(\"d-m-Y\",$t);\n}", "function rlip_timestamp($hour = null, $minute = null, $second = null, $month = null, $day = null, $year = null, $timezone = 99) {\n if ($hour === null) {\n $hour = gmdate('H');\n }\n if ($minute === null) {\n $minute = gmdate('i');\n }\n if ($second === null) {\n $second = gmdate('s');\n }\n if ($month === null) {\n $month = gmdate('n');\n }\n if ($day === null) {\n $day = gmdate('j');\n }\n if ($year === null) {\n $year = gmdate('Y');\n }\n return make_timestamp($year, $month, $day, $hour, $minute, $second, $timezone);\n}", "function localToGmt($datetime, $timezone, $isTimestamp=false) {\n// $this->log(__CLASS__ . \".\" . __FUNCTION__ . \"(args) where args= \" . print_r(func_get_args(), true), LOG_DEBUG);\n\n $returnVal = null;\n\n if (!empty($datetime)) {\n if ($isTimestamp) {\n $ts = $datetime;\n } \n else { // convert from local time\n // save old timezone\n $oldtimezone = date_default_timezone_get();\n\n date_default_timezone_set($timezone);\n $ts = strtotime($datetime);\n\n // reset to old timezone\n date_default_timezone_set($oldtimezone);\n }\n\n $returnVal = gmdate(MYSQL_DATETIME_FORMAT, $ts);\n }\n// $this->log(__CLASS__ . \".\" . __FUNCTION__ . \"() returning \" . $returnVal, LOG_DEBUG);\n return $returnVal;\n }", "function date_get_date_time($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date_time'], $timestamp);\n}", "function cata_ts2unixts($timestamp) {\n\tif (strlen($timestamp) == 14) {\n\t\t$year = intval(substr($timestamp, 0, 4));\n\t\t$month = intval(substr($timestamp, 4, 2));\n\t\t$day = intval(substr($timestamp, 6, 2));\n\t\t$hour = intval(substr($timestamp, 8, 2));\n\t\t$minute = intval(substr($timestamp, 10, 2));\n\t\t$second = intval(substr($timestamp, 12, 2));\n\n\t\treturn mktime($hour, $minute, $second, $month, $day, $year);\n\t} else {\n\t\treturn 0;\n\t}\n}", "static public function timestamp($value) {\n // Default empty values to now\n if (empty($value)) {\n return time();\n }\n\n // Does it look like it's already a timestamp? Just return it\n if (is_numeric($value)) {\n return $value;\n }\n\n $time = strtotime($value);\n if ($time == FALSE) {\n // Handles form YYYY-MM-DD HH:MM:SS.garbage\n if (drupal_strlen($value) > 19) {\n $time = strtotime(drupal_substr($value, 0, 19));\n }\n }\n return $time;\n }", "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "function Post_Time($timestamp)\n{\n\t$hrformat = \"%A, %d.%m.%Y. u %H:%M\"; \n\t$res = strftime($hrformat,strtotime($timestamp)); \n\t$vrijeme = iconv('ISO-8859-2', 'UTF-8', $res);\n\t\n\techo($vrijeme);\t\n}", "public static function parseDatetime($timestamp){\n $timestamp = str_ireplace('T', ' ', $timestamp);\n $t = explode('-',$timestamp);\n if(count($t) == 4){\n unset($t[count($t)-1]);\n return implode('-', $t);\n }else{\n $t = explode('+',$timestamp);\n return $t[0];\n }\n }", "public function GetTaggerLocalEpoch()\n\t{\n\t\t$epoch = $this->GetTaggerEpoch();\n\t\t$tz = $this->GetTaggerTimezone();\n\t\tif (preg_match('/^([+\\-][0-9][0-9])([0-9][0-9])$/', $tz, $regs)) {\n\t\t\t$local = $epoch + ((((int)$regs[1]) + ($regs[2]/60)) * 3600);\n\t\t\treturn $local;\n\t\t}\n\t\treturn $epoch;\n\t}", "function WindowsTime2UnixTime($WindowsTime) {\n\t$UnixTime = $WindowsTime / 10000000 - 11644473600;\n\treturn $UnxiTime; \n}", "public function GetFromAsTimestamp()\n\t{\n\t\t//Alerts don't pass time as a string, they pass as unix ms\n\t\tif(!strtotime($this->from))\n\t\t{\n\t\t\treturn $this->from;\n\t\t}\n\t\treturn strtotime($this->from);\n\t}", "public function getMessageTime ($timestamp)\n\t{\n\t\t$timestamp = explode(' ', $timestamp);\n\t\t$date = explode('-', $timestamp[0]);\n\t\t$time = explode(':', $timestamp[1]);\n\t\t$time[2] = ($time[0] > 12) ? 'PM' : 'AM';\n\t\tif ($time[0] > 12) $time[0] -= 12;\n\t\tif ($time[0] == 0) $time[0] = '01';\n\t\t\n\t\t$timestamp = $date[1] . '/' . $date[2] . '/' . $date[0] . ' ' . $time[0] . ':' . $time[1] . ' ' . $time[2];\n\t\treturn $timestamp;\n\t}", "function solrTimestamp($epoch=0) {\n if($utc = intval($epoch)) {\n return date('Y-m-d\\TH:i:s\\Z',$utc);\n }\n else {\n return date('Y-m-d\\TH:i:s\\Z',time());\n }\n return;\n}", "public static function date($timestamp) {\n return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';\n }", "function modify_lora_date($time)\n\t{\n\t\t$cdate = strtotime($time);\n\t\t# miliseconds unix time\n\t\tif( $cdate == false ) {\n\t\t\t$militime = DateTime::createFromFormat('U.u', $time/1000);\n\t\t\t$militime->setTimezone(new DateTimeZone(date_default_timezone_get())); \n\t\t\treturn $militime->format(\"Y.m.d H:i:s.u\");\n\t\t}\n\t\treturn Date(\"Y.m.d H:i:s\", $cdate);\n\t}", "function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}", "function erp_mysqldate_to_phptimestamp( $time, $timestamp = true ) {\n\n if ( ! preg_match( '/\\d{2}:\\d{2}:\\d{2}$/', $time ) ) {\n $time = $time . ' 00:00:00';\n }\n\n $timezone = erp_wp_timezone();\n $datetime = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', $time, $timezone );\n\n if ( false === $datetime ) {\n return false;\n }\n\n if ( $timestamp ) {\n return $datetime->getTimestamp();\n }\n\n return $datetime;\n}", "function WindowsTime2DateTime($WindowsTime) {\n\t$UnixTime = $WindowsTime / 10000000 - 11644473600;\n\treturn date('Y-m-d H:i:s', $UnixTime); \n}", "public function convertTimeTimezone($timeStamp)\n {\n date_default_timezone_set('UTC');\n\n $timezone = $this->dataPhpArray['timezone'];\n\n return date('H:i', $timeStamp + $timezone);\n }", "function variant_date_from_timestamp($timestamp) {}", "function localToGmt($datetime, $timezone, $isTimestamp=false) {\n if (empty($datetime)) {\n return null;\n } else {\n if ($isTimestamp) {\n $ts = $datetime;\n } else { // convert from local time\n // save old timezone\n $oldtimezone = date_default_timezone_get();\n\n date_default_timezone_set($timezone);\n $ts = strtotime($datetime);\n\n // reset to old timezone\n date_default_timezone_set($oldtimezone);\n }\n\n return gmdate(MYSQL_DATETIME_FORMAT, $ts);\n }\n }", "function toUnix($local = false)\n\t{\n\t\t$date = null;\n\t\tif ($this->_date !== false) {\n\t\t\t$date = ($local) ? $this->_date + $this->_offset : $this->_date;\n\t\t}\n\t\treturn $date;\n\t}", "public function toISOLocalDateTime() : string\n {\n if ($this->timezoneIsLocal) {\n return $this->format('Y-m-d H:i:s');\n }\n return $this->cloneToMutable()->setTimezone(static::$timezoneLocal)->format('Y-m-d H:i:s');\n }", "function convertTime($time){\n return date(\"H:i\", strtotime($time));\n}", "public static function getTimestamp($time){\n return date('Y-m-d H:i:s',$time);\n }", "function toDateTime ($timestamp)\n\t{\n\t\treturn date('Y-m-d h:i:s', $timestamp);\n\t}", "public function GetAsTimestamp(){\r\n\t\t\t$timestamp = null;\r\n\t\t\tif( $this->year !== null && $this->month !== null && $this->day !== null ){\r\n\t\t\t\t$timestamp = strtotime( $this->year . '/' . $this->month . '/' . $this->day . ' ' . $this->hours . ':' . $this->minutes . ':' . $this->seconds );\r\n\t\t\t}\r\n\t\t\treturn $timestamp;\r\n\t\t}", "function acf_convert_time_to_php($time = '')\n{\n}", "function standard_date_time2($date) {\n\t$timestamp = strtotime($date);\n\t$fdate=date('d M, Y h:i A', $timestamp);\n\treturn $fdate;\n\t}", "function _getFormattedTimestamp()\n {\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\n }", "private function ConvertPayPalTimestampToDBDateTime($timestamp)\n {\n\tif(strlen($timestamp) == 0) {\n return \"\";\n\t}\n\t\t\n\treturn gmdate('Y-m-d H:i:s', strtotime($timestamp));\n }", "public static function timeStringToStamp($string)\r\n {\r\n return strtotime($string);\r\n }", "function db2gmtime($var){\n global $cfg;\n if(!$var) return;\n \n $dbtime=is_int($var)?$var:strtotime($var);\n return $dbtime-($cfg->getMysqlTZoffset()*3600);\n }", "public static function getDatetimeFromTimestamp($timestamp)\n {\n return date(\"Y-m-d H:i:s\", $timestamp);\n }", "function timestampToString($time) {\n\treturn date('Y-m-d H:i:s', $time);\n}", "function to_time($string){\n $split = explode(':', $string);\n $front = $split[0];\n $back = $split[1];\n // am or pm\n $period = substr($back, -2);\n $back = substr($back, 0,2);\n\n if($period == 'PM' and $front != '12'){\n $front += 12;\n }\n\n return ((string)$front . \":\" . (string)$back . \":00\");\n }", "function getTimeS($timestamp){\n\t\tif ($timestamp > 60*60*24){\n\t\t\t$timestamp = $timestamp % (60*60*24) + 2*(60*60);\n\t\t}\n\t\t$hours = intval($timestamp / (60*60));\n\t\t$minutes = intval(($timestamp % (60*60)) / 60);\n\t\treturn sprintf('%02d', $hours).\":\".sprintf('%02d', $minutes); \n\t}", "public static function createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null)\n {\n $time = new self(gmdate('Y-m-d H:i:s', $timestamp), 'UTC', $locale);\n $timezone ??= 'UTC';\n\n return $time->setTimezone($timezone);\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }", "public static function timestamp() {}", "public static function localTimezoneAbbrivation($localTime = null, $localTimezoneCity = null) {\n \n $fromTZ = new DateTimeZone($localTimezoneCity ?: date_default_timezone_get());\n \n if (is_numeric($localTime)) {\n $dt = new DateTime(null, $fromTZ); //always force UTC from DB\n $dt->setTimestamp($localTime);\n } else {\n $dt = new DateTime($localTime, $fromTZ); //always force UTC from DB\n }\n \n return $dt->format('T');\n }", "public static function strtotime($timestamp, ORM $object = NULL)\n {\n return strtotime($timestamp) * 1000;\n }", "function ISO8601toLocale($tstamp='') {\n if($tstamp=='')\n return date('d/m/Y H:i:s');\n \n $a = $m = $d = $h = $n = $s = 0; \n $p = explode('T', str_replace(array(':','/',' ','Z'), array('','','',''), $tstamp));\n \n //Si tiene dos partes, es porque hay fecha y hora\n if(count($p)==2) {\n //Fecha\n if(strlen($p[0])==8) {\n $a = substr($p[0], 0, 4);\n $m = substr($p[0], 4, 2);\n $d = substr($p[0], 6, 2);\n }\n //Hora\n if(strlen($p[1])==6) {\n $h = substr($p[1], 0, 2);\n $n = substr($p[1], 2, 2);\n $s = substr($p[1], 4, 2);\n } \n //Time Zone (no le doy bola)\n return \"{$d}/{$m}/{$a} {$h}:{$n}:{$s}\";\n }\n elseif(count($p)==1)\n {\n //Tiene una sola parte, Solo Fecha\n if(strlen($p[0])==8) {\n $a = substr($p[0], 0, 4);\n $m = substr($p[0], 4, 2);\n $d = substr($p[0], 6, 2);\n }\n return \"{$d}/{$m}/{$a}\"; \n }\n\n return date('d/m/Y H:i:s');\n }", "function getTimestamp(){\n return date('m/d/Y G:h');\n}", "public function format_timestamp($time)\n {\n }", "function get_local_iso_8601_date($int_date, $server_offset_time)\n{\n // $int_date: current date in UNIX timestamp\n $GMT_value = get_local_GMT_offset($server_offset_time);\n $local_date = date(\"Y-m-d\\TH:i:s\", $int_date + $server_offset_time);\n $local_date .= $GMT_value;\n return $local_date;\n}", "public static function SQLToLocal($sqlTime = null, $localTimezoneCity = null, $includeTZAbbriviation = true, $dateFormat = 'Y-m-d H:i:s') {\n \n $fromTZ = new DateTimeZone('UTC'); \n $toTZ = new DateTimeZone($localTimezoneCity ?: date_default_timezone_get());\n \n if (is_numeric($sqlTime)) {\n $dt = new DateTime(null, $fromTZ); //always force UTC from DB\n $dt->setTimestamp($sqlTime);\n } else {\n $dt = new DateTime($sqlTime, $fromTZ); //always force UTC from DB\n }\n $dt->setTimezone($toTZ);\n \n if ($dateFormat === false) return $dt->getTimestamp();\n else return $dt->format(($dateFormat ?: 'Y-m-d H:i:s') . ($includeTZAbbriviation ? ' T' : ''));\n }", "function getTime($ts = -1)\n{\n\tif($ts == '')\n\t\treturn 'Never';\n\telse if($ts == -1)\n\t\t$ts = TIME;\n\n\treturn str_replace(' ', '&nbsp;', gmdate(TIMEFORMAT, $ts + TZOFFSET));\n}", "function date_to_ts($value) {\n\treturn strtotime($value);\n}", "function date_timezone( $format, $timestamp ) {\r\n $gmt_offset = get_option( 'gmt_offset' );\r\n if ( false === $gmt_offset ) {\r\n $timestamp = $timestamp;\r\n } else {\r\n $timestamp = $timestamp + $gmt_offset * 3600;\r\n }\r\n return date( $format, $timestamp );\r\n }", "function time_sql2php($sqltime){\n return strtotime($sqltime . \" GMT\");\n}", "function timestamp($date){\n\t \n\t$return = strtotime($date);\n\treturn $return;\n}", "public function GetToAsTimestamp()\n\t{\n\t\t//Alerts don't pass time as a string, they pass as unix ms\n\t\tif(!strtotime($this->to))\n\t\t{\n\t\t\treturn $this->to;\n\t\t}\n\t\treturn strtotime($this->to);\n\t}", "function shadow_to_unixtime($t) {\n return (int)($t * 24 * 60 * 60);\n}", "function time2string($timestamp=''){\n $meses = array('01' => 'enero','02'=>'febrero','03'=>'marzo','04'=>'abril','05'=>'mayo','06'=>'junio','07'=>'julio','08'=>'agosto','09'=>'septiembre','10'=>'octubre','11'=>'noviembre','12'=>'diciembre');\n $partes = preg_split('/[\\s,-]+/',$timestamp);\n $fecha = $partes[2].' de '.$meses[$partes[1]].' de '.$partes[0].' a las '.$partes[3];\n return $fecha;\n}" ]
[ "0.7740931", "0.7464092", "0.7126095", "0.67731786", "0.64272344", "0.6325479", "0.6258044", "0.6254964", "0.6203448", "0.6131247", "0.6129367", "0.60866755", "0.589495", "0.5835377", "0.5804004", "0.578841", "0.57881343", "0.5764446", "0.5734318", "0.5728769", "0.5694262", "0.56547815", "0.564885", "0.5634537", "0.5625519", "0.55723226", "0.55635214", "0.5479584", "0.54551476", "0.5451129", "0.5445734", "0.54342616", "0.5420367", "0.5417545", "0.53886926", "0.5381945", "0.53676534", "0.534015", "0.53344905", "0.53332305", "0.53198206", "0.53164136", "0.53162885", "0.5307469", "0.52937174", "0.52805847", "0.52539116", "0.5252969", "0.525234", "0.524016", "0.5238516", "0.52353764", "0.5212386", "0.5192419", "0.5181867", "0.5176817", "0.51716065", "0.51699454", "0.5163109", "0.51619595", "0.5157166", "0.5146414", "0.51423264", "0.51301837", "0.51266336", "0.5110869", "0.5099938", "0.50967336", "0.5096585", "0.5093655", "0.5067027", "0.50647825", "0.50630134", "0.506125", "0.50612396", "0.505964", "0.5057453", "0.50548685", "0.5045755", "0.50384384", "0.5037588", "0.5032754", "0.5031911", "0.50303394", "0.5027927", "0.5026189", "0.5017997", "0.5008197", "0.4990725", "0.49902666", "0.49845386", "0.49812335", "0.497097", "0.49606097", "0.49599156", "0.495388", "0.49472523", "0.49466813", "0.49377424", "0.49347806" ]
0.769866
1
Converts degree Fahrenheit to degree Celsius Source:
public static function convertFahrenheitToCelsius($value) { if (is_array($value)) { foreach ($value as $key=>$v) { $value[$key] = self::convertFahrenheitToCelsius($v); } } else { $value = ($value - 32) * 5 / 9; } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function convertFahrenheitToCelsius($tempF){\n\t\t$tempC = ($tempF - 32)*0.556;\n\t\treturn $tempC;\n\t}", "function f2c($tempValue)\r\n{\r\n\t$celsius=($tempValue-32)*(5/9);\r\n return round($celsius,2);\r\n}", "function f2c ($value){\n $celsius=($value-32)/9*5;\n return $celsius;\n }", "function c2f ($value){\n $fahrenheit=$value/5*9+32;\n return $fahrenheit;\n }", "function celciusToFahrenheit($celcius)\n{\n $conversi=($celcius*9/5)+32;\n\n echo \"$celcius celcius = $conversi fahrenheit\";\n}", "abstract public function convertFromCelsius(float $degrees): float;", "public function setTempCelsius() {\n\t\t$this->unit = 'celsius';\n\t}", "function temperaturConversion()\n {\n echo \"Enter temperature: \\n\";\n $temp = AlgorithmsUtility::get_Integer();\n echo \"Enter C for Celsius or F for Fahrenheit for the temperature you have input. \\n\";\n $chtemp = AlgorithmsUtility::get_String();\n\n if (strpos($chtemp, \"c\") === false && strpos($chtemp, \"C\") === false) {\n $conv = ($temp * 9 / 5) + 32;\n } else {\n $conv = ($temp - 32) * 5 / 9;\n }\n\n echo \"converted temperature is \" . $conv . \"\\n\";\n }", "public function setTempFahrenheit() {\n\t\t$this->unit = 'fahrenheit';\n\t}", "public function convertCelsiusToFahrenheit($value) {\n\t\tif(is_numeric($value)) {\n\t\t\treturn round( ($value * 1.8 + 32), 0);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function kelvin_to_celcius($k){\r\n $d = $k - 273.15;\r\n return $d;\r\n }", "public function toFahrenheit(): Fahrenheit\n {\n return new Fahrenheit($this->value * 1.8 + 32);\n }", "abstract public function convertToCelsius(float $degrees): float;", "public function toCelsius(): self\n {\n return new static($this->value);\n }", "public function getTempUnitSign() {\n\t\tif( $this->getTempUnit() == 'celsius' ) {\n\t\t\treturn 'C';\n\t\t} else {\n\t\t\treturn 'F';\n\t\t}\n\t}", "function convertTemp($temp, $unit1, $unit2)\n{\n // switch statement to see which unit the temp to be converted is set to\n // Then nested cases check which converted temp unit the user set\n // then based on each case a formula is applied and sets the $convertedTemp variable to be returned\n\n\n switch ($unit1) {\n case 'celsius':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 + 32;\n break;\n\n case 'kelvin':\n $convertedTemp = $temp + 273.15;\n break; \n }\n break; \n\n case 'kelvin':\n switch ($unit2) {\n\n case 'fahrenheit':\n $convertedTemp = $temp * 9/5 - 459.67;\n break;\n\n case 'celsius':\n $convertedTemp = $temp - 273.15;\n break;\n \n } \n break; \n\n case 'fahrenheit':\n switch ($unit2) {\n\n case 'celsius':\n $convertedTemp = ($temp - 32) * 5/9;\n break;\n\n case 'kelvin':\n $convertedTemp = ($temp + 459.67) * 5/9;\n break; \n }\n break;\n \n \n \n }\n // echo $convertedTemp; for testing and dev\n return $convertedTemp;\n\n // conversion formulas\n // Celsius to Fahrenheit = T(°C) × 9/5 + 32\n // Celsius to Kelvin = T(°C) + 273.15\n // Fahrenheit to Celsius = (T(°F) - 32) × 5/9\n // Fahrenheit to Kelvin = (T(°F) + 459.67)× 5/9\n // Kelvin to Fahrenheit = T(K) × 9/5 - 459.67\n // Kelvin to Celsius = T(K) - 273.15 \n\n}", "function convertTemp($temp, $unit1, $unit2)\n { $newTemp = 0;\n if ($unit1 == 'celsius') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 32;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp + 273.15;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp;\n }\n } \n if ($unit1 == 'fahrenheit') {\n if ($unit2 == 'celsius') {\n $newTemp = ($temp -32) * 5/9;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = ($temp + 459.67) * 5/9;\n } elseif ($unit2 == 'fahrenheit') {\n $newTemp = $temp;\n } \n } \n if ($unit1 == 'kelvin') {\n if ($unit2 == 'fahrenheit') {\n $newTemp = $temp * 9/5 + 459.67;\n } elseif ($unit2 == 'celsius') {\n $newTemp = $temp - 273.15;\n } elseif ($unit2 == 'kelvin') {\n $newTemp = $temp;\n } \n } \n return $newTemp;\n }", "public function getTemperature();", "function convert_cm_to_feet($cm_value)\n{\n\t//TODO: Convert cm to feet eg. 5'7\n\treturn $cm_value;\n}", "private function calcTemp()\n\t{\n#\t\t#define CCS811_R_NTC 10000 // resistance of NTC at a reference temperature\n#\t\t#define CCS811_R_NTC_TEMP 25 // reference temperature for NTC\n#\t\t#define CCS811_BCONSTANT 3380 // B constant\n#\n#\t\t// get NTC resistance\n#\t\tuint32_t r_ntc = ccs811_get_ntc_resistance (sensor, CCS811_R_REF);\n#\n#\t\t// calculation of temperature from application note ams AN000372\n#\t\tdouble ntc_temp;\n#\t\tntc_temp = log((double)r_ntc / self::R_NTC); // 1\n#\t\tntc_temp /= self::B; // 2\n#\t\tntc_temp += 1.0 / (self::R_NTC_TEMP + 273.15); // 3\n#\t\tntc_temp = 1.0 / ntc_temp; // 4\n#\t\tntc_temp -= 273.15; // 5\n\t}", "public function transformTemperature(float $temperature): float;", "function convertToFlOz ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.166667;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 8;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 16;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 32;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 128;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "function contenu()\n{\n // reprendre l'exercice sur Celsius\n\t$cels= -50;\n\t$far = -58;\n\n\tprint(\"<h1>\" .'Correspondance Celsius\tFahrenheit'.\"</h1>\");\n\tprint(\"\\n\");\n\n\tprint(\"\\t\". \"<table>\" .\"\\n\");\n\tprint(\"\\t\\t\". \"<thead>\" .\"\\n\");\n\n\tprint(\"\\t\\t\" .\"<tr>\". \"\\n\");\n\t\tprint(\"\\t\\t\". \"<th>\" .\"Celsius\". \"</th>\" .\"\\n\");\n\t\tprint(\"\\t\\t\". \"<th>\" .\"Fahrenheit\". \"</th>\" .\"\\n\");\n\tprint(\"\\t\\t\" .\"</tr>\". \"\\n\");\n\n\tprint(\"\\t\\t\". \"</thead>\" .\"\\n\");\n\n\tfor($cpt=0; $cpt<21; $cpt++)\n\t{\n\t\tprint(\"\\t\\t\". \"<tr class=\\\"bleu_fonc\\\">\" .\"\\n\");\n\n\t\tprint(\"\\t\\t\\t\". \"<td>\");\n\t\tprint($cels);\n\t\tprint(\"\\t\\t\". \"</td>\" .\"\\n\");\n\t\t//print(\"\\t\");\n\t\tprint(\"\\t\\t\\t\". \"<td>\");\n\t\tprint($far);\n\t\tprint(\"\\t\\t\". \"</td>\" .\"\\n\");\n\t\t//print(\"<br />\" .\"\\n\");\n\t\tprint(\"\\t\\t\". \"</tr>\" .\"\\n\");\n\n\t\t$cels += 5;\n\t\t$far += 9;\n\t}\n\n\tprint(\"\\t\". \"</table>\" .\"\\n\");\n}", "public function testConvert() {\n $this->assertEquals(new Temperature('230.85', TemperatureUnit::CELSIUS), $this->temperatureKelvin->convert('C')->round(2));\n $this->assertEquals(new Temperature('447.53', TemperatureUnit::FAHRENHEIT), $this->temperatureKelvin->convert('F')->round(2));\n\n $this->assertEquals(new Temperature('32', TemperatureUnit::FAHRENHEIT), $this->temperatureCelsius->convert('F')->round());\n $this->assertEquals(new Temperature('273.15', TemperatureUnit::KELVIN), $this->temperatureCelsius->convert('K')->round(2));\n\n $this->assertEquals(new Temperature('18', TemperatureUnit::CELSIUS), $this->temperatureFahrenheit->convert('C')->round());\n $this->assertEquals(new Temperature('291.48', TemperatureUnit::KELVIN), $this->temperatureFahrenheit->convert('K')->round(2));\n }", "public function getTemperature(): string\n {\n return $this->temperature;\n }", "public function getNuCelular()\n\t{\n\t\treturn $this->nu_celular;\n\t}", "public function getMtCpEuroOuFranc() {\n return $this->mtCpEuroOuFranc;\n }", "function transformBrewTemp(int $brewnumber): float {\n // 173 = 93 deg C\n\n $k = ((93 - 24) / (754 - 173))*-1;\n $m = (($k * 754) - 24)*-1;\n\n return $k*$brewnumber+$m;\n}", "function convertToCp ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0208333;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 2;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 4;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 16;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "public function getIteneraryEquivFareCurrency()\n {\n return $this->IteneraryEquivFareCurrency;\n }", "public function temperature() {\r\n\t\tApp::uses('TemperatureLib', 'Tools.Lib');\r\n\t\t$temperatureLib = new TemperatureLib();\r\n\t\t$units = $temperatureLib->getSupported();\r\n\t\t$this->set(compact('units'));\r\n\t\t$result = '';\r\n\t\tif ($this->Common->isPosted()) {\r\n\t\t\t$temperatureLib->set($this->request->data['Math']['value'], $this->request->data['Math']['unit']);\r\n\t\t\t$result = $temperatureLib->get($this->request->data['Math']['targetUnit'], true);\r\n\t\t}\r\n\r\n\t\t$this->set(compact('result'));\r\n\t}", "function fiftyone_degrees_get_number($string, $start, $end) {\n $value = 0;\n for ($i = $end, $p = 0; $i >= $start; $i--, $p++) {\n $value += pow(10, $p) * ($string[$i] - ord('0'));\n }\n return $value;\n}", "function convertRadians($Value) \r\n{\r\n return $Value * pi() / 180;\r\n}", "function transformServiceTemp(int $servicenumber): float {\n // 63 = 125 deg C\n\n $k = ((125 - 24) / (735 - 63))*-1;\n $m = (($k * 735) - 24)*-1;\n\n return $k*$servicenumber+$m;\n}", "public function getTemperature()\n {\n //no-op\n }", "function to_feetinches($mm,$denom) {\n #\n # Arguments:\n # mm - length in millimeters\n # denom - accuracy in fractions of an inch, e.g. 1/8, 1/6, etc\n #\n $in_frac = round($mm/25.4*$denom,0,PHP_ROUND_HALF_UP);\n $inches = floor($in_frac/$denom);\n $num = $in_frac % $denom;\n $gcd = gcd($num,$denom);\n $num = $num/$gcd;\n $denom = $denom/$gcd;\n $feet = floor($inches/12);\n $inches = $inches % 12;\n $retval = \"\";\n if ($num == 0) {\n $retval = $feet . \"'-\" . $inches . \"\\\"\";\n }\n else {\n $retval = $feet . \"'-\" . $inches . \" \" . $num . \"/\" . $denom . \"\\\"\";\n }\n return $retval;\n}", "public function getCFU(): int\n {\n return array_reduce($this->esami, function ($acc, $esame) {\n return $acc + $esame->cfu * $esame->in_cdl;\n }, 0);\n }", "public function getTempUnit() {\n return $this->cTempUnit;\n }", "public function getTemperature() {\n\t\treturn $this->temperature;\n\t}", "public function testCsch()\n {\n $csch = Trigonometry::csch(1.5);\n $this->assertEquals(0.46964244059522, $csch, '', 1E-8);\n }", "public function getInputTempUnit() {\n return $this->cInputTempUnit;\n }", "public function getTemperature() {\n\t\treturn $this->_temperature;\n\t}", "function KcToEur($koruny) {\n $euroKurz = 26; /* Spise nizsi (ale legalni) cislo! */\n return ceil($koruny / $euroKurz);\n}", "function degree_to_radian($input)\n {\n return $input / 180.0;\n }", "public function getMtCgEuroOuFranc() {\n return $this->mtCgEuroOuFranc;\n }", "function convertir($devisefrom, $montant)\n\n//verifie sie le montant est numerique sinon il me faut un nombre\n\n{\n\n if(!is_numeric(($montant))) return 'il me faut un nombre';\n if($devisefrom = \"EUR\"){\n $total=$montant*1.15023; //1 EUR =1,15023USD\n }\n else {\n $total=$montant*0.869310; //1 USD = 0,869310 EUR\n }\n return ($total);\n}", "protected function get_temperature( ) {\n// depending on the temperature, Heat Index or Wind Chill Temperature is calculated.\n// Format is tt/dd where tt = temperature and dd = dew point temperature. All units are\n// in Celsius. A 'M' preceeding the tt or dd indicates a negative temperature. Some\n// stations do not report dew point, so the format is tt/ or tt/XX.\n\n if (preg_match('#^(M?[0-9]{2})/(M?[0-9]{2}|[X]{2})?$#',$this->current_group_text,$pieces)) {\n $tempC = (integer) strtr($pieces[1], 'M', '-');\n $tempF = round(1.8 * $tempC + 32);\n $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['TEMPERATURE_F'] = $tempF;\n $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_C'] = $tempC;\n// $this->wxInfo['ITEMS'][$this->tend]['WINDCHILL_F'] = $tempF;\n $this->get_wind_chill($tempF);\n if (strlen($pieces[2]) != 0 && $pieces[2] != 'XX') {\n $dewC = (integer) strtr($pieces[2], 'M', '-');\n $dewF = convertTempToF($dewC);\n $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_C'] = $dewC;\n// $this->wxInfo['ITEMS'][$this->tend]['DEWTEMPERATURE_F'] = $dewF;\n $rh = round(100 * pow((112 - (0.1 * $tempC) + $dewC) / (112 + (0.9 * $tempC)), 8),1);\n $this->wxInfo['ITEMS'][$this->tend]['HUMIDITY'] = $rh;\n $this->get_heat_index($tempF, $rh);\n }\n $this->wxInfo['ITEMS'][$this->tend]['CODE_TEMPERATURE'] = $this->current_group_text;\n $this->current_ptr++;\n $this->current_group++;\n }\n else {\n $this->current_group++;\n }\n }", "public function getUnitsConversion(): float\n {\n return $this->inputUnit->getConversionForTargetUnit($this->getOutputUnit());\n }", "public function toCurrency()\n {\n return $this->amount * config('foria.tokens.value');\n }", "function ConvertCurrency($input_value, $input_currency_code, $target_currency_code) {\n // Convert input to base, then to target currency\n $rate_in = GetConversionRate($input_currency_code);\n $rate_out = GetConversionRate($target_currency_code);\n\n $output = ($input_value/$rate_in) * $rate_out;\n return number_format($output, 2, '.', '');\n }", "function converfecha($fechao){\n\t$cuenta = 0;\n\t$año=substr($fechao,-4,4);\n\t$mes=substr($fechao,-7,2);\n\t$dia=substr($fechao,0,2);\n\t//checa si la fecha recibida es valida\n\t\tif(is_numeric($año)&&is_numeric($mes)&&is_numeric($dia)){$fechac=$año.\"-\".$mes.\"-\".$dia;}else{$fechac=$fechao;}\n\treturn $fechac;\n}", "private function calculate(): float\n {\n return $this->conversionMultiple / $this->getUnitValue($this->to);\n }", "public function makeCoffee(): float;", "public function getValorCofins()\n {\n return $this->valorCofins;\n }", "public function costo()\n {\n return '$' . (string) number_format($this->costo, 2);\n }", "public function getPorcentagemChef() {\n return $this->getChaveValor('PORCENTAGEM_CHEF');\n }", "public function getIteneraryTotalFareCurrency()\n {\n return $this->IteneraryTotalFareCurrency;\n }", "public function getToCurrency()\n {\n return $this->toCurrency;\n }", "function convertToQt ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00520833;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.015625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.03125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.25;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 4;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "public function get_temperature($port_num)\n {\n $current_temp = floatval($this->xml->ports->port[$port_num]->condition[0]->currentReading);\n \n return $current_temp;\n }", "public function getTemperatureForLocation($latitude = null, $longitude = null) {\n $this->validateData($latitude, $longitude);\n\n $response = $this->provider->getResponse($this->latitude, $this->longitude);\n $temperature = $this->provider->extractTemperature($response);\n $temperatureInCelsius = $this->provider->getTemperatureInCelsius($temperature);\n\n return $temperatureInCelsius;\n }", "public function getInputSpeedUnit() {\n return $this->cInputSpeedUnit;\n }", "function valore_costi_esterni_gas($id_ordine,$id_gas){\r\n\r\n $costo_trasporto = valore_costo_trasporto_ordine_gas($id_ordine,$id_gas); \r\n $costo_gestione = valore_costo_gestione_ordine_gas($id_ordine,$id_gas);\r\n $costi = $costo_trasporto+\r\n $costo_gestione;\r\n \r\n return (float)$costi; \r\n}", "public function getPerPersonEquivFareCurrency()\n {\n return $this->PerPersonEquivFareCurrency;\n }", "function degree_to_compass_point($d){\r\n $dp = $d + 11.25;\r\n $dp = $dp % 360;\r\n $dp = floor($dp / 22.5) ;\r\n $points = array(\"N\",\"NNE\",\"NE\",\"ENE\",\"E\",\"ESE\",\"SE\",\"SSE\",\"S\",\"SSW\",\"SW\",\"WSW\",\"W\",\"WNW\",\"NW\",\"NNW\",\"N\");\r\n $dir = $points[$dp];\r\n return $dir;\r\n }", "public function get_powerFactor(): float\n {\n // $res is a float;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::POWERFACTOR_INVALID;\n }\n }\n $res = $this->_powerFactor;\n if ($res == self::POWERFACTOR_INVALID) {\n $res = $this->_cosPhi;\n }\n $res = round($res * 1000) / 1000;\n return $res;\n }", "public function convertCurrencies(): ?float\n {\n $exchangeRate = $this->getExchangeRate();\n\n return round($this->valueToExchange * $exchangeRate, 2);\n }", "public function getTrC(): ?float {\n return $this->trC;\n }", "private function _pxToCm($value) {\n return $value * 0.264583333; //($value*25.4)/150;\n }", "public function testCoth()\n {\n $coth = Trigonometry::coth(1.5);\n $this->assertEquals(1.1047913929825, $coth, '', 1E-8);\n }", "public function getInputRainUnit() {\n return $this->cInputRainUnit;\n }", "function conv($t) {\n$t*=1.8;\n$t+=32;\nreturn($t);}", "public function getSpeedUnit() {\n return $this->cSpeedUnit;\n }", "function valore_costo_trasporto_ordine_gas($id_ordine,$id_gas){\r\n $valore_globale_attuale_netto_qarr = valore_totale_ordine_qarr($id_ordine);\r\n $valore_gas_attuale_netto_qarr = valore_totale_mio_gas($id_ordine,$id_gas);\r\n $percentuale_mio_gas = ($valore_gas_attuale_netto_qarr / $valore_globale_attuale_netto_qarr) *100;\r\n $costo_globale_trasporto = valore_trasporto($id_ordine,100);\r\n $costo_trasporto = ($costo_globale_trasporto / 100) * $percentuale_mio_gas;\r\n return (float)$costo_trasporto;\r\n}", "public function getValueTo():float {\n return $this->valueTo;\n }", "public function getBachilleratofecha()\n\t{\n\t\treturn $this->bachilleratofecha;\n\t}", "public function setIteneraryEquivFareCurrency(string $value): self\n {\n $this->IteneraryEquivFareCurrency = $value;\n\n return $this;\n }", "public function getCfax()\n {\n return $this->cfax;\n }", "function get_ffd_currency() {\r\n\treturn apply_filters( 'ffd_currency', get_option( 'ffd_currency' ) );\r\n}", "public function getCex()\n {\n return $this->cex;\n }", "public function getCelular()\n\t{\n\t\treturn $this->celular;\n\t}", "public function getFT() {\n\t\t\treturn \"<p>FT Pct: \".$this->ft.\"</p>\";\n\t\t}", "function convertToGal ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00130208;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00390625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.0078125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.0625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 0.125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue * 0.25;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "public function getTempUnit() {\n\t\treturn $this->unit;\n\t}", "public function getTotalCotisFsh(): ?float {\n return $this->totalCotisFsh;\n }", "public function get_cosPhi(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::COSPHI_INVALID;\n }\n }\n $res = $this->_cosPhi;\n return $res;\n }", "function getTotalTTC() {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->totalTTC));\n else return 0;\n }", "public function getSourceCurrency();", "private function formatFNumber($input) {\n $leader = \"f/\"; // input in format f/16; trim \"f/\" leader\n if (strpos($input, $leader) === 0) {\n $input = substr($input, strpos($input, $leader) + strlen($leader));\n }\n\n if (!is_numeric($input)) {\n assert(\"is_numeric('$input') && \\$input = '$input'\");\n return \"\";\n }\n \n if ((int)$input <= 0) {\n assert(\"(int)'$input' > 0 && \\$input = '$input'\");\n return \"\";\n }\n \n return \"ƒ/\".$input;\n }", "protected function getCurrencyValue($value)\n\t{\n\t\tif(preg_match('/[-+]?([0-9]*\\.)?[0-9]+([eE][-+]?[0-9]+)?/',$value,$matches))\n\t\t\treturn floatval($matches[0]);\n\t\telse\n\t\t\treturn 0.0;\n\t}", "public function setCelular($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->celular !== $v) {\n\t\t\t$this->celular = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::CELULAR;\n\t\t}\n\n\t\treturn $this;\n\t}", "function currency( $c_f_x )\t\r\n {\r\n \t$c_f_x = round($c_f_x, 2);\t//THIS WILL ROUND THE ACCEPTED PARAMETER TO THE \r\n \t\t\t\t\t\t\t //PRECISION OF 2\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n \t$temp_c_f_variable = strstr(round($c_f_x,2), \".\");\t//THIS WILL ASSIGN THE \".\" AND WHAT EVER \r\n \t\t\t\t\t\t\t\t//ELSE COMES AFTER IT. REMEMBER DUE TO \r\n \t\t\t\t\t\t\t\t//ROUNDING THERE ARE ONLY THREE THINGS\r\n \t\t\t\t\t\t\t\t//THIS VARIABLE CAN CONTAIN, A PERIOD \r\n \t\t\t\t\t\t\t\t//WITH ONE NUMBER, A PERIOD WITH TWO NUMBERS,\r\n \t\t\t\t\t\t\t\t//OR NOTHING AT ALL\r\n \t\t\t\t\t\t\t\t//EXAMPLE : \".1\",\".12\",\"\"\r\n\t\t\t\t\t\t\t\t\t\r\n \tif (strlen($temp_c_f_variable) == 2)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \".1\" SO YOU WOULD ADD A ZERO TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT \r\n \t{\r\n \t\t$c_f_x = $c_f_x . \"0\";\r\n \t}\r\n\t\t\r\n \tif (strlen($temp_c_f_variable) == 0)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \"\" SO YOU WOULD ADD TWO ZERO'S TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT\r\n \t{\r\n \t\t$c_f_x = $c_f_x . \".00\";\r\n \t}\r\n\t\t\r\n\t\t$c_f_x = \"$\" . $c_f_x;\t//THIS WILL ADD THE \"$\" TO THE FRONT \r\n\r\n \treturn $c_f_x;\t//THIS WILL RETURN THE VARIABLE IN A NICE FORMAT\r\n \t\t\t\t\t//BUT REMEMBER THIS NEW VARIABLE WILL BE A STRING \r\n \t\t\t\t\t//THEREFORE CAN BE USED IN ANY FURTHER CALCULATIONS\r\n \t\t\r\n }", "function valore_costo_gestione_ordine_gas($id_ordine,$id_gas){\r\n $valore_globale_attuale_netto_qarr = valore_totale_ordine_qarr($id_ordine);\r\n $valore_gas_attuale_netto_qarr = valore_totale_mio_gas($id_ordine,$id_gas);\r\n $percentuale_mio_gas = ($valore_gas_attuale_netto_qarr / $valore_globale_attuale_netto_qarr) *100;\r\n $costo_globale_gestione = valore_gestione($id_ordine,100);\r\n $costo_gestione = ($costo_globale_gestione / 100) * $percentuale_mio_gas;\r\n return (float)$costo_gestione;\r\n}", "function convertValueToPcs($value) {\r\n\tconvertValueToLusin($value_lusin);\r\n\t$to_pcs = floor(convertValueToLusin($value_lusin) % 12);\r\n\treturn $to_pcs;\t\r\n}", "public function peso_cesta_formato(){\r\n\t\t\t$p = $this->peso_cesta();\r\n\t\t\treturn number_format($p,2,\",\",\".\");\r\n\t\t}", "protected function giveCost()\n {\n $novoValor = 4;\n $this->valueNow = 210.54 / $novoValor;\n return $this->valueNow;\n }", "public function preferredCurrencyCode()\n {\n return CulqiCashier::usesCurrency();\n }", "public static function fiat2crypto($value, $from, $to) {\n $from = trim(strtolower($from));\n $to = trim(strtolower($to));\n if ($from == $to) {\n return $value;\n }\n\n $endpoint = '/v1/to' . $to;\n $params = array(\n 'currency' => $from,\n 'value' => $value\n );\n $result = Request::execute('get', $endpoint, $params );\n\n if (Request::isResponseError($result)) {\n Log::debug($result);\n return false;\n }\n else {\n return (float) $result;\n }\n }", "function peso_ideal(float $altura, string $sexo){\n\n if($sexo == \"F\"){\n return (62.1 * $altura) - 44.7;\n }elseif($sexo == \"M\"){\n return (72.2 * $altura) - 58;\n }else{\n return \"Sexo invalido\";\n }\n}", "function toigian_ps()\n {\n $uscln = $this->USCLN($this->tuso, $this->mauso);\n $this->tuso = $this->tuso/$uscln;\n $this->mauso = $this->mauso/$uscln;\n }" ]
[ "0.7410081", "0.73945624", "0.7288268", "0.7222563", "0.7169441", "0.69283265", "0.6915956", "0.6640113", "0.6631088", "0.65820247", "0.65173095", "0.64709014", "0.6454186", "0.64132935", "0.6314897", "0.6239329", "0.5943448", "0.5885289", "0.5848754", "0.58189905", "0.5751831", "0.55350435", "0.544467", "0.54198796", "0.5397865", "0.53559774", "0.5353665", "0.5351579", "0.53481835", "0.53243303", "0.52757686", "0.52226365", "0.52211636", "0.5188291", "0.5187394", "0.51646405", "0.5157136", "0.5152107", "0.51507753", "0.5098823", "0.5081942", "0.5067139", "0.5063572", "0.50612783", "0.5060445", "0.5049531", "0.5040693", "0.50381607", "0.49591595", "0.49434528", "0.48938343", "0.4886329", "0.48852402", "0.48818797", "0.48615226", "0.48354837", "0.48329645", "0.48058522", "0.48058167", "0.47812295", "0.47751918", "0.47697568", "0.4756916", "0.4756631", "0.47560453", "0.47520334", "0.47500092", "0.4725429", "0.47187907", "0.47182465", "0.47159895", "0.47096232", "0.47087228", "0.4698914", "0.4683739", "0.46573806", "0.46521303", "0.46431515", "0.46308848", "0.4630727", "0.4628748", "0.46264434", "0.46112272", "0.46071953", "0.46048164", "0.46010166", "0.46004575", "0.45951355", "0.45942226", "0.459306", "0.45841247", "0.45794556", "0.45785517", "0.45769167", "0.45669764", "0.45578462", "0.45547372", "0.4552699", "0.45515472", "0.4545958" ]
0.6792544
7
Convert datetime to timestamp if required
public static function asTimestamp($timestamp) { // Return numerics as is if (is_numeric($timestamp)) { return $timestamp; } // Convert datetime & return on success if (($ts = strtotime($timestamp)) !== false) { return $ts; } throw new \InvalidArgumentException( 'No valid datetime or timestamp format: '.$timestamp ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time_2_timestamp(&$time) {\r\n if ($time instanceof \\DateTime)\r\n $time = $time->getTimestamp();\r\n else\r\n $time = strtotime($time);\r\n}", "function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}", "function convert_timestamp($timestamp)\n\t{\n\t\t$timestamp_bits = explode('T', $timestamp);\n\n\t\tif(isset($timestamp_bits[0], $timestamp_bits[0])):\n\t\t\t$date_bits = explode('-', $timestamp_bits[0]);\n\t\t\t$time_bits = explode(':', $timestamp_bits[1]);\n\t\t\t$year = $date_bits[0];\n\t\t\t$month = $date_bits[1];\n\t\t\t$day = $date_bits[2];\n\t\t\t$hour = $time_bits[0];\n\t\t\t$minute = $time_bits[1];\n\t\t\t$second = $time_bits[2];\n\n\t\t\treturn mktime($hour,$minute,$second, $month, $day, $year);\n\t\tendif;\n\n\t\treturn false;\n\n\t}", "function variant_date_to_timestamp($variant) {}", "function datetime_sql2timestamp($datetime)\r\n\t{\r\n\t\t$datetime = explode(\" \", $datetime);\r\n\t\t$datetime[\"date\"] = explode(\"-\", $datetime[0]);\r\n\t\t$datetime[\"time\"] = explode(\":\", $datetime[1]);\r\n\t\t\r\n\t\t$timestamp = mktime($datetime[\"time\"][0], $datetime[\"time\"][1], $datetime[\"time\"][2], $datetime[\"date\"][1], $datetime[\"date\"][2], $datetime[\"date\"][0]);\r\n\t\treturn $timestamp;\r\n\t}", "function date_to_ts($value) {\n\treturn strtotime($value);\n}", "function erp_mysqldate_to_phptimestamp( $time, $timestamp = true ) {\n\n if ( ! preg_match( '/\\d{2}:\\d{2}:\\d{2}$/', $time ) ) {\n $time = $time . ' 00:00:00';\n }\n\n $timezone = erp_wp_timezone();\n $datetime = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', $time, $timezone );\n\n if ( false === $datetime ) {\n return false;\n }\n\n if ( $timestamp ) {\n return $datetime->getTimestamp();\n }\n\n return $datetime;\n}", "public function GetAsTimestamp(){\r\n\t\t\t$timestamp = null;\r\n\t\t\tif( $this->year !== null && $this->month !== null && $this->day !== null ){\r\n\t\t\t\t$timestamp = strtotime( $this->year . '/' . $this->month . '/' . $this->day . ' ' . $this->hours . ':' . $this->minutes . ':' . $this->seconds );\r\n\t\t\t}\r\n\t\t\treturn $timestamp;\r\n\t\t}", "public static function timestamp($time=false) {\n\t\tglobal $db; //TODO: REMOVE GLOBAL REFERENCE\n\t\treturn pudl::convert_tz(\n\t\t\tself::from_unixtime($time !== false ? $time : $db->time()),\n\t\t\tnew pudlGlobal('time_zone'),\n\t\t\t'UTC'\n\t\t);\n\t}", "static public function toDatetime($timestamp) {\r\n\t\tif ($timestamp === null) return null;\r\n\t\telse return \\date('Y-m-d H:i:s', $timestamp);\r\n\t}", "static public function timestamp($value) {\n // Default empty values to now\n if (empty($value)) {\n return time();\n }\n\n // Does it look like it's already a timestamp? Just return it\n if (is_numeric($value)) {\n return $value;\n }\n\n $time = strtotime($value);\n if ($time == FALSE) {\n // Handles form YYYY-MM-DD HH:MM:SS.garbage\n if (drupal_strlen($value) > 19) {\n $time = strtotime(drupal_substr($value, 0, 19));\n }\n }\n return $time;\n }", "function date2Timestamp($date) {\r\n //2003-04-12 00:05:43\r\n if ($date == null) {\r\n return 0;\r\n }\r\n list($y, $mth, $d, $h, $min, $sec) = sscanf($date,\"%d-%d-%d %d:%d:%d\");\r\n return mktime ( $h, $min, $sec, $mth, $d, $y);\r\n}", "public static function get_timestamp($value)\n\t{\n\t\t$date = isset($value[\"date\"]) ? $value[\"date\"] : \"\";\n\t\t$time = isset($value[\"time\"]) ? $value[\"time\"] : \"\";\n\t\t$day = $month = $year = $hour = $min = 0;\n\n\t\tif (!empty($date))\n\t\t{\n\t\t\tlist($day, $month, $year) = explode(\".\", $date, 3);\n\t\t}\n\n\t\tif (!empty($time))\n\t\t{\n\t\t\tlist($hour, $min) = explode(\":\", $time, 2);\n\t\t}\n\n\t\t$timestamp = $year ? mktime((int)$hour, (int)$min, 0, (int)$month, (int)$day, (int)$year) : 0;\n\t\treturn $timestamp;\n\t}", "public function stdWrap_strtotimeReturnsTimestampDataProvider() {}", "function ts2dt($timestamp) {\n $pieces = explode(\"_\",$timestamp);\n $date = new DateTime();\n $date->setDate($pieces[0],$pieces[1],$pieces[2]);\n $date->setTime($pieces[3],$pieces[4],$pieces[5]);\n return $date;\n}", "function variant_date_from_timestamp($timestamp) {}", "function timestampToDate($t) {\n return date(\"d-m-Y\",$t);\n}", "public static function datetimeToTs($datetime)\n {\n /*\n $keys = array('ye', 'mo', 'da', 'hr', 'mi', 'se');\n $values = \\sscanf($datetime, '%4s%2s%2s%2s%2s%2s');\n $parts = array_combine($keys, $values)\n return \\mktime($parts['hr'], $parts['mi'], $parts['se'], $parts['mo'], $parts['da'], $parts['ye']);\n */\n $datetime = self::getDateTime($datetime);\n return (int) $datetime->format('U');\n }", "public static function unix_timestamp_to_datetime($value)\n\t{\n\t\treturn date(conf(\"format.datetime\"), $value);\n\t}", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "function date_to_timestamp($date)\n {\n $with_time = explode(' ', $date);\n $date = explode('/', $with_time[0]);\n\n if (count($date) == 3) {\n $hour = null;\n $minutes = null;\n\n if (isset($with_time[1])) {\n $time = explode(':', $with_time[1]);\n\n $hour = $time[0];\n $minutes = $time[1];\n }\n\n if ($timestamp = \\Carbon\\Carbon::create($date[2], $date[1], $date [0], $hour, $minutes)) {\n return $timestamp->format(\\DateTime::RFC3339);\n }\n }\n }", "public function convertDateTime(\\DateTime $oDateTime)\n {\n return $oDateTime->getTimestamp();\n }", "function toDateTime ($timestamp)\n\t{\n\t\treturn date('Y-m-d h:i:s', $timestamp);\n\t}", "function convertTimestamp($timestamp, $timezone = \"-0000\"){\r\n \treturn \"/Date($timestamp$timezone)/\";\r\n }", "public static function timestamp() {}", "function timestamp($date){\n\t \n\t$return = strtotime($date);\n\treturn $return;\n}", "function dateToTimestamp($date){\n\t$dia=substr($date,0,2);\n\t$mes=substr($date,3,2);\n\t$ano=substr($date, 6,4);\t\n\t\n\t$timestamp= mktime(0,0,0,$mes,$dia,$ano);\n\treturn $timestamp;\n }", "protected function get_timestamp_as_date($timestamp)\n {\n }", "function tstotime($timestamp){\n return date(\"Y-m-d H:i:s\", $timestamp);\n}", "public static function parseDateTimeToTimestamp($value, $timeValue = null)\n {\n return DbDateValidator::parseDateTime($value, $timeValue);\n }", "public abstract function fromUnixtime ($timestamp);", "protected function convert_time_stamp($timestamp) {\n return $timestamp ? gmdate('Y-m-d h:i:s a', $timestamp) : null;\n }", "public function getTimestamp()\n {\n return strtotime($this->getValue());\n }", "public function toTimestamp(): ?int\n {\n $gc = new GregorianCalendar();\n $julianDay = $gc->ymdToJd(($this->year > 0 && $this->epoch) ? -$this->year : $this->year, $this->monthDigital ?: 1, $this->day ?: 1);\n return ($julianDay - 2440588) * 86400;\n }", "function scrappy_dateToTimestamp($string)\n{\n $check = (is_int($string) OR is_float($string)) ? $string : (string) (int) $string;\n\tif (($check === $string) AND ( (int) $string <= PHP_INT_MAX) AND ( (int) $string >= ~PHP_INT_MAX)) return $string;\n return (bool)strtotime($string) ? strtotime($string) : $string;\n}", "function date_to_timestamp($d) {\n return mktime(substr($d, 8, 2), // hour\n substr($d, 10, 2), // minute\n 0, // second\n substr($d, 4, 2), // month\n substr($d, 6, 2), // day\n substr($d, 0, 4)); // year\n}", "function date_sql2timestamp($date)\r\n\t{\r\n\t\t$date = explode(\"-\", $date);\r\n\r\n\t\t$timestamp = mktime(0, 0, 0, $date[1], $date[2], $date[0]);\r\n\t\treturn $timestamp;\r\n\t}", "public static function timestamp($time) {\n\t\treturn pudl::convert_tz(\n\t\t\tstatic::from_unixtime(\n\t\t\t\tis_object($time) ? $time->time() : ((int)$time)\n\t\t\t),\n\t\t\tnew pudlGlobal('time_zone'),\n\t\t\t'UTC'\n\t\t);\n\t}", "public static function dateToTimestamp ($date)\n\t{\n\t\n\t\treturn $date != '0000-00-00' ? \n\t\t\tmktime (\n\t\t\t\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t1,\n\t\t\t\tsubstr ($date, 5, 2),\n\t\t\t\tsubstr ($date, 8, 2),\n\t\t\t\tsubstr ($date, 0, 4)\n\t\t\t \n\t\t): false;\n\t\n\t}", "function utime2timestamp($string2format) {\n \t\treturn date(\"YmdHis\",$string2format);\n \t}", "function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}", "public function timestamp(Carbon $timestamp = null);", "function _convert_to_unix_timestamp($timestamp)\n\t{\n\t\tlist($time, $date) = explode('.', $timestamp);\n\t\t\n\t\t// breakdown time\n\t\t$hour = substr($time, 0, 2);\n\t\t$minute = substr($time, 2, 2);\n\t\t$second = substr($time, 4, 2);\n\t\t\n\t\t// breakdown date\n\t\t$day = substr($date, 0, 2);\n\t\t$month = substr($date, 2, 2);\n\t\t$year = substr($date, 4, 2);\n\t\t\n\t\treturn gmmktime($hour, $minute, $second, $month, $day, $year);\n\t}", "public function timestamp();", "public function fromDateTime($value)\n {\n // If the value is already a UTCDateTime instance, we don't need to parse it.\n if ($value instanceof Timestamp) {\n return $value;\n }\n\n // Let Eloquent convert the value to a DateTime instance.\n if (!$value instanceof DateTime) {\n $value = parent::asDateTime($value);\n }\n\n return new Timestamp($value->timestamp);\n }", "public static function getTimestamp($time){\n return date('Y-m-d H:i:s',$time);\n }", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "private function ConvertPayPalTimestampToDBDateTime($timestamp)\n {\n\tif(strlen($timestamp) == 0) {\n return \"\";\n\t}\n\t\t\n\treturn gmdate('Y-m-d H:i:s', strtotime($timestamp));\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }", "public static function ToTimestamp($DateTime = '') {\n if (preg_match('/^(\\d{4})-(\\d{2})-(\\d{2})(?:\\s{1}(\\d{2}):(\\d{2})(?::(\\d{2}))?)?$/', $DateTime, $Matches)) {\n $Year = $Matches[1];\n $Month = $Matches[2];\n $Day = $Matches[3];\n $Hour = ArrayValue(4, $Matches, 0);\n $Minute = ArrayValue(5, $Matches, 0);\n $Second = ArrayValue(6, $Matches, 0);\n return mktime($Hour, $Minute, $Second, $Month, $Day, $Year);\n } elseif (preg_match('/^(\\d{4})-(\\d{2})-(\\d{2})$/', $DateTime, $Matches)) {\n $Year = $Matches[1];\n $Month = $Matches[2];\n $Day = $Matches[3];\n return mktime(0, 0, 0, $Month, $Day, $Year);\n // } elseif ($DateTime == '') {\n // return time();\n } else {\n return FALSE;\n }\n }", "private function getTimestamp()\n {\n $originalTime = microtime(true);\n $micro = sprintf(\"%06d\", ($originalTime - floor($originalTime)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.'.$micro, $originalTime));\n\n return $date->format($this->config['dateFormat']);\n }", "function timestamp($includeTime=true, $includeDate=true) {\r\n\t$parts = array();\r\n\tif ($includeDate) {\r\n\t\t$parts[] = \"Y-m-d\";\r\n\t}\r\n\tif ($includeTime) {\r\n\t\t$parts[] = \"H:i:s\";\r\n\t}\r\n\t$format = implode(\" \", $parts);\r\n\treturn date($format);\r\n}", "public function GetToAsTimestamp()\n\t{\n\t\t//Alerts don't pass time as a string, they pass as unix ms\n\t\tif(!strtotime($this->to))\n\t\t{\n\t\t\treturn $this->to;\n\t\t}\n\t\treturn strtotime($this->to);\n\t}", "function cata_ts2unixts($timestamp) {\n\tif (strlen($timestamp) == 14) {\n\t\t$year = intval(substr($timestamp, 0, 4));\n\t\t$month = intval(substr($timestamp, 4, 2));\n\t\t$day = intval(substr($timestamp, 6, 2));\n\t\t$hour = intval(substr($timestamp, 8, 2));\n\t\t$minute = intval(substr($timestamp, 10, 2));\n\t\t$second = intval(substr($timestamp, 12, 2));\n\n\t\treturn mktime($hour, $minute, $second, $month, $day, $year);\n\t} else {\n\t\treturn 0;\n\t}\n}", "public function getTimestamp()\n {\n }", "function datetime_unix2mysql($timestamp) {\n\treturn date('Y-m-d H:i:s', $timestamp);\n}", "function tstamptotime($tstamp) {\n // 1984-09-01T14:21:31Z\n sscanf($tstamp,\"%u-%u-%uT%u:%u:%uZ\",$year,$month,$day,\n $hour,$min,$sec);\n $newtstamp=mktime($hour,$min,$sec,$month,$day,$year);\n return $newtstamp;\n }", "public static function timestampToDateTime($timestamp) {\n\t\treturn date(self::MYSQL_DATETIME_FORMAT, $timestamp);\n\t}", "function mkUnixTimestampFromDateTime( $datetime ) {\n\t\n\t$year\t\t\t= substr( $datetime, 0, 4 );\n\t$month\t\t\t= substr( $datetime, 4, 2 );\n\t$day\t\t\t= substr( $datetime, 6, 2 );\n\t$hour\t\t\t= substr( $datetime, 8, 2 );\n\t$min\t\t\t= substr( $datetime, 10, 2 );\n\t$sec\t\t\t= substr( $datetime, 12, 2 );\n\t\n\t$timestamp\t\t= mktime( $hour, $min, $sec, $month, $day, $year, -1 );\n\t\n\treturn $timestamp;\n}", "function crystal_sqlite_from_unixtime($timestamp)\n {\n $timestamp = trim($timestamp);\n if (!preg_match(\"/^[0-9]+$/is\", $timestamp))\n $ret = strtotime($timestamp);\n else\n $ret = $timestamp;\n \n $ret = date(\"Y-m-d H:i:s\", $ret);\n crystal_sqlite_debug(\"FROM_UNIXTIME ($timestamp) = $ret\");\n return $ret;\n }", "function convert_all_timestamps()\n\t{\n\t\t$check_already_included = !empty($this->timestamps);\n\t\tforeach($this->table_def['fd'] as $name => $data)\n\t\t{\n\t\t\tif ($data['type'] == 'timestamp' && (!$check_already_included || !in_array($name,$this->timestamps)))\n\t\t\t{\n\t\t\t\t$this->timestamps[] = $name;\n\t\t\t}\n\t\t}\n\t}", "function readTimestamp(): int;", "public function getAsDateTime() {}", "private function makeTimestamp($date) \n\t{\n\t\tglobal $user;\n\n\t\t$this->stamp = strtotime($date);\n\t\treturn ($this->stamp);\n\t}", "public function datetime_to_date($datetime) {\r\n\t\t\r\n\t}", "protected static function getTimestamp()\n\t{\n\t\treturn date(\"Y-m-d H:00:00\");\n\t}", "function convert_to_datetime($dateTime, $format = 'Y-m-d H:i:s')\n {\n if ($time = strtotime($dateTime)) {\n $date_time = date($format, $time);\n\n return $date_time;\n }\n\n return false;\n }", "function getTimestamp($data) {\r\n\t// yyyy-mm-dd HH:ii:ss\r\n\t// 0123456789012345678\r\n\t$h = substr($data, 11, 2);\r\n\t$i = substr($data, 14, 2);\r\n\t$s = substr($data, 17, 2);\r\n\t$m = substr($data, 5, 2);\r\n\t$d = substr($data, 8, 2);\r\n\t$y = substr($data, 0, 4);\r\n\t//**************\r\n\treturn mktime($h, $i, $s, $m, $d, $y);\r\n}", "protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }", "public function getTimestamp()\n {\n $timestamp = $this->getData('timestamp');\n $attributeCodeThis = $this->getData('attribute_code');\n $attributeCodeObj = $this->getAttributeObject()->getAttributeCode();\n if (is_null($timestamp) || $attributeCodeThis != $attributeCodeObj) {\n $value = $this->getValue();\n if ($value) {\n if (is_numeric($value)) {\n $timestamp = $value;\n } else {\n $timestamp = strtotime($value);\n }\n } else {\n $timestamp = false;\n }\n $this->setData('timestamp', $timestamp);\n $this->setData('attribute_code', $attributeCodeObj);\n }\n return $timestamp;\n }", "abstract public function getTstamp();", "public function GetFromAsTimestamp()\n\t{\n\t\t//Alerts don't pass time as a string, they pass as unix ms\n\t\tif(!strtotime($this->from))\n\t\t{\n\t\t\treturn $this->from;\n\t\t}\n\t\treturn strtotime($this->from);\n\t}", "protected function makeTimestamp($timestamp = null)\n {\n if (is_null($timestamp)) {\n return $this->getTimestamp();\n }\n\n return (int) $timestamp;\n }", "function dateToCal($timestamp) {\nreturn date('Ymd\\THis', $timestamp);\n}", "public static function datetime_to_unix_timestamp($value)\n\t{\n\t\tif (!preg_match('/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)\\s(\\d\\d):(\\d\\d):(\\d\\d)/', $value, $m)) return 0;\n\t\treturn mktime($m[4], $m[5], $m[6], $m[2], $m[3], $m[1]);\n\t}", "public static function dateTimeToSQLTimestamp($dateTime)\n {\n $dateTime->setTimezone(new DateTimeZone(\"UTC\"));\n return $dateTime->format('Y-m-d H:i:s');\n }", "function convert2CustomDatetime( $datetime, $format = \"Y-m-d G:i:s\" )\n\t{\n\t\tif( !isset( $datetime ) || empty( $datetime ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// added failsafe for new/old php versions\n\n\t\tif( PHP_VERSION >= 5.3 )\n\t\t{\n\t\t\t//dump($datetime, 'first');\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$datetime = new DateTime( $datetime, new DateTimeZone( 'America/New_York' ) );\n\t\t\t}\n\t\t\tcatch( Exception $e )\n\t\t\t{\n\t\t\t\t//echo $e->getMessage();\n\t\t\t\texit( 1 );\n\t\t\t}\n\n\t\t\t//dump($datetime, 'second');\n\n\t\t\t// dump($datetime->format($format));\n\n\t\t\t//die;\n\n\t\t\treturn $datetime->format( $format );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$old_date_timestamp = strtotime( $datetime );\n\t\t\t$new_date = date( $format, $old_date_timestamp );\n\n\t\t\treturn $new_date;\n\t\t}\n\t}", "public static function localTimestamp($timestamp)\n {\n // Transfor to timestamp if required\n return date(\n 'Y-m-d H:i:s',\n self::asTimestamp($timestamp) + self::$settings[1] * 3600\n );\n }", "function solrTimestamp($epoch=0) {\n if($utc = intval($epoch)) {\n return date('Y-m-d\\TH:i:s\\Z',$utc);\n }\n else {\n return date('Y-m-d\\TH:i:s\\Z',time());\n }\n return;\n}", "function to_time($datetime)\n {\n return date('H:i:s', strtotime($datetime));\n }", "public static function strtotime($timestamp, ORM $object = NULL)\n {\n return strtotime($timestamp) * 1000;\n }", "protected function _makeTimestamp($string)\n {\n if (empty($string)) {\n // use \"now\":\n $time = time();\n } elseif (preg_match('/^\\d{14}$/', $string)) {\n // it is mysql timestamp format of YYYYMMDDHHMMSS? \n $time = mktime(\n substr($string, 8, 2),\n substr($string, 10, 2),\n substr($string, 12, 2),\n substr($string, 4, 2),\n substr($string, 6, 2),\n substr($string, 0, 4)\n );\n \n } elseif (is_numeric($string)) {\n // it is a numeric string, we handle it as timestamp\n $time = (int)$string;\n \n } else {\n // strtotime should handle it\n $time = strtotime($string);\n if ($time == -1 || $time === false) {\n // strtotime() was not able to parse $string, use \"now\":\n $time = time();\n }\n }\n \n return $time;\n }", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "public function fw_convert_date_to_timestamp($date_string) {\n if ($date_string) {\n $timestamp = date(\"U\", strtotime($date_string));\n return $timestamp;\n }\n else {\n return NULL;\n }\n }", "function convert_time($value)\n\t{\n\t\t$dateLargeInt=$value; // nano secondes depuis 1601 !!!!\n\t\t$secsAfterADEpoch = $dateLargeInt / (10000000); // secondes depuis le 1 jan 1601\n\t\t$ADToUnixConvertor=((1970-1601) * 365.242190) * 86400; // UNIX start date - AD start date * jours * secondes\n\t\t$unixTimeStamp=intval($secsAfterADEpoch-$ADToUnixConvertor); // Unix time stamp\n\t\treturn $unixTimeStamp;\n\t}", "public static function getDatetimeFromTimestamp($timestamp)\n {\n return date(\"Y-m-d H:i:s\", $timestamp);\n }", "public function getTimestamp(): ?string;", "protected function typeTimestamp(Magic $column)\n {\n return 'DATETIME';\n }", "public static function isTimestamp($time) {\n\t\tif( (int)$time > 0 && strtotime(date('Y-m-d H:i:s', $time))===(int)$time ){\n\t\t\treturn\t['code'=>1];\n\t\t}else{\n\t\t\treturn\t['code'=>0, 'msg'=>'时间戳格式有误'];\n\t\t}\n\t}", "#[ReturnTypeWillChange]\n public function setTimestamp($timestamp)\n {\n $time = date('Y-m-d H:i:s', $timestamp);\n\n return self::parse($time, $this->timezone, $this->locale);\n }", "static public function fromTimestamp($timestamp){\n\t\treturn self::getDatefromTimestamp($timestamp);\n\t}", "protected function castCreatedAt(string $timestamp): void\n {\n $this->created_at = Datetime::fromString($timestamp);\n }", "public function toDateTime(): \\DateTime\n {\n return new \\DateTime($this->getTimestamp());\n }", "public static function toDateTime($ts){\n return date('d.m.Y H:i:s',$ts); \n }", "function _unix_timestamp($date) { return strtotime($date); }", "protected function typeTimestamp(Fluent $column)\n {\n return 'datetime';\n }", "function getDatestamp()\n{\n $d = new DateTime();\n return $d->getTimestamp() . \"\";\n}" ]
[ "0.6994985", "0.68751204", "0.67336977", "0.667425", "0.6666232", "0.6470565", "0.64420027", "0.641171", "0.63390946", "0.6321646", "0.632027", "0.6305848", "0.6279379", "0.6246241", "0.62109846", "0.6209737", "0.62015337", "0.6196752", "0.6189135", "0.6167675", "0.6167675", "0.6167675", "0.61670893", "0.61298186", "0.6118014", "0.61130166", "0.6095876", "0.60938364", "0.6075364", "0.60618335", "0.60611653", "0.6059276", "0.6057296", "0.6046072", "0.60372645", "0.6036182", "0.60245633", "0.6016783", "0.59889114", "0.5984629", "0.59808165", "0.5975813", "0.5970696", "0.5969832", "0.59697527", "0.5952364", "0.5948234", "0.5922815", "0.59197074", "0.59197074", "0.59129703", "0.59096664", "0.58951944", "0.58889955", "0.5837691", "0.5836384", "0.5820605", "0.5780364", "0.5777783", "0.57774293", "0.57556874", "0.5744557", "0.5738603", "0.5721895", "0.5715516", "0.5713921", "0.5713551", "0.56983745", "0.56924343", "0.56881195", "0.5684639", "0.56762683", "0.5671788", "0.5665701", "0.5653976", "0.5650605", "0.564985", "0.5641474", "0.56366783", "0.5631963", "0.5630972", "0.56237006", "0.56058264", "0.5604978", "0.56037295", "0.5592838", "0.55916065", "0.55877984", "0.55850375", "0.55826426", "0.5576766", "0.5571523", "0.55586016", "0.55585736", "0.55564445", "0.55303943", "0.55285007", "0.5522338", "0.5521376", "0.5506778" ]
0.6131606
23
Display a listing of the resource.
public function index() { return Departments::all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $request->validate([ 'department_name' => 'required' ]); return Departments::create($request->all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $department = Departments::find($id); $department->update($request->all()); return $department; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $delete = Departments::destroy($id); if ($delete) { return ['message' => 'department has been deleted successfully']; } else { return ['message' => 'Oops something went wrong']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
This watchdog watches for cron ticks.
function tickWatchdog($depth = null) { $things = $this->getThings("cron"); if ($things == null) { $this->response .= "No ticks found. "; return true; } // // devstack. // $test = $thing->variables['test']; // //$test = $thing['variables']['test']; $refreshed_at = []; foreach ($things as $uuid => $thing) { $refreshed_at[$uuid] = $thing->variables["cron"]["refreshed_at"]; } array_multisort($refreshed_at, SORT_DESC, $things); $age = 1e99; if (isset($things[0]->variables["cron"]["refreshed_at"])) { // $age = 1e99; $refreshed_at = $things[0]->variables["cron"]["refreshed_at"]; $age = strtotime($this->current_time) - strtotime($refreshed_at); } $tick_limit_seconds = 60; if ($age > $tick_limit_seconds) { $thing = new Thing(null); // Document as $thing->Create('to', 'from', 'message text') $thing->Create( "human", "watchdog", "Watchdog barked. It has been quiet since " . $age ); $thing->thing_report["sms"] = "merp"; $web = ""; $web .= "This number was made about ago."; $web .= "<br>"; $thing->thing_report["email"] = $web; $message_thing = new Message($thing, $thing->thing_report); $this->thing_report["info"] = $message_thing->thing_report["info"]; $this->response .= "Did not see a tick within the last " . $tick_limit_seconds . ". "; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }", "static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}", "function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT * FROM {$table_name}\";\n\t\t$feeds = $wpdb->get_results( $sql );\n\n\t\t// ===============================\n\t\t// = go over each iCalendar feed =\n\t\t// ===============================\n\t\tforeach( $feeds as $feed ) {\n\t\t // flush the feed\n\t\t $wgobd_settings_controller->flush_ics_feed( false, $feed->feed_url );\n\t\t // import the feed\n\t\t\t$wgobd_importer_helper->parse_ics_feed( $feed );\n\t\t}\n\t}", "function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}", "public function wp_cron_scheduled_check()\n {\n }", "public function schedule_cron() {\n\t\twp_schedule_event( time(), 'daily', 'download_iracing_members_files' );\n\t\twp_schedule_event( time(), 'daily', 'convert_iracing_members_file_to_json' );\n\t}", "public function run() {\n\t\t$this->cronStarts = time() - 1;\n\t\tif (!$this->isOtherCronRunning()) {\n\t\t\t$config = new UnzerCw_SettingApi();\n\t\t\tUnzerCw_MutableConstantApi::setConstant(self::CRON_MUTEX_NAME, 0);\n\t\t}\n\t\t$cronProcessor = new Customweb_Cron_Processor(UnzerCw_Util::getContainer());\n\t\t$cronProcessor->run();\n\t}", "function install_cron(){\n wp_schedule_event(\n time(),\n 'cuentadigital_interval',\n 'cuentadigital_cron_hook'\n );\n }", "function view_check_cron() {\n\t}", "public function cronCleanup() {\n if (variable_get('cron_semaphore', FALSE)) {\n watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);\n\n // Release cron semaphore.\n variable_del('cron_semaphore');\n }\n }", "public function cron()\n {\n wp_schedule_event(time(), 'hourly', array($this, 'generate'));\n }", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "public function cronRun() {\n @ignore_user_abort(TRUE);\n\n // Try to allocate enough time to run all the hook_cron implementations.\n drupal_set_time_limit(240);\n return $this->processQueues();\n }", "function wp_doing_cron()\n {\n }", "public function cron() {\n settings()->cron = json_decode(db()->where('`key`', 'cron')->getValue('settings', '`value`'));\n\n $this->process();\n }", "public function addcron() {\r\n $os = php_uname('s');\r\n\r\n $file = APP_PATH . '/index.php?c=cron&a=apply';\r\n\r\n\r\n switch ($os) {\r\n case substr($os, 0, 7) == 'Windows':\r\n exec(\"schtasks /create /sc minute /mo 5 /tn 'update_quota' /tr . $file . /ru 'System'\");\r\n break;\r\n\r\n case substr($os, 0, 5) == 'Linux':\r\n switch ($_SERVER['SERVER_PORT']) {\r\n case 80:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n case 443:\r\n $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n default:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\r\n }\r\n\r\n $cmdline = '*/5 * * * * /usr/bin/curl' . $url;\r\n\r\n exec('crontab -e <' . $cmdline);\r\n break;\r\n }\r\n }", "function do_cron() {\n global $config;\n ct_log(\"Cron-Job started.\", 2, -1, 'cron');\n \n $btns = churchcore_getModulesSorted(false, false);\n foreach ($btns as $key) {\n include_once (constant(strtoupper($key)) . \"/$key.php\");\n if (function_exists($key . \"_cron\") && getConf($key . \"_name\")) {\n $arr = call_user_func($key . \"_cron\");\n }\n }\n ct_sendPendingNotifications();\n ct_log(\"Cron-Job finished.\", 2, -1, 'cron');\n}", "protected function checkScheduledJobs() {\n global $database;\n // first get all active cronjobs\n $SQL = sprintf(\"SELECT * FROM %smod_kit_cj_cronjob WHERE `cronjob_status`='ACTIVE'\", TABLE_PREFIX);\n if (null ===($result = $database->query($SQL))) {\n $this->setError(sprintf('[%s _ %s] %s', __METHOD__, __LINE__, $database->get_error()));\n exit($this->getError());\n }\n $cronjobs = array();\n while (false !== ($job = $result->fetchRow(MYSQL_ASSOC))) {\n $cronjobs[$job['cronjob_id']] = $job;\n }\n foreach ($cronjobs as $cronjob) {\n $this->log[self::CRONJOB_ID] = $cronjob['cronjob_id'];\n $this->log[self::CRONJOB_NAME] = $cronjob['cronjob_name'];\n if ($cronjob['cronjob_next_run'] == '0000-00-00 00:00:00') {\n // this cronjob was never executed...\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $cronjob['cronjob_last_status'] = 'First call, calculate the next regular run of this cronjob.';\n $cronjob['cronjob_last_run'] = date('Y-m-d H:i:s');\n $this->updateCronjob($cronjob);\n $this->log[self::LOG_MESSAGE] = 'First call, calculate the next regular run of this cronjob.';\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = $cronjob['cronjob_last_run'];\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n }\n if (strtotime($cronjob['cronjob_next_run']) < time()) {\n // execute this cronjob\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_URL)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_URL));\n }\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_PATH)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_PATH));\n }\n if (strpos($cronjob['cronjob_command'], DIRECTORY_SEPARATOR) == 0) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], 1);\n }\n $execute = LEPTON_PATH.DIRECTORY_SEPARATOR.$cronjob['cronjob_command'];\n if (!file_exists($execute)) {\n // write the error to the log but continue with the next cronjob.\n $this->setError(sprintf('The relative path %s does not exists, please check the settings for this cronjob!', $cronjob['cronjob_command']));\n continue;\n }\n if (false === ($result = exec(sprintf(\"%s %s\", $this->php_exec, $execute)))) {\n // error executing - write log and continue\n $this->setError(sprintf('Error executing %s - no more informations available.', $cronjob['cronjob_command']));\n continue;\n }\n $this->log[self::LOG_MESSAGE] = $result;\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = date('Y-m-d H:i:s');\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n $cronjob['cronjob_last_run'] = $this->log[self::CRONJOB_RUN];\n $cronjob['cronjob_last_status'] = $result;\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $this->updateCronjob($cronjob);\n $this->cronjob_executed = true;\n }\n }\n }", "public function startListeningForEvents()\n\t\t{\n\n\t\t\t// Initialize the crontab manager if this has not been done before\n\t\t\tif(is_null($this->CronManager)) $this->CronManager = new ssh2_crontab_manager();\n\n\t\t\t// Check if the cron job has already been added\n\t\t\t$this->readConfig();\n\n\t\t\tif(\n\t\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] === \"enabled\" &&\n\t\t\t\tisSizedString($this->CronManager->cronjob_exists(\"checkTimeEventExecutionNeeds\"))\n\t\t\t)\n\t\t\t{\n\n\t\t\t\t// Cancel the execution of the function\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\t// Restart the cronjob in case he is already issued\n\t\t\tif(isSizedArray($this->CronManager->cronjob_exists(\"checkTimeEventExecutionNeeds\")))\n\t\t\t\t$this->stopListeningForEvents();\n\n\t\t\t// Add the cron job\n\t\t\t$this->CronManager->append_cronjob(\n\t\t\t// Running every minute\n\t\t\t\t\"* * * * * sudo php -c /etc/php/7.3/fpm/php.ini \".ABSPATH.'/mods/'.static::ACTIVE_MOD.'/cronActions/checkTimeEventExecutionNeeds.php'\n\t\t\t);\n\n\t\t\t// Write status to the config\n\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] = \"enabled\";\n\t\t\t$this->writeConfFile($this->data['config'], true);\n\n\t\t}", "public static function remove_crons() {\n\t\t$events = self::get_events();\n\n\t\tforeach ( $events as $event => $recurrence ) {\n\t\t\t$timestamp = wp_next_scheduled( $event );\n\t\t\tif ( false !== $timestamp ) {\n\t\t\t\twp_unschedule_event( $timestamp, $event );\n\t\t\t}\n\t\t}\n\t}", "function goodrds_schedule_cron() {\n\t if ( !wp_next_scheduled( 'goodrds_cronjob' ) )\n\t wp_schedule_event(time(), 'daily', 'goodrds_cronjob');\n\t}", "public function set_cron_check() {\n\n\t\t/* Nonce check */\n\t\tcheck_ajax_referer( 'wpcd-admin', 'nonce' );\n\n\t\t/* Permision check - unsure that this is needed since the action is not destructive and might cause issues if the user sees the message and can't dismiss it because they're not an admin. */\n\t\tif ( ! wpcd_is_admin() ) {\n\t\t\twp_send_json_error( array( 'msg' => __( 'You are not authorized to perform this action - dismiss cron check.', 'wpcd' ) ) );\n\t\t}\n\n\t\t/* Permissions passed - set transient. */\n\t\tset_transient( 'wpcd_cron_check', 1, 12 * HOUR_IN_SECONDS );\n\t\twp_die();\n\n\t}", "function questionnaire_cron () {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n return questionnaire_cleanup();\n}", "public static function wpapp_schedule_events() {\n\t\t// setup temporary script deletion.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_file_watcher' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_file_watcher' );\n\n\t\t// setup deferred instance actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_server' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_server' );\n\n\t\t// setup repeated actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_apps' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_apps' );\n\n\t\t// @TODO does not work because the cron schedule is not registered.\n\t\t// wp_schedule_event( time(), 'every-10-seconds', \"wpcd_wordpress_repeated_actions_for_apps\" );\n\t}", "function simulateCron() {\n\t\tglobal $publishthis;\n\n\t\t// Return here is we want to pause polling.\n\t\tif ( $publishthis->get_option ( 'pause_polling' ) ) {\n\t\t\tif ( ! get_option ( 'publishthis_paused_on' ) ) {\n\t\t\t\tupdate_option ( 'publishthis_paused_on', time() );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tignore_user_abort( true );\n\n\t\t//modifying the logic here a bit and going with options, instead of\n\t\t//transients, because those were sometimes disappearing from\n\t\t//the wp cache. don't want to disrupt the clients site\n\n\t\t//basic algorithm\n\t\t/*\n 1 - see if we are doing the cron all ready, if so, don't do anything\n 2 - if not doing cron, get the last timestamp of when we did this cron\n -- we only want to check every XX minutes\n 3 - if no time is set yet, we do the check\n 4 - if the time is set, and we have not yet passed our XX minutes, we do not do anything\n 5 - if we are doing the check, update that we are doing the cron\n 6 - do the cron action\n 7 - once completed, set\n - the timestamp we completed at, for future checks\n - remove the doing cron value\n */\n\t\t$doingSimulatedCron = get_option ( 'pt_simulated_cron' );\n\n\t\t//create lock flag if not exists and set it to 0 (false)\n\t\tif ( false === $doingSimulatedCron ) {\n\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t}\n\t\t$doingSimulatedCron = intval($doingSimulatedCron);\n\t\t//cron is not running\n\t\tif ( 0 === $doingSimulatedCron ) {\n\t\t\t//check the time\n\t\t\t$secondsExpiration = 60 * 2; //roughly 2 minutes. should be based on publishing action set poll times, but that would be too much to query;\n\n\t\t\t$timestamp = get_option ( 'pt_simulated_cron_ts' );\n\n\t\t\t$currentTimestamp = ( time() ) * 1000;\n\n\t\t\tif ( !$timestamp ) {\n\t\t\t\t//this has never been set before, so, we can just assume we need to do the cron\n\t\t\t\t$timestamp = $currentTimestamp;\n\t\t\t\t\n\t\t\t\t//set the timestamp the first time\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $timestamp );\n\t\t\t}\n\t\t\t//see if we need to do the cron\n\t\t\t$diffTimestamp = $currentTimestamp - $timestamp;\n\t\t\t\n\t\t\t$diffTimeSeconds = ( $diffTimestamp / 1000 );\n\t\n\t\t\tif ( $diffTimeSeconds >= $secondsExpiration ) {\n\t\t\t\t//ok, we need to do the cron action\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 1 );\n\n\t\t\t\ttry {\n\t\t\t\t\t//if we are here, that means we need to do the cron action\n\t\t\t\t\t//get only active Publishing Actions\n\t\t\t\t\t$actions = $publishthis->publish->get_publishing_actions();\n\n\t\t\t\t\t$publishthis->log->addWithLevel ( array(\n\t\t\t\t\t\t\t'message' => 'Checking on simulated cron events',\n\t\t\t\t\t\t\t'status' => 'info',\n\t\t\t\t\t\t\t'details' => \"Found \" . count( $actions ) . \" publishing events to check\" ), \"2\" );\n\t\t\t\t\t\n\t\t\t\t\t// do import\n\t\t\t\t\t$publishthis->publish->run_import();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//set simulate cron options on failure\n\t\t\t\t\t//leaving duplicated lines, because php4 doesn't have finally block\n\t\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//now that we are done, set the old timestamp\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t}\t\n\t\t}\t\t\n\t}", "public function schedule_cron($rate = 'md5_hash_weekly') {\n if ( !wp_next_scheduled( 'md5_hasher_check_dir' ) ) {\n wp_schedule_event( time(), $rate, 'md5_hasher_check_dir');\n }\n }", "function cicleinscription_cron () {\n return true;\n}", "private function _updateCronStats()\n\t{\n\t $this->load->model('tasks');\n\t $this->tasks->updateCronStats();\n\t}", "function wp_schedule_update_checks()\n {\n }", "static function jobs() {\n\t\tif(self::doCron()):\n\t\t\n\t\twhile(!Db::lock());\n\n\t\tReminder::cron();\n\t\t\n\t\t$ctrl = new Cronjob();\n\t\t$ctrl->checkBookings();\n\t\t$ctrl->cancelPending();\n\t\t$ctrl->unattended();\n\t\t\n\t\twhile(!Db::unlock());\n\t\t\n\t\tPreferences::set('lastCron', date(\"H:i:s\"));\n\t\t_debug(\"CRON JOBS DONE!\");\n\t\tendif;\n\t}", "function _unschedule_cron( $hook ) {\n\t\tIMFORZA_Utils::unschedule_cron( $hook );\n\t}", "function econsole_cron () {\r\n global $CFG;\r\n\r\n return true;\r\n}", "public static function monitorLinesExecuted() {\r\n\t\tregister_tick_function('Debug::tickLineMonitor');\r\n\t}", "public function importer_cron()\n\t{\n\t\tDBTP_Utils::log('Importer started');\n\n\t\t$importManager = new DBTP_Import_Manager();\n\t\t$schedule = $importManager->schedule_imports();\n\n\t\tif (is_wp_error($schedule)) {\n\t\t\tDBTP_Utils::log('Importer error: '. $schedule->get_error_message());\n\t\t} else {\n\t\t\tDBTP_Utils::log('Imported has been scheduled');\n\t\t}\n\t}", "public function monitor(Schedule $schedule)\n\t{\n\n\t\t$date = Carbon::today()->toDateString();\n\n\t\t$events = new Collection($schedule->events());\n\n\t\t$events->each(function (Event $event) use ($date) {\n\n\t\t\t$command = str_after($event->command, '\\'artisan\\' ');\n\t\t\t$filename = str_slug($command) . \"-$date.log\";\n\t\t\t$path = storage_path(\"logs/$filename\");\n\n\t\t\t$event->sendOutputTo($path)->after(function () use ($command, $path) {\n\n\t\t\t\tif (file_exists($path) && ($output = file_get_contents($path))) {\n\n\t\t\t\t\t$start = $end = NULL;\n\t\t\t\t\t$json = json_decode($output, true);\n\n\t\t\t\t\tif( !empty( $json ) ){\n\t\t\t\t\t\t// cron success\n\t\t\t\t\t\t$start = $json['start'];\n\t\t\t\t\t\t$end = $json['end'];\n\t\t\t\t\t\t$output = $json['output'];\n\t\t\t\t\t\tCron::where( 'command', $command )->increment( 'success', 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCron::where( 'command', $command )->increment( 'error', 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tDB::table('cron_loggers')->insert([\n\t\t\t\t\t\t'command' => $command,\n\t\t\t\t\t\t'start' => $start,\n\t\t\t\t\t\t'end'\t\t=> $end,\n\t\t\t\t\t\t'output' => $output,\n\t\t\t\t\t\t'created_at' => Carbon::now(),\n\t\t\t\t\t]);\n\n\t\t\t\t\tunlink($path);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "public function runInCron(): void\n {\n $result = $this->run();\n\n if ($result->getStatus() !== true) {\n do_action(Hooks::ADVANCED_CHECK_ALERT, $this, $result);\n }\n }", "function metarefresh_hook_cron(&$croninfo) {\n\tassert('is_array($croninfo)');\n\tassert('array_key_exists(\"summary\", $croninfo)');\n\tassert('array_key_exists(\"tag\", $croninfo)');\n\n\tSimpleSAML\\Logger::info('cron [metarefresh]: Running cron in cron tag [' . $croninfo['tag'] . '] ');\n\n\ttry {\n\t\t$config = SimpleSAML_Configuration::getInstance();\n\t\t$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');\n\n\t\t$sets = $mconfig->getConfigList('sets', array());\n\t\t$stateFile = $config->getPathValue('datadir', 'data/') . 'metarefresh-state.php';\n\n\t\tforeach ($sets AS $setkey => $set) {\n\t\t\t// Only process sets where cron matches the current cron tag\n\t\t\t$cronTags = $set->getArray('cron');\n\t\t\tif (!in_array($croninfo['tag'], $cronTags, true)) continue;\n\n\t\t\tSimpleSAML\\Logger::info('cron [metarefresh]: Executing set [' . $setkey . ']');\n\n\t\t\t$expireAfter = $set->getInteger('expireAfter', NULL);\n\t\t\tif ($expireAfter !== NULL) {\n\t\t\t\t$expire = time() + $expireAfter;\n\t\t\t} else {\n\t\t\t\t$expire = NULL;\n\t\t\t}\n\n\t\t\t$outputDir = $set->getString('outputDir');\n\t\t\t$outputDir = $config->resolvePath($outputDir);\n\t\t\t$outputFormat = $set->getValueValidate('outputFormat', array('flatfile', 'serialize'), 'flatfile');\n\n\t\t\t$oldMetadataSrc = SimpleSAML_Metadata_MetaDataStorageSource::getSource(array(\n\t\t\t\t'type' => $outputFormat,\n\t\t\t\t'directory' => $outputDir,\n\t\t\t));\n\n\t\t\t$metaloader = new sspmod_metarefresh_MetaLoader($expire, $stateFile, $oldMetadataSrc);\n\n\t\t\t# Get global blacklist, whitelist and caching info\n\t\t\t$blacklist = $mconfig->getArray('blacklist', array());\n\t\t\t$whitelist = $mconfig->getArray('whitelist', array());\n\t\t\t$conditionalGET = $mconfig->getBoolean('conditionalGET', FALSE);\n\n\t\t\t// get global type filters\n\t\t\t$available_types = array(\n\t\t\t\t'saml20-idp-remote',\n\t\t\t\t'saml20-sp-remote',\n\t\t\t\t'shib13-idp-remote',\n\t\t\t\t'shib13-sp-remote',\n\t\t\t\t'attributeauthority-remote'\n\t\t\t);\n\t\t\t$set_types = $set->getArrayize('types', $available_types);\n\n\t\t\tforeach($set->getArray('sources') AS $source) {\n\n\t\t\t\t// filter metadata by type of entity\n\t\t\t\tif (isset($source['types'])) {\n\t\t\t\t\t$metaloader->setTypes($source['types']);\n\t\t\t\t} else {\n\t\t\t\t\t$metaloader->setTypes($set_types);\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific blacklists\n\t\t\t\tif(isset($source['blacklist'])) {\n\t\t\t\t\t$source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['blacklist'] = $blacklist;\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific whitelists\n\t\t\t\tif(isset($source['whitelist'])) {\n\t\t\t\t\t$source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['whitelist'] = $whitelist;\n\t\t\t\t}\n\n\t\t\t\t# Let src specific conditionalGET override global one\n\t\t\t\tif(!isset($source['conditionalGET'])) {\n\t\t\t\t\t$source['conditionalGET'] = $conditionalGET;\n\t\t\t\t}\n\n\t\t\t\tSimpleSAML\\Logger::debug('cron [metarefresh]: In set [' . $setkey . '] loading source [' . $source['src'] . ']');\n\t\t\t\t$metaloader->loadSource($source);\n\t\t\t}\n\n\t\t\t// Write state information back to disk\n\t\t\t$metaloader->writeState();\n\n\t\t\tswitch ($outputFormat) {\n\t\t\t\tcase 'flatfile':\n\t\t\t\t\t$metaloader->writeMetadataFiles($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'serialize':\n\t\t\t\t\t$metaloader->writeMetadataSerialize($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ($set->hasValue('arp')) {\n\t\t\t\t$arpconfig = SimpleSAML_Configuration::loadFromArray($set->getValue('arp'));\n\t\t\t\t$metaloader->writeARPfile($arpconfig);\n\t\t\t}\n\t\t}\n\n\t} catch (Exception $e) {\n\t\t$croninfo['summary'][] = 'Error during metarefresh: ' . $e->getMessage();\n\t}\n}", "function dllc_cron () {\n return true;\n}", "function _schedule_cron( $hook, $recurrence = null, $time = null ) {\n\t\tIMFORZA_Utils::schedule_cron( $hook, $recurrence, $time );\n\t}", "function add_custom_cron() {\n\tif ( ! wp_next_scheduled( 'custom_cron_action' ) ) {\n\t\twp_schedule_event( current_time( 'timestamp' ), 'hourly', 'custom_cron_action' );\n\t}\n}", "public function cron() {\n include('programming_cron.php');\n }", "function drush_lightcron_run_cron_hooks() {\n $modules = lightcron_parse_arguments(func_get_args(), FALSE);\n foreach ($modules as $module) {\n if (module_exists($module)) {\n $callback = $module . '_cron';\n if (function_exists($callback)) {\n $callback();\n drush_log(dt('!module (!date): cron hook executed.', array('!module' => $module, '!date' => date('Y-m-d H:i:s O'))), 'ok');\n }\n else {\n drush_log(dt('!module does not have a cron hook.', array('!module' => $module)), 'error');\n }\n }\n else {\n drush_log(dt('!module does not exist i.e. not installed and enabled.', array('!module' => $module)), 'error');\n }\n }\n}", "function CheckCron()\n\t{\n\t\t$cronok = false;\n\t\t$query = \"SELECT * FROM \" . SENDSTUDIO_TABLEPREFIX . \"settings\";\n\t\t$result = $this->Db->Query($query);\n\t\t$row = $this->Db->Fetch($result);\n\t\tif ($row['cronok'] == 1) {\n\t\t\t$cronok = true;\n\t\t}\n\n\t\t$this->cronok = $cronok;\n\t\t$this->cronrun1 = (int)$row['cronrun1'];\n\t\t$this->cronrun2 = (int)$row['cronrun2'];\n\n\t\tif (isset($row['database_version'])) {\n\t\t\t$this->database_version = $row['database_version'];\n\t\t} else {\n\t\t\t$query = \"ALTER TABLE \" . SENDSTUDIO_TABLEPREFIX . \"settings ADD COLUMN database_version INT\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t\tif ($result) {\n\t\t\t\t$query = \"UPDATE \" . SENDSTUDIO_TABLEPREFIX . \"settings SET database_version='0'\";\n\t\t\t\t$result = $this->Db->Query($query);\n\t\t\t}\n\t\t}\n\n\t\t$query = \"SELECT * FROM \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule\";\n\t\t$result = $this->Db->Query($query);\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\n\t\t\t/**\n\t\t\t * check if the item is in the schedule array.\n\t\t\t * If it's not, then it may be an addon has defined a cron schedule but not cleaned itself up when it has been uninstalled/disabled.\n\t\t\t */\n\t\t\t$schedule_name = $row['jobtype'];\n\t\t\tif (!isset($this->Schedule[$schedule_name])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->Schedule[$schedule_name] = array('lastrun' => $row['lastrun']);\n\t\t}\n\n\t\treturn $cronok;\n\t}", "function bpsPro_schedule_PFWAP_check() {\n$options = get_option('bulletproof_security_options_pfw_autopilot');\n$bpsPFWAPCronCheck = wp_get_schedule('bpsPro_PFWAP_check');\n$killit = '';\n\t\n\tif ( ! get_option('bulletproof_security_options_pfw_autopilot' ) || ! $options['bps_pfw_autopilot_cron'] || $options['bps_pfw_autopilot_cron'] == '' ) {\n\t\treturn $killit;\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron'] == 'On' ) {\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '1' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled( 'bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_1', 'bpsPro_PFWAP_check');\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '5' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_5', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '10' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_10', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '15' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_30' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_15', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\t\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '30' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_60' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_30', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\n\tif ( $options['bps_pfw_autopilot_cron_frequency'] == '60' ) {\n\tif ( $bpsPFWAPCronCheck == 'minutes_1' || $bpsPFWAPCronCheck == 'minutes_5' || $bpsPFWAPCronCheck == 'minutes_10' || $bpsPFWAPCronCheck == 'minutes_15' || $bpsPFWAPCronCheck == 'minutes_30' ) {\n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n\t\n\tif ( ! wp_next_scheduled('bpsPro_PFWAP_check' ) ) {\n\t\twp_schedule_event( time(), 'minutes_60', 'bpsPro_PFWAP_check' );\n\t}\n\t}\n\n\t}\n\telseif ( $options['bps_pfw_autopilot_cron'] == 'Off' ) { \n\t\twp_clear_scheduled_hook('bpsPro_PFWAP_check');\n\t}\n}", "function registry()\n\t{\n\t\tif ( !wp_next_scheduled( 'admin_action_delibera_cron_action' ) ) // if already been scheduled, will return a time \n\t\t{\n\t\t\twp_schedule_event(time(), 'hourly', 'admin_action_delibera_cron_action');\n\t\t}\n\t}", "public function everyHour() {\n $this->cron('0 * * * *');\n }", "public function cron_action()\n\t{\n\n\t\t// process any recently updated inventory\n\t\t$this->inventory_batch();\n\t\t\n\t\t// process any recently shipped orders\n\t\t$this->shipping_batch();\n\n\t\t// process any recently processing orders\n\t\t$this->processing_batch();\n\n\t\t// process any product updates\n\t\t$this->product_batch(); \n\n\t\t// clean up any old records from the queues\n\t\t$this->cleanup();\n\t\texit('done');\n\n\t}", "public function cron(){\n\n $servers = $this->getServers();\n $emails = Notification::all();\n \n foreach ($servers as $server){\n //Get the server metrics and thresholds\n $this->getServerThresholds( $server ); \n\n $msg = \"\";\n\n if( isset($server->warnings) && count($server->warnings) > 0 ){\n // Got the message\n foreach( $server->warnings as $warning){\n $msg[] = $warning ;\n }\n //Store the notification\n //Save notification on messages table\n $this->storeServerNotifications($msg, $server->id);\n \n //Get the users for notification\n foreach( $emails as $item){\n $user = User::where('email', $item->email )->first();\n $user->notify( new ServerThresholdReached( $msg ) ); \n }\n \n }\n\n //echo $server->name . \" / \" . implode(\",\",$msg) . \"<br/>\"; \n //Notify users of the issue \n }\n }", "public static function eventCronEnd()\n {\n $errorSites = array();\n $config = AiBolitHelper::getConfig();\n $mail_config = AiBolitHelper::getMailConfig();\n $sites = AibolitModel::getAllSites();\n $autoScanSites = AibolitModel::getAutoScanSites();\n \n foreach ($autoScanSites as $site) {\n if ($sites[$site]['scanner']['virus_detected']) {\n $errorSites[] = $site . ' (viruses: ' . $sites[$site]['scanner']['virus_detected'] . ')';\n }\n if ($sites[$site]['scanner']['queue'] == AibolitModel::STATUS_ERROR) {\n $errorSites[] = $site . ' (error scanning)';\n }\n }\n\n if (count($errorSites) > 0 && $config['send_email_detected']) {\n AiBolitHelper::sendEmail($mail_config['fromWhoName'] . ' - Ai-bolit', 'Scanner finded viruses in sites: ' . implode(', ', $errorSites), $config['email']);\n AiBolitHelper::toLog('Send to email ' . $config['email'] . ': Scanner finded viruses in sites: ' . implode(', ', $errorSites));\n }\n }", "function bigbluebuttonbn_cron () {\n return true;\n}", "function etherpadlite_cron () {\n return true;\n}", "function install_cron_scheduler() {\n\tglobal $amp_conf;\n\tglobal $nt;\n\n\t// crontab appears to return an error when no entries, os only fail if error returned AND a list of entries.\n\t// Don't know if this will ever happen, but a failure and a list could indicate something wrong.\n\t//\n\t$outlines = array();\n\texec(\"/usr/bin/crontab -l\", $outlines, $ret);\n\tif ($ret && count($outlines)) {\n\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Failed to check crontab for cron manager\"), sprintf(_(\"crontab returned %s error code when checking for crontab entries to start freepbx-cron-scheduler.php crontab manager\"),$ret));\n\t} else {\n\t\t$nt->delete('retrieve_conf', 'CRONMGR');\n\t\t$outlines2 = preg_grep(\"/freepbx-cron-scheduler.php/\",$outlines);\n\t\t$cnt = count($outlines2);\n\t\tswitch ($cnt) {\n\t\t\tcase 0:\n\t\t\t\t/** grab any other cronjobs that are running as asterisk and NOT associated with backups\n \t\t\t\t* this code was taken from the backup module for the most part. But seems to work...\n \t\t\t\t*/\n\t\t\t\t$outlines = array();\n\t\t\t\texec(\"/usr/bin/crontab -l | grep -v ^#\\ DO\\ NOT | grep -v ^#\\ \\( | grep -v freepbx-cron-scheduler.php\", $outlines, $ret);\n\t\t\t\t$crontab_entry = \"\";\n\t\t\t\tforeach ($outlines as $line) {\n\t\t\t\t\t$crontab_entry .= $line.\"\\n\";\n\t\t\t\t}\n\t\t\t\t// schedule to run hourly, at a random time. The random time is explicit to accomodate things like module_admin online update checking\n\t\t\t\t// since we will want a random access to the server. In the case of module_admin, that will also be scheduled randomly within the hour\n\t\t\t\t// that it is to run\n\t\t\t\t//\n\t\t\t\t$crontab_entry .= rand(0,59).\" * * * * \".$amp_conf['AMPBIN'].\"/freepbx-cron-scheduler.php\";\n\t\t\t\tsystem(\"/bin/echo '$crontab_entry' | /usr/bin/crontab -\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t// already running, nothing to do\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// error, there should never be more than one running\n\t\t\t\techo \"TODO: deal with error here\\n\";\n\t\t\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Multiple freepbx-cron-scheduler.php running\"), sprintf(_(\"There were %s freepbx-cron-scheduler.php instances running. There should be only 1.\"),$cnt));\n\t\t}\n\t}\n}", "public function holiday() {\n\t\t// Disable cron\n\t\t$output = shell_exec('crontab -l');\n\t\t$lines = explode(\"\\n\", trim($output));\n\t\tif (count($lines) > 3) {\n\t\t\t$x='';\n\t\t\twhile ($lines[0] != \"#BEGIN\") {\n\t\t\t\t$x .=$lines[0].PHP_EOL; //copy first header lines of cron file\n\t\t\t\tarray_shift($lines);\n\t\t\t}\n\t\t\t$x .=$lines[0].PHP_EOL; //copy first header lines of cron file\n\t\t\tarray_shift($lines);\n\t\t\tforeach ($lines as $line) {\n\t\t\t\tif (substr($line,0,1) != '#') $x .= '#'.$line.PHP_EOL; //comment cron line\n\t\t\t\telse $x .= $line.PHP_EOL;\n\t\t\t}\n\t\t\tfile_put_contents(Flight::get(\"pathCron\"), $x);\n\t\t\texec(\"cat \".Flight::get(\"pathCron\").\" | crontab -\");\n\t\t\t$ret = array('Status' => 'OK');\n\n\t\t}\n\t\telse { $ret = array('Status' => 'KO','Cron' => 'Not Found'); }\n\t\t// del all \"At\"\n\t\t$x = shell_exec('atq');\n\t\tif (count($x) >= 1) {\n\t\t\t$x = explode(\"\\n\",trim($x));\n\t\t\tforeach ($x as $at) {\n\t\t\t\t$at = explode(\"\\t\", $at);\n\t\t\t\tpassthru('atrm '.$at[0],$x1);\n\t\t\t}\n\t\t}\n\t\tFlight::json($ret);\n\t}", "static public function disable_cron()\n {\n wp_clear_scheduled_hook( self::$cron_name );\n }", "public function cron($key) {\n\t\t// Todo a task \n\t}", "public function cron($key) {\n\t\t// Todo a task \n\t}", "function DbgCmd_Watch() {\n\t\tglobal $user;\n\n\t\t$this->watches = array();\n\n\t\tif (is_readable($this->watchfile())) {\n\t\t\t$s = implode(\"\",@file($this->watchfile()));\n\n\t\t\t$a = unserialize($s);\n\n\t\t\tif (count($a) > 0)\n\t\t\t\t$this->watches = (array)$a;\n\t\t}\n\t}", "function annotation_cron () {\n return true;\n}", "function cron_job_for_closed_event_check() {\n $this->event_model->cron_job_for_closed_event_check();\n }", "function roshine_cron () {\n return true;\n}", "protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}", "function tquiz_cron () {\n return true;\n}", "static function doCron() {\n\t\t$lc = new DateTime(Preferences::value(\"lastCron\"));\n\t\t$now = new DateTime();\n\t\t\n\t\t$diff = $now->diff($lc, true);\n\t\tif($diff->i >= 1) return true;\n\t\treturn false;\n\t}", "public function cron()\n\t{\n\t\t$objNews = $this->Database->prepare(\"SELECT * FROM tl_news WHERE newsalert=? AND na_sent=? AND date<=?\")\n\t\t\t\t\t\t\t\t ->execute(1, '', time());\n\t\t\t\t\t\t\t\t \n\t\tif ($objNews->numRows)\n\t\t{\n\t\t\twhile( $objNews->next() )\n\t\t\t{\n\t\t\t\t$this->send($objNews->id, true);\n\t\t\t}\n\t\t}\n\t}", "static public function activate()\n {\n do_action( \"sc_wpfmp_enable_wp_cron\" ); // Go enable cron\n }", "public function fireMailerCrons()\n {\n $notify_crons = $this->timber->option_model->getOptionByKey('_notify_crons');\n\n $status = true;\n\n if( (false !== $notify_crons) && (is_object($notify_crons)) ){\n $notify_crons = $notify_crons->as_array();\n\n $notify_crons['op_value'] = unserialize($notify_crons['op_value']);\n\n foreach ( $notify_crons['op_value'] as $key => $data ) {\n unset($notify_crons['op_value'][$key]);\n $status &= (boolean) $this->execMailerCron($data);\n }\n\n $status &= $this->timber->option_model->updateOptionById(array(\n 'op_id' => $notify_crons['op_id'],\n 'op_value' => serialize($notify_crons['op_value'])\n ));\n }\n\n return $status;\n }", "public function cron(Reminder $reminder);", "public function cron($timeLimit = self::CRON_EXEC_TIME, $workerID = self::WORKER_ID)\n {\n $start = microtime(true);\n $workerID = $this->setWorkerID($workerID);\n $log = [];\n $lastCount = -1;\n while (count($log) > $lastCount &&\n (\n empty($timeLimit) ||\n $timeLimit > (microtime(true) - $start)\n )\n ) {\n $lastCount = count($log);\n $query = $this->pdo->prepare(<<<SQL\nUPDATE robotstxt__cache1\nSET worker = :workerID\nWHERE worker IS NULL AND nextUpdate <= UNIX_TIMESTAMP()\nORDER BY nextUpdate ASC\nLIMIT 1;\nSQL\n );\n $query->bindValue('workerID', $workerID, \\PDO::PARAM_INT);\n $query->execute();\n $query = $this->pdo->prepare(<<<SQL\nSELECT base\nFROM robotstxt__cache1\nWHERE worker = :workerID\nORDER BY nextUpdate DESC\nLIMIT 10;\nSQL\n );\n $query->bindValue('workerID', $workerID, \\PDO::PARAM_INT);\n $query->execute();\n while ($baseUri = $query->fetch(\\PDO::FETCH_COLUMN)) {\n if ((new Base($this->pdo, $baseUri, $this->curlOptions, $this->byteLimit))->refresh()) {\n $log[(string)microtime(true)] = $baseUri;\n }\n }\n }\n return $log;\n }", "function update_interval_schedule($int) {\n\t//check schedule exists, remove it, add new one\t\n\twp_clear_scheduled_hook('standards_resource_check');\t\n\tif ($int > 0)\n\t\twp_schedule_single_event( time() + 3600 * $int, 'standards_resource_check' );\n}", "public function cronSet() {\n// de tim height, khi nao co height thi tiep tuc lay tu 2 https://blockchain.info/latestblock va thuc hien phep toan .\n//\n// neu thoa man thi update status = 1 trong bang hash_confirm va borrow = 1 status\n // check borrow the chap\n $listCheck = Hash::where('status', 0)->get();\n if(count($listCheck)) {\n foreach($listCheck as $ihash) {\n $keyHash = $ihash->hask;\n $baseUrl = 'https://blockchain.info/rawtx/';\n $getInfo = $baseUrl.$keyHash;\n $file = $getInfo;\n $file_headers = @get_headers($file);\n if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found' || $file_headers[0] == 'HTTP/1.1 500 Internal Server Error') {\n $exists = false;\n }\n else {\n $exists = true;\n }\n if ($exists) {\n $jsonInfo = file_get_contents($getInfo);\n $objInfo = json_decode($jsonInfo);\n $urlHeight = 'https://blockchain.info/latestblock';\n $jsonInfoHeight = file_get_contents($urlHeight);\n $objInfoHeight = json_decode($jsonInfoHeight);\n if ( ( ($objInfoHeight->height - $objInfo->block_height) + 1) > 2 ) {\n Hash::where('id', $ihash->id)->update(array('status'=>1));\n // update status ...\n Borrow::where('id', $ihash->dataId)->update(array('status'=>1));\n }\n }\n }\n }\n\n $data = date('Y-m-d');\n $time = date('h-A');\n \\Log::useFiles(base_path() . '/log/'.$data.'/'.$time.'-info.log', 'info');\n \\Log::info('Log content here ...');\n // http://localhost/lending/tlog\n }", "public static function cronDaily() {\n\t\t$rel_folder='plugins/aTVremote/resources/images/';\n\t\t$abs_folder=dirname(__FILE__).'/../../../../'.$rel_folder;\n\t\texec(\"find \".$abs_folder.\"*.png -mtime +7 -exec rm {} \\;\");\n\t}", "public function watch()\n {\n set_error_handler([ $this, 'catchError' ], E_ALL);\n set_exception_handler([ $this, 'catchException' ]);\n \n add_action( 'shutdown', [ $this, 'runShutdownCleaner' ]);\n }", "public function cronAction()\n {\n $force = Mage::app()->getRequest()->getParam('force', false);\n $generator = Mage::getModel('smartassistant/generator');\n $generator->scheduleRun($force);\n }", "public function getCron() {\n\t\t$cron = [\"raw\" => \"\", \"active\" => false, \"mm\" => \"\", \"hh\" => \"\", \"dd\" => \"\", \"name\" => \"\"];\n\t\t$output = shell_exec('crontab -l');\n\t\t$lines = explode(\"\\n\", trim($output));\n\t\tif (count($lines) > 3) { // check cron is not empty - First 3 lines are not cron entry but used to reload crontrab at reboot\n\t\t\t$return['Status'] = \"OK\";\n\t\t\twhile ($lines[0] != \"#BEGIN\") { array_shift($lines); } //Remove non cron lines\n\t\t\tarray_shift($lines);\n\t\t\tforeach ($lines as $entry) {\n\t\t\t\t$str = explode(\"/usr\", $entry);\n\t\t\t\t$cron[\"raw\"] = rtrim($str[0]);\n\t\t\t\tif ($cron[\"raw\"][0] == \"#\") {\n\t\t\t\t\t$cron[\"active\"] = false;\n\t\t\t\t\t$sched = substr($cron[\"raw\"],1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$cron[\"active\"] = true;\n\t\t\t\t\t$sched = $cron[\"raw\"];\n\t\t\t\t}\n\t\t\t\t$sched = explode(\" \",$sched);\n\t\t\t\t$cron[\"mm\"] = $sched[0];\n\t\t\t\t$cron[\"hh\"] = $sched[1];\n\t\t\t\t$cron[\"dd\"] = $sched[4];\n\t\t\t\t$cron[\"name\"] = explode(\"#\",$str[count($str)-1]);\n\t\t\t\t$cron[\"name\"] = $cron[\"name\"][1];\n\t\t\t\t$return['cron'][]=$cron;\n\t\t\t}\n\t\t}\n\t\telse $return['Status'] = \"KO\";\n\t\tif (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2)[1]['function'] == 'invokeMethod') Flight::json($return);\n\t\telse return $return;\n\t}", "protected function runScheduledEvents()\r\n {\r\n foreach ($this->schedule->dueEvents($this->laravel) as $event) {\r\n $event = $this->convertEvent($event);\r\n\r\n if ($this->canAccessFiltersPass($event) && (! $event->filtersPass($this->laravel))) {\r\n continue;\r\n }\r\n\r\n if ($this->cache->has('eyewitness_scheduler_mutex_'.$event->mutexName())) {\r\n $this->line('<error>Skipping command due to Eyewitness pause:</error> '.$event->getSummaryForDisplay());\r\n continue;\r\n }\r\n\r\n $this->line('<info>Running scheduled command:</info> '.$event->getSummaryForDisplay());\r\n\r\n $event->run($this->laravel);\r\n\r\n $this->eventsRan = true;\r\n }\r\n }", "function uninstall_cron(){\n wp_clear_scheduled_hook( 'cuentadigital_cron_hook' );\n }", "function escape_cron () {\n global $CFG;\n\n return true;\n}", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "public static function initiate_schedules() {\n\t\t/** Clearing scheduled hook */\n\t\tif ( wp_next_scheduled( 'xl_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_clear_scheduled_hook( 'xl_maybe_track_usage_scheduled' );\n\t\t}\n\n\t\tif ( ! wp_next_scheduled( 'xl_new_maybe_track_usage_scheduled' ) ) {\n\t\t\twp_schedule_event( current_time( 'timestamp' ), 'weekly_xl', 'xl_new_maybe_track_usage_scheduled' );\n\t\t}\n\t}", "public function cron(){\n\t\t$query = 'SELECT `dr`.`device_id` FROM `device_registration` AS `dr` WHERE `http_client` = true;';\n\n\t\tif(!$this->morseduino -> _query($devices, $query, FALSE)){\n\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\treturn FALSE;\n\t\t}\n\t\tunset($query);\n\n\t\tforeach($devices as $dkey => $dvalue){\n\t\t\t$this->_idle_check($dvalue['device_id']);\n\t\t}\n\t\tunset($devices);\n\t\tunset($dkey);\n\t\tunset($dvalue);\n\n\t\treturn TRUE;\n\t}", "public function actionCronHourly()\n {\n switch (date('H')) {\n default: echo \"Nothing to run\\n\";\n }\n echo \"Done!\\n\";\n }", "function virtualcron($minDelay = false, $controlFile = false) {\r\n if ($minDelay)\r\n $this->minDelay = $minDelay;\r\n if ($controlFile)\r\n $this->controlFile = $controlFile;\r\n $this->lastExec = 0; // it will contain the UNIXTIME of the last action\r\n $this->nextExec = 0; // it will contain the UNIXTIME of the next action\r\n $this->secToExec = 0; // it will contain the time in seconds until of the next action\r\n if (file_exists($this->controlFile))\r\n $this->check = true;\r\n else {\r\n $handle = fopen($this->controlFile, \"w\");\r\n if (!$handle)\r\n $this->check = false;\r\n else {\r\n if (!fwrite($handle, time()))\r\n $this->check = false;\r\n else {\r\n fclose($handle);\r\n $this->check = true;\r\n }\r\n }\r\n }\r\n }", "public static function wpapp_clear_scheduled_events() {\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_file_watcher' );\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_server' );\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_apps' );\n\t}", "function loadCrons(&$manager, $specialOnly = FALSE, $token = \"\", $server = \"\") {\n\tif (!$token) { global $token; }\n\tif (!$server) { global $server; }\n\n\tif ($specialOnly) {\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/2n_updateReporters.php\", \"updateReporter\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/2o_updateCoeus.php\", \"processCoeus\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"publications/getAllPubs_func.php\", \"getPubs\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", date(\"Y-m-d\"));\n\t} else if ($token && $server) {\n\t\t$has = checkMetadataForFields($token, $server);\n\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", \"Monday\");\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", \"2020-03-05\");\n\t\t$manager->addCron(\"drivers/2n_updateReporters.php\", \"updateReporter\", \"Tuesday\");\n\t\tif ($has['coeus']) {\n\t\t\t$manager->addCron(\"drivers/2o_updateCoeus.php\", \"processCoeus\", \"Thursday\");\n\t\t}\n\t\tif ($has['news']) {\n\t\t\t$manager->addCron(\"news/getNewsItems_func.php\", \"getNewsItems\", \"Friday\");\n\t\t}\n $manager->addCron(\"drivers/13_pullOrcid.php\", \"pullORCIDs\", \"Friday\");\n\t\t$manager->addCron(\"publications/getAllPubs_func.php\", \"getPubs\", \"Saturday\");\n\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Monday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Tuesday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Wednesday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Thursday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Friday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Saturday\");\n\t\t$manager->addCron(\"drivers/12_reportStats.php\", \"reportStats\", \"Saturday\");\n\t\tif ($has['vfrs']) {\n\t\t\t$manager->addCron(\"drivers/11_vfrs.php\", \"updateVFRS\", \"Thursday\");\n\t\t}\n\t}\n\techo $manager->getNumberOfCrons().\" crons loaded\\n\";\n}", "function _get_cron_array()\n {\n }", "public function addCron() { // cron parameters passed via JSON query string\n\t\t$cron = json_decode(Flight::request()->query['cron'],true);\n\t\t$t = explode(\":\",$cron['t']); //time\n\t\t$i= 0;\n\t\t$str='';\n\t\tforeach ($cron['d'] as $d) { //compose day of Week\n\t\t\tif ($d) $str .= $i.',';\n\t\t\t$i++;\n\t\t};\n\t\t$str = rtrim($str,',');\n\t\t$cronLine = $t[1].' '.$t[0].' * * '.$str.' /usr/bin/curl localhost/radion >/dev/null 2>&1 #'.$cron['c'].PHP_EOL;\n\t\tfile_put_contents(Flight::get(\"pathCron\"), $cronLine, FILE_APPEND | LOCK_EX);\n\t\texec(\"cat \".Flight::get(\"pathCron\").\" | crontab -\");\n\t\tFlight::json(array('Status' => 'OK','Cron' => $t[1].' '.$t[0].' * * '.$str.' #'.$cron['c']));\n\t}", "public static function setup_sync_cronjob() {\n\t\tself::$timezone_string = get_option( 'timezone_string' );\n\t\tif ( ! wp_next_scheduled( self::SYNC_CRONJOB_NAME ) ) {\n\t\t\twp_schedule_event( Carbon::parse( '4am', self::$timezone_string )->getTimestamp(), 'daily', self::SYNC_CRONJOB_NAME );\n\t\t}\n\t}", "public static function cronIsRunning(){\n\t\t$utc_str = gmdate(\"M d Y H:i:s\", time());\n\t\t$utc = strtotime($utc_str);\n\t\treturn \\GO::config()->get_setting('cron_last_run') > $utc-300;\n\t}", "public static function doingCron() {\n\t\treturn (defined(\"DOING_CRON\") && DOING_CRON);\n\t}", "function _get_cron_lock()\n {\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//Runs daily, every 5 minutes from 03:00\n\t\t$schedule->command(TranslationsBackup::class)->dailyAt('03:00'); // Dispatching a Job that will create a CSV File with the translations\n\t\t$schedule->command(RemoveCsvFiles::class, ['1', '--queue'])->dailyAt('03:05'); // Remove CSV Files older than x months (default 1) from /var/www/public/admin/reports/csv\n\t\t$schedule->command(DeleteOldTokens::class, ['1'])->dailyAt('03:10'); // Deletes the tokens that are older than x (default 1) days\n\t\t$schedule->command(DeleteUselessTransactions::class, ['3', '1000'])->dailyAt('03:15'); //Delete a number of created transactions older than 3 months\n\t\t//$schedule->command(DeleteExpiredClients::class, ['1000'])->dailyAt('03:20'); // TODO: This comes from V1, why do we do it? Clear expired maestro clients\n\n\t\t//Runs every hour\n\t\t$schedule->command(ActivateVouchers::class)->hourly(); // Activate vouchers that are inactive and startDate < now()\n\t\t$schedule->command(DeactivateVouchers::class)->hourly(); // Deactivate vouchers that are active and stopDate < now()\n\t\t//$schedule->command(ClearPasswordAttempts::class, ['3'])->hourly(); // Update reminder table where there are more than 2 attempts and updated < last x (default 3) hours\n\t\t//$schedule->command(ClearHheClients::class)->hourly(); // TODO: This comes from V1, why do we do it? Clear expired hhe clients\n\n\t\t//Runs every 10 minutes\n\t\t//$schedule->command(MerakiCheck::class)->everyTenMinutes(); // Update airhealth.hardware based on a xml taken from a URL from site_attribute having \"meraki_network\"\n\t\t//$schedule->command(DestroyGhostSessions::class, ['10'])->everyTenMinutes(); // 1. Cleaning up NULL Connectinfo_Start records; 2. Cleaning up NULL Connectinfo_Stop records and acctstoptime; 3. Removing records stale for x (default 10) minutes\n\t\t//$schedule->command(ShutdownIdle::class, ['20'])->everyTenMinutes(); // Shuts down sessions older than x (default 20) minutes where IP is 192.168.1.2 by adding a acctstoptime | Might be CC only\n\t\t//$schedule->command(UpdateGender::class)->everyTenMinutes(); // Checks the name with the names that we have in our DB to return the gender\n\t\t$schedule->command(UpdatePmsDynamicIp::class)->everyTenMinutes(); // Updates the IP of site attributes that have dynamic_ip enabled (for UPMS and Captive PMS)\n\n\t\t//Runs every minute\n\t\t$schedule->command(DeleteTransactionReceipts::class, ['2', '10000'])->everyMinute(); // Delete a number of transaction receipts older than x (default 2) months\n\n\t\t// These are the SSID scheduling and was never implemented (unless it was)\n//\t\t$schedule->command(RevertScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n//\t\t$schedule->command(ChangeScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n\t}", "public function everyMinute()\n {\n return $this->cron('* * * * * *');\n }", "protected function processQueues() {\n $original_session_saving = drupal_save_session();\n drupal_save_session(FALSE);\n\n // Force the current user to anonymous to ensure consistent permissions on\n $original_user = $GLOBALS['user'];\n $GLOBALS['user'] = drupal_anonymous_user();\n\n $return = FALSE;\n\n // Try to acquire cron lock.\n if (!lock_acquire('cron', 240.0)) {\n // Cron is still running normally.\n return watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING);\n }\n\n //Grab the defined cron queues.\n $queues = $this->infoQueues;\n //$queues = module_invoke_all('cron_queue_info');\n drupal_alter('cron_queue_info', $queues);\n\n // Make sure every queue exists. There is no harm in trying to recreate an existing queue.\n foreach ($queues as $queue_name => $info) {\n DrupalQueue::get($queue_name)->createQueue();\n }\n // Iterate through the modules calling their cron handlers (if any):\n foreach (module_implements('cron') as $module) {\n // Do not let an exception thrown by one module disturb another.\n try {\n module_invoke($module, 'cron');\n }\n catch (Exception $e) {\n watchdog_exception('cron', $e);\n }\n }\n\n // Record cron time.\n variable_set('cron_last', REQUEST_TIME);\n watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);\n // Release cron lock.\n lock_release('cron');\n // Return TRUE so other functions can check if it did run successfully\n $return = TRUE;\n\n foreach ($queues as $queue_name => $info) {\n if (!empty($info['skip on cron'])) {\n // Do not run if queue wants to skip.\n continue;\n }\n\n $callback = $info['worker callback'];\n $end = time() + (isset($info['time']) ? $info['time'] : 15);\n $queue = DrupalQueue::get($queue_name);\n\n while (time() < $end && ($item = $queue->claimItem())) {\n try {\n call_user_func($callback, $item->data);\n $queue->deleteItem($item);\n }\n catch (Exception $e) {\n // In case of exception log it and leave the item in the queue to be processed again later.\n watchdog_exception('cron', $e);\n }\n }\n }\n\n // Restore the user.\n $GLOBALS['user'] = $original_user;\n drupal_save_session($original_session_saving);\n\n return $return;\n }", "public function runCronJob(): void\n {\n // A single warm up run must not run (much) longer than single WP-Cron run is allowed/expected to take, therefore:\n $now = \\microtime(true);\n // 1) Get the time current WP-Cron invocation started. If unknown, assume it just started now.\n $wp_cron_start_time = get_transient('doing_cron') ?: $now;\n // 2) Get the time-out value: it is equal to WP-Cron time-out by default, but can be set to a *smaller* value.\n $timeout = \\min(apply_filters(Hooks::FILTER_CACHE_WARM_UP_RUN_TIMEOUT, WP_CRON_LOCK_TIMEOUT), WP_CRON_LOCK_TIMEOUT);\n // 3) Compute time-out value adjusted to time left in current WP-Cron invocation.\n $adjusted_timeout = (int) max($wp_cron_start_time + $timeout - $now, 0);\n\n // Run the warm up with computed timeout...\n if ($this->run($adjusted_timeout) !== 0) {\n // ...if there are any items to crawl left, schedule next WP-Cron invocation.\n $this->schedule();\n }\n }", "function runcron() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\n\t\t$this->sendPerCycle = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['sendPerCycle']) : 50;\n\t\t$this->useDeferMode = trim($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) ? intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['useDeferMode']) : 0;\n\t\t$this->notificationJob = intval($TYPO3_CONF_VARS['EXTCONF']['direct_mail']['notificationJob']);\n\t\tif(!is_object($LANG) ) {\n\t\t\trequire_once (PATH_typo3.'sysext/lang/lang.php');\n\t\t\t$LANG = t3lib_div::makeInstance('language');\n\t\t\t$L = $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] ? $TYPO3_CONF_VARS['EXTCONF']['direct_mail']['cron_language'] : $this->user_dmailerLang;\n\t\t\t$LANG->init(trim($L));\n\t\t\t$LANG->includeLLFile('EXT:direct_mail/locallang/locallang_mod2-6.xml');\n\t\t}\n\n\t\t$pt = t3lib_div::milliseconds();\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\t'sys_dmail',\n\t\t\t'scheduled!=0' . \n\t\t\t' AND scheduled < ' . time() .\n\t\t\t' AND scheduled_end = 0' .\n\t\t\t' AND type NOT IN (2,3)' . \n\t\t\tt3lib_BEfunc::deleteClause('sys_dmail'),\n\t\t\t'',\n\t\t\t'scheduled'\n\t\t);\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y'), 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_invoked_at'). ' ' . date('h:i:s d-m-Y');\n\n\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t\t// format headers for SMTP use\n\t\t\tif ($this->useSmtp) {\n\t\t\t\t// create a new mail object to be used to sending the mass email and notification job\n\t\t\t\tif (!is_a($this->mailObject, 'Mail_smtp') || $this->confSMTP['persist'] == 1) {\n\t\t\t\t\t$this->mailObject = NULL;\n\t\t\t\t\t$this->mailObject =& Mail::factory('smtp', $this->confSMTP);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_sys_dmail_record') . ' ' . $row['uid']. ', \\'' . $row['subject'] . '\\'' . $LANG->getLL('dmailer_processed');\n\t\t\t$this->dmailer_prepare($row);\n\t\t\t$query_info=unserialize($row['query_info']);\n\t\t\tif (!$row['scheduled_begin']) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'begin');\n\t\t\t}\n\t\t\t$finished = $this->dmailer_masssend_list($query_info,$row['uid']);\n\t\t\tif ($finished) {\n\t\t\t\t$this->dmailer_setBeginEnd($row['uid'],'end');\n\t\t\t}\n\t\t} else {\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_nothing_to_do'), 'direct_mail');\n\t\t\t$this->logArray[] = $LANG->getLL('dmailer_nothing_to_do');\n\t\t}\n\n\t\t//closing DB connection\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t\n\t\t$parsetime = t3lib_div::milliseconds()-$pt;\n\t\tif (TYPO3_DLOG) t3lib_div::devLog($LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms', 'direct_mail');\n\t\t$this->logArray[] = $LANG->getLL('dmailer_ending'). ' ' . $parsetime . ' ms';\n\t}", "function start()\n {\n\n // initialize crontab as user www-data\n $crontab = new Engine\\Crontab('www-data');\n\n // show exists tasks as array\n print_r($crontab->crontabs);\n // add cron task\n// $crontab->addCron(0, \"*\", \"*\", \"*\", \"*\", \"ls -al\");\n// $crontab->writeCrontab();\n // delete cron task\n// $crontab->delEntry(0);\n// $crontab->writeCrontab();\n\n $this->tpl->setBlock(\"breadcrumb\",'<a href=\"/crontab\">Crontab example</a>');\n $this->tpl->setBlock('content','');\n }", "function add_cron_interval( $schedules ) {\n\t$schedules['ten_seconds'] = array(\n\t\t'interval' => 60,\n\t\t'display' => esc_html__( 'Every Ten Seconds' ),\n\t);\n\n\treturn $schedules;\n}", "public static function handle_tasks()\n {\n\t $granularity = (int)get_site_preference('pseudocron_granularity',60);\n\t $last_check = get_site_preference('pseudocron_lastrun',0);\n\t if( (time() - $granularity * 60) >= $last_check )\n\t\t {\n\t\t\t // 1. Get Task objects.\n\t\t\t self::get_tasks();\n\t\n\t\t\t // 2. Evaluate Tasks\n\t\t\t self::execute();\n\t\n\t\t\t // 3. Cleanup to minimize memory usage\n\t\t\t self::cleanup();\n\n\t\t\t // 4. Say we've done a check\n\t\t\t set_site_preference('pseudocron_lastrun',time());\n\t\t }\n }", "function activate_zanders_cron(){\n\t$timestamp = wp_next_scheduled( 'zanders_ftp_download_inventory' );\n\t$status = false;\n\t//If $timestamp == false schedule daily backups since it hasn't been done previously\n\tif( $timestamp == false ){\n\t$status = wp_schedule_event( time(), 'quarterhour', 'zanders_ftp_download_inventory' );\n\t}\n\n\twp_die(); \n}", "function create_daily_hook() {\n //wp_clear_scheduled_hook( 'efpsenddailyhook' );\n if (!wp_next_scheduled('efpsenddailyhook')) {\n wp_schedule_event(time(), 'daily', 'efpsenddailyhook');\n //wp_schedule_event(time(), 'minutes_5', 'efpsenddailyhook');\n }\n}" ]
[ "0.65979344", "0.65530014", "0.64842916", "0.6410471", "0.64058197", "0.63764656", "0.6251501", "0.62430567", "0.61791646", "0.6152695", "0.6119657", "0.6107443", "0.60973734", "0.60618156", "0.60081786", "0.5946361", "0.59160054", "0.5901183", "0.58769846", "0.58727354", "0.5858336", "0.5852314", "0.5844376", "0.5834755", "0.5820265", "0.58055156", "0.57741946", "0.5769504", "0.5764352", "0.5760593", "0.57445216", "0.57414323", "0.57202727", "0.57183826", "0.5707968", "0.57040304", "0.57015353", "0.5698335", "0.5695592", "0.5694563", "0.5652794", "0.56519747", "0.5645959", "0.56331676", "0.56300896", "0.5624976", "0.56249344", "0.56233805", "0.5619135", "0.5593892", "0.5592307", "0.5577638", "0.5577516", "0.55740255", "0.5539945", "0.5539945", "0.55340666", "0.5524971", "0.55190676", "0.5518649", "0.5511018", "0.54806095", "0.54777354", "0.54627323", "0.5457461", "0.5439537", "0.5436511", "0.54325014", "0.5410325", "0.5397341", "0.5389388", "0.5388726", "0.53872156", "0.5386959", "0.5383721", "0.53800267", "0.53749377", "0.5366473", "0.5362146", "0.5358521", "0.5358039", "0.53279626", "0.5315131", "0.5311414", "0.52954704", "0.52893555", "0.52815926", "0.5279674", "0.5270181", "0.52668214", "0.5266373", "0.52655494", "0.5264558", "0.52587146", "0.5255176", "0.52529967", "0.52414405", "0.5239528", "0.522548", "0.5222443" ]
0.6699991
0
check if the email address is not set
function has_logged_in() { if( $this->session->userdata('usir_nim') ) { redirect('reminders'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _check_email_exists($email = ''){\n\t\t\n\t}", "public function hasEmailAddress()\n {\n return $this->_hasVar('user_email') && $this->_getVar('user_email');\n }", "public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }", "public function emailNotUsed($email) {\n\t\t$this->db->query(\"SELECT email FROM users WHERE email = :email\");\n\n\t\t// Bind values\n\t\t$this->db->bind(':email', $email);\n\t\t\n\t\t// Assign\n\t\t$thisUser = $this->db->single();\n\t\t\n\t\tif(!$thisUser) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "public function isEmail();", "protected static function _email(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_EMAIL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid email\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function has_email() {\r\n $options = get_option( 'myhome_redux' );\r\n if ( array_key_exists( 'mh-agent-email_show', $options ) && empty( $options['mh-agent-email_show'] ) ) {\r\n return false;\r\n }\r\n return ! empty( $this->email );\r\n }", "public static function email($email, $field){\n\t\t\tif(!empty($email)){\n\t\t\t\tif(!filter_var($email, FILTER_VALIDATE_EMAIL)){\n\t\t \tSession::set('error-email', 'Please enter a valid email address.');\n\t\t \treturn true;\n\t\t }\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function hasEmail(): bool;", "protected function checkEmail() {\n //Check Email only when it is not empty\n if (!empty($_POST[$this->_email])) {\n //Validate value (email address by default)return validEmail otherwise false\n $validEmail = filter_input(INPUT_POST, $_POST[$this->_email], FILTER_VALIDATE_EMAIL);\n if ($validEmail) {\n //Store validEmail for using later\n $this->_validEmail = $validEmail;\n } else {\n //Set error['email]\n $this->_errors[$this->_email] = true;\n //Set message\n $this->_messages[] = \"Invalid email address.\";\n }\n }\n }", "public function emailEntryIsValid() {\r\n if (array_key_exists(\"email\", $_POST) )\r\n {\r\n if ( !Validator::emailIsValid($_POST[\"email\"]) )\r\n {\r\n $this->errors[\"email\"] = \"Email is not valid!\"; // if the email is not valid then the error will be filled with this message\r\n }\r\n }\r\n else\r\n {\r\n $this->errors[\"email\"] = \"Email is required!\"; // if the email is not entered then the error will be filled with this message\r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ); // if there are no errors then this will return true, if the error messege is filled with something it will return false\r\n }", "function is_email_address_unsafe($user_email)\n {\n }", "public function isCheckEmail()\n {\n if( (!$this -> zgloszePozniej) && ($this -> emailAtt2User == '') ) :\n return false;\n endif;\n return true;\n }", "private function email ($param)\n {\n if(!filter_var($this->value, FILTER_VALIDATE_EMAIL))\n {\n $this->SetError('email', 'The '.$this->SpacedKey.' field must be a valid email address');\n return false;\n }\n return true;\n }", "public function testEmailNotAvailable()\n {\n $user = factory(User::class)->create();\n $this->assertFalse(User::isEmailAvailable($user->email));\n }", "protected function validateEmail($value){\n\t\tif(!$value) return true;\n\t\treturn filter_var($value, FILTER_VALIDATE_EMAIL) !== false;\n\t}", "public function isEmail()\n {\n return filter_var($this->_value, FILTER_VALIDATE_EMAIL);\n }", "static public function checkEmail($email){\n\t\treturn !t3lib_div::validEmail($email);\n\t}", "private function setEmail()\n {\n\t if ( empty( $_POST['email'] ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n }\n \n $e = trim( $_POST['email'] );\n \n\t\tif ( ! filter_var( $e, FILTER_VALIDATE_EMAIL ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n\t\t}\n \n\t\t$this->data['email'] = $e;\n }", "function emailValidation($email)\n\t{\n\t\tif (!filter_var($email, FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn 1;\n \t}", "function _elastic_email_has_valid_settings() {\n $site_mail = variable_get('site_mail', NULL);\n $username = variable_get(ELASTIC_EMAIL_USERNAME, NULL);\n $api_key = variable_get(ELASTIC_EMAIL_API_KEY, NULL);\n\n if (is_null($site_mail) || $site_mail == '') {\n return FALSE;\n }\n if (is_null($username) || $username == '') {\n return FALSE;\n }\n if (is_null($api_key) || $api_key == '') {\n return FALSE;\n }\n return TRUE;\n}", "public function hasEmail() {\n return $this->_has(4);\n }", "private function setEmail($param)\n {\n $this->email = $param;\n\n if (filter_var($param, FILTER_VALIDATE_EMAIL)) {\n return true;\n } else {\n return false;\n }\n }", "public function setEmail($email)\r\n {\r\n if(!$this->validate($email)){\r\n $this->message = \"Field is empty\";\r\n return false;\r\n }\r\n \r\n $this->email = $email;\r\n\r\n return true;\r\n }", "public function testReturnsFalseWhenEmailIsEmpty()\n {\n $validator = new ContactValidator();\n $this->assertFalse($validator->validateEmail(''));\n }", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }", "public function checkIfEmailExists($email);", "function validate_email() {\n # Check Value is an Email Address\n if ($this->check_email_address($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Email\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for email address ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank String\n return \"\";\n }\n }", "function funcs_isValidEmail($email){\n\tif (!isset($email) || (empty($email) && $email!=0) \n\t\t\t|| !preg_match('/^[a-z0-9_\\-\\.]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+$/i',trim($email))){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "private function checkEmail($data) {\n\t\tif(filter_var($data, FILTER_VALIDATE_EMAIL)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function checkEmail($sender,$param)\r\n\t{\r\n\t\t$userRecord=TblUsers::finder()->findBy_email($this->Email->Text);\r\n\r\n\t\tif($userRecord != null)\r\n\t\t\t$param->IsValid = false;\r\n\t}", "public function uniqueEmail() {\n if (CmsUser::model()->exists(\"id != \" . userId() . \" AND email='{$this->register_email}'\")) {\n $this->addError('register_email', 'Email already exist');\n }\n }", "public function validate() {\n\t\treturn is_email( $this->email );\n\t}", "public function validateUserEmail()\n {\n if (!$this->hasErrors() && !$this->getUser()) {\n $this->addError('id', Yii::t('skeleton', 'Your email was not found.'));\n }\n }", "function _webform_edit_email_validate($element, &$form_state) {\r\n if ($form_state['values']['user_email']) {\r\n $form_state['values']['value'] = '%useremail';\r\n }\r\n}", "public function validateEmail()\n {\n if (!isset($this->_data['email'])) {\n return false;\n }\n\n $response = filter_var($this->_data['email'], FILTER_VALIDATE_EMAIL);\n\n return ($response !== false);\n }", "protected function validateEmail($value) {\n if (filter_var($value, FILTER_VALIDATE_EMAIL))\n return true;\n $this->setError(t(\"Invalid e-mail address\"));\n return false;\n }", "private function email_Check_Validation($email){\r\n return (filter_var($email, FILTER_VALIDATE_EMAIL)) ? true : false;\r\n }", "public function email_check($str) {\n //if(!empty($str) && $this->get_by(\"email\", $str))\n // return FALSE;\n return TRUE;\n }", "function validateEmail($field)\n\t{\n //Make sure field is not blank\n if ($field == \"\") return \"Please specify an email address.\\\\n\";\n //Return an error if invalid input\n if (!filter_var($field, FILTER_VALIDATE_EMAIL)) return \"Invalid email address given.\\\\n\";\n\t\treturn \"\";\n\t}", "function Validateform($email)\n{\n if ($email == null || $email == '') {\n return false;\n } else return true;\n}", "public function isAtLeastOneKnownEmailAddress($_);", "function _webform_validate_email($form_element, $form_state) {\r\n $component = $form_element['#webform_component'];\r\n if (!empty($form_element['#value']) && !valid_email_address($form_element['#value'])) {\r\n form_error($form_element, t('%value is not a valid email address.', array('%value' => $form_element['#value'])));\r\n }\r\n}", "public function emptyStringIsValid()\n {\n $email = '';\n\n $this->assertTrue($this->fixture->validate($email));\n }", "static function checkEmailAddress($input)\r\n {\r\n if (filter_var($input, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n } else {\r\n echo PageBuilder::printError(\"Please enter a valid email id.\");\r\n return false;\r\n }\r\n }", "function checkEmail($email) {\n\t\tif(strpos($email, '@') && strpos($email, '.')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function validEmailInvalidDataProvider() {}", "function validEmail($email)\n {\n //using filter_var function we can check for valid email\n return !empty($email) && filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "public function setEmail($email) {\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return false;\n }\n $this->email = $email;\n return true;\n }", "public function emailAvailable($email) {\n $conn = $this->getConnection();\n $result = $conn->query(\"SELECT Email FROM User WHERE Email = '$email'\", PDO::FETCH_ASSOC);\n return $result == null || $result->rowCount() <= 0;\n }", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "public function emailExists($email='') {\n\t\t$checkEmail = check($email) ? $email : $this->_email;\n\t\tif(!check($checkEmail)) return;\n\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_EMAIL_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_EMAIL_.\" = ?\", array($checkEmail));\n\t\tif(!is_array($result)) return;\n\t\treturn true;\n\t}", "function isValidEmail($email, &$acountInfo)\n {\n $retval = true;\n $acountInfo = modApiFunc(\"Users\", \"getAcountInfoByEmail\", $email);\n if (sizeof($acountInfo)==0)\n {\n $retval=false;\n }\n return $retval;\n }", "private static function is_email_address(string $username)\n {\n }", "function email($email)\n {\n if (!is_valid_email($email))\n return false;\n\n if ($email != $this->email)\n $this->update['email'] = $email;\n\n $this->email = $email;\n\n return true;\n }", "public function hasContactEmail() {\n\t\treturn $this->contactEmail !== null;\n\t}", "private function check_Email($email){\r\n\r\n //Remove all illegal characters from an e-mail adress\r\n $email_B = filter_var($email, FILTER_SANITIZE_EMAIL);\r\n\r\n $Validate = self::email_Check_Validation($email_B);\r\n\r\n return (($Validate == false) || ($email != $email_B)) ? true : false;\r\n }", "function useremail_check($str) {\r\n $res = $this->auth_model->is_email_exists($str);\r\n if ($res <= 0) {\r\n $this->form_validation->set_message('useremail_check', lang_key('email_not_matched'));\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function getEmail_always_returnCorrectly()\n {\n $this->assertEquals($this->user['email'], $this->entity->getEmail());\n }", "public function validEmailValidDataProvider() {}", "public function check_email() {\n\t\t$email = urldecode($_GET['email']);\n\n\t\t$result = $this->Member_Model->check_email_if_exists($email);\n\n\t\tif ($result > 0) {\n\t\t\techo json_encode(false);\n\t\t} else {\n\t\t\techo json_encode(true);\n\t\t}\n\t}", "static function IsEmail($email) {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "static function checkEmailAddress($input)\r\n {\r\n if (filter_var($input, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n } else {\r\n echo PageBuilder::printError(\"Username or Password is Incorrect!\");\r\n return false;\r\n }\r\n }", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "public function testGetInvalidUserByEmail() {\n\t\t// grab an email that does not exist\n\t\t$user = User::getUserByEmail($this->getPDO(), \"<sript><Scrpt\");\n\t\t$this->assertNull($user);\n\t}", "function validEmail($email)\r\n {\r\n\r\n $email = str_replace(' ', '', $email);\r\n return !empty($email);\r\n }", "function isValidEmail($email) {\n return strpos($email, \"@\") !== false;\n }", "public function check_email( $email )\n\t{\n\t\t// Check the e-mail address\n\t\t$user_email = apply_filters( 'user_registration_email', $email );\n\t\tif (! is_email( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_invalid\", $this->settings['strings']['email_invalid'] );\n\t\t\t$user_email = '';\n\t\t} elseif ( email_exists( $user_email ) ) {\n\t\t\t$this->errors['email'] = apply_filters( \"{$this->prefix}/create_object/error/email_exists\", $this->settings['strings']['email_exists'] );\n\t\t}\n\t\treturn $user_email;\n\t}", "function isEmailAddress($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\t$pattern =\"/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z.]{2,4}$/\";\n\t\tif(preg_match($pattern, $value)){\n\t\treturn true;\n\t\t}else{\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t}\n\t}", "function checkEmail(){\n\t\t$json\t= ceHelper::checkEmail(JRequest::getVar('email'));\n\t\t$this->jsonReturn($json);\n\t}", "private function validate_email($value)\n\t{\n\t\t$value = trim($value);\n\t\t// empty user name is not valid\n\t\tif ($value) {\n\t\t\t$p_field_valid = validator_helper::validate_email($value);\n\t\t\t//since the validator function returns FALSE if invalid or the value if valid,\n\t\t\t//it's safer to check explicitly for not FALSE)\n\t\t\tif (!$p_field_valid === FALSE) {\n\t\t\t\t//echo \"p_field_valid: \" . $p_field_valid . \"<br>\";\n\t\t\t\treturn 1; // valid\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 0; /* invalid characters */\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t return 0; /* field empty */\n\t\t}\n\t\n\t}", "public static function email($value){\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n\t}", "protected static function validate_email( $value ) {\n\t\treturn WmfFramework::validateEmail( $value )\n\t\t\t&& !DataValidator::cc_number_exists_in_str( $value );\n\t}", "function email_check($email)\r\n\t{\r\n\t\tif ( $user = $this->generic_model->get_where_single_row('users', array('email' => $email))) \r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('email_check', 'This %s is already registered.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse { return true; }\r\n\t}", "function is_email($email)\n {\n return util::isEmail($email);\n }", "function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}", "function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}", "function invalidEmail($email) {\n $result;\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $result = true;\n } else {\n $result = false;\n }\n return $result;\n }", "public function validateEmailConfirmedUnique()\n\t{ \n\t\tif ( $this->email )\n\t\t{\n\t\t\t$exists = User::findOne([\n\t\t\t\t'email' => $this->email,\n\t\t\t]);\n\n\t\t\tif ( $exists )\n\t\t\t{\n\t\t\t\t$this->addError('email', 'This E-mail has already been taken.');\n\t\t\t}\n\t\t}\n\t}", "private function filterInputValidateEmail() {\n if (!$email = filter_input(INPUT_POST, 'email')) {\n $this->response['errors'][] = [\n 'inputName' => 'email',\n 'message' => $this->language->getText('reset-password', 'error-email-empty')\n ];\n $this->response;\n return false;\n }\n if (!$email = filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $this->response['errors'][] = [\n 'inputName' => 'email',\n 'message' => $this->language->getText('reset-password', 'error-email-invalid')\n ];\n $this->response;\n return false;\n }\n return $email;\n }", "function _os2dagsorden_create_agenda_meeting_create_user_form_email_validate($element, $form, &$form_state) {\r\n $value = $element['#value'];\r\n if (!valid_email_address($value)) {\r\n form_error($element, t('Indtast en gyldig email adresse.'));\r\n }\r\n if (db_query(\"SELECT COUNT(*) FROM {users} WHERE mail = :mail;\", array(':mail' => $value))->fetchField()) {\r\n form_error($element, t('Der findes allerede en bruger med denne email.'));\r\n }\r\n}", "function valid_email($name){\r\n if(strpos($name, '@') !== false)\r\n return true;\r\n else\r\n return false;\r\n }", "public function check_email_exists($email){\n\t\t\t$this->form_validation->set_message('check_email_exists', 'That email is taken. Please choose a different one');\n\t\t\tif($this->um->check_email_exists($email)){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function setEmail($email)\n\t\t{\n\t\t$this->email = $email;\n\t\treturn true;\n\t\t}", "public function validUniqueMail() {\n $em = $this->getDoctrine()->getManager();\n $Person = $em->getRepository('UNOEvaluacionesBundle:Person')->findOneBy(array('email' => $this->_datPerson[email]));\n if ($Person) {\n #si existe el mail, por lo que hay q pedirle q ingrece otro\n return false;\n }else{\n return true;\n }\n\n }", "function invalidEmail($emailadres) {\n\tif (!filter_var($emailadres, FILTER_VALIDATE_EMAIL)) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "protected function validateEmail(string $identifier, mixed $value): bool\n {\n return ! empty( filter_var($value, FILTER_VALIDATE_EMAIL));\n }", "private function emailValidation($field) {\t\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\t\r\n\t \t\t$email_pattern = '/^[^@\\s<&>]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i';\r\n\t\t\tif (preg_match($email_pattern, $sent)) \r\n \t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t \t}", "public static function email($data){\n if(!filter_var($data,FILTER_VALIDATE_EMAIL)){\n return false;\n }\n return true;\n }", "private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }", "function email_is_valid($email) {\n return filter_var($email, FILTER_VALIDATE_EMAIL);\n }", "public function testEmailIsNotValidatedByDefault()\n {\n $this->expectNotToPerformAssertions();\n\n new FirstLastNameUser('Edwin', 'van der Sar', 'not valid email address');\n }", "public function checkEmail($email){\n\t\t\t/**\n\t\t\t*\t@var array $result - rezultat pretrage tabele users za datu email adresu\n\t\t\t*/\n\t\t\t$result = $this->db->get_where('users', array('email' => $email));\n\t\t\tif(empty($result->row_array())){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}", "private function isEmailValid($email)\n {\n //We could handle email format validation here\n }", "public function set_email($email){\n if (\n !empty($email) &&\n \\Audit::instance()->email($email) == false\n ) {\n // no valid email address\n $this->throwValidationError('email');\n }\n return $email;\n }", "public function testReturnsFalseWhenEmailIsInvalid()\n {\n $validator = new ContactValidator();\n $this->assertFalse($validator->validateEmail('testnowhere.com'));\n }", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}" ]
[ "0.75649357", "0.7492721", "0.7437279", "0.74316293", "0.7108669", "0.70435894", "0.7004579", "0.69915247", "0.69817847", "0.69811004", "0.697054", "0.6948235", "0.69099367", "0.69015485", "0.68737847", "0.68706095", "0.6858958", "0.6852584", "0.68466246", "0.6830629", "0.6808834", "0.68008393", "0.6798337", "0.6795321", "0.67914534", "0.67696285", "0.67625725", "0.67531705", "0.67432046", "0.6738606", "0.6719389", "0.6718572", "0.6699501", "0.668489", "0.6679874", "0.6677813", "0.6670654", "0.66523504", "0.6651172", "0.6646467", "0.66395307", "0.66313404", "0.66295576", "0.66236883", "0.6611671", "0.6603149", "0.6600654", "0.65961254", "0.6595341", "0.65859", "0.65842015", "0.65739405", "0.6572404", "0.65710074", "0.65688336", "0.6567535", "0.656292", "0.6560776", "0.65542734", "0.65499955", "0.6532128", "0.653208", "0.6526701", "0.6524579", "0.6524128", "0.6521622", "0.6516513", "0.6514662", "0.651226", "0.6510088", "0.6509339", "0.65053153", "0.65006393", "0.6491178", "0.6491007", "0.6488466", "0.64837825", "0.64763904", "0.64762086", "0.6470936", "0.64642966", "0.64597857", "0.64577687", "0.64550745", "0.6454578", "0.6451453", "0.6448663", "0.64478546", "0.64400065", "0.6439635", "0.6439609", "0.6439266", "0.6434387", "0.642898", "0.6425717", "0.64254797", "0.6415445", "0.641388", "0.6412379", "0.6411153", "0.6404062" ]
0.0
-1
Test that user not logged in can't visit the account profile page.
public function testVisitUserAccountProfilePageRedirectsToLogin() { $response = $this->call('GET', $this->accountProfilePageUrl); $response->assertRedirect('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "public function testGetInvalidProfileByProfileEmail() : void {\n\t\t// get an email that doesn't exist\n\t\t$profile = Profile::getProfileByProfileEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($profile);\n\t}", "public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }", "public function testCannotViewRegisterIfLoggedIn()\n {\n $user = factory(User::class)->create([\n 'email' => '[email protected]',\n 'password' => bcrypt('testing')\n ]);\n\n $this->actingAs($user)->visit('/')->visit('/register')->seePageIs('/');\n }", "public function testGetProfileUserNotExist()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/thor\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n //AppBundle:User object not found. (404 Not Found)\r\n $this->assertTrue($response->code === 404);\r\n\r\n }", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "public function testGetProfileNotLoggedIn()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $response = \\Httpful\\Request::get($url)->send();\r\n\r\n //ERROR Call to a member function getWellnessProfessional() on string (500 Internal Server Error)\r\n $this->assertEquals(302, $response->code);\r\n\r\n }", "public function test_that_unauthroized_user_cannot_view_courses()\n {\n\n }", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testUserWithoutAccesToResource()\n {\n $this->unlogged();\n $this->visit('/resource')\n ->seePageIs(route('auth.getLogin'))\n ->see('Login');\n }", "public function testGetAccountProfileOut()\n {\n // Grab Page\n $result = $this->visit('account/profile')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }", "public function testGetInvalidProfileByProfileName() : void {\n\t\t// get a profile name that doesn't exist\n\t\t$profile = Profile::getProfileByProfileName($this->getPDO(), \"Invalid Profile Name\");\n\t\t$this->assertCount(0, $profile);\n\t}", "public function testGetInvalidProfileByProfileId () : void {\n\t\t// grab a profile id that doesn't exist?\n\t\t$invalidProfileId = generateUuidV4();\n\n\t\t$profile = Profile::getProfileByProfileId($this->getPDO() , \"$invalidProfileId\");\n\t\t$this->assertNull($profile);\n\t}", "public function testUpdateUserProfileErrorForbidden()\n {\n // Request\n $response = $this->call('POST', $this->accountProfilePostUrl, []);\n\n // Assert redirect to login\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "function testCanViewAccountPage() {\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('p.message', array(\n\t\t\t\"You'll need to login before you can access the account page. If you are not registered, you won't be able to access it until you make your first order, otherwise please enter your details below.\", ));\n\n\t\t/* But if we're logged on you can see */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('#PastOrders h3', array('Your Order History'));\n\t}", "public function testIndexFailNotLoggedIn()\n {\n $this->get($this->indexUrl);\n $this->assertRedirectContains(Router::url([\n 'prefix' => false,\n 'controller' => 'Users',\n 'action' => 'login'\n ]));\n }", "public function testNoPermission(){\n $noAccessUser = $this->drupalCreateUser([]);\n $this->drupalLogin($noAccessUser);\n $this->drupalGet('connect-four');\n $this->assertSession()->statusCodeEquals(403);\n }", "public function testNotAuthenticated()\n {\n $response = $this->get('/api/auth/me');\n $response->assertStatus(302);\n\n $response = $this->followingRedirects()->get('/api/auth/me');\n $response->assertStatus(401);\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testProfileInvalid()\n {\n $email = new Notification();\n $email->profile('derp');\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testNotLoggedIn()\n {\n $user = new User($this->getDb());\n $user->setNick(\"TestNickname\");\n $user->setPassword(\"TestPassword\");\n $user->create();\n\n // create a rank\n $this->createTestRank(\"Test Name\");\n\n $deleteApi = new Delete($this->getDb());\n $answer = $deleteApi->post(1);\n\n $this->assertEquals(['error' => 'NotLoggedIn'], $answer);\n\n // try to load the rank\n $rank = new Rank($this->getDb(), 1);\n $this->assertEquals(\"Test Name\", $rank->getTitle());\n }", "public function testUserCannotAccessAdminDashboard(): void\n {\n $username = $this->fixtures->getReference('user')->getUsername();\n $this->formLogIn($username);\n $this->client->request('GET', '/admin/dashboard');\n $this->assertSame(\n Response::HTTP_FORBIDDEN,\n $this->client->getResponse()->getStatusCode()\n );\n }", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public function noaccess() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tSession::setMessage(array('alert'=>'info','icon'=>'exclamation','text'=>\"User does not have access\"));\n\t\techo \"<h1>Unauthorised access to this page</h1>\";\n\t\techo \"<p>You are trying to access a page that requires different authorisation. You are currently logged in as <strong>\".Session::get('user')->name.\"</strong>. This user does not have the permissions to view this page.</p>\";\n\t\techo \"<p>Please log out and provide the proper credentials, or navigate to another page.</p>\";\n\t\techo \"<ul><li><a href=\\\"/user?logout\\\">Log out</a></li></ul>\";\n\t}", "public function testNotLoggedIn()\n {\n $this->sessionInfo['logged_in'] = false;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }", "public function testManagerNotAccessSettingsPage()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/setting/');\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testCannotLoginInactiveUser()\n {\n $user = factory(User::class)->create();\n $user->create_activation();\n \n $this->post('/api/v1/login', [\n 'email' => $user->email,\n 'password' => 'secret',\n ], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'message' => 'This account has not been activated. Please check your email.'\n ]);\n \n $this->get('/api/v1/me', ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson(['error' => 'Unauthenticated.']);\n }", "public function testShowUnauthicatedAccess(): void { }", "public function testWPGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "public function testSaveProfileWrongUser() {\n\t\tCakeSession::write('Auth.User.id', 2);\n\t\t$this->Model->saveProfile(array(\n\t\t\t'User' => array(\n\t\t\t\t'id' => 1\n\t\t\t)\n\t\t));\n\t}", "public function testUsersNoLogin()\n {\n $response = $this->get('/users');\n\n $response->assertStatus(302);\n }", "public function testGetInvalidProfileActivationToken() : void {\n\t\t// get an activation token that does not exist\n\t\t$profile = Profile::getProfileByProfileActivationToken($this->getPDO(), \"91a930a7d9746db530a1315d65c31bbf\");\n\t\t$this->assertNull($profile);\n\t}", "public function testAccessDeniedUserNotAuthorized()\n {\n $this->assertVoter(VoterInterface::ACCESS_DENIED, 'user1', 'user2');\n }", "public function testGetInvalidAccessByAccessId() {\n\t\t//grab a user id that exceeds the maximum allowable profile id\n\t\t$access = Access::getAccessByAccessId($this->getPDO(), TimeCrunchersTest::INVALID_KEY);\n\t\t$this->assertNull($access);\n\t}", "public function testCheckProfile()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('http://localhost:8000/user/12/profile')\n ->assertSee('My Profile');\n });\n }", "public function testNotLoggedInRedirect()\n {\n $response = $this->get($this->getSuccessUrl());\n\n $response->assertRedirect($this->getLoginUrl());\n }", "public function test_if_user_isnt_authorized_to_sign_in_if_doesnt_exists()\n {\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertUnauthorized();\n }", "public function testGetInvalidUserByEmail() {\n\t\t// grab an email that does not exist\n\t\t$user = User::getUserByEmail($this->getPDO(), \"<sript><Scrpt\");\n\t\t$this->assertNull($user);\n\t}", "public function testGetInvalidUserByEmail(): void {\n\t\t// Grab an email that does not exist\n\t\t$user = User::getUserByUserEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($user);\n\t}", "public function testAdminUpdateAccountDoesntExist()\n {\n $this->withSession(['expert' => ['id' => 99, 'type' => 'admin']])\n ->get(route('account.update', ['id' => 9999]))\n ->assertSessionHas('warning')\n ->assertRedirect(route('account.list'));\n }", "public function testUserCanNotLogin()\n {\n $data = [\n 'email' => 'invalid_email',\n 'password' => 'pass'\n ];\n $response = $this->postJson('/api/login', $data);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => false\n ]);\n }", "public function viewFail(FunctionalTester $I)\n {\n $I->wantTo('Try to view project not owned by the logged user');\n $I->cantAccessAsGuest(['projects/view', 'id' => 1004]);\n $I->amLoggedInAs(1002);\n $I->amOnPage(['projects/view', 'id' => 1004]);\n $I->seeResponseCodeIs(404);\n }", "public function test_unauthorized_user_cannot_access_the_user_route()\n {\n $response = $this->getJson('/user');\n\n $response->assertStatus(401);\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "function user_not_loggedin() {\n global $USER;\n return ($USER->id <= 0 || isguestuser());\n}", "public function testLoginActionWithUnknowUser()\n {\n $data = [\n '_username' => 'unknowuser',\n '_password' => '',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('Bad credentials', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "public function testNonAdminUserCannotViewThePageIndex()\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/admin/blog/pages');\n\n $response->assertStatus(403);\n }", "public function testGuestNotAccessSettingsPage()\n\t{\n\t\t$this->open('setting');\n\t\t$this->assertTextNotPresent('Settings');\n\t}", "protected static function maybe_disable_invalid_profile_notice() {\n\t\tif ( isset( $_GET['wcs_disable_paypal_invalid_profile_id_notice'] ) ) {\n\t\t\tupdate_option( 'wcs_paypal_invalid_profile_id', 'disabled' );\n\t\t}\n\n\t\tif ( isset( $_GET['wcs_ipn_error_notice'] ) ) {\n\t\t\tupdate_option( 'wcs_fatal_error_handling_ipn_ignored', true );\n\t\t}\n\t}", "public function _assertProfileExists($profile_uid)\n {\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function testNonLoggedUserVisitsChangePasswordPageRedirectsToLogin()\n {\n // Request\n $response = $this->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }", "public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }", "public function forceProfilePage() {\n\t\t$user = wp_get_current_user();\n\t\tif ( ! is_object( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\tif ( $settings->force_auth != true ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//not enable for this role oass\n\t\tif ( ! Auth_API::isEnableForCurrentRole( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//check if this role is forced\n\t\tif ( ! Auth_API::isForcedRole( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//user already enable OTP\n\t\tif ( Auth_API::isUserEnableOTP( $user->ID ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$screen = get_current_screen();\n\t\tif ( $screen->id != 'profile' ) {\n\t\t\twp_safe_redirect( admin_url( 'profile.php' ) . '#show2AuthActivator' );\n\t\t\texit;\n\t\t}\n\t}", "public function testCannotLoginInvalidUser()\n {\n $user = factory(User::class)->create();\n $user->activate();\n \n $this->post('/api/v1/login', [\n 'email' => $user->email,\n 'password' => \"notsecret\",\n ], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'message' => 'These credentials do not match our records.',\n ]);\n \n $this->get('/api/v1/me', ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertStatus(401);\n }", "public function checkCurrentUserWithError(UserProfile $profile)\n {\n if(!$this->checkCurrentUser($profile)) {\n throw new ApiException('access_denied', 403);\n }\n }", "public function testGetAccountProfileIn($auth)\n {\n // Grab Page\n $result = $this->actingAs($auth)\n ->visit('account/profile')\n ->see('Account Privacy')\n ->see('SPONSORED')\n ->see('ADS')\n ->see('CALENDAR')\n ->see('Edit Profile Image')\n ->seePageIs('account/profile');\n }", "public function require_no_user()\n {\n //{\n // Session::flash('notice', 'You must be logged out to see that page.');\n // redirect('/');\n //}\n }", "public function testIndexFailNotAdmin()\n {\n $this->setUserSession();\n $this->get($this->indexUrl);\n $this->assertRedirect('/');\n }", "public function testGetInvalidAdultUsername() : void {\n// grab an email that does not exist\n$profile = Adult::getAdultByAdultUsername($this->getPDO(), \"yourmom\");\n$this->assertNull($profile);\n}", "public function testUserMustBeLoggedIn()\n {\n $response = $this->json('POST', '/avatar', [\n 'avatar' => ''\n ]);\n\n $response->assertStatus(401);\n }", "public function testGuestUserCannotComment()\n {\n $this->createUser(1);\n $this->createChannel();\n $this->createEpisode();\n\n $this->visit('/episodes/1')\n ->see('Only logged in users can comment.');\n }", "private function notExist() : void\n {\n if(!$this->user)\n {\n (new Session())->set('user','error','Désolé une erreur est survenue');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "public function testProfileIndexNotFound()\n {\n $profileService = $this->createProfileServiceMock();\n\n $profileService\n ->method('getProfile')\n ->willReturn(null);\n\n $client = static::createClient();\n $client->getContainer()->set(\"blokkr.service.profile\", $profileService);\n $client->request(\"GET\", \"/profile/1\");\n\n\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n }", "public function test_teams_index_authenticated_user_returns_403(){\n $this->signInUser();\n $response = $this->get(route('teams.index'));\n $response->assertStatus(403); }", "public function test_users_edit_leader_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 2]));\n $response->assertStatus(403);\n }", "public function loginWhenNotLoggedIn()\n {\n /* @var $helper MagentoComponents_Helper*/\n $helper = Menta_ComponentManager::get('MagentoComponents_Helper');\n // open homepage\n $this->getSession()->open($this->getConfiguration()->getValue('testing.maindomain'));\n $this->assertTrue($this->getHelperCommon()->isVisible($helper->getLoginLinkPath()));\n $this->assertTrue($this->getHelperCommon()->isVisible($helper->getAccountLinkPath()));\n }", "function logout_if_profile_creation_fail( $uri ) {\n\t\tif ( ! isset( $_REQUEST['profile-cancel'] ) && ! isset( $_REQUEST['amp;amp;profile-cancel'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$redirect_to = isset( $_REQUEST['amp;amp;redirect_to'] ) ? $_REQUEST['amp;amp;redirect_to'] : '';\n\t\t$redirect_to = ! $redirect_to && isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : $redirect_to;\n\t\t$redirect_to = esc_url_raw( $redirect_to );\n\n\t\t// log user out\n\t\twp_logout();\n\n\t\t// and redirect them to the location stored in the cookie\n\t\twp_safe_redirect( $redirect_to );\n\t\texit();\n\t}", "public function unconfirmed_account() {\n \n // Check if the current user is admin and if session exists\n $this->check_session();\n \n if ( $this->user_status == 1 ) {\n \n redirect('/user/app/dashboard');\n \n }\n \n // Show unconfirmed account page\n $this->load->view('user/unconfirmed-account');\n \n }", "public function testGetProfileWPNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/natasha-romanov\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Natasha Romanov', $response->body->data->user->name);\r\n $this->assertNotEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testRoomMembershipNotAuthorized()\n {\n $room = $this->createRoomWithPassword('Test Password');\n $user = factory(User::class)->create();\n\n $response = $this->actingAs($user)\n ->call('GET', '/room/'.$room->id);\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function test_teams_show_authenticated_user_returns_403(){\n $this->signInUser();\n $response = $this->get(route('teams.show', ['team' => 1]));\n $response->assertStatus(403); }", "public function testLoginButLogin(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('login'));\n $response->assertRedirect(route('home'));\n }", "public function testNonAdminUserNotAllowed()\n {\n print sprintf(\"Non-Admin user admin acces - To be %d %s\", 302 ,PHP_EOL);\n $user = factory(\\App\\User::class)->create(['type'=>'user']);\n $response = $this->actingAs($user)\n ->get('/admin');\n $response->assertStatus(302);\n \n }", "public function testRedirectedIsNotLogged()\n {\n $this->addTestFixtures();\n $this->client->request('GET', '/tasks');\n\n $response = $this->client->getResponse();\n\n $statusCode = $response->getStatusCode();\n $this->assertEquals(302, $statusCode);\n }", "function testGetUserBySession() {\n $this->assertFalse(Sessions::getUserBySession());\n }", "public function testProfileUnilogin()\n {\n\n }", "public function test_a_user_cannot_modify_another_users_account_information()\n {\n $userA = factory(User::class)->create();\n $userB = factory(User::class)->create();\n\n // When user A tries to view user B data\n Passport::actingAs($userA);\n $response = $this->json('GET', 'api/v1/users/' . $userB->id);\n\n // Then it is not successful\n $response->assertStatus(ResponseCode::HTTP_UNAUTHORIZED);\n $response->assertSee('Unauthorized Access');\n }", "public function testNoAuth() : void\n {\n $response = $this->get(action('HomeController@index'));\n\n $response->assertStatus(200);\n }", "public function testProfileApp()\n {\n $client = static::createClient();\n $client->request('GET', '/candidate/profile');\n $this->assertEquals(301, $client->getResponse()->getStatusCode());\n\n //authenticated users are allowed\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile');\n $response = $client->getResponse();\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue(0 === strpos($response->getTargetUrl(), 'https'));\n\n //https and authentication loads page\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile', [], [], ['HTTPS' => true]);\n $this->assertTrue($crawler->filter('html:contains(\"Loading ...\")')->count() > 0);\n }", "public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }", "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "public function testPostForgotPageUserNotFoundError()\n\t{\n\t\t$hash = \\Str::random(10);\n\t\t\n\t\t$this->call('orchestra::forgot@index', array(), 'POST', array(\n\t\t\t'email' => \"{$hash}@{$hash}.com\",\n\t\t\t\\Session::csrf_token => \\Session::token(),\n\t\t));\n\t\t$this->assertRedirectedTo(handles('orchestra::forgot'));\n\t\t$this->assertTrue(is_string(\\Session::get('message')));\n\t}", "public function testBlankNameNotAllowed()\n {\n $this->browse(function ($browser) {\n $browser->visit(new Pages\\ProfilePage())\n ->type('name', '')\n ->click('.btn-success')\n ->assertPathIs($this->pageUrl)\n ->assertSee('You need to mention your name.');\n });\n }", "public function testGetAccountFriendsUsersOut()\n {\n // Grab Page\n $result = $this->visit('account/friends/users')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }", "public function checkForProfile()\n\t\t{\n\t\t\treturn (!Auth::user()->profiles) ? false : true;\n\t\t}", "function sabs_logged_in_only() {\n\tif ( ! is_user_logged_in() ) {\n\t\tdie( 'Please Log In' );\n\t}\n}", "public function testNoErrorIsReturnedIfTwoFactorIsNotEnabled()\n {\n Carbon::setTestNow(Carbon::now());\n\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create(['use_totp' => false]);\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'password',\n ]);\n\n $response->assertStatus(Response::HTTP_NO_CONTENT);\n }", "public function testItCanNotAccessPagesPendingCurationPage()\n {\n $this->logInAsUser(['curator' => 0]);\n\n $this->get('/curation/new')->assertResponseStatus(401);\n }", "public function testGetInvalidUserByUserName(): void {\n\t\t// Grab an username that does not exist\n\t\t$user = User::getUserByUserName($this->getPDO(), \"doesnotexist\");\n\t\t$this->assertCount(0, $user);\n\t}", "public function testUserCanNotLoginWithIncorrectEmail()\n {\n $user = factory(User::class)->create();\n factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "public function testGuestNotAccessHomePage()\n\t{\n\t\t$this->open('/');\n\t\t$this->assertTextNotPresent('Home');\n\t}", "public function only_logged_in_customer_can_see_profile_edit_form()\n {\n $response = $this->get('/profile/edit')\n ->assertRedirect('/login');\n\n }" ]
[ "0.7759397", "0.75381947", "0.6942299", "0.6810553", "0.67139274", "0.6675969", "0.6601072", "0.6550491", "0.64657634", "0.6423427", "0.6423136", "0.64229345", "0.6413876", "0.6409626", "0.63627875", "0.63598245", "0.63513106", "0.6341972", "0.6333638", "0.6294066", "0.6270864", "0.6251882", "0.62442994", "0.6234733", "0.6220953", "0.6219672", "0.6204181", "0.6200437", "0.6174421", "0.6169811", "0.61687714", "0.615124", "0.61506206", "0.61236066", "0.609545", "0.6084933", "0.608445", "0.6076938", "0.6075183", "0.60713536", "0.6057313", "0.6054814", "0.60502154", "0.6025073", "0.60222685", "0.6007944", "0.5997595", "0.59896827", "0.59753793", "0.5962959", "0.59615225", "0.5949309", "0.5946338", "0.59416", "0.59325975", "0.59230965", "0.59219277", "0.59198856", "0.59021866", "0.5889356", "0.58882314", "0.58832943", "0.58697706", "0.5866103", "0.58623564", "0.58595383", "0.58551913", "0.58539486", "0.584795", "0.5847841", "0.583789", "0.5833769", "0.58324826", "0.5831736", "0.58286023", "0.5822514", "0.5814312", "0.58063483", "0.58015776", "0.57984376", "0.57943386", "0.5789983", "0.5789036", "0.57871723", "0.57753396", "0.5774441", "0.5772145", "0.5766318", "0.5765553", "0.5751974", "0.57458466", "0.57426935", "0.5735809", "0.5728618", "0.5719591", "0.5706743", "0.5701404", "0.5691945", "0.5687434", "0.5686532" ]
0.66978306
5
Test that a logged user can visit its account profile page.
public function testLoggedUserVisitAccountProfilePageOk($withUserMeta) { // Prepare $user = factory(User::class)->create([ 'name' => 'Mario', 'password' => bcrypt('123456'), 'can_login' => true, ]); if ($withUserMeta) { $userMeta = factory(UserMeta::class)->create([ 'user_id' => $user->id, ]); } // Request $response = $this->actingAs($user)->call('GET', $this->accountProfilePageUrl); // Asserts $response->assertStatus(200); $response->assertViewIs('account.profile.profile'); $response->assertResponseHasData('userProfile'); $response->assertResponseDataModelHasValues('userProfile', $user->attributesToArray()); if (!$withUserMeta) { $response->assertResponseDataHasRelationLoaded('userProfile', 'userMeta', 0); } else { $response->assertResponseDataHasRelationLoaded('userProfile', 'userMeta', 1); $response->assertResponseDataModelHasValues('userProfile.userMeta', $userMeta->attributesToArray()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function testCheckProfile()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('http://localhost:8000/user/12/profile')\n ->assertSee('My Profile');\n });\n }", "function testCanViewAccountPage() {\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('p.message', array(\n\t\t\t\"You'll need to login before you can access the account page. If you are not registered, you won't be able to access it until you make your first order, otherwise please enter your details below.\", ));\n\n\t\t/* But if we're logged on you can see */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('#PastOrders h3', array('Your Order History'));\n\t}", "function a_user_has_a_profile()\n {\n $user = create('App\\User');\n\n $this->get(\"/profiles/{$user->name}\")\n ->assertSee($user->name);\n }", "public function testVisitUserAccountProfilePageRedirectsToLogin()\n {\n $response = $this->call('GET', $this->accountProfilePageUrl);\n $response->assertRedirect('login');\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function testGetAccountProfileIn($auth)\n {\n // Grab Page\n $result = $this->actingAs($auth)\n ->visit('account/profile')\n ->see('Account Privacy')\n ->see('SPONSORED')\n ->see('ADS')\n ->see('CALENDAR')\n ->see('Edit Profile Image')\n ->seePageIs('account/profile');\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testUserProfile() {\n\t\tif (!$this->_hasTrigger('userProfile')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$expected = $this->_manualCall('userProfile', $this->ViewtEvent);\n\n\t\t$result = $this->Event->trigger($this->ViewObject, $this->plugin . '.userProfile');\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testGetOwnProfile()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n\r\n }", "public function testProfilePersonalInfo()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see('seeInElement', '.country', DB::table('countries')->where('id', 4)->first()->full_name);\n }", "public function testProfileApp()\n {\n $client = static::createClient();\n $client->request('GET', '/candidate/profile');\n $this->assertEquals(301, $client->getResponse()->getStatusCode());\n\n //authenticated users are allowed\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile');\n $response = $client->getResponse();\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue(0 === strpos($response->getTargetUrl(), 'https'));\n\n //https and authentication loads page\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile', [], [], ['HTTPS' => true]);\n $this->assertTrue($crawler->filter('html:contains(\"Loading ...\")')->count() > 0);\n }", "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "public function testGetAccountProfileOut()\n {\n // Grab Page\n $result = $this->visit('account/profile')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }", "public function testUserDetails() {\n\t\t// make new User and save it to the database\n\t\t$Role = Role::where('name', 'user')->first();\n\n\t\t// test home page 200 response code\n\t\t$this->visit('/home')\n\t\t\t->seePageIs('/home')\n\t\t\t->assertResponseOk();\n\n\t\t// check that User details are being displayed\n\t\t$this->visit('/home')->within('.body-content', function() use($Role) {\n\t\t\t$this->see($this->User->name)\n\t\t\t\t->see($this->User->email)\n\t\t\t\t->see(Language::trans('database.role-name-'.$Role->name));\n\t\t});\n\t}", "public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "public function test_authorized_user_can_access_the_user_route()\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n\n $response = $this->get('/user');\n\n $response->assertStatus(200);\n $response->assertJson(['data' => ['name' => $user->name, 'email' => $user->email]]);\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/user/profile')\n ->assertSee('Profile');\n \n });\n }", "public function testUser1() {\n // Load the user 1 profile page.\n $this->drupalGet('/user/1');\n // Confirm the page title is correct.\n $this->assertRaw('<title>Access denied | ');\n $this->assertNoRaw('<title>admin | ');\n $this->assertNoRaw('<title>Site under maintenance | ');\n\n // Put the site into maintenance mode.\n \\Drupal::state()->set('system.maintenance_mode', TRUE);\n Cache::invalidateTags(['rendered']);\n\n // Load the user 1 profile page again.\n $this->drupalGet('/user/1');\n // Confirm the page title has changed.\n $this->assertNoRaw('<title>Access denied | ');\n $this->assertNoRaw('<title>admin | ');\n $this->assertRaw('<title>Site under maintenance | ');\n }", "public function only_logged_in_customer_can_see_profile_edit_form()\n {\n $response = $this->get('/profile/edit')\n ->assertRedirect('/login');\n\n }", "public function testLoggedUserVisitsChangePasswordPageOk()\n {\n // Prepare\n $user = factory(User::class)->create();\n\n // Request\n $response = $this->actingAs($user)->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(200);\n $response->assertViewIs('account.profile.changePassword');\n }", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function _assertProfileExists($profile_uid)\n {\n }", "public function testClientsPageAsLoggedInUser() {\n\n // Generate user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/clients')\n ->see($user->email);\n\n }", "public function testGetAccountFriendsUsersIn($auth)\n {\n // Set query param\n // Grab Page\n $result = $this->actingAs($auth)\n ->visit('account/friends/users?query=a')\n ->see('success\":true,')\n ->see('error\":null,')\n ->seePageIs('/account/friends/users?query=a');\n }", "public function testAuth()\n {\n $user = factory(User::class)->create();\n $this->browse(function ($first, $second, $third) use ($user) {\n // prompted to log in\n $first->visit(new AdminPage)\n ->assertRouteIs('login');\n\n // successfully login\n $second->loginAs($user)\n ->visit(new AdminPage)\n ->assertRouteIs('admin')\n ->assertSee('Dashboard')\n ->assertSee($user->name);\n\n // successfully logout\n $third->loginAs($user)\n ->visit(new AdminPage)\n ->click('@profile-toggle')\n ->click('@logout-link')\n ->assertRouteIs('login');\n });\n }", "public function profile_view(User $user)\n {\n return $user->hasPermission('profile-view');\n }", "public function test_user_can_be_logged_in()\n {\n $user = factory(User::class)->create();\n\n $response = $this->actingAs($user)->get(route('login'));\n\n $response->assertRedirect('/home');\n }", "abstract protected function getUserProfile();", "public function check_for_profile(){\n\t\t\n\t\t//get username for logged in user\n\t\t$user_name = $_SESSION['username'];\n\t\t// get user id for the logged in user\n\t\t$user_id = Database::user_id_query($user_name);\n\t\t//call static fucntion to check if user profile already exists\n\t\t$result = UserProfileHelper::check_profile($user_id);\n\t\t//var_dump($result);\n\t\treturn $result;\n\t}", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "public function testSeeMemberButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertSee(__(\"project.add_member\"));\n }", "public function testProfileUnilogin()\n {\n\n }", "public function test_user_is_able_to_login()\n {\n \n $this->browse(function (Browser $browser) {\n $user = factory (User::class)->create();\n $browser->visit(new LoginPage)\n ->loginAsUser($user)\n ->assertSee(\"Welcome {$user->name}\");\n });\n }", "public function testGetProfileOtherUserSupporter()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/tony-stark\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Tony Stark', $response->body->data->user->name);\r\n\r\n $this->assertEquals(1, $response->body->data->relationships->isSupportee);\r\n\r\n }", "public function testFillProfile() {\n $user = factory(\\App\\Models\\User::class)->make();\n\n // Register with factory credentials\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/register')\n ->type('name', $user->name)\n ->type('email', $user->email)\n ->type('password', $user->password)\n ->type('password_confirmation', $user->password)\n ->press('Register')\n // Should be able to see My Profile after authentication\n ->assertSee('My Profile');\n\n // Go to profile\n $browser->clickLink('My Profile')\n ->assertSee('About Me');\n\n // Go to My Experience, open accordion\n $browser->clickLink('My Experience')\n ->assertSee('My Experience')\n ->press('Add Diploma/Degree')\n ->assertSee('New Diploma/Degree');\n\n // Add a diploma\n $browser->select('#degrees\\5b new\\5d \\5b 1\\5d degreeType', '4')\n ->type('#degrees\\5b new\\5d \\5b 1\\5d degreeArea', 'Test area of study')\n ->type('#degrees\\5b new\\5d \\5b 1\\5d degreeInstitution', 'Test institution');\n // TODO: Selectors for date picker\n //->click('#degrees\\5b new\\5d \\5b 1\\5d degreeStartDate')\n //->type('#degrees\\5b new\\5d \\5b 1\\5d degreeStartDate', ['2017'], ['{tab}'], ['0717']);\n //->type('#degrees\\5b new\\5d \\5b 1\\5d degreeEndDate', '2018', ['{tab}'], '08', ['{tab}'], '18');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Diploma/Degree')\n ->pause(777) // Fails without a short pause\n ->press('Save Diploma/Degree')\n ->assertSee('Phd, Test area of study');\n\n // TODO: Repeat for certification / equivalent experience\n //$browser->press('Add Course/Certification')\n // ->assertSee('New Course/Certification');\n\n // Go to My Skills page\n $browser->clickLink('My Skills')\n ->assertSee('My Skills')\n ->press('Add Skill')\n ->assertSee('New Skill');\n\n // Add a soft skill\n $browser->select('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillSelection', '24') // Select dropdown by value\n ->keys('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillSelection',\n ['{tab}'], ['{tab}'], ['{arrow_right}']) // Keyboard controls were necessary to select skill level properly\n ->type('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillDescription', 'Test skill description');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Text corresponding to skill selection value should be visible\n $browser->assertSee('Save Skill')\n ->pause(777)\n ->press('Save Skill')\n ->assertSee('Passion');\n\n // TODO: Repeat for hard skill\n\n // Go to My References, open accordion\n $browser->clickLink('My References')\n ->assertSee('My References')\n ->press('Add Reference')\n ->assertSee('New Reference');\n\n // Add a reference\n $browser->type('#references\\5b new\\5d \\5b 1\\5d referenceName', 'Test Reference')\n ->select('#references\\5b new\\5d \\5b 1\\5d referenceRelationship') // Selects random if not specified\n ->type('#references\\5b new\\5d \\5b 1\\5d referenceEmail', '[email protected]')\n ->type('#references\\5b new\\5d \\5b 1\\5d referenceDescription', 'Test reference description');\n\n // Scroll down (button click will fail if not visible on test browser screen)\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Reference')\n ->pause(777) // Fails without a short pause\n ->press('Save Reference')\n ->assertSee('Test Reference');\n\n // Go to My Work Samples, open accordion\n $browser->clickLink('My Work Samples')\n ->assertSee('My Work Samples')\n ->press('Add Sample')\n ->assertSee('New Work Sample');\n\n // Add work sample data, wouln't work without copying the full selector\n $browser->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleName', 'Test Sample')\n ->select('#work_samples\\5b new\\5d \\5b 1\\5d sampleType') // Selects random if not specified\n ->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleLink', 'http://talent.canada.ca')\n ->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleDescription', 'Test sample description');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Sample')\n ->pause(777) // Fails without a short pause\n ->press('Save Sample')\n ->assertSee('Test Sample');\n\n });\n }", "public function testExample()\n {\n $this->browse(function ($browser) {\n $exampleTest = new ExampleTest();\n $exampleTest->testBasicLogin();\n\n $browser->visit(new Pages\\ProfilePage())\n ->assertSeeIn('section.content-header', 'My profile');\n });\n }", "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function testProfileIndexFound()\n {\n $profileService = $this->createProfileServiceMock();\n\n $profileService\n ->method('getProfile')\n ->willReturn(new BlokkrUser());\n\n $client = static::createClient();\n $client->getContainer()->set(\"blokkr.service.profile\", $profileService);\n $client->request(\"GET\", \"/profile/1\");\n\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n }", "public function is_profile_page() {\r\n\t\tglobal $pagenow;\r\n\r\n\t\treturn $pagenow === 'profile.php' || $pagenow === 'user-new.php' || $pagenow === 'user-edit.php';\r\n\t}", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function test_edit_settings_page_show_as_user()\n {\n $user = factory(User::class)->create();\n $this->actingAs($user)\n ->get('/settings')\n ->assertStatus(404);\n }", "function action_profile_show() {\n // Process request with using of models\n $user = get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n return ['view' => 'user/show', 'data' => $data];\n } else {\n return error403();\n }\n}", "public function testHasPage() {\n $this->assertEquals(1, $this->users->page());\n }", "public function profile() {\n\tif(!$this->user) {\n\t\tRouter::redirect(\"/users/login\");\n\t\t\n\t\t# Return will force this method to exit here so the rest of \n\t\t# the code won't be executed and the profile view won't be displayed.\n\t\treturn false;\n\t}\n \n # Setup view\n\t$this->template->content = View::instance('v_users_profile');\n\t$this->template->title = \"Profile of \".$this->user->first_name;\n \n #var_dump($this->user);\n \t\n\t# Render template\n\techo $this->template;\n }", "public function testGetSingleUserPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function profileAction()\n {\n \tZend_Registry::set('Category', Category::COMMUNITY);\n Zend_Registry::set('SubCategory', SubCategory::USERS);\n\n $userId = $this->_request->getParam(2, null);\n if(empty($userId)){\n throw new Lib_Exception_NotFound(\"No user id found for profile page\");\n }\n\n if($userId == $this->_user->{User::COLUMN_USERID}){\n \tZend_Registry::set('Category', Category::ACCOUNT);\n\t\t\tZend_Registry::set('SubCategory', SubCategory::NONE);\n }\n\n $table = new User();\n $user = $table->find($userId)->current();\n if(empty($user)){\n throw new Lib_Exception_NotFound(\"User '$userId' could not be found for profile page\");\n }\n\n $blog = $user->getBlog();\n if(!$blog->isReadableBy($this->_user, $this->_acl)){\n $blog = null;\n \t}\n\n $album = $user->getProfileAlbum();\n if(!$album->isReadableBy($this->_user, $this->_acl)){\n $album = null;\n \t}\n\n $this->view->profilee = $user;\n $this->view->album = $album;\n $this->view->blog = $blog;\n $this->view->medias = $album->getItemSet();\n }", "public function pageProfile()\r\n {\r\n if (!user()) {\r\n $this->redirect('/login?r=' . urlencode('/profile'));\r\n }\r\n\r\n return $this->view('profile');\r\n }", "public function forceProfilePage() {\n\t\t$user = wp_get_current_user();\n\t\tif ( ! is_object( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$settings = Auth_Settings::instance();\n\t\tif ( $settings->force_auth != true ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//not enable for this role oass\n\t\tif ( ! Auth_API::isEnableForCurrentRole( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//check if this role is forced\n\t\tif ( ! Auth_API::isForcedRole( $user ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//user already enable OTP\n\t\tif ( Auth_API::isUserEnableOTP( $user->ID ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$screen = get_current_screen();\n\t\tif ( $screen->id != 'profile' ) {\n\t\t\twp_safe_redirect( admin_url( 'profile.php' ) . '#show2AuthActivator' );\n\t\t\texit;\n\t\t}\n\t}", "public function profileAction() {\n\t\t$this->view->assign('account', $this->accountManagementService->getProfile());\n\t}", "public function myprofileAction()\n {\n \tZend_Registry::set('Category', Category::ACCOUNT);\n \tZend_Registry::set('SubCategory', SubCategory::NONE);\n\n $album = $this->_user->getProfileAlbum();\n if(!$album->isReadableBy($this->_user, $this->_acl)){\n $album = null;\n \t}\n\n $blog = $this->_user->getBlog();\n if(!$blog->isReadableBy($this->_user, $this->_acl)){\n $blog = null;\n \t}\n\n $this->view->profilee = $this->_user;\n $this->view->album = $album;\n $this->view->blog = $blog;\n $this->view->medias = $album->getItemSet();\n\n $this->renderScript('user/profile.phtml');\n }", "public function testShowUser()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->actingAs($user)->withSession(['Foo' => 'bar'])->get('/memes');\n \t$response->assertStatus(200);\n \n }", "public function test_users_create_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testHasAccess()\n {\n $user = new User(null, null, null, \"admin\");\n\n $this->assertTrue($user->is(User::STUDENT));\n $this->assertTrue($user->isStudent());\n\n $this->assertFalse($user->is(User::LECTURER));\n $this->assertFalse($user->isLecturer());\n\n $this->assertFalse($user->is(User::ADMIN));\n $this->assertFalse($user->isAdmin());\n\n $user->setVerified(true);\n\n $this->assertTrue($user->is(User::STUDENT));\n $this->assertTrue($user->isStudent());\n\n $this->assertTrue($user->is(User::LECTURER));\n $this->assertTrue($user->isLecturer());\n\n $this->assertTrue($user->is(User::ADMIN));\n $this->assertTrue($user->isLecturer());\n }", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "public function testWPGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testRedirect()\n {\n //$member = $this->objFromFixture(Member::class, \"joebloggs\");\n //$this->logInAs($member);\n $this->markTestIncomplete('Test user config CMS fields');\n }", "public function myProfile()\n {\n //make sure user is logged in\n Auth::checkAuthentication();\n \n //loads profile from session\n $this->View->render('user/myProfile'); \n }", "public function testGetUsersPageWithoutAuth()\n\t{\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\t\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::login'), \n\t\t\t$response->foundation->headers->get('location'));\n\t}", "public function testCannotViewRegisterIfLoggedIn()\n {\n $user = factory(User::class)->create([\n 'email' => '[email protected]',\n 'password' => bcrypt('testing')\n ]);\n\n $this->actingAs($user)->visit('/')->visit('/register')->seePageIs('/');\n }", "public function checkForProfile()\n\t\t{\n\t\t\treturn (!Auth::user()->profiles) ? false : true;\n\t\t}", "public function test_basic_user_auth()\n {\n // User 2 has permission to do a couple things.\n $user = User::find(2);\n $this->assertTrue($user->hasRole(Role::getByName('Administrator')));\n\n // The models we'll test.\n $page = Page::find(1);\n\n $this->assertTrue($user->can('view', $page));\n $this->assertFalse($user->can('delete', $page));\n\n // User model is a managed class. The user doesn't have the manage permission.\n // So, They shouldn't be able to edit a user that doesn't belong to them.\n $testUser = User::find(1);\n $this->assertFalse($user->can('edit', $testUser));\n\n // But they can edit themselves.\n $this->assertTrue($user->can('edit', $user));\n }", "public function testProfileTitle()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see(trans('profile.title', ['username'=>'johndoe']));\n }", "public function test_if_user_can_sign_in()\n {\n $this->createFakerUser($this->credentials);\n\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertOk();\n }", "public function testGetProfileOtherUserFriends()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bruce-banner\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bruce Banner', $response->body->data->user->name);\r\n $this->assertEquals(1, $response->body->data->relationships->isFriend);\r\n\r\n }", "public function profile() {\n $this->restrictToRoleId(2);\n \n // Exécute la view\n $this->show('user/profile');\n }", "public function test_users_edit_authenticated_user_shows_correct_view(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 5]));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.edit');\n }", "public function testUserWithAccesToResource()\n {\n $this->logged();\n $this->visit('/resource')\n ->seePageIs('/resource');\n }", "public function testStatsNavigationLinksIsPresent()\n {\n $user = User::find(User::JANITOR_USER_ID);\n\n $this->browse(function ($browser) use ($user) {\n $browser->loginAs($user)\n ->visit(new HomePage)\n ->click('@nav-cog')\n ->assertSee('Stats');\n });\n }", "public function testVisitAdminUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin')\n ->clickLink('Users')\n ->assertPathIs('/admin/user')\n ->assertTitleContains('User')\n ->assertSee('List Users');\n });\n }", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testAccountApp()\n {\n $client = static::createClient();\n $client->request('GET', '/candidate/account');\n $this->assertEquals(301, $client->getResponse()->getStatusCode());\n\n //authenticated users are allowed\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/account');\n $response = $client->getResponse();\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue(0 === strpos($response->getTargetUrl(), 'https'));\n\n //https and authentication loads page\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/account', [], [], ['HTTPS' => true]);\n $this->assertTrue($crawler->filter('html:contains(\"Loading ...\")')->count() > 0);\n }", "public function testGetAccountFriendsIn($auth)\n {\n // Grab Page\n $result = $this->actingAs($auth)\n ->visit('account/friends')\n ->see('Notifications')\n ->see('Friends')\n ->see('Invite')\n ->seePageIs('account/friends');\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "function testProfileTitle() {\n $this->drupalGet(Url::fromRoute('entity.linkit_profile.edit_form', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ]));\n\n $this->assertText('Edit ' . $this->linkitProfile->label() . ' profile');\n }", "public function testGetProfileUserNotExist()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/thor\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n //AppBundle:User object not found. (404 Not Found)\r\n $this->assertTrue($response->code === 404);\r\n\r\n }", "function profileUser() {\n if (SSession::getInstance()->__isset(\"role\")) {\n $model = new UserModel;\n $result = $model->selectUser(SSession::getInstance()->mail);\n $this->view->show(\"profileView.php\", $result);\n } else {\n $this->view->show(\"indexView.php\");\n }\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function testGetSiteMembershipForPerson()\n {\n }", "public function testGETProfile()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/profile/2',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Found\",\"data\":{\"totalCount\":1,\"profile\":{\"id\":\"2\",\"user_id\":\"2\",\"photo\":\"0\",\"website\":\"mysite2.com\",\"owner\":{\"id\":\"2\",\"username\":\"username2\",\"password\":\"password2\",\"email\":\"[email protected]\"}}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function test_only_logged_in_users_can_see_detailed_customer_list()\n {\n // the login page, assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertRedirect('/login');\n\n }", "public function test_example()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->withSession(['banned' => false])\n ->post('/nova/login', ['email' => $user->email, 'password' => $user->password]);\n\n $response->assertStatus(302);\n\n }", "public function getUserProfile();", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}", "public function testGetCustomerProfile()\n {\n self::testCreateCustomerProfile();\n\n $response = $this->gateway->getCustomerProfile($this->customerProfileId);\n\n $this->assertTrue($response->isSuccess());\n }", "public function profile() {\n //dd(session()->all());\n if (UserController::userNotLoggedin()){\n //return redirect()->to('/');\n return view('user_login');\n }\n return redirect()->action([UserController::class, 'myprofile']);\n }", "public function checkCurrentUser(UserProfile $profile) : bool\n {\n if($this->getProfile()->getId() == $profile->getId()) {\n return true;\n }\n\n return false;\n }", "private function testUser($email) {\r\n\t\t$verifiedEmails = Configure::read('Shop.email');\r\n\t\tif(in_array($email, $verifiedEmails)) {\r\n\t\t\t$this->Session->write('admin', 1);\r\n\t\t\t$this->BsRedirect('Logged in');\r\n\t\t} else {\r\n\t\t\tdie('Not a valid email address');\r\n\t\t}\r\n }", "public function testDestiny2GetProfile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }", "public function profile()\n {\n if ($this->Session && $this->Permissions) {\n if($this->Session['admin'] == 1 || $this->Permissions['profielen'] == 'Y') {\n $data['Title'] = 'Gebruikers profiel';\n $data['Active'] = 4;\n $data['user'] = $this->user->getProfile();\n $data['logs'] = $this->Log->getUserLogs();\n $data['permissions'] = $this->rights->getUserRights();\n\n $this->load->view('components/admin_header', $data);\n $this->load->view('components/navbar_admin', $data);\n $this->load->view('admin/profile', $data);\n $this->load->view('components/footer');\n }\n } else {\n redirect('Admin', 'refresh');\n }\n }", "public function testGetSiteMembershipRequestForPerson()\n {\n }", "public function testGetAccountFriendsUsersOut()\n {\n // Grab Page\n $result = $this->visit('account/friends/users')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }", "public function test_userHomePage()\n\t{\n\t\t$output = $this->request('GET', ['UserController','userHomePage']);\n\t\t$this->assertContains('<h3 class=\"text-center text-dark\"><i>Običan Korisnik</i></h3>', $output);\n\t}", "function user_user_profile($CI,$user){\n\t\t$CI->user->head($user);\n\t}", "public function testProfileFind()\n {\n\n }" ]
[ "0.7703105", "0.76862603", "0.7526517", "0.7506219", "0.74963754", "0.73833436", "0.72476393", "0.70179343", "0.6981847", "0.67047733", "0.6704037", "0.66967225", "0.6675425", "0.6596855", "0.65867704", "0.6520833", "0.6460878", "0.63976884", "0.6355461", "0.63335913", "0.6274193", "0.626725", "0.6264319", "0.6258341", "0.62509894", "0.62349427", "0.6222443", "0.6220617", "0.62094504", "0.61671126", "0.61641073", "0.61544365", "0.6150839", "0.61491555", "0.614211", "0.6132854", "0.6124565", "0.6123643", "0.6121595", "0.61211777", "0.61197567", "0.61067975", "0.6105116", "0.6102535", "0.6090256", "0.60898465", "0.6084415", "0.60565925", "0.60526294", "0.6050298", "0.6047239", "0.6041969", "0.6027548", "0.60150075", "0.6011712", "0.59808564", "0.5978024", "0.5959557", "0.5949098", "0.5934616", "0.59280765", "0.5926991", "0.59259075", "0.5920944", "0.591922", "0.5917429", "0.59148514", "0.59069467", "0.59052014", "0.58984256", "0.58974755", "0.5878058", "0.5868051", "0.5862809", "0.5860277", "0.5858769", "0.58550864", "0.58542913", "0.58370215", "0.5835234", "0.5833976", "0.5819254", "0.58188796", "0.5817326", "0.5813646", "0.5812907", "0.58084315", "0.5801814", "0.57844263", "0.57843566", "0.57746357", "0.57696384", "0.5762488", "0.57610315", "0.5757978", "0.5755353", "0.57529676", "0.5752286", "0.57385904", "0.57310414" ]
0.6456538
17
Test users can update their profiles.
public function testUpdateUserProfileOk($userData, $userMetadata, $userHasMetadata) { // Prepare /** @var User $user */ $user = factory(User::class)->create(); if ($userHasMetadata) { /** @var UserMeta $userMeta */ $userMeta = factory(UserMeta::class)->create([ 'user_id' => $user->id, ]); } $requestData['user'] = $userData; $requestData['usermeta'] = $userMetadata; // Request $response = $this->actingAs($user)->call('POST', $this->accountProfilePostUrl, $requestData); // Asserts $response->assertRedirect($this->accountProfilePageUrl); $this->assertDatabaseHas('users', [ 'id' => $user->id, 'name' => $userData['name'], 'username' => $userData['username'], 'email' => $userData['email'], 'receive_newsletter' => array_key_exists('receive_newsletter', $userData) && $userData['receive_newsletter'] == 'on', ]); if (!$userHasMetadata && empty($userMetadata)) { $this->assertDatabaseMissing('user_meta', ['user_id' => $user->id,]); // 1 } else if (!$userHasMetadata && !empty($userMetadata)) { $this->assertDatabaseHas('user_meta', array_merge(['user_id' => $user->id,], $userMetadata)); // 3 } else if ($userHasMetadata && empty($userMetadata)) { $this->assertDatabaseHas('user_meta', $userMeta->attributesToArray()); // 2 } else if ($userHasMetadata && !empty($userMetadata)) { $this->assertDatabaseHas('user_meta', array_merge(['user_id' => $user->id,], $userMetadata)); // 4 } $response->assertSessionHas('success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProfileUpdateAll()\n {\n\n }", "public function test_user_edit_its_profile()\n {\n $user = factory(User::class)->create();\n\n $newProfession = factory(Profession::class)->create();\n\n //$this->actingAs($user);\n\n $response = $this->get('/perfil/');\n $response->assertStatus(200);\n\n $response = $this->put('/perfil/', [\n \t'first_name' => 'Dayan',\n 'last_name' => 'Betancourt',\n\t 'email' => '[email protected]',\n\t 'profession_id' => $newProfession->id,\n\t 'bio' => 'Programador de Laravel',\n\t 'twitter' => 'https://twitter.com/delfinbeta',\n ]);\n\n $response->assertRedirect();\n\n $this->assertDatabaseHas('users', [\n 'first_name' => 'Dayan',\n 'last_name' => 'Betancourt',\n\t 'email' => '[email protected]'\n ]);\n\n $this->assertDatabaseHas('user_profiles', [\n 'profession_id' => $newProfession->id,\n 'bio' => 'Programador de Laravel',\n\t 'twitter' => 'https://twitter.com/delfinbeta',\n ]);\n }", "public function testProfileUpsert()\n {\n\n }", "public function testProfilePrototypeUpdateByIdCommunityRoles()\n {\n\n }", "public function testProfilePrototypeUpdateByIdAccessTokens()\n {\n\n }", "public function testUpdateValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new profile and update it in mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// edit the profile and update it in mySQL\n\t\t$profile->setProfileContent($this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_NAME);\n\t\t$profile->update($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testProfileChange() {\n $this->installProcedure->shouldBeCalledTimes(2);\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n $this->cachedInstall->setProfile('standard');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function test_update() {\n global $DB;\n\n $this->resetAfterTest();\n\n // Create user and modify user profile.\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n\n $course1 = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course1->id);\n $teacherrole = $DB->get_record('role', array('shortname' => 'teacher'));\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user1->id, $course1->id);\n $this->getDataGenerator()->enrol_user($user2->id, $course1->id);\n role_assign($teacherrole->id, $user1->id, $coursecontext->id);\n role_assign($teacherrole->id, $user2->id, $coursecontext->id);\n\n $this->setAdminUser();\n accesslib_clear_all_caches_for_unit_testing();\n\n // Use the userroleseditable api to remove all roles from user1 and give user2 student and teacher.\n $itemid = $course1->id . ':' . $user1->id;\n $newvalue = json_encode([]);\n\n $result = \\core_user\\output\\user_roles_editable::update($itemid, $newvalue);\n $this->assertTrue($result instanceof \\core_user\\output\\user_roles_editable);\n\n $currentroles = get_user_roles_in_course($user1->id, $course1->id);\n\n $this->assertEmpty($currentroles);\n\n $this->setAdminUser();\n accesslib_clear_all_caches_for_unit_testing();\n\n $itemid = $course1->id . ':' . $user2->id;\n $newvalue = json_encode([$teacherrole->id, $studentrole->id]);\n\n $result = \\core_user\\output\\user_roles_editable::update($itemid, $newvalue);\n $this->assertTrue($result instanceof \\core_user\\output\\user_roles_editable);\n $currentroles = get_user_roles_in_course($user2->id, $course1->id);\n\n $this->assertContains('Non-editing teacher', $currentroles);\n $this->assertContains('Student', $currentroles);\n\n }", "public function testProfileView()\n {\n $this->loginReader();\n\n $response = $this->get('api/user/profile/1');\n\n $response->assertStatus(200);\n }", "public function testEditUsersSuccess()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users/'.$user->id.'/edit')\n ->resize(900, 1000)\n ->assertSee('Update users')\n ->type('name',$user->name)\n ->press('Submit')\n ->assertSee('Successfully updated user!')\n ->assertPathIs('/admin/users');\n });\n $this->assertDatabaseHas('users', [\n 'name' => $user->name]);\n }", "public function testProfilePrototypeUpdateByIdQuarantines()\n {\n\n }", "public function testProfilePrototypeUpdateByIdPosts()\n {\n\n }", "public function testUserUpdate() {\n\t\t// make new User and save it to the database\n\t\t$uploadTestFile = realpath(base_path().'/tests/files/upload_test.png');\n\t\tif(!file_exists($uploadTestFile)) {\n\t\t\t$this->fail('Upload test file is missing!');\n\t\t}\n\t\t$oldImage = $this->User->getImage();\n\t\t$newName = Generate::string();\n\t\t$Role = Role::where('name', 'user')->first();\n\n\t\t// navigate to and submit new User details\n\t\t$this->visit('/home')->within('.body-content', function() use($oldImage) {\n\t\t\t$this->see('/'.$oldImage);\n\t\t});\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->type($newName, 'name')\n\t\t\t->attach($uploadTestFile, 'image')\n\t\t\t->press('Save');\n\n\t\t// check the details have been updated\n\t\t$this->seeInDatabase('users', [\n\t\t\t'email' => $this->User->email,\n\t\t\t'name' => $newName\n\t\t]);\n\n\t\t// update our User object and check the image name has changed\n\t\t$this->User = User::find($this->User->id);\n\t\tif($oldImage===$this->User->getImage()) {\n\t\t\t$this->fail('Image was not updated!');\n\t\t}\n\t}", "public function test_users_update_valid_perists_to_db(){\n $this->signInUser();\n $user = User::find(5);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email']\n ]);\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "public function testCheckProfile()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('http://localhost:8000/user/12/profile')\n ->assertSee('My Profile');\n });\n }", "public function testUserProfile() {\n\t\tif (!$this->_hasTrigger('userProfile')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$expected = $this->_manualCall('userProfile', $this->ViewtEvent);\n\n\t\t$result = $this->Event->trigger($this->ViewObject, $this->plugin . '.userProfile');\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function testProfilePrototypeUpdateByIdLikes()\n {\n\n }", "public function testProfilePrototypeUpdateByIdReviews()\n {\n\n }", "public function testProfilePrototypeUpdateAttributes()\n {\n\n }", "function updateMyProfile($data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE users SET `email`= ? WHERE id= ?\");\r\n $update->execute(array($data['email'], $this->user_id));\r\n\t\t$preparedProfileParam = prepareProfileParams($data);\r\n\t\tupdateProfileParameters($this->user_id,$preparedProfileParam);\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t\treturn true;\r\n\t}", "public function testProfilePrototypeUpdateByIdGroups()\n {\n\n }", "public function testSuccessfulInstructorUpdate() {\n try {\n $updatedInstructor = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->assertNotNull($updatedInstructor, \"The updated instructor is null\");\n $this->assertEquals($this->userTypeEnum->INSTRUCTOR, $updatedInstructor->getType(), \"The updated user is not\n an instance of INSTRUCTOR\");\n\n $InstructorInstitution = PersistentUserXInstitutionPeer::retrieveByPk($updatedInstructor->getUserId(),\n $this->institution->getInstitutionId());\n $this->assertNotNull($InstructorInstitution, \"The user x institution relation was not created for the instructor.\");\n $this->assertEquals(self::IDENTIFICATION, $InstructorInstitution->getIdentification(), \"The Instructor school\n identification is incorrect\");\n $this->assertEquals($updatedInstructor->getUserId(), $InstructorInstitution->getUserId(), \"The user id is\n incorrect on user x institution for the instructor\");\n $this->assertEquals($this->institution->getInstitutionId(), $InstructorInstitution->getInstitutionId(),\n \"The institution id is incorrect on user x institution for the instructor\");\n\n $instXProjec = PersistentUserXProjectPeer::retrieveByPK($updatedInstructor->getJnUsername(),\n $this->project->getProjectJnName());\n $this->assertNotNull($instXProjec, \"The relationship between instructor and project was not created\");\n $this->assertEquals($this->project->getProjectJnName(), $instXProjec->getProjectJnName(), \"The project name\n is incorrect on user x project\");\n $this->assertEquals($updatedInstructor->getJnUsername(), $instXProjec->getJnUsername(), \"The java.net\n username is incorrect on user x project for instructor\");\n $this->assertTrue($instXProjec->getIsOwner() == 1, \"The instructor is the owner of project.\");\n\n } catch (InfinityMetricsException $ime){\n $this->fail(\"The successful update of profile failed: \" . $ime);\n }\n\n }", "public function testUpdateUser()\n {\n $user = factory(User::class)->create();\n \n $userRepo = new UserRepository(new User);\n $update = $userRepo->update($user->id, $this->data);\n $updatedUser = $userRepo->get($user->id);\n \n $this->assertTrue($update);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($value, $updatedUser->$key);\n }\n }", "public function testProfileCreate()\n {\n\n }", "public function test_user_update_no_permission()\n {\n // User login for test\n $user = new User();\n $user->id = 13;\n $this->be($user);\n\n Storage::fake('photos');\n $response =\n $this->json('POST', '/update_user', [\n 'id' => 1,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n $response\n ->assertStatus(200)\n ->assertJson([\n $this->all_message => $this->user_update_no_permission,\n ]);\n }", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function testProfileUnilogin()\n {\n\n }", "public function test_user_update_own_success()\n {\n //User login for test\n $new_user = factory(\\App\\User::class)->create();\n $new_user_id=$new_user->id;\n users_details::insert(['users_id'=>$new_user_id]);\n $user = new User();\n $user->id = $new_user_id;\n $this->be($user);\n if(User::where('email',$this->email_update)->exists()){\n User::where('email',$this->email_update)->delete();\n }\n Storage::fake('photos');\n $response =\n $this->json('POST', '/update_user', [\n 'id' => '553456382u6hsdgh',\n 'full_name' => $this->fullname,\n 'email' => $this->email_update,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg')->size(100),\n ]);\n $response\n ->assertStatus(200)\n ->assertJson([\n $this->all_message => $this->user_update_success,\n ]);\n }", "public function testCanSelfEditUser()\n {\n $faker = \\Faker\\Factory::create();\n $user = factory(User::class)->create();\n $user->activate();\n $newName = $faker->name;\n $newEmail = $faker->email;\n $newPass = bcrypt(\"newsecret\");\n Auth::login($user);\n \n $this->put('/api/v1/user/'.$user->id, ['name' => $newName], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $newName,\n 'email' => $user->email,\n ]\n ]);\n $this->put('/api/v1/user/'.$user->id, ['name' => $user->name, 'email' => $newEmail], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]\n ]);\n $this->put('/api/v1/user/'.$user->id, ['password' => $newPass, 'password_confirmation' => $newPass], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]);\n }", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function updateProfile($user, array $profile);", "public function testProfilePrototypeUpdateByIdOwnedGroups()\n {\n\n }", "public function test_it_updates_a_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]', 'given_name' => 'A', 'family_name' => 'H'];\n\n $this->json('PUT', sprintf('/users/%d', $user->id), $update)\n ->seeJson($update);\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function testIntegrationEdit()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->see('Edit Account');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => $userFaker->username,\n 'email' => $userFaker->email\n ]);\n $this->assertViewHas('model');\n }", "public function testProfileExistsGetProfilesidExists()\n {\n\n }", "public function testProfileExistsHeadProfilesid()\n {\n\n }", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "function a_user_has_a_profile()\n {\n $user = create('App\\User');\n\n $this->get(\"/profiles/{$user->name}\")\n ->assertSee($user->name);\n }", "public function updateProfile() {\n\t\t\n\t\treturn $this->_post(self::URL_USERS_UPDATE_PROFILE, $this->_query);\n\t}", "public function testExample()\n {\n\n $finduser = Profile::find(3);\n $finduser->fname ='Silmon';\n $finduser->save();\n $this->assertEquals('Silmon', $finduser->fname);\n }", "public function only_logged_in_customer_can_see_profile_edit_form()\n {\n $response = $this->get('/profile/edit')\n ->assertRedirect('/login');\n\n }", "public function testUpdateUser()\n {\n // grab test user data\n $user = User::where('email', '[email protected]') -> first();\n $oldName = $user -> name;\n $newName = 'name'.rand(1,999999);\n // update user name\n User::where('email', '[email protected]') -> update(['name' => $newName]);\n // verify name is different\n $user = User::where('email', '[email protected]') -> first();\n $this -> assertSame($user -> name, $newName);\n $this -> assertFalse($oldName == $user -> name);\n }", "public function testPostUpdateUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2));\n\n\t\t$response = $this->call('orchestra::users@view', array($user->id), 'POST', array(\n\t\t\t'id' => $user->id,\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'crynobone',\n\t\t\t'password' => '345678',\n\t\t\t'roles' => array(2),\n\t\t));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$updated_user = Orchestra\\Model\\User::find($user->id);\n\n\t\t$this->assertEquals('[email protected]', $updated_user->email);\n\t\t$this->assertEquals('crynobone', $updated_user->fullname);\n\t\t$this->assertTrue(Hash::check('345678', $updated_user->password));\n\n\t\t$updated_user->delete();\n\t}", "public function testUpdateUser()\n {\n $user = factory(User::class)->create();\n $this->assertTrue($user->update([\n 'name' => 'Test Updated'\n ]));\n }", "public static function profile($profile){\n $pro = Profile::where('user_id',Auth::id())->first();\n if ($pro){\n $pro->update($profile);\n }else{\n Profile::create($profile);\n }\n }", "public function testProfilePersonalInfo()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see('seeInElement', '.country', DB::table('countries')->where('id', 4)->first()->full_name);\n }", "public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testProfileApp()\n {\n $client = static::createClient();\n $client->request('GET', '/candidate/profile');\n $this->assertEquals(301, $client->getResponse()->getStatusCode());\n\n //authenticated users are allowed\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile');\n $response = $client->getResponse();\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue(0 === strpos($response->getTargetUrl(), 'https'));\n\n //https and authentication loads page\n $client = $this->createAuthClient('[email protected]', 'user');\n $crawler = $client->request('GET', '/candidate/profile', [], [], ['HTTPS' => true]);\n $this->assertTrue($crawler->filter('html:contains(\"Loading ...\")')->count() > 0);\n }", "public function test_authenticated_common_users_can_hit_the_update_endpoint()\n {\n // First we create a test country\n $country = $this->createCountry();\n\n // Then we check if it was successfully added into the database\n $this->assertDatabaseHas('countries', $country->toArray());\n\n // Then we create an update request with auth headers and empty params\n $this->authenticated()->update($country->code, [])\n // We assert status is 403, because now we are authenticated, but we are not able to execute this action\n ->assertStatus(403)\n // Then we assert we receive the message unauthorized\n ->assertSeeText('unauthorized');\n }", "public function testEditUser()\n {\n }", "public function testGetOwnProfile()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n\r\n }", "public function testCreateAndUpdateUser()\n {\n $username = '[email protected]';\n\n $currentEmail = $username;\n $newEmail = '[email protected]';\n\n $raw = $this->getUser($username, $currentEmail);\n\n // Create\n $this->adapter->send(new Request(array(\n $raw,\n )));\n\n $real = static::$repository->getUserService()->loadUserByLogin($username);\n $this->assertInstanceOf(User::class, $real);\n $this->assertEquals($currentEmail, $real->email);\n\n // Update\n $raw->data['email'] = $newEmail;\n $this->adapter->send(new Request(array(\n $raw,\n )));\n\n $real = static::$repository->getUserService()->loadUserByLogin($username);\n $this->assertInstanceOf(User::class, $real);\n $this->assertEquals($newEmail, $real->email);\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function updateProfile(ValidProfile $request){\n\n\t\t// Ensure only the logged in user can update their profile. \n $user = User::find(Auth::user()->id); \n \n $user->name = $request->name;\n\t\t$user->traveller_rv_type_id = $request->rvType;\n\t\t$user->traveller_rv_size = $request->rvSize;\n\t\t$user->host_description = $request->description;\n\t\t\n\t\t$user->save();\n \n return Redirect::route('home');\n }", "public function testModify()\n {\n $user = User::factory()->create();\n $old_name = $user->name;\n $old_email = $user->email;\n\n $user->name = 'David';\n $user->email = '[email protected]';\n $update = $user->save();\n\n $this->assertTrue($update);\n $this->assertNotEquals($old_name, $user->name);\n $this->assertNotEquals($old_email, $user->email);\n }", "public function testEditUser() \n\t{\n\t\t// Log in as admin.\n\t\t$user = array(\n\t\t\t'email' => '[email protected]', \n\t\t\t'password' => 'Welkom01'\n\t\t);\n\n\t\t// Check if this user can login.\n\t\t$this->assertTrue(Auth::attempt($user));\n\n\t\t$response = $this->call('GET', 'user/edit/1');\n\n\t\t$this->assertTrue($this->client->getResponse()->isOk());\n\t}", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "public function testDestiny2GetProfile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function updateProfile()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('profileEdit');\n\n return $this->loadPublicView('user.profile-edit', $breadCrumb['data']);\n }", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "public function testAdminCanEditUser()\n {\n $faker = \\Faker\\Factory::create();\n $user = factory(User::class)->create();\n $admin = factory(User::class)->create();\n $admin->activate();\n $admin->assignRole('administrator');\n $newName = $faker->name;\n $newEmail = $faker->email;\n $newPass = bcrypt(\"newsecret\");\n Auth::login($admin);\n \n $this->put('/api/v1/user/'.$user->id, ['name' => $newName], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $newName,\n 'email' => $user->email,\n ]\n ]);\n $this->put('/api/v1/user/'.$user->id, ['name' => $user->name, 'email' => $newEmail], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]\n ]);\n $this->put('/api/v1/user/'.$user->id, ['password' => $newPass, 'password_confirmation' => $newPass], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $newEmail,\n ]);\n }", "public function test_users_update_valid_redirects_home(){\n $this->signInUser();\n $user = User::find(5);\n $response = $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $response->assertStatus(302);\n $response->assertRedirect(route('home.index'));\n }", "public function testProfilePrototypeUpdateByIdComments()\n {\n\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function actionUpdate() {\r\n\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n \r\n $user = new User;\r\n $user = $user->getUserById($userID);\r\n \r\n if(!$user) {\r\n $errors['firstname'][0] = 'Unable to find user. Please, try again later';\r\n } else {\r\n //user properties\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n } \r\n \r\n //check if the form has been submitted\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n \r\n $firstname = $this->test_input($_POST['firstname']);\r\n $lastname = $this->test_input($_POST['lastname']);\r\n $email = $this->test_input($_POST['email']);\r\n \r\n //create form model, validate it and if success - update user profile\r\n $model = new EditProfileForm($userID, $firstname, $lastname, $email);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else {\r\n #!!!!!!!!!!!!!\r\n $success = $model->updateProfile() ? 'USER DATA SUCCESFULLY UPDATED': 'UNABLE TO UPDATE USER PROFILE. TRY AGAIN LATER';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/update.php';\r\n }", "public function testUrlEditUsers()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users')\n ->click('.button-edit')\n ->assertSee('Update users')\n ->assertPathIs('/admin/users/'.$user->id.'/edit');\n });\n }", "public function testProfileFindById()\n {\n\n }", "public function testProfileFindOne()\n {\n\n }", "public function test_update_user_as_admin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($this->admin)\n ->put(route('api.users.update', [$user->id]), [\n 'name' => 'My second brand new user'\n ]);\n\n $response->assertStatus(200)\n ->assertJsonFragment(['name' => 'My second brand new user'])\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "function updateProfile($data) {\ntry {\n\n if (!$conn = connectDB()) {\n return false;\n }\n\n $userId = $_SESSION[\"userId\"];\n $args = array(\n $data[\"firstName\"], $data[\"lastName\"],\n $data[\"phone\"], $data[\"email\"], $data[\"location\"],\n $userId\n );\n\n $sql = <<<SQL\nUPDATE WebUser\nSET firstName=$1, lastName=$2,\n phonenumber=$3, emailaddress=$4, location=$5\nWHERE userId=$6\nSQL;\n\n $result = executeSQL($conn, $sql, $args);\n\n if (getUpdateCount($result) != 1) {\n /* Update was unsuccessful */\n closeDB($conn);\n return false;\n }\n\n /* Update succeeded */\n closeDB($conn);\n return true;\n\n} catch (Exception $e) {\n error(\"updateProfile\");\n closeDB($conn);\n return false;\n}\n}", "public function updateProfile(array $data){\n $user = App_Auth::getInstance()->getIdentity();\n $data['id'] = $user->id;\n\n $this->save($data);\n }", "public function testEditUser()\n {\n\n }", "public function test_user_update()\n {\n $this->withoutMiddleware(ValidJWTMiddleware::class);\n\n $user = User::first();\n\n $response = $this->json('PUT', \"api/usuario/$user->id\", [\n 'first_name' => $this->faker->firstName(),\n 'last_name' => $this->faker->lastName(),\n 'email' => $this->faker->email(),\n 'telephone' => '+55' . $this->faker->phoneNumberCleared(),\n ]);\n\n $userValidate = User::first();\n\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n\n $this->assertNotEquals($userValidate, $user);\n }", "public function testSaveProfileWrongUser() {\n\t\tCakeSession::write('Auth.User.id', 2);\n\t\t$this->Model->saveProfile(array(\n\t\t\t'User' => array(\n\t\t\t\t'id' => 1\n\t\t\t)\n\t\t));\n\t}", "public function test_updateSettings() {\n\n }", "public function testFillProfile() {\n $user = factory(\\App\\Models\\User::class)->make();\n\n // Register with factory credentials\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/register')\n ->type('name', $user->name)\n ->type('email', $user->email)\n ->type('password', $user->password)\n ->type('password_confirmation', $user->password)\n ->press('Register')\n // Should be able to see My Profile after authentication\n ->assertSee('My Profile');\n\n // Go to profile\n $browser->clickLink('My Profile')\n ->assertSee('About Me');\n\n // Go to My Experience, open accordion\n $browser->clickLink('My Experience')\n ->assertSee('My Experience')\n ->press('Add Diploma/Degree')\n ->assertSee('New Diploma/Degree');\n\n // Add a diploma\n $browser->select('#degrees\\5b new\\5d \\5b 1\\5d degreeType', '4')\n ->type('#degrees\\5b new\\5d \\5b 1\\5d degreeArea', 'Test area of study')\n ->type('#degrees\\5b new\\5d \\5b 1\\5d degreeInstitution', 'Test institution');\n // TODO: Selectors for date picker\n //->click('#degrees\\5b new\\5d \\5b 1\\5d degreeStartDate')\n //->type('#degrees\\5b new\\5d \\5b 1\\5d degreeStartDate', ['2017'], ['{tab}'], ['0717']);\n //->type('#degrees\\5b new\\5d \\5b 1\\5d degreeEndDate', '2018', ['{tab}'], '08', ['{tab}'], '18');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Diploma/Degree')\n ->pause(777) // Fails without a short pause\n ->press('Save Diploma/Degree')\n ->assertSee('Phd, Test area of study');\n\n // TODO: Repeat for certification / equivalent experience\n //$browser->press('Add Course/Certification')\n // ->assertSee('New Course/Certification');\n\n // Go to My Skills page\n $browser->clickLink('My Skills')\n ->assertSee('My Skills')\n ->press('Add Skill')\n ->assertSee('New Skill');\n\n // Add a soft skill\n $browser->select('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillSelection', '24') // Select dropdown by value\n ->keys('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillSelection',\n ['{tab}'], ['{tab}'], ['{arrow_right}']) // Keyboard controls were necessary to select skill level properly\n ->type('#skill_declarations\\5b new\\5d \\5b soft\\5d \\5b 1\\5d skillDescription', 'Test skill description');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Text corresponding to skill selection value should be visible\n $browser->assertSee('Save Skill')\n ->pause(777)\n ->press('Save Skill')\n ->assertSee('Passion');\n\n // TODO: Repeat for hard skill\n\n // Go to My References, open accordion\n $browser->clickLink('My References')\n ->assertSee('My References')\n ->press('Add Reference')\n ->assertSee('New Reference');\n\n // Add a reference\n $browser->type('#references\\5b new\\5d \\5b 1\\5d referenceName', 'Test Reference')\n ->select('#references\\5b new\\5d \\5b 1\\5d referenceRelationship') // Selects random if not specified\n ->type('#references\\5b new\\5d \\5b 1\\5d referenceEmail', '[email protected]')\n ->type('#references\\5b new\\5d \\5b 1\\5d referenceDescription', 'Test reference description');\n\n // Scroll down (button click will fail if not visible on test browser screen)\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Reference')\n ->pause(777) // Fails without a short pause\n ->press('Save Reference')\n ->assertSee('Test Reference');\n\n // Go to My Work Samples, open accordion\n $browser->clickLink('My Work Samples')\n ->assertSee('My Work Samples')\n ->press('Add Sample')\n ->assertSee('New Work Sample');\n\n // Add work sample data, wouln't work without copying the full selector\n $browser->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleName', 'Test Sample')\n ->select('#work_samples\\5b new\\5d \\5b 1\\5d sampleType') // Selects random if not specified\n ->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleLink', 'http://talent.canada.ca')\n ->type('#work_samples\\5b new\\5d \\5b 1\\5d sampleDescription', 'Test sample description');\n\n $browser->script('window.scrollTo(0, 1000);');\n\n // Saved work sample name should be visible\n $browser->assertSee('Save Sample')\n ->pause(777) // Fails without a short pause\n ->press('Save Sample')\n ->assertSee('Test Sample');\n\n });\n }", "public function test_update_user_roles()\n {\n $roles = [\n Role::firstOrCreate(['display_name' => Role::ACCOUNT_MANAGER])->id,\n Role::firstOrCreate(['display_name' => Role::CASHIER])->id,\n ];\n\n $this->user->syncRoles($roles);\n\n $branchManager = Role::firstOrCreate(['display_name' => Role::BRANCH_MANAGER])->id;\n\n $this->put('users/'.$this->user->id, ['roles' => [$branchManager]])\n ->assertRedirect(route_with_hash('settings.index', '#users'))\n ->assertSessionHas('flash_notification.message', 'User details updated');\n\n self::assertCount(1, $this->user->roles);\n }", "public function testProfileFind()\n {\n\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "public function testUpdateUserProfileErrorForbidden()\n {\n // Request\n $response = $this->call('POST', $this->accountProfilePostUrl, []);\n\n // Assert redirect to login\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function Save() {\n $this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n $this->session->SetAuthenticatedUser($this->profile);\n return $this->db->RowCount() === 1;\n }", "public function updateAction(){\n\n \n if ($this->user->updateProfile($_POST)) {\n\n $this->token = new Token($_POST['token']);\n \n if(isset($_POST['token']) && $_POST['token'] === $this->token->getValue()){\n\n \n Flash::addMessage('Profile was Update');\n $this->redirect('/profile/index');\n\n }else{\n\n\n Flash::addMessage('Profile was not Update', Flash::WARNING);\n\n View::renderTemplate('Profile/index.html', [\n 'user' => htmlspecialchars($this->user),\n 'token'=> $this->token->updateToken()\n ]);\n \n }\n\n\n } else {\n\n Flash::addMessage('Profile was not Update', Flash::INFO);\n\n View::renderTemplate('Profile/index.html', [\n 'user' => htmlspecialchars($this->user)\n ]);\n\n }\n }", "public function update_profile($id, $data) \n {\n $this->db->set($data);\n $this->db->where('id', $id);\n $this->db->update('users');\n if ($this->db->affected_rows() > 0) \n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function testSellerEditSuccess()\n {\n $this->demoUserLoginIn();\n $spu = Spu::create([\n 'users_id' => '1',\n 'name' => 'test',\n 'description' => 'test',\n ]);\n $response = $this->call('GET', '/seller/3/edit');\n $this->assertEquals(200, $response->status());\n }", "public function testGetValidProfileById() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new Profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function testGETProfile()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/profile/2',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Found\",\"data\":{\"totalCount\":1,\"profile\":{\"id\":\"2\",\"user_id\":\"2\",\"photo\":\"0\",\"website\":\"mysite2.com\",\"owner\":{\"id\":\"2\",\"username\":\"username2\",\"password\":\"password2\",\"email\":\"[email protected]\"}}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function test_authenticated_admin_users_can_hit_the_update_endpoint()\n {\n // First we create a test country\n $country = $this->createCountry();\n\n // Then we check if it was successfully added into the database\n $this->assertDatabaseHas('countries', $country->toArray());\n\n // Then we create an update request with auth headers and empty params\n $this->authenticatedAdmin()->update($country->code, [])\n // We assert status is 422, because now we are authenticated, but request params are invalid\n ->assertStatus(422)\n // Then we assert errors structure matches expected\n ->assertJsonStructure([\n 'errors' => [\n 'name',\n 'code'\n ]\n ]);\n }", "function wrm_profile_update($profile_id, $wrmpass, $email)\n{\n\tglobal $db_raid, $phpraid_config;\n\n\tif ($wrmpass != '')\n\t{\n\t\t$sql = sprintf(\"UPDATE \" . $phpraid_config['db_prefix'] . \"profile \n\t\t\t\t\t\tSET email = %s, password = %s, last_login_time = %s WHERE profile_id = %s\",\n\t\t\t\t\t\tquote_smart($email),quote_smart($wrmpass),quote_smart(time()),\n\t\t\t\t\t\tquote_smart($profile_id)\n\t\t\t\t\t\t);\n\t}\n\telse\n\t{\n\t\t$sql = sprintf(\"UPDATE \" . $phpraid_config['db_prefix'] . \"profile \n\t\t\t\t\t\tSET email = %s, last_login_time = %s WHERE profile_id = %s\",\n\t\t\t\t\t\tquote_smart($email),quote_smart(time()),\n\t\t\t\t\t\tquote_smart($profile_id)\n\t\t\t\t\t\t);\n\t}\n\t$db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(), 1);\n\t\n\treturn 1;\n}", "public function testProfilePrototypeUpdateImage()\n {\n\n }", "public function testSellerUpdatedSuccess()\n {\n $this->demoUserLoginIn();\n $spu = Spu::create([\n 'users_id' => '1',\n 'name' => 'test',\n 'description' => 'test',\n ]);\n $response = $this->call('PATCH', '/seller/4/update', [\n 'name' => 'testUpdate',\n 'description' => 'testUpdate',\n ]);\n $this->assertEquals(302, $response->status());\n }", "public function testUnitUpdate()\n {\n $input = [\n 'username' => 'foo.bar',\n 'email' => '[email protected]',\n 'password' => 'asdfg',\n 'password_confirmation' => 'asdfg',\n 'name' => 'foo bar'\n ];\n $request = Mockery::mock('Suitcoda\\Http\\Requests\\UserEditRequest[all]');\n $request->shouldReceive('all')->once()->andReturn($input);\n\n $model = Mockery::mock('Suitcoda\\Model\\User[save]');\n $model->shouldReceive('findOrFailByUrlKey')->once()->andReturn($model);\n $model->shouldReceive('save')->once();\n\n $user = new UserController($model);\n\n $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $user->update($request, 1));\n }", "public function testProfileCreateChangeStreamPostProfilesChangeStream()\n {\n\n }", "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "public function test_a_user_cannot_modify_another_users_account_information()\n {\n $userA = factory(User::class)->create();\n $userB = factory(User::class)->create();\n\n // When user A tries to view user B data\n Passport::actingAs($userA);\n $response = $this->json('GET', 'api/v1/users/' . $userB->id);\n\n // Then it is not successful\n $response->assertStatus(ResponseCode::HTTP_UNAUTHORIZED);\n $response->assertSee('Unauthorized Access');\n }", "public function postProfile() {\n $this->_adminUserRepository->updateProfile ( $this->auth->user ()->id );\n return redirect ( 'users/profile' )->withSuccess ( trans ( 'user::adminuser.profile.success' ) );\n }" ]
[ "0.7830626", "0.73956645", "0.70280325", "0.7027531", "0.6968363", "0.6965224", "0.6961997", "0.6961828", "0.6867657", "0.6827248", "0.68127936", "0.6770621", "0.67602813", "0.67362744", "0.6692876", "0.66749215", "0.66616416", "0.6608596", "0.6600718", "0.6554914", "0.6547893", "0.6518054", "0.6506932", "0.6478437", "0.64779633", "0.64718544", "0.64568824", "0.64515823", "0.64461786", "0.6440009", "0.6428764", "0.64042985", "0.63965344", "0.6388725", "0.63830537", "0.63776714", "0.6367984", "0.6362866", "0.63603693", "0.6356444", "0.63534", "0.6345775", "0.6328164", "0.63244855", "0.63181317", "0.6294217", "0.6286048", "0.62841123", "0.62715507", "0.62599957", "0.62178016", "0.6209236", "0.62074274", "0.6200943", "0.619388", "0.6191277", "0.618643", "0.61767656", "0.6173614", "0.6161126", "0.61552256", "0.61504143", "0.6150353", "0.6149005", "0.6147877", "0.61477536", "0.61415446", "0.61405426", "0.6135025", "0.61253244", "0.61216944", "0.61216396", "0.61116177", "0.61072147", "0.60954183", "0.60943574", "0.6078116", "0.60656035", "0.60566795", "0.6050453", "0.60485995", "0.60454816", "0.6027895", "0.60275215", "0.6015151", "0.6012101", "0.6011903", "0.60106075", "0.6007659", "0.6005133", "0.5996542", "0.5984318", "0.5980736", "0.5978974", "0.5978309", "0.59589195", "0.59525657", "0.59489155", "0.5943554", "0.59407854", "0.5937724" ]
0.0
-1
Test validation error on profile update.
public function testUpdateUserProfileErrorValidations() { // Prepare $user = factory(User::class)->create(); $requestData = [ 'user' => [], 'usermeta' => [ 'twitter' => '@geekytheory', 'instagram' => 'geekytheory', 'facebook' => 'GeekyTheory', 'biography' => 'This text is longer than 255 characters and will not pass the validation. The biography cannot have more than 255 characters and this text has more than that quantity so the validation will fail showing an error message in the biography attribute.', ], ]; // Request $response = $this->actingAs($user)->call('POST', $this->accountProfilePostUrl, $requestData); // Asserts $response->assertStatus(302); $response->assertRedirect($this->accountProfilePageUrl); $response->assertSessionHasErrors([ 'name', 'username', 'email', 'twitter', 'instagram', 'facebook', 'biography', ]); // Check that user and user meta haven't been modified $this->assertDatabaseHas('users', $user->attributesToArray()); $this->assertDatabaseMissing('user_meta', ['user_id' => $user->id,]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new profile and update it in mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// edit the profile and update it in mySQL\n\t\t$profile->setProfileContent($this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_NAME);\n\t\t$profile->update($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function test_if_failed_update()\n {\n }", "public function testWrongFieldInstructorProfileUpdate() {\n try {\n\n $nonExistentInstructor = UserManagementController::updateInstructorProfile(\"gggggg\",\"686875\",\"[email protected]\",\n \"gfhgjhk \",\"hjhkhkj\",\"ghgjhgj\",true,$this->institution->getAbbreviation(),\n \"Teacher572\");\n\n $this->fail(\"The exceptional profile update failed for non existing Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"userNotFound\"]);\n }\n\n try {\n\n $wrongProjectNameFieldUpdate = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,\"ABC\"\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed for non existing Project of Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"projectNotFound\"]);\n }\n\n try {\n\n $wrongInstitutionNameFieldUpdate = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,\"ABCD\",self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed for non existing Institution of Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"institutionNotFound\"]);\n }\n }", "public function testUpdateUserProfileErrorForbidden()\n {\n // Request\n $response = $this->call('POST', $this->accountProfilePostUrl, []);\n\n // Assert redirect to login\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testProfileInvalid()\n {\n $email = new Notification();\n $email->profile('derp');\n }", "public function testMissingFieldsInstructorProfileUpdate() {\n try {\n $missingNames = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,\"\",\"\",$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed with missing name\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"newFirstName\"]);\n $this->assertNotNull($errorFields[\"newLastName\"]);\n }\n\n try {\n $missingEmailandOthers = UserManagementController::updateInstructorProfile(\"\",\"\" ,\"\"\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed with missing\n username, password email\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"username\"]);\n $this->assertNotNull($errorFields[\"newPassword\"]);\n $this->assertNotNull($errorFields[\"newEmail\"]);\n }\n\n try {\n $missingProjectName = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,\"\"\n ,\"\",$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional instructor update failed for\n missing project name, team leader and other fields\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"newProjectName\"]);\n $this->assertNotNull($errorFields[\"new_isOwner\"]);\n }\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $this->customDealerAccountData, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Verify\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHasErrors();\n }", "public function test_it_doesnt_update_a_user_if_validation_fails()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]'];\n\n $response = $this->call('PUT', sprintf('/users/%d', $user->id), $update);\n\n $this->assertEquals(422, $response->status());\n $this->assertJsonStringEqualsJsonString(json_encode([\n 'given_name' => ['The given name field is required.'],\n 'family_name' => ['The family name field is required.']\n ]), $response->getContent());\n }", "public function testUpdateUserValidationError()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->putJson('/api/user/' . $user->id, ['email' => 'Invalid@email com']);\n\n $response->assertStatus(422);\n }", "public function testGetInvalidProfileByProfileName() : void {\n\t\t// get a profile name that doesn't exist\n\t\t$profile = Profile::getProfileByProfileName($this->getPDO(), \"Invalid Profile Name\");\n\t\t$this->assertCount(0, $profile);\n\t}", "public function test_users_update_bad_email_error(){\n $this->signInUser();\n $this->user['email'] = 'email';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function testGetInvalidProfileByProfileEmail() : void {\n\t\t// get an email that doesn't exist\n\t\t$profile = Profile::getProfileByProfileEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($profile);\n\t}", "public function testGetInvalidProfileByProfileId () : void {\n\t\t// grab a profile id that doesn't exist?\n\t\t$invalidProfileId = generateUuidV4();\n\n\t\t$profile = Profile::getProfileByProfileId($this->getPDO() , \"$invalidProfileId\");\n\t\t$this->assertNull($profile);\n\t}", "public function test_user_update_invalid_phone()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => str_repeat(01670514306, 10),\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_phone,\n ]);\n }", "public function test_profile_update_bad($insertedId)\n {\n $url = $this->makeUrl('/v1/provider/1/profile/{id}', $insertedId);\n\n $data = [\n 'offset' => '101',\n 'provider_id' => '999999',\n 'dilution_steps' => [\n [\n 'dilution' => '-1',\n 'expiration' => '100',\n 'bill_rate' => 'x',\n 'color_name' => 'REDxx',\n 'color' => '1671168000'\n ],\n ],\n 'bottle_numbering_order' => 'bad',\n 'name' => '12345678990123456789901234567899012345678990123456',\n 'low_glycerin_limit' => '100.01',\n 'high_glycerin_limit' => '100.01',\n 'default_vial_size' => '12345678990123456',\n 'include_diluent_name' => 'x',\n 'preferred_glycerin_diluent_id' => '9999',\n 'preferred_aqueous_diluent_id' => '9999'\n ];\n\n $response = $this->putJsonTest($url, $data, 'validation');\n\n $response\n ->assertStatus(400)\n ->assertJson([\n 'status' => 'validation',\n 'errors' => [\n 'name' => [\n 'The name must be between 1 and 45 characters.'\n ],\n// 'provider_id' => [\n// 'The selected provider id is invalid.'\n// ],\n 'offset' => [\n 'The offset must be between -2 and 2.'\n ],\n 'low_glycerin_limit' => [\n 'The low glycerin limit must be between 0 and 100.00.'\n ],\n 'high_glycerin_limit' => [\n 'The high glycerin limit must be between 0 and 100.00.'\n ],\n 'default_vial_size' => [\n 'The default vial size must be between 0 and 15 characters.'\n ],\n 'include_diluent_name' => [\n 'The selected include diluent name is invalid.'\n ],\n 'preferred_glycerin_diluent_id' => [\n 'The selected preferred glycerin diluent id is invalid.'\n ],\n 'preferred_aqueous_diluent_id' => [\n 'The selected preferred aqueous diluent id is invalid.'\n ],\n 'bottle_numbering_order' => [\n 'The selected bottle numbering order is invalid.'\n ],\n 'dilution_steps.0.dilution' => [\n 'The dilution_steps.0.dilution must be between 0 and 100000000.'\n ],\n 'dilution_steps.0.bill_rate' => [\n 'The dilution_steps.0.bill_rate must be a number.'\n ],\n 'dilution_steps.0.expiration' => [\n 'The dilution_steps.0.expiration must be between 0 and 60.'\n ],\n 'dilution_steps.0.color_name' => [\n 'The dilution_steps.0.color_name must be between 0 and 4 characters.'\n ]\n ]\n ]);\n\n return $insertedId;\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function testSaveFailure()\n {\n $this->specify('Fail creating new user with empty props', function () {\n $model = new SuperUserForm();\n\n $result = $model->save();\n\n verify('Model should not save', $result)->false();\n\n $expectedErrorKeys = ['email', 'password', 'type', 'status'];\n foreach ($expectedErrorKeys as $key) {\n verify($key . ' error message should be set', $model->errors)->hasKey($key);\n }\n });\n\n $this->specify('Fail creating new user with invalid props', function () {\n $model = new SuperUserForm(null, [\n 'email' => 'invalid',\n 'type' => -1,\n 'status' => -1,\n 'password' => '123',\n 'passwordConfirm' => '123456',\n 'notifications' => 'invalid',\n 'mentions' => 'invalid',\n ]);\n\n $result = $model->save();\n\n verify('Model should not save', $result)->false();\n\n $expectedErrorKeys = ['email', 'password', 'passwordConfirm', 'type', 'status', 'notifications', 'mentions'];\n foreach ($expectedErrorKeys as $key) {\n verify($key . ' error message should be set', $model->errors)->hasKey($key);\n }\n });\n\n $this->specify('Fail updating existing user with invalid props', function () {\n $originalUser = User::findOne(1001);\n $user = User::findOne(1001);\n $model = new SuperUserForm($user, [\n 'email' => 'invalid',\n 'type' => -1,\n 'status' => -1,\n 'password' => '123',\n 'passwordConfirm' => '123456',\n 'notifications' => 'invalid',\n 'mentions' => 'invalid',\n ]);\n\n $result = $model->save();\n\n $user->refresh();\n\n verify('Model should not save', $result)->false();\n verify('User model should not be changed', $user)->equals($originalUser);\n\n $expectedErrorKeys = ['email', 'password', 'passwordConfirm', 'type', 'status', 'notifications', 'mentions'];\n foreach ($expectedErrorKeys as $key) {\n verify($key . ' error message should be set', $model->errors)->hasKey($key);\n }\n });\n }", "public function test_user_update_invalid_fname()\n {\n Storage::fake('photos');\n $response = $this->json('POST', 'update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => str_repeat('First Name', 21),\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_user_update_invalid_fname,\n ]);\n }", "public function testItDoesntUpdateAnInvalidUser()\n {\n $this->actingAs($this->user)\n ->putJson(\"api/v1/users/0\", [\n \"firstname\" => \"melinda\",\n \"lastname\" => \"epifano\",\n ])\n ->assertStatus(422);\n }", "function mtii_utilities_profile_update_errors($errors, $update, $user) {\n if ($update) {\n return;\n }\n if (empty($_POST['gender']) || ! empty($_POST['gender']) && trim($_POST['gender']) == '') {\n $errors->add(\n 'gender_error',\n __(\n '<strong>ERROR</strong>: Please select your Gender', 'mtii-utilities-josbiz'\n )\n );\n }\n if (empty($_POST['phone_number']) || ! empty($_POST['phone_number']) && trim(intval($_POST['phone_number'])) == '') {\n $errors->add(\n 'phone_error',\n __(\n '<strong>ERROR</strong>: Please input a valid phone number', 'mtii-utilities-josbiz'\n )\n );\n }\n if (empty($_POST['state_city']) || ! empty($_POST['state_city']) && trim($_POST['state_city']) == '') {\n $errors->add(\n 'city_error',\n __('<strong>ERROR</strong>: Please input a City', 'mtii-utilities-josbiz'\n )\n );\n }\n }", "public function testProfileUpsert()\n {\n\n }", "public function updateProfile(ValidProfile $request){\n\n\t\t// Ensure only the logged in user can update their profile. \n $user = User::find(Auth::user()->id); \n \n $user->name = $request->name;\n\t\t$user->traveller_rv_type_id = $request->rvType;\n\t\t$user->traveller_rv_size = $request->rvSize;\n\t\t$user->host_description = $request->description;\n\t\t\n\t\t$user->save();\n \n return Redirect::route('home');\n }", "public function testProfileUpdateAll()\n {\n\n }", "public function test_users_update_non_unique_email_error(){\n $this->signInUser();\n $this->user['email'] = '[email protected]'; //assume correct test data\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function test_user_update_invalid_email()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => 'mayeennbd',\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_email,\n ]);\n }", "public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/branch/edit', $this->customBranchData, [], [], ['HTTP_REFERER' => '/branch/edit']);\n \n // Verify\n $this->assertRedirectedTo('/branch/edit');\n $this->assertSessionHasErrors();\n }", "public function test_users_update_no_email_error(){\n $this->signInUser();\n unset($this->user['email']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); $response->assertSessionHasErrors(['email']);\n }", "public function test_user_update_invalid_full_name()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => str_repeat('Full Name', 51),\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_full_name,\n ]);\n }", "public function test_user_update_invalid_lname()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => str_repeat('Last Name', 21),\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_lname,\n ]);\n }", "public function test_users_update_long_email_error(){\n $this->signInUser();\n $this->user['email'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function verify_user_profile()\n {\n $this->CI->load->library('form_validation');\n $this->form_validation->CI =& $this;\n\n $this->CI->form_validation->set_rules('profdesc','Profile Description','required|min_length[5]|alpha_numeric_spaces|max_length[253]');\n $this->CI->form_validation->set_rules('first_name','Firstname','required|alpha|min_length[3]|max_length[15]');\n $this->CI->form_validation->set_rules('last_name','Lastname','required|alpha|min_length[2]|max_length[15]');\n\n\n return $this->CI->form_validation->run();\n }", "public function updateFailed();", "public function testDeleteValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new Profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// delete the Profile from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$profile->delete($this->getPDO());\n\n\t\t// grab the data from mySQL and make sure the Profile does not exist\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertNull($pdoProfile);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"profile\"));\n\t}", "public function testProfilePrototypeUpdateByIdQuarantines()\n {\n\n }", "function validate_on_update() {}", "public function testSuccessfulInstructorUpdate() {\n try {\n $updatedInstructor = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->assertNotNull($updatedInstructor, \"The updated instructor is null\");\n $this->assertEquals($this->userTypeEnum->INSTRUCTOR, $updatedInstructor->getType(), \"The updated user is not\n an instance of INSTRUCTOR\");\n\n $InstructorInstitution = PersistentUserXInstitutionPeer::retrieveByPk($updatedInstructor->getUserId(),\n $this->institution->getInstitutionId());\n $this->assertNotNull($InstructorInstitution, \"The user x institution relation was not created for the instructor.\");\n $this->assertEquals(self::IDENTIFICATION, $InstructorInstitution->getIdentification(), \"The Instructor school\n identification is incorrect\");\n $this->assertEquals($updatedInstructor->getUserId(), $InstructorInstitution->getUserId(), \"The user id is\n incorrect on user x institution for the instructor\");\n $this->assertEquals($this->institution->getInstitutionId(), $InstructorInstitution->getInstitutionId(),\n \"The institution id is incorrect on user x institution for the instructor\");\n\n $instXProjec = PersistentUserXProjectPeer::retrieveByPK($updatedInstructor->getJnUsername(),\n $this->project->getProjectJnName());\n $this->assertNotNull($instXProjec, \"The relationship between instructor and project was not created\");\n $this->assertEquals($this->project->getProjectJnName(), $instXProjec->getProjectJnName(), \"The project name\n is incorrect on user x project\");\n $this->assertEquals($updatedInstructor->getJnUsername(), $instXProjec->getJnUsername(), \"The java.net\n username is incorrect on user x project for instructor\");\n $this->assertTrue($instXProjec->getIsOwner() == 1, \"The instructor is the owner of project.\");\n\n } catch (InfinityMetricsException $ime){\n $this->fail(\"The successful update of profile failed: \" . $ime);\n }\n\n }", "public function testInsertValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create new profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "function validateRemoteProfile()\n {\n if ($this->oprofile->isGroup()) {\n $target = common_local_url('ostatusgroup', array(), array('profile' => $this->profile_uri));\n common_redirect($target, 303);\n } else if ($this->oprofile->isPeopletag()) {\n $target = common_local_url('ostatuspeopletag', array(), array('profile' => $this->profile_uri));\n common_redirect($target, 303);\n }\n }", "public function test_user_update_invalid_image()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.docs')->size(1200),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_image,\n ]);\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testProfilePrototypeUpdateAttributes()\n {\n\n }", "public function test_user_update_invalid_postal()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => str_repeat(1207, 21),\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_postal,\n ]);\n }", "function seun_user_profile_nicename_error( $errors, $update, $user ) {\n\t\t\n\t\t\t$errors->add( 'user_nicename', __( '<strong>ERROR</strong>: This user nicename is already registered. Please choose another one.', 'seun' ) );\n\t\t\n\t\t}", "function updateStudentValidate(){\n\t\t\n\t\tif(@$this->institution == \"\" | @$this->identification == \"\" | @$this->passkey == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"FAILED TO IDENTIFY USER BASED ON GIVEN CRITERIA!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t$this->basics->updateStudent($this->sanitize($this->nom), $this->sanitize($this->institution), $this->sanitize($this->major), $this->sanitize($this->minor), $this->sanitize($this->identification), $this->obsfucate->makePass($this->sanitize($this->passkey)), $this->sanitize($this->google), $this->sanitize($this->yahoo), $this->sanitize($this->live), $this->sanitize($this->facebook), $this->sanitize($this->linkedin), $this->sanitize($this->twitter), @$this->sanitize($this->department), @$this->sanitize($this->school), @$this->sanitize($this->country));\n\t\t}\n\t\n\t}", "public function test_users_update_existing_email_no_error(){\n $this->signInUser();\n $user = User::find(5);\n $this->user['email'] = $user->email;\n $response = $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $response->assertSessionHasNoErrors(['email']);\n }", "public function testGetValidProfileById() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new Profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function _assertProfileExists($profile_uid)\n {\n }", "private function failUpdate($puserId)\r\n\t{\r\n\t\t$this->startSession(KalturaSessionType::USER, 'test1');\r\n\t\t\t\t\r\n\t\t$entry = $this->client->baseEntry->get($this->entryId);\r\n\t\t$entry = $this->switchUsers($entry);\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\t$this->client->baseEntry->update($this->entryId, $entry);\r\n\t\t\t$this->fail(\"UpdateShould fail\");\r\n\t\t}\r\n\t\tcatch(Exception $e)\r\n\t\t{\r\n\t\t\t$this->checkException($e, array('INVALID_KS', 'PROPERTY_VALIDATION_ADMIN_PROPERTY'));\r\n\t\t}\r\n\t}", "public function testValueValidationForUpdate()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n\n $this->assertNotNull($eavValue);\n\n $eavValue->setValue('not_existing_type');\n\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n }", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_users_update_authenticated_long_name_error(){\n $this->signInUser();\n $this->user['name'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['name']);\n }", "public function testGetValidProfileByProfileName() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new Profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// get Profile form database using profile name\n\t\t$results = Profile::getProfileByProfileName($this->getPDO(), $this->VALID_PROFILE_NAME);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\n\t\t// make sure no other objects are contaminating the profile\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\FoodTruckFinder\\\\Profile\", $results);\n\n\t\t// make sure results are same as expected\n\t\t$pdoProfile = $results[0];\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "function seun_user_profile_nicename_generic_error( $errors, $update, $user ) {\n\n\t\t\t$errors->add( 'user_nicename', __( '<strong>ERROR</strong>: There was an error updating the user nicename. Please try again.', 'seun' ) );\n\t\t\n\t\t}", "public function test_user_update_invalid_dob()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->name,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => '1993',\n 'gender' => $this->gender,\n 'postal_code' =>$this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_dob,\n ]);\n }", "public function testProfile() {\n $profile = <<<PROFILE_TEST\ncore_version_requirement: '*'\nname: The Perfect Profile\ntype: profile\ndescription: 'This profile makes Drupal perfect. You should have no complaints.'\nPROFILE_TEST;\n\n vfsStream::setup('profiles');\n vfsStream::create([\n 'fixtures' => [\n 'invalid_profile.info.txt' => $profile,\n ],\n ]);\n $info = $this->infoParser->parse(vfsStream::url('profiles/fixtures/invalid_profile.info.txt'));\n $this->assertFalse($info['core_incompatible']);\n }", "public function testValidateFormFailure()\n {\n $formData = 10;\n $validation = GRUB\\Validator\\Validator::validateIngredient($formData);\n $expected = 10;\n $this->assertEquals($validation, $expected);\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "public function testEnterIncorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => '',\n 'password' => '',\n '_token' => csrf_token()\n ]);\n \n $this->assertNotEquals(200, $response->getStatusCode());\n\n $response = $this->call('POST', '/admin/signin', [\n 'email' => '[email protected]',\n 'password' => '123',\n '_token' => csrf_token()\n ]);\n $this->assertEquals(422, $response->decodeResponseJson()['status']);\n\n }", "public function testUpdateUnsuccessfulReason()\n {\n }", "public function testGetErrorMessagesAfterValidationFailure()\n {\n $this->validator->isValid(-211);\n $this->assertCount(1, $this->validator->errors());\n }", "public function validationHasFailed() {}", "public function testInvalidUpdate()\n {\n $manager = $this->getModelManager();\n\n // Get the first tutor\n $tutor = $manager->findById(1);\n\n /** @var TutorLanguage $tutorLanguage */\n $tutorLanguage = $tutor->getTutorLanguages()->first();\n\n $response = $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language-banana');\n\n $this->assertBadRequestJsonResponse($response);\n }", "public function testSaveProfileWrongUser() {\n\t\tCakeSession::write('Auth.User.id', 2);\n\t\t$this->Model->saveProfile(array(\n\t\t\t'User' => array(\n\t\t\t\t'id' => 1\n\t\t\t)\n\t\t));\n\t}", "public function testUpdateInvalidUser() {\n\t\t// create a USer and try to update it without actually inserting it\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->update($this->getPDO());\n\t}", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function test_users_update_authenticated_no_name_error(){\n $this->signInUser();\n unset($this->user['name']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); $response->assertSessionHasErrors(['name']);\n }", "public function testProfileCheckIfDisplayNameIsTaken()\n {\n\n }", "public function testSellerUpdatedFailed()\n {\n $this->demoUserLoginIn();\n $response = $this->call('PATCH', '/seller/999/update', [\n 'name' => 'testUpdate',\n 'description' => 'testUpdate',\n ]);\n $this->assertEquals(404, $response->status());\n }", "function shorthand_admin_settings_validate($form, &$form_state) {\n $user_id = $form_state['values']['shorthand_user_id'];\n $token = $form_state['values']['shorthand_token'];\n if (!is_numeric($user_id)) {\n form_set_error('shorthand_user_id', t('User ID must be an integer.'));\n }\n else {\n $data = sh_get_profile($user_id, $token);\n if (!isset($data->username)) {\n form_set_error('shorthand_token', t('Invalid token.'));\n }\n }\n}", "public function testProfileUnilogin()\n {\n\n }", "public function validateStatus()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if ($user->status==User::STATUS_BLOCKED || $user->status==User::STATUS_DELETED) {\n $this->addError('password', Yii::t('app','Your account is blocked, please contact support.'));\n }\n\n if ($user->status==User::STATUS_EMAIL_VALIDATION) {\n $this->addError('password', Yii::t('app','Du hast Deine Registrierung noch nicht abgeschlossen. Prüfe Deine E-Mails, dort findest Du eine E-Mail mit dem Bestätigungslink. Bitte klicke auf diesen Link um Deine Registrierung abzuschliessen.'));\n }\n\n }\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "public function updateProfile(Request $request) {\n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n ]); \n if ($validator->fails()) {\n $err_msg = $validator->messages()->first();\n $response['error'] = true;\n $response['message'] = $err_msg;\n return response($response)->header('Content-Type', 'json');\n }\n $user_id = $request->get('user_id');\n $check = Profile::check_valid_user($user_id);\n if($check > 0) {\n $response = Profile::update_profile($user_id,$request);\n } else {\n return response(['error'=>false,'message'=>'User not found in application'])->header('Content-Type', 'json');\n }\n return $response;\n }", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "public function testGetErrorMessagesAfterValidationFailure()\n {\n $validator = new Callback(function ($input) {\n return ($input == 1) ? true : false;\n });\n\n $this->assertFalse($validator->isValid(2));\n $this->assertCount(1, $validator->errors());\n }", "public function updateProfile()\n {\n try {\n $email = Crypt::decryptString(request()->hash);\n $user = Customer::whereEmail($email)->first();\n if ($user) {\n $user->fname = request()->fname;\n $user->lname = request()->lname;\n $user->phone = request()->phone;\n $user->address = request()->address;\n if (request()->image)\n $user->image = $this->uploadBase64Image(request()->image);\n\n $user->save();\n\n $user->access_token = Crypt::encryptString($user->email);\n\n return ['status' => true, 'message' => 'Profile updated successfully.', 'data' => $user];\n }//..... end if() .....//\n\n return ['status' => false, 'message' => 'User details not found!.'];\n } catch (\\Exception $exception) {\n return $exception->getMessage();\n return ['status' => false, 'message' => 'Internal server error occurred, please try later.'];\n }\n }", "function validate_user_edit(array $inputs, array &$form): bool\n{\n if (App::$db->getRowById('wall', $_GET['id'])['poster'] !== $_SESSION['email']) {\n $form['error'] = 'ERROR YOU\\'RE NOT ALLOWED TO EDIT THAT';\n return false;\n }\n\n return true;\n}", "public function testNotCorrectAssignuser() \r\n {\r\n // expect_not($model->assignuser());\r\n // expect_that($model->getErrors('id'));\r\n // expect_that($model->getErrors('authorRole'));\r\n \r\n }", "public function test_users_store_bad_email_error(){\n $this->signInUser();\n $this->user['email'] = 'email';\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function testUserNotExisted(){\n $array_test = ['email' => '[email protected]', 'pubid' => 4];\n\n $api = new ApiConnection();\n $dataCheck = [\n 'status' => 401,\n 'message' => \"User does not exist\",\n 'data' => []\n ];\n $this->assertEquals($dataCheck, $api->updateAccount($array_test));\n }", "public function updateprofile()\n\t\t{\n\t\t\t$validator = Validator::make(Input::all(), User::$editrules);\n\t\t\tif(Auth::check()) {\n\t\t\t\t$usertoupdate = Auth::user();\n\t\t\t\t$usertoupdate->firstname = Input::get('firstname');\n\t\t\t\t$usertoupdate->lastname = Input::get('lastname');\n\t\t\t\t$usertoupdate->phone = Input::get('phone');\n\t\t\t\t$checkdbforusername = DB::table('users')->where('username', Input::get('username'))->pluck('username');\n\t\t\t\t$checkdbforemail = DB::table('users')->where('email', Input::get('email'))->pluck('email');\n\n\t\t\t\tif($validator->fails()) {\n\t\t\t\t\tSession::flash('errormessage', 'Sorry, some of your inputs are incorrect');\n\t\t\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t\t\t} else {\n\t\t\t\t\tif($checkdbforusername == null || $checkdbforusername == Auth::user()->username) {\n\t\t\t\t\t\tif($checkdbforemail == null || $checkdbforemail == Auth::user()->email) {\n\t\t\t\t\t\t\tif($checkdbforusername != Auth::user()->username) {\n\t\t\t\t\t\t\t\t$usertoupdate->username = Input::get('username');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($checkdbforemail != Auth::user()->email) {\n\t\t\t\t\t\t\t\t$usertoupdate->email = Input::get('email');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$usertoupdate->save();\n\t\t\t\t\t\t\tSession::forget('loggedinuser');\n\t\t\t\t\t\t\tSession::put('loggedinuser', $usertoupdate->username);\n\t\t\t\t\t\t\tSession::flash('successMessage', 'Profile successfully updated!');\n\t\t\t\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSession::flash('errorMessage', 'This email address is already taken');\n\t\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSession::flash('errorMessage', 'This username is already taken');\n\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function a_name_is_required()\n {\n //$this->withoutExceptionHandling();\n\n $this->actingAsCustomer();\n\n $response = $this->patch('/profile/update', array_merge($this->customerData(), ['name' => '']));\n $response->assertSessionHasErrors('name');\n }", "public function test_users_update_valid_perists_to_db(){\n $this->signInUser();\n $user = User::find(5);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email']\n ]);\n }", "public function update_user_profile($user_data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($user_data['name'])) {\r\n $this->errors['name'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($user_data['name']) < 5) {\r\n $this->errors['name'] = 'يجب على اسم المستخدم أن يتكون من 5 أحرف فأكثر';\r\n }\r\n\r\n if (str_word_count($user_data['bio']) > 150) {\r\n $this->errors['bio'] = 'يسمح فقط بـ 150 كلمة أو أقل في النبذة الخاصة بك';\r\n }\r\n\r\n if (!filter_var($user_data['email'], FILTER_VALIDATE_EMAIL)) {\r\n $this->errors['email'] = 'رجاء أدخل بريدا إلكترونيا صالحا';\r\n }\r\n\r\n if (empty($this->errors)) { // If There is No Error\r\n // Sanitize Data\r\n $name = filter_var($user_data['name'], FILTER_SANITIZE_STRING);\r\n $bio = filter_var($user_data['bio'], FILTER_SANITIZE_STRING);\r\n $email = filter_var($user_data['email'], FILTER_SANITIZE_EMAIL);\r\n\r\n // Get Old User Pictures\r\n $avatar = $this->get_user_info('avatar', $user_id);\r\n $cover = $this->get_user_info('cover', $user_id);\r\n\r\n // If The User Uploaded a New Avatar\r\n if (!empty($_FILES['avatar']['tmp_name'])) {\r\n // Get The Avatar\r\n $image = $_FILES['avatar'];\r\n $ext = pathinfo($image['name'], PATHINFO_EXTENSION);\r\n\r\n // If The User Has Not an Image Folder Before\r\n if (in_array($avatar, ['male.png', 'female.png'])) {\r\n // Create a New One\r\n $user_dir = str_replace(' ', '_', $name) . '_' . time() . '/';\r\n } else { // If Not\r\n // Use The Old One\r\n $user_dir = pathinfo($avatar, PATHINFO_DIRNAME) . '/';\r\n }\r\n\r\n // Fill Important Properties\r\n $this->extensions = ['png', 'jpg', 'jpeg', 'gif'];\r\n $this->upload_dir = 'assets/images/profile/' . $user_dir;\r\n $this->upload_name = 'profile.' . $ext;\r\n\r\n // Upload The New Image\r\n if ($this->upload($image)) {\r\n $avatar = $user_dir . $this->upload_name;\r\n }\r\n }\r\n\r\n // If The User Uploaded a New Cover Photo\r\n if (!empty($_FILES['cover']['tmp_name'])) {\r\n // Get The Image\r\n $image = $_FILES['cover'];\r\n $ext = pathinfo($image['name'], PATHINFO_EXTENSION);\r\n\r\n // If The User Has Not an Image Folder Before\r\n if (in_array($avatar, ['male.png', 'female.png'])) {\r\n // Create a New One\r\n $user_dir = str_replace(' ', '_', $name) . '_' . time() . '/';\r\n } else { // If Not\r\n // Use The Old One\r\n $user_dir = pathinfo($avatar, PATHINFO_DIRNAME) . '/';\r\n }\r\n\r\n // Fill Important Properties\r\n $this->extensions = ['png', 'jpg', 'jpeg', 'gif'];\r\n $this->upload_dir = 'assets/images/profile/' . $user_dir;\r\n $this->upload_name = 'cover.' . $ext;\r\n\r\n // Upload The New Image\r\n if ($this->upload($image)) {\r\n $cover = $user_dir . $this->upload_name;\r\n }\r\n }\r\n\r\n // Connect To DB\r\n $connection = DB::connect();\r\n\r\n // Update users Table\r\n $stmt = \"UPDATE users SET\r\n name = '$name',\r\n email = '$email',\r\n bio = '$bio',\r\n avatar = '$avatar',\r\n cover = '$cover' WHERE id = '$user_id'\";\r\n\r\n // If The User Profile Wans't Updated SuccessFully\r\n if ($connection->query($stmt) === false) {\r\n echo '<script>alert(\"لا نستطيع تحديث معلوماتك الآن، يمكنك الإتصال بفريق الدعم أو المحاولة لاحقا\")</script>';\r\n return;\r\n }\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n //header('location: ' . $profile_url);\r\n\r\n }\r\n }", "public function saveProfile()\r\n {\r\n $input = Input::all();\r\n $user = User::find(Auth::user()->id);\r\n $user->user_type = User::TYPE_ADMIN;\r\n $user->email = $input['email'];\r\n $user->first_name = $input['first_name'];\r\n $user->middle_name = $input['middle_name'];\r\n $user->last_name = $input['last_name'];\r\n $user->phone_1 = $input['phone_1'];\r\n $user->phone_2 = $input['phone_2'];\r\n\r\n try {\r\n // check if old password matches\r\n if (!empty($input['old_password']) || !empty($input['new_password']) || !empty($input['repeat_password'])) {\r\n $hashCheck = Hash::check($input['old_password'], $user->getAuthPassword());\r\n if (!$hashCheck) {\r\n Session::flash(\r\n 'systemMessages',\r\n ['errors' => [[Lang::get('pages.users.old_password_incorrect')]]]\r\n );\r\n\r\n return Redirect::action('UserController@profile')->withInput();\r\n }\r\n\r\n if ($input['new_password'] !== $input['repeat_password']) {\r\n Session::flash(\r\n 'systemMessages',\r\n ['errors' => [[Lang::get('pages.users.passwords_dont_match')]]]\r\n );\r\n\r\n return Redirect::action('UserController@profile')->withInput();\r\n }\r\n\r\n $user->password = Hash::make($input['new_password']);\r\n }\r\n\r\n $user->save();\r\n\r\n // upload the new avatar if any\r\n $bm = new \\BaseModel();\r\n $filename = $bm->uploadImage('user', $user->id, Input::file('avatar'));\r\n\r\n // update the user record with the new avatar\r\n if (!empty($filename)) {\r\n $user->avatar = $filename;\r\n $user->save();\r\n }\r\n\r\n Session::flash('systemMessages', ['success' => [Lang::get('pages.profile.saved_success')]]);\r\n } catch (\\Exceptions\\ValidateException $e) {\r\n Session::flash('systemMessages', ['errors' => $e->getErrors()]);\r\n }\r\n\r\n return Redirect::back()->withInput();\r\n }", "public function testProfileCreate()\n {\n\n }", "public function testProfilePrototypeUpdateImage()\n {\n\n }", "public function validateUpdateProfile($input){\n $adminData = array();\n\n\n if(!empty($input['firstname'])){\n $adminData = array_merge($adminData,array('firstname' => $this->cleanInput($input['firstname'])));\n }\n\n if(!empty($input['lastname'])){\n $adminData = array_merge($adminData,array('lastname' => $this->cleanInput($input['lastname'])));\n }\n\n \n if(!empty($input['nationality'])){\n $cleanData = $this->cleanInput($input['nationality']); \n require_once '../app/models/countries.php';\n if(in_array($cleanData,Countries::$countries)){\n $adminData = array_merge($adminData,array('nationality' => $cleanData));\n } \n }\n\n if(!empty($input['country'])){ \n $cleanData = $this->cleanInput($input['country']); \n require_once '../app/models/countries.php';\n if(in_array($cleanData,Countries::$countries)){\n $adminData = array_merge($adminData,array('country' => $cleanData));\n }\n }\n\n if(!empty($input['city'])){\n $adminData = array_merge($adminData,array('city' => $this->cleanInput($input['city'])));\n }\n\n if(!empty($input['address'])){\n $adminData = array_merge($adminData,array('address' => $this->cleanInput($input['address'])));\n }\n\n\n return $adminData;\n }", "public function testUpdateCardValidationRules()\n {\n $card = factory('App\\Card')->create();\n\n $response = $this->actingAs($card->owner, 'api')\n ->withHeader('Accept', 'application/json')\n ->put(route('api.cards.update', [$card->id]), []);\n\n $response->assertStatus(422);\n $response->assertJsonValidationErrors(['name']);\n }", "protected function validateUserProfile(Request $request)\n {\n if (kAuth::$validateProfileUpdatesWith) {\n $this->callCustomValidator(\n kAuth::$validateProfileUpdatesWith, $request\n );\n } else {\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'email' => 'required|email|unique:users,email,'.Auth::id(),\n ]);\n }\n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "public function testSellerEditFailed()\n {\n $this->demoUserLoginIn();\n $response = $this->call('GET', '/seller/999/edit');\n $this->assertEquals(404, $response->status());\n }", "public function test_users_update_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "function saveprofile() {\r\n $sesdata = array(\r\n 'is_logged_in' => true,\r\n 'guser' => '[email protected]'\r\n );\r\n $this->session->set_userdata($sesdata);\r\n // remove this block above once complete \r\n $this->load->library('form_validation');\r\n $this->form_validation->set_rules('email', 'Email', 'required|trim|valid_email');\r\n $this->form_validation->set_rules('work_phone', 'Work Phone', 'trim|callback_valid_workphone');\r\n if ($this->form_validation->run()) {\r\n\r\n if ($this->updateUserProfile()) {\r\n redirect('user/savefirm');\r\n } else {\r\n echo 'database Error saving User Profile!';\r\n }\r\n } else {\r\n $this->load->view('templates/header');\r\n $this->load->view('templates/topnav');\r\n $this->load->view('templates/blankleftnav');\r\n $this->load->view('pages/setupprofile');\r\n $this->load->view('templates/footer');\r\n }\r\n }", "public function test_user_update()\n {\n $this->withoutMiddleware(ValidJWTMiddleware::class);\n\n $user = User::first();\n\n $response = $this->json('PUT', \"api/usuario/$user->id\", [\n 'first_name' => $this->faker->firstName(),\n 'last_name' => $this->faker->lastName(),\n 'email' => $this->faker->email(),\n 'telephone' => '+55' . $this->faker->phoneNumberCleared(),\n ]);\n\n $userValidate = User::first();\n\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n\n $this->assertNotEquals($userValidate, $user);\n }", "public function testGetInvalidAdultUsername() : void {\n// grab an email that does not exist\n$profile = Adult::getAdultByAdultUsername($this->getPDO(), \"yourmom\");\n$this->assertNull($profile);\n}", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }" ]
[ "0.7288875", "0.6990703", "0.6946653", "0.6801551", "0.6751499", "0.67002904", "0.66921353", "0.6669946", "0.66324055", "0.6624186", "0.66074485", "0.6446012", "0.6445949", "0.6411381", "0.63535625", "0.6330519", "0.62504953", "0.6244715", "0.6243925", "0.6242274", "0.6236224", "0.62323356", "0.62156105", "0.62153876", "0.6207105", "0.62045825", "0.61986494", "0.61956686", "0.61499155", "0.61067784", "0.60894996", "0.6080195", "0.60722256", "0.60705465", "0.60541785", "0.6052602", "0.6041479", "0.6041198", "0.60161185", "0.60016125", "0.6001388", "0.59793556", "0.59708476", "0.5952541", "0.5942055", "0.59234565", "0.5910483", "0.58944196", "0.5867113", "0.5862048", "0.58592", "0.5849761", "0.584807", "0.5843262", "0.5838105", "0.58222836", "0.582103", "0.5812797", "0.57931256", "0.5787024", "0.5769373", "0.5768486", "0.5764515", "0.57486415", "0.5738891", "0.5738013", "0.57298744", "0.57271945", "0.5715619", "0.57066584", "0.5705019", "0.5690824", "0.56879777", "0.56709564", "0.5663929", "0.5651882", "0.56482", "0.5621804", "0.5617286", "0.5611963", "0.56076545", "0.56048524", "0.56033164", "0.5597811", "0.5597521", "0.55922437", "0.5590702", "0.558964", "0.5580409", "0.5578521", "0.55782396", "0.5573437", "0.5572707", "0.55631936", "0.5550523", "0.55495214", "0.554791", "0.5545239", "0.5541071", "0.5538665" ]
0.7530587
0
Test that a nonlogged user can't update a profile.
public function testUpdateUserProfileErrorForbidden() { // Request $response = $this->call('POST', $this->accountProfilePostUrl, []); // Assert redirect to login $response->assertStatus(302); $response->assertRedirect('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "public function testSaveProfileWrongUser() {\n\t\tCakeSession::write('Auth.User.id', 2);\n\t\t$this->Model->saveProfile(array(\n\t\t\t'User' => array(\n\t\t\t\t'id' => 1\n\t\t\t)\n\t\t));\n\t}", "public function testProfileInvalid()\n {\n $email = new Notification();\n $email->profile('derp');\n }", "public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }", "public function testProfilePrototypeUpdateByIdQuarantines()\n {\n\n }", "public function testGetInvalidProfileByProfileEmail() : void {\n\t\t// get an email that doesn't exist\n\t\t$profile = Profile::getProfileByProfileEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($profile);\n\t}", "public function testGetInvalidProfileByProfileName() : void {\n\t\t// get a profile name that doesn't exist\n\t\t$profile = Profile::getProfileByProfileName($this->getPDO(), \"Invalid Profile Name\");\n\t\t$this->assertCount(0, $profile);\n\t}", "public function test_user_update_no_permission()\n {\n // User login for test\n $user = new User();\n $user->id = 13;\n $this->be($user);\n\n Storage::fake('photos');\n $response =\n $this->json('POST', '/update_user', [\n 'id' => 1,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n $response\n ->assertStatus(200)\n ->assertJson([\n $this->all_message => $this->user_update_no_permission,\n ]);\n }", "public function testGetInvalidProfileByProfileId () : void {\n\t\t// grab a profile id that doesn't exist?\n\t\t$invalidProfileId = generateUuidV4();\n\n\t\t$profile = Profile::getProfileByProfileId($this->getPDO() , \"$invalidProfileId\");\n\t\t$this->assertNull($profile);\n\t}", "protected static function maybe_disable_invalid_profile_notice() {\n\t\tif ( isset( $_GET['wcs_disable_paypal_invalid_profile_id_notice'] ) ) {\n\t\t\tupdate_option( 'wcs_paypal_invalid_profile_id', 'disabled' );\n\t\t}\n\n\t\tif ( isset( $_GET['wcs_ipn_error_notice'] ) ) {\n\t\t\tupdate_option( 'wcs_fatal_error_handling_ipn_ignored', true );\n\t\t}\n\t}", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function test_users_update_admin_leads_403(){\n $this->signInUser();\n $response = $this->patch(route('users.update', ['user' => 1]), $this->user); \n $response->assertStatus(403);\n }", "public function test_update_user_as_unauthorized_admin()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->put(route('api.users.update', [$user2->id]), [\n 'name' => 'My third brand new user',\n ]);\n\n $response->assertStatus(403);\n }", "public function test_users_update_leader_leads_403(){\n $this->signInUser();\n $response = $this->patch(route('users.update', ['user' => 2]), $this->user); \n $response->assertStatus(403);\n }", "public function test_unauthenticated_users_cannot_hit_the_update_endpoint()\n {\n // First we create a test country\n $country = $this->createCountry();\n\n // Then we assert it was successfully added into the database\n $this->assertDatabaseHas('countries', $country->toArray());\n\n // Then we create a update request with no auth headers\n $this->update($country->code, [])\n // Finally we assert status is 401 because unauthenticated users should not be able to hit this endpoint\n ->assertStatus(401);\n }", "public function testCannotEditOtherUser()\n {\n $faker = \\Faker\\Factory::create();\n $user = factory(User::class)->create();\n $user->activate();\n $other = factory(User::class)->create();\n $other->activate();\n $newName = $faker->name;\n Auth::login($other);\n \n $this->put('/api/v1/user/'.$user->id, ['name' => $newName], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertStatus(403);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $user->email\n ]);\n }", "public function testAdminUpdateAccountDoesntExist()\n {\n $this->withSession(['expert' => ['id' => 99, 'type' => 'admin']])\n ->get(route('account.update', ['id' => 9999]))\n ->assertSessionHas('warning')\n ->assertRedirect(route('account.list'));\n }", "public function testUserNotExisted(){\n $array_test = ['email' => '[email protected]', 'pubid' => 4];\n\n $api = new ApiConnection();\n $dataCheck = [\n 'status' => 401,\n 'message' => \"User does not exist\",\n 'data' => []\n ];\n $this->assertEquals($dataCheck, $api->updateAccount($array_test));\n }", "public function test_a_user_cannot_modify_another_users_account_information()\n {\n $userA = factory(User::class)->create();\n $userB = factory(User::class)->create();\n\n // When user A tries to view user B data\n Passport::actingAs($userA);\n $response = $this->json('GET', 'api/v1/users/' . $userB->id);\n\n // Then it is not successful\n $response->assertStatus(ResponseCode::HTTP_UNAUTHORIZED);\n $response->assertSee('Unauthorized Access');\n }", "public function testUpdateValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new profile and update it in mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// edit the profile and update it in mySQL\n\t\t$profile->setProfileContent($this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_NAME);\n\t\t$profile->update($this->getPDO());\n\n\t\t// grab the date from mySQL and enforce the fields match out expectations\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$this->assertEquals($pdoProfile->getProfileId(), $profileId);\n\t\t$this->assertEquals($pdoProfile->getProfileActivationToken(), $this->VALID_ACTIVATION_TOKEN);\n\t\t$this->assertEquals($pdoProfile->getProfileEmail(), $this->VALID_PROFILE_EMAIL);\n\t\t$this->assertEquals($pdoProfile->getProfileHash(), $this->VALID_PROFILE_HASH);\n\t\t$this->assertEquals($pdoProfile->getProfileIsOwner(), $this->VALID_PROFILE_IS_OWNER);\n\t\t$this->assertEquals($pdoProfile->getProfileName(), $this->VALID_PROFILE_NAME);\n\t}", "public function testWrongFieldInstructorProfileUpdate() {\n try {\n\n $nonExistentInstructor = UserManagementController::updateInstructorProfile(\"gggggg\",\"686875\",\"[email protected]\",\n \"gfhgjhk \",\"hjhkhkj\",\"ghgjhgj\",true,$this->institution->getAbbreviation(),\n \"Teacher572\");\n\n $this->fail(\"The exceptional profile update failed for non existing Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"userNotFound\"]);\n }\n\n try {\n\n $wrongProjectNameFieldUpdate = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,\"ABC\"\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed for non existing Project of Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"projectNotFound\"]);\n }\n\n try {\n\n $wrongInstitutionNameFieldUpdate = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,\"ABCD\",self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed for non existing Institution of Instructor\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"institutionNotFound\"]);\n }\n }", "private function failUpdate($puserId)\r\n\t{\r\n\t\t$this->startSession(KalturaSessionType::USER, 'test1');\r\n\t\t\t\t\r\n\t\t$entry = $this->client->baseEntry->get($this->entryId);\r\n\t\t$entry = $this->switchUsers($entry);\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\t$this->client->baseEntry->update($this->entryId, $entry);\r\n\t\t\t$this->fail(\"UpdateShould fail\");\r\n\t\t}\r\n\t\tcatch(Exception $e)\r\n\t\t{\r\n\t\t\t$this->checkException($e, array('INVALID_KS', 'PROPERTY_VALIDATION_ADMIN_PROPERTY'));\r\n\t\t}\r\n\t}", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }", "public function test_users_update_no_email_error(){\n $this->signInUser();\n unset($this->user['email']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); $response->assertSessionHasErrors(['email']);\n }", "public function testVolunteerHourUpdateFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/volunteerEdit/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testGetProfileUserNotExist()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/thor\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n //AppBundle:User object not found. (404 Not Found)\r\n $this->assertTrue($response->code === 404);\r\n\r\n }", "public function testVolunteerHourUpdateFailure_BasicUser()\n {\n // Set test user as current authenticated user\n $this->be($this->basicUser);\n \n $this->session([\n 'username' => $this->basicUser->username, \n 'access_level' => $this->basicUser->access_level\n ]);\n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/volunteerEdit/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testMissingFieldsInstructorProfileUpdate() {\n try {\n $missingNames = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,\"\",\"\",$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed with missing name\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"newFirstName\"]);\n $this->assertNotNull($errorFields[\"newLastName\"]);\n }\n\n try {\n $missingEmailandOthers = UserManagementController::updateInstructorProfile(\"\",\"\" ,\"\"\n ,self::FIRSTNAME,self::LASTNAME,$this->project->getProjectJnName()\n ,self::IS_OWNER,$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional profile update failed with missing\n username, password email\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"username\"]);\n $this->assertNotNull($errorFields[\"newPassword\"]);\n $this->assertNotNull($errorFields[\"newEmail\"]);\n }\n\n try {\n $missingProjectName = UserManagementController::updateInstructorProfile(self::USERNAME,self::PASSWORD ,self::EMAIL\n ,self::FIRSTNAME,self::LASTNAME,\"\"\n ,\"\",$this->institution->getAbbreviation(),self::IDENTIFICATION);\n\n $this->fail(\"The exceptional instructor update failed for\n missing project name, team leader and other fields\");\n } catch (InfinityMetricsException $ime) {\n $errorFields = $ime->getErrorList();\n $this->assertNotNull($errorFields);\n $this->assertNotNull($errorFields[\"newProjectName\"]);\n $this->assertNotNull($errorFields[\"new_isOwner\"]);\n }\n }", "public function testVolunteerHourProjectUpdateFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/edit/project/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testGetInvalidAccessByAccessId() {\n\t\t//grab a user id that exceeds the maximum allowable profile id\n\t\t$access = Access::getAccessByAccessId($this->getPDO(), TimeCrunchersTest::INVALID_KEY);\n\t\t$this->assertNull($access);\n\t}", "public function testGetProfileNotLoggedIn()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $response = \\Httpful\\Request::get($url)->send();\r\n\r\n //ERROR Call to a member function getWellnessProfessional() on string (500 Internal Server Error)\r\n $this->assertEquals(302, $response->code);\r\n\r\n }", "public function testVolunteerHourProjectUpdateFailure_BasicUser()\n {\n // Set test user as current authenticated user\n $this->be($this->basicUser);\n \n $this->session([\n 'username' => $this->basicUser->username, \n 'access_level' => $this->basicUser->access_level\n ]);\n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/edit/project/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function _assertProfileExists($profile_uid)\n {\n }", "public function test_users_edit_leader_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 2]));\n $response->assertStatus(403);\n }", "public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }", "public function testRenderUpdateNoUser()\n {\n $this->withSession($this->adminSession)\n ->call('GET', '/dealer-account/edit', ['ID' => 4]);\n \n $this->assertResponseStatus(404);\n }", "public function testManagerNotAccessSettingsPage()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/setting/');\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}", "public function testTwoFactorCanBeDisabledOnAccount()\n {\n Carbon::setTestNow(Carbon::now());\n\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create(['use_totp' => true]);\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'invalid',\n ]);\n\n $response->assertStatus(Response::HTTP_BAD_REQUEST);\n $response->assertJsonPath('errors.0.code', 'BadRequestHttpException');\n $response->assertJsonPath('errors.0.detail', 'The password provided was not valid.');\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'password',\n ]);\n\n $response->assertStatus(Response::HTTP_NO_CONTENT);\n\n $user = $user->refresh();\n $this->assertFalse($user->use_totp);\n $this->assertNotNull($user->totp_authenticated_at);\n $this->assertSame(Carbon::now()->toIso8601String(), $user->totp_authenticated_at->toIso8601String());\n }", "public function testProfileChange() {\n $this->installProcedure->shouldBeCalledTimes(2);\n $this->updateProcedure->shouldNotBeCalled();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n $this->cachedInstall->setProfile('standard');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "public function test_users_update_authenticated_no_name_error(){\n $this->signInUser();\n unset($this->user['name']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); $response->assertSessionHasErrors(['name']);\n }", "public function testItDoesntUpdateAnInvalidUser()\n {\n $this->actingAs($this->user)\n ->putJson(\"api/v1/users/0\", [\n \"firstname\" => \"melinda\",\n \"lastname\" => \"epifano\",\n ])\n ->assertStatus(422);\n }", "function updateMyProfile($data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE users SET `email`= ? WHERE id= ?\");\r\n $update->execute(array($data['email'], $this->user_id));\r\n\t\t$preparedProfileParam = prepareProfileParams($data);\r\n\t\tupdateProfileParameters($this->user_id,$preparedProfileParam);\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t\treturn true;\r\n\t}", "public function testProfilePrototypeUpdateByIdAccessTokens()\n {\n\n }", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }", "public function testUpdateUnauthenticatedAccess(): void { }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function testVolunteerHourProjectEditFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/edit/project/'.$projectID);\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testForgotPasswordFailNonActive()\n {\n $user = $this->Users->get(1);\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $data = [\n 'email' => $user->get('email'),\n ];\n\n $this->assertEmpty($user->get('activation_key'));\n\n $this->post('/users/forgotPassword', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n\n $user = $this->Users->get(1);\n\n $this->assertEmpty($user->get('activation_key'));\n }", "public function test_users_update_bad_email_error(){\n $this->signInUser();\n $this->user['email'] = 'email';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function testProfileUpdateAll()\n {\n\n }", "public function testVolunteerHourContactEditFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteerEdit/'.$volunteerID);\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "function core_validateUserAccessProfile($intProfileID, $intUserID = 0) {\n\tif ($intUserID == 0) $intUserID = $_SESSION[\"wt\"][\"uid\"];\n\n\tif (check_user_class(\"admin\") || check_user_class(\"helpdesk\")) {\n\t\treturn true;\n\t}\n\telse {\n\t\t$strQuery = \"SELECT UAPD.module AS shouldHave, UA.module AS hasAccess\n\t\t\t\t\t FROM wt_user_access_perfiles_d AS UAPD\n\t\t\t\t\t\t\tLEFT JOIN wt_user_access AS UA\n\t\t\t\t\t\t\tON UA.module = UAPD.module AND\n\t\t\t\t\t\t\t UA.userid = {$intUserID}\n\t\t\t\t\t WHERE UAPD.perfil_id = {$intProfileID} AND\n\t\t\t\t\t\t UA.module IS NULL\n\t\t\t\t\t ORDER BY UAPD.module\";\n\t\t$qTMP = db_query($strQuery);\n\t\t$intNumRows = db_num_rows($qTMP);\n\t\tdb_free_result($qTMP);\n\n\t\treturn ($intNumRows == 0);\n\t}\n}", "public function testNotCorrectAssignuser() \r\n {\r\n // expect_not($model->assignuser());\r\n // expect_that($model->getErrors('id'));\r\n // expect_that($model->getErrors('authorRole'));\r\n \r\n }", "public function test_if_failed_update()\n {\n }", "public function testUpdatePasswordUnableToLoadUserByUid()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $this->setRequestParameter('uid', 'aaaaaa');\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'aaaaaa');\n\n $oView = oxNew('forgotpwd');\n\n try {\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == 'ERROR_MESSAGE_PASSWORD_LINK_EXPIRED';\n }\n\n $this->assertTrue($blExcp);\n }", "public function testWPGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "public function test_users_edit_admin_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 1 ]));\n $response->assertStatus(403);\n }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function testNotLoggedIn()\n {\n $this->sessionInfo['logged_in'] = false;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }", "public function only_logged_in_customer_can_see_profile_edit_form()\n {\n $response = $this->get('/profile/edit')\n ->assertRedirect('/login');\n\n }", "public function testProfile() {\n $profile = <<<PROFILE_TEST\ncore_version_requirement: '*'\nname: The Perfect Profile\ntype: profile\ndescription: 'This profile makes Drupal perfect. You should have no complaints.'\nPROFILE_TEST;\n\n vfsStream::setup('profiles');\n vfsStream::create([\n 'fixtures' => [\n 'invalid_profile.info.txt' => $profile,\n ],\n ]);\n $info = $this->infoParser->parse(vfsStream::url('profiles/fixtures/invalid_profile.info.txt'));\n $this->assertFalse($info['core_incompatible']);\n }", "public function test_users_update_non_unique_email_error(){\n $this->signInUser();\n $this->user['email'] = '[email protected]'; //assume correct test data\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function testUpdateUserProfileErrorValidations()\n {\n // Prepare\n $user = factory(User::class)->create();\n\n $requestData = [\n 'user' => [],\n 'usermeta' => [\n 'twitter' => '@geekytheory',\n 'instagram' => 'geekytheory',\n 'facebook' => 'GeekyTheory',\n 'biography' => 'This text is longer than 255 characters and will not pass the validation. The \n biography cannot have more than 255 characters and this text has more than that\n quantity so the validation will fail showing an error message in the \n biography attribute.',\n ],\n ];\n\n // Request\n $response = $this->actingAs($user)->call('POST', $this->accountProfilePostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountProfilePageUrl);\n $response->assertSessionHasErrors([\n 'name',\n 'username',\n 'email',\n 'twitter',\n 'instagram',\n 'facebook',\n 'biography',\n ]);\n\n // Check that user and user meta haven't been modified\n $this->assertDatabaseHas('users', $user->attributesToArray());\n $this->assertDatabaseMissing('user_meta', ['user_id' => $user->id,]);\n }", "public function testProfileUpsert()\n {\n\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "public function test_users_update_existing_email_no_error(){\n $this->signInUser();\n $user = User::find(5);\n $this->user['email'] = $user->email;\n $response = $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $response->assertSessionHasNoErrors(['email']);\n }", "public function testUserProfile() {\n\t\tif (!$this->_hasTrigger('userProfile')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$expected = $this->_manualCall('userProfile', $this->ViewtEvent);\n\n\t\t$result = $this->Event->trigger($this->ViewObject, $this->plugin . '.userProfile');\n\t\t$this->assertEquals($expected, $result);\n\t}", "function wrm_profile_update($profile_id, $wrmpass, $email)\n{\n\tglobal $db_raid, $phpraid_config;\n\n\tif ($wrmpass != '')\n\t{\n\t\t$sql = sprintf(\"UPDATE \" . $phpraid_config['db_prefix'] . \"profile \n\t\t\t\t\t\tSET email = %s, password = %s, last_login_time = %s WHERE profile_id = %s\",\n\t\t\t\t\t\tquote_smart($email),quote_smart($wrmpass),quote_smart(time()),\n\t\t\t\t\t\tquote_smart($profile_id)\n\t\t\t\t\t\t);\n\t}\n\telse\n\t{\n\t\t$sql = sprintf(\"UPDATE \" . $phpraid_config['db_prefix'] . \"profile \n\t\t\t\t\t\tSET email = %s, last_login_time = %s WHERE profile_id = %s\",\n\t\t\t\t\t\tquote_smart($email),quote_smart(time()),\n\t\t\t\t\t\tquote_smart($profile_id)\n\t\t\t\t\t\t);\n\t}\n\t$db_raid->sql_query($sql) or print_error($sql, $db_raid->sql_error(), 1);\n\t\n\treturn 1;\n}", "public function testUserEditNoUsername()\n {\n $this->browse(function (Browser $browser) {\n // locate the new user created in previous test\n for ($i = 1; $i <= 10; $i++) {\n self::$locator = 'table tr:nth-child(' . $i . ')';\n if (self::$username == $browser->text(self::$locator . ' td:nth-child(1)')) {\n break;\n }\n }\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', ' ')\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The username field is required.')\n ->assertSee('The username field is required.');\n });\n }", "public function test_user_update_invalid_email()\n {\n Storage::fake('photos');\n $response = $this->json('POST', '/update_user', [\n 'id' => $this->admin_user_id,\n 'full_name' => $this->fullname,\n 'email' => 'mayeennbd',\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_update_invalid_email,\n ]);\n }", "public function testNotLoggedIn()\n {\n $user = new User($this->getDb());\n $user->setNick(\"TestNickname\");\n $user->setPassword(\"TestPassword\");\n $user->create();\n\n // create a rank\n $this->createTestRank(\"Test Name\");\n\n $deleteApi = new Delete($this->getDb());\n $answer = $deleteApi->post(1);\n\n $this->assertEquals(['error' => 'NotLoggedIn'], $answer);\n\n // try to load the rank\n $rank = new Rank($this->getDb(), 1);\n $this->assertEquals(\"Test Name\", $rank->getTitle());\n }", "public function testEmailUpdateUserNotFound(): void {\n\t\t$user = $this->createUser();\n\t\t$email = '[email protected]';\n\t\t$newEmail = '[email protected]';\n\t\tPassport::actingAs($user);\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->postJson($this->route.'/email/update', [\n\t\t\t'email' => $email,\n\t\t\t'email_update' => $newEmail]);\n\t\t$response->assertStatus(HttpStatus::STATUS_BAD_REQUEST);\n\t\t$response->assertJson([\n\t\t\t'error' => 'We cannot find a user with that e-mail address.'\n\t\t]);\n\t\t$this->assertDatabaseMissing('users', [\n\t\t\t'email' => $email\n\t\t]);\n\t\t$this->assertDatabaseMissing('email_verification',[\n\t\t\t'user_id' => $user->id,\n\t\t\t'email_update' => $user->email\n\t\t]);\n\t}", "public function test_edit_existing_wall_when_not_owner_or_admin() {\n global $CFG;\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $this->_walls[2]->id . '/edit/5');\n $url = $CFG->wwwroot . SLUG . $this->_app['url_generator']->generate('wall', array(\n 'id' => 5,\n ));\n $this->assertTrue($client->getResponse()->isRedirect($url));\n }", "public function testProfileUnilogin()\n {\n\n }", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "function editProfile($staff){\n return false;\n }", "public function testVolunteerHourProjectEditFailure_BasicUser()\n {\n // Set test user as current authenticated user\n $this->be($this->basicUser);\n \n $this->session([\n 'username' => $this->basicUser->username, \n 'access_level' => $this->basicUser->access_level\n ]);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/edit/project/'.$projectID);\n \n $this->assertRedirectedToRoute('unauthorized');\n\n }", "public function testVolunteerHourContactEditFailure_BasicUser()\n {\n // Set test user as current authenticated user\n $this->be($this->basicUser);\n \n $this->session([\n 'username' => $this->basicUser->username, \n 'access_level' => $this->basicUser->access_level\n ]);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteerEdit/'.$volunteerID);\n \n $this->assertRedirectedToRoute('unauthorized');\n\n }", "public function test_edit_non_existent_talkpoint() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id . '/edit/999');\n }", "public function testNoErrorIsReturnedIfTwoFactorIsNotEnabled()\n {\n Carbon::setTestNow(Carbon::now());\n\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create(['use_totp' => false]);\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'password',\n ]);\n\n $response->assertStatus(Response::HTTP_NO_CONTENT);\n }", "function validateRemoteProfile()\n {\n if ($this->oprofile->isGroup()) {\n $target = common_local_url('ostatusgroup', array(), array('profile' => $this->profile_uri));\n common_redirect($target, 303);\n } else if ($this->oprofile->isPeopletag()) {\n $target = common_local_url('ostatuspeopletag', array(), array('profile' => $this->profile_uri));\n common_redirect($target, 303);\n }\n }", "public function should_return_not_found_if_user_not_in_database()\n {\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secret123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::NOT_FOUND);\n $this->seeJsonContains(['message' => 'The user with id: 1, was not found']);\n }", "public function test_that_unauthroized_user_cannot_view_courses()\n {\n\n }", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "public function testUserEditNonUniqueUsername()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', 'testuser1')\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The username has already been taken.')\n ->assertSee('The username has already been taken.');\n });\n }", "public function testHardeningInactive(): void\n {\n $this->assertArrayHasKey(\n 'pingback.ping',\n \\apply_filters('xmlrpc_methods', ['pingback.ping' => 'this:pingback_ping', ])\n );\n\n $this->assertTrue(\\apply_filters('xmlrpc_enabled', true));\n\n // Authentication with both email and login should pass.\n $this->assertInstanceOf(\\WP_User::class, \\wp_authenticate(self::DUMMY_USER_EMAIL, Constants::FACTORY_PASSWORD));\n $this->assertInstanceOf(\\WP_User::class, \\wp_authenticate(self::DUMMY_USER_LOGIN, Constants::FACTORY_PASSWORD));\n }", "public function checkForProfile()\n\t\t{\n\t\t\treturn (!Auth::user()->profiles) ? false : true;\n\t\t}", "public function test_it_doesnt_update_a_user_if_validation_fails()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]'];\n\n $response = $this->call('PUT', sprintf('/users/%d', $user->id), $update);\n\n $this->assertEquals(422, $response->status());\n $this->assertJsonStringEqualsJsonString(json_encode([\n 'given_name' => ['The given name field is required.'],\n 'family_name' => ['The family name field is required.']\n ]), $response->getContent());\n }", "function testGetUserBySession() {\n $this->assertFalse(Sessions::getUserBySession());\n }", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testDeleteValidProfile() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"profile\");\n\n\t\t// create a new Profile and insert into mySQL\n\t\t$profileId = generateUuidV4();\n\n\t\t$profile = new Profile($profileId, $this->VALID_ACTIVATION_TOKEN, $this->VALID_PROFILE_EMAIL, $this->VALID_PROFILE_HASH, $this->VALID_PROFILE_IS_OWNER, $this->VALID_PROFILE_NAME);\n\t\t$profile->insert($this->getPDO());\n\n\t\t// delete the Profile from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"profile\"));\n\t\t$profile->delete($this->getPDO());\n\n\t\t// grab the data from mySQL and make sure the Profile does not exist\n\t\t$pdoProfile = Profile::getProfileByProfileId($this->getPDO(), $profile->getProfileId());\n\t\t$this->assertNull($pdoProfile);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"profile\"));\n\t}", "function check_suspension($user_id) {\n\t\t$user = get_user_by('ID', $user_id);\n\t\tupdate_user_meta($user_id, 'suspended', $_POST['suspend']);\n\t}", "public function testWrongUser(){\n Session::flush();\n $user = $this->postuser(array('username'=>'XxX','password'=>'XxX'));\n $status_message = $this->getJsonResponse();\n $this->assertResponseStatus('401');\n $this->assertTrue($status_message['message'] == 'login refused');\n }", "public function should_return_unprocessable_entity_if_new_password_not_confirmed()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'new_password' => ['The new password confirmation does not match.']\n ]);\n }" ]
[ "0.7777229", "0.7260776", "0.70233315", "0.69894785", "0.6918899", "0.6726046", "0.67123973", "0.6670188", "0.66519797", "0.656386", "0.6521925", "0.6516324", "0.6498633", "0.6493491", "0.6485312", "0.6462092", "0.64052385", "0.63738525", "0.63450766", "0.63059175", "0.62950116", "0.6282673", "0.62813115", "0.6256311", "0.61879313", "0.6185176", "0.6174039", "0.6135655", "0.60918283", "0.60825026", "0.60718125", "0.6069505", "0.60559374", "0.60366726", "0.6028257", "0.6021633", "0.6012629", "0.59786314", "0.5970397", "0.5952526", "0.59499115", "0.5920044", "0.5916206", "0.59112066", "0.58795565", "0.5873868", "0.587214", "0.5866266", "0.5861961", "0.5856163", "0.5853264", "0.58470017", "0.58406043", "0.5839545", "0.58320177", "0.5830977", "0.58258384", "0.5823346", "0.58137757", "0.5812769", "0.5801137", "0.57995784", "0.57982934", "0.579826", "0.578767", "0.57847905", "0.57604945", "0.5756073", "0.5748184", "0.5747304", "0.5744851", "0.57303566", "0.5724179", "0.5708215", "0.5705671", "0.5697026", "0.56928164", "0.5685503", "0.56796086", "0.5678559", "0.5678241", "0.5671835", "0.56708515", "0.56651527", "0.56648254", "0.5663253", "0.56630045", "0.56580853", "0.5653922", "0.56485224", "0.5647925", "0.56402695", "0.5629622", "0.5626643", "0.56237644", "0.5615356", "0.5613179", "0.56097627", "0.56062514", "0.55904055" ]
0.7421343
1
Test logged user can visit the account page to change the password.
public function testLoggedUserVisitsChangePasswordPageOk() { // Prepare $user = factory(User::class)->create(); // Request $response = $this->actingAs($user)->call('GET', $this->accountChangePasswordPageUrl); // Asserts $response->assertStatus(200); $response->assertViewIs('account.profile.changePassword'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function testNonLoggedUserVisitsChangePasswordPageRedirectsToLogin()\n {\n // Request\n $response = $this->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "protected function changePassword() {}", "public function testNonLoggedUserUpdatePasswordRedirectsToLogin()\n {\n $response = $this->call('POST', $this->accountChangePasswordPostUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function testTryToAccessForgotPasswordPageAsLoggedInUser() {\n\t\t$user = factory(User::class)->create();\n\n\t\t$response = $this\n\t\t\t->actingAs($user)\n\t\t\t->get('/password/reset');\n\n\t\t$response->assertStatus(302);\n\t}", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "function testPasswordGet()\n {\n $this->assertEqual($this->referenceHash, auth::getPassword(1), \"Testing password retrieval.\");\n }", "function can_change_password() {\n return false;\n }", "function can_change_password() {\n\t\treturn false;\n\t}", "public function testChangeMemberPassword()\n {\n }", "public function testRegularUserChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(false);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo', 'currentPassword' => 'blue']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n $changePasswordModel->setCurrentPassword('blue');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayHasKey('currentPassword',$view->children);\n }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function can_change_password() {\n return false;\n }", "public function testAdminChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(true);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayNotHasKey('current_password',$view->children);\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function testUpdatePasswordOk()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => $currentPassword,\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHas('success', trans('home.password_changed'));\n }", "function testActivatePasswordSuccess() {\r\n $this->User = new User();\r\n \t\r\n\t\t$expected = $this->User->field('password', array('id'=>'1'));\t\r\n \t\r\n \t// should return the new password\r\n $password = $this->User->activatePassword('1bc29b36f623ba82aaf6724fd3b16718');\r\n $this->assertTrue($password);\r\n \r\n //checkk if the password has changed\r\n\t\t$result = $this->User->field('password', array('id'=>'1'));\t\r\n \t$this->assertNotEqual($result, $expected);\r\n \t\r\n \t//check if the returned password is the same as in the database\r\n \t$this->assertEqual(md5($password), $result);\r\n \t\r\n \t\r\n \t\r\n \t//test done set data to the original values\r\n \t$this->User->id=1;\r\n \t$this->User->saveField('password', $expected);\r\n \t$this->User->saveField('password_key', '1bc29b36f623ba82aaf6724fd3b16718');\r\n }", "public function post_changePassword() {\n //try to change the password\n $status = AuxUser::changePassword();\n if ($status[0]) {\n //if the password change process worked, redirect to the profile page\n echo '<script>alert(\"Password Changed\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"'.$status[1].'\");</script>';\n Response::redirect('/profile');\n }\n }", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "public function testGetResetPasswordPage()\n\t{\n\t\t$meta = \\Orchestra\\Memory::make('user');\n\t\t$hash = \\Str::random(32);\n\t\t$meta->put('reset_password_hash.1', $hash);\n\n\t\t$this->call('orchestra::forgot@reset', array(1, $hash));\n\t\t$this->assertRedirectedTo(handles('orchestra::login'));\n\n\t\t$user = \\Orchestra\\Model\\User::find(1);\n\t\t$this->assertFalse(\\Hash::check('123456', $user->password));\n\t}", "public function changeUserPassword($uid,$newPassword);", "public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testResetPasswordLoggedIn()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/resetPassword/[email protected]/');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect();\n }", "public function testCorrectCredentialsLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'password' );\n $browser->click( '.button.is-primary' );\n $browser->waitFor( 'header' );\n $browser->assertSee( 'Dashboard' );\n });\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function testGetForgotPageWithAuth()\n\t{\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::forgot@index');\n\t\t$this->assertRedirectedTo(handles('orchestra'));\n\t}", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function testLoginCorrect()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login')\n ->assertSee('Password')\n ->type('username', 'peinfant')\n ->type('password', 'pablo1')\n ->press('Login')\n ->assertPathIs('/admin/index')\n ->assertSee('Welcome')\n ->clickLink('Logout');\n\n $browser->assertSee('Login')\n ->assertSee('Password');\n });\n }", "public function setPassword($newPassword);", "function can_change_password() {\n return !empty($this->config->changepasswordurl);\n }", "public function DoChangePassword($form)\n\t{\n\t\tif ($form->GetValue('Pw') == $form->GetValue('Pw2'))\n\t\t{\n\t\t\t$this->user->ChangePassword($form->GetValue('OldPw'), $form->GetValue('Pw'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->AddMessage('info', 'Password didn\\'t match.');\n\t\t}\n\t\t\n\t\t$this->RedirectToController('profile');\n\t}", "public function testResetPasswordPass()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $this->assertEquals(0, $user->active);\n\n $data = [\n 'new_password' => 'test',\n 'confirm_password' => 'test',\n ];\n\n $this->post('/users/resetPassword/' . $user->email . '/' . $user->activation_key . '/', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testGetAccountPasswordForgotOut()\n {\n // Get forgot pass page\n $result = $this->visit('account/password/forgot')\n ->see('RESET YOUR PASSWORD')\n ->seePageIs('/account/password/forgot');\n }", "public function change_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['old_pass'])) {\n if($_POST['new_pass']==$_POST['new_pass_verify']){\n $this->User->setPassword($User->getId(), $_POST['new_pass']);\n session_write_close();\n header(\"Location: \".app::site_url(''));\n exit(0);\n } else {\n $flash = \"I'm sorry, but the new passwords did not match.\";\n }\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array('flash' => $flash);\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function isPasswordChangeEnabled();", "public function changePassword(User $user, string $newPassword): void;", "public function testLoginActionPass()\n {\n // creating a new user\n $user = $this->Users->newEntity([\n 'email' => '[email protected]',\n 'password' => 'test',\n ]);\n\n $user->set('role_id', 1);\n $user->set('active', 1);\n\n $this->Users->save($user);\n\n $login = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $this->post('/users/login', $login);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/admin/manager/users');\n\n $this->assertSession(5, 'Auth.User.id');\n $this->assertSession('[email protected]', 'Auth.User.email');\n }", "function changePassword( $name, $pw ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as &$user) {\n if ($name == $user['name'] || $name == $user['email']) {\n $user[\"password\"] = $pw;\n saveDB( $d );\n $found = true;\n break;\n }\n }\n if (!$found)\n return FALSE;\n audit( \"changePassword done\", $name );\n return TRUE;\n }", "function user_changed_password($user_id, $new_password) {\n \n }", "public function changePasswordAction()\n {\n $user = $this->get('security.context')->getToken()->getUser();\n if (!is_object($user) || !$user instanceof UserInterface) {\n $this->createAccessDeniedException('This user does not have access to this section.');\n }\n\n $this->page = $this->getDoctrine()->getRepository('PageBundle:Page')->findOneByAlias($this::PASSWORD_CHANGE_PAGE_ALIAS);\n\n if (!$this->page) {\n return $this->get('bardiscms_page.services.show_error_page')->errorPageAction(Page::ERROR_404);\n }\n\n // Simple publishing ACL based on publish state and user Allowed Publish States\n $accessAllowedForUserRole = $this->get('bardiscms_page.services.helpers')->isUserAccessAllowedByRole(\n $this->page->getPublishState(),\n $this->publishStates\n );\n\n if (!$accessAllowedForUserRole) {\n return $this->get('bardiscms_page.services.show_error_page')->errorPageAction(Page::ERROR_401);\n }\n\n $this->page = $this->get('bardiscms_settings.set_page_settings')->setPageSettings($this->page);\n\n $form = $this->get('fos_user.change_password.form');\n $formHandler = $this->get('fos_user.change_password.form.handler');\n\n $process = $formHandler->process($user);\n if ($process) {\n $this->setFlash('fos_user_success', 'change_password.flash.success');\n\n return $this->redirect($this->getRedirectionUrl($user));\n }\n\n $pageData = array(\n 'page' => $this->page,\n 'mobile' => $this->serveMobile,\n 'logged_username' => $this->userName,\n 'form' => $form->createView(),\n );\n\n // Render Password change page\n $response = $this->render('SonataUserBundle:ChangePassword:changePassword.html.twig', $pageData);\n\n return $response;\n }", "public function account_change_password()\n\t{\n\t\t$data = array('password' => $this->input->post('new_password'));\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "public function testTryToAccessForgotPasswordPageAsGuest() {\n\t\t$response = $this->get('/password/reset');\n\n\t\t$response->assertStatus(200);\n\t}", "function userCanSetDbPassword(){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function allowPasswordChange()\n\t{\n\t\tglobal $ilUser, $ilSetting;\n\t\t\n\t\t\n\t\treturn ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));\n\t\t\n\t\t// Moved to ilAuthUtils\n\t\t\n\t\t// do nothing if auth mode is not local database\n\t\tif ($ilUser->getAuthMode(true) != AUTH_LOCAL &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get(\"cas_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get(\"shib_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get(\"soap_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_OPENID)\n\t\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->userSettingVisible('password') ||\n\t\t\t$this->ilias->getSetting('usr_settings_disable_password'))\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\n\t\treturn true;\n\t}", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "public function testRegistrationPasswordNotMatch()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234qw')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public function change_password()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->change_password($this->mUser->id, $this->input->post('new_password'));\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully changed password.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to changed password.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function changePassword() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'change_password';\n\t\t$data['pageName'] = 'Change Password';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\tif($data['common_data']['user_data']['account_type'] == FACEBOOK_ACCOUNT_TYPE){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t//Getting all payment details\n\t\t$data['payment_details'] = $this->payment_model->getPaymentDetailsById($data['common_data']['user_id']);\n\t\t$data['tutor_badges'] = $this->user_model->getTutorBadges($data['common_data']['user_id']);\n\t\t$data['badges'] = $this->user_model->getBadges();\n\n\t\t$template['body_content'] = $this->load->view('frontend/profile/change-password', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "public function change()\n {\n // Page de changement de mdp\n define(\"TITLE_HEAD\", \"Volunteers | Change password\");\n $this->load->view('user/change_password.php');\n }", "public function testLoginSubmissionRightEmailAndWrongPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "function testCanViewAccountPage() {\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('p.message', array(\n\t\t\t\"You'll need to login before you can access the account page. If you are not registered, you won't be able to access it until you make your first order, otherwise please enter your details below.\", ));\n\n\t\t/* But if we're logged on you can see */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t$this->get('account/');\n\t\t$this->assertPartialMatchBySelector('#PastOrders h3', array('Your Order History'));\n\t}", "public function passwordPage() {\n return view('admin.account.change_password');\n }", "public function changePassword()\n {\n $user = Auth::user();\n return view('member.change_password');\n }", "public function testLoginSubmissionRightEmailAndRightPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'secret')\n ->press('Sign in')\n ->assertPathIs('/devices');\n });\n }", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }", "public function testUpdatePasswordValidationError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = '123';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => '123456789',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function modifpassword($user,$passwd){\n \n }", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function action_password() {\n\tif (Session::get(\"username\", null) != null) {\n\t $this->template->title = \"Already authenticated!\";\n\t $this->template->content = 'You have already loggend in! You are ' .\n\t\t Session::get(\"username\") . ' your role is ' .\n\t\t Session::get(\"role\");\n\t return;\n\t}\n\n\tif (Input::post(\"username\", null) == null) {\n\t //there was no user input\n\t $this->template->title = \"Please, authenticate\";\n\t $this->template->content = View::forge(\"account/password\");\n\t} else {\n\t //user is trying to authenticate\n\n\t $user = Model_Orm_Passworduser::password_login(Input::post(\"username\"), Input::post(\"password\"));\n\n\t if ($user == null) {\n\t\tSession::set_flash(\"error\", \"User name or password incorrect\");\n\t\t//and returning the same login form\n\t\t$this->template->title = \"Please, authenticate\";\n\t\t$this->template->content = View::forge(\"account/password\");\n\t } else {\n\t\t//tried to authenticate and succeeded\n\t\t$this->template->title = 'Authentication successful';\n\t\t$this->template->content = 'Authentication was successful, you are ' .\n\t\t\t$user->user_name . ' your role is ' .\n\t\t\t$user->user_role;\n\t\tSession::set(\"username\", $user->user_name);\n\t\tSession::set(\"role\", $user->user_role);\n\t }\n\t}\n }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function testApplicationLogin()\n {\n $this->visit('/login')\n ->type($this->user->email, 'email')\n ->type('password', 'password')\n ->press('submit')\n ->seeIsAuthenticatedAs($this->user)\n ->seePageIs('/admin/post');\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function ask_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser');\n $cmd->expectsQuestion('Password', 'testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "public function changePasswordAction()\n {\n $form = new Form\\Password();\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $userModel = new Model\\Users();\n $identity = $this->_auth ->getIdentity();\n $userId = $identity->getId();\n $user = $userModel->getUser($userId);\n $result = $userModel->savePassword($user, $form->getValue('new_password'), $form->getValue('password'));\n\n if ($result) {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was changed.'); \n } else {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was NOT changed.');\n }\n $this->_redirect($this->getRequest()->getRequestUri());\n }\n $this->view->passwordForm = $form;\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "public function changePassword(PasswordChangeForm $form, User $user);", "public function password_change()\n\t{\n\t\t$data['title'] = \"Change Password\";\n\t\t$this->load->view('admin/user/_header');\n\t\t$this->load->view('admin/user/_left_sideber');\n\t\t$this->load->view('admin/user/view_change_password');\n\t\t$this->load->view('admin/user/_footer');\n\t\t\t\n\t}", "public function testGetAccountPasswordForgotIn($auth)\n {\n // Get forgot pass page\n $result = $this->actingAs($auth)\n ->visit('account/password/forgot')\n ->see('Search Events Near You')\n ->seePageIs('/');\n }", "public function testValidPassword()\n {\n $client = static::createClient();\n $crawler = $client->request('GET', '/register');\n $form = $crawler->selectButton('Envoyer')->form();\n\n $form['user[nickName]'] = 'JoJo';\n $form['user[email]'] = '[email protected]';\n $form['user[plainPassword][first]'] = 'JoJo1234';\n $form['user[plainPassword][second]'] = 'JoJo1234';\n\n $crawler = $client->submit($form);\n\n $this->assertTrue(\n $client->getResponse()->isRedirect('/login')\n );\n }", "public function setPassword($newPassword){\n\t}", "public function changePassword($username, $password);", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "function user_changed_password($user_id, $new_password)\n\t{\n\t}", "public function testLoginWithAdminRedirect()\n {\n $this->visit('/admin')\n ->seePageIs('/auth/login')\n ->see('Login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n\n }", "public static function edit_account() {\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\t\t$enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );\n\t\t$minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );\n\n\t\tif ( 'yes' === $enable_strong_password || '1' === $enable_strong_password ) {\n\t\t\twp_enqueue_script( 'ur-password-strength-meter' );\n\t\t}\n\n\t\tur_get_template(\n\t\t\t'myaccount/form-edit-password.php',\n\t\t\tarray(\n\t\t\t\t'user' => get_user_by( 'id', get_current_user_id() ),\n\t\t\t\t'enable_strong_password' => $enable_strong_password,\n\t\t\t\t'minimum_password_strength' => $minimum_password_strength,\n\t\t\t)\n\t\t);\n\t}", "public function checkPassword($value);", "function changePassword()\n {\n $this->view->load('frontend/user/changePassword');\n }", "function changePassword($userID, $password, $newPassword) {\n global $log, $mysqli;\n\n $currentUserID = $_SESSION['user_id'];\n $query = \"SELECT admin, pswd FROM users WHERE id='$currentUserID'\";\n $results = $mysqli->query($query);\n\n // Check that there is exactly one matching user\n if ($results && $results->num_rows === 1) {\n $currentUser = $results->fetch_assoc();\n\n if (!password_verify($password, $currentUser['pswd'])) {\n return 'Incorrect user password.';\n }\n\n if ($currentUserID === $userID || $currentUser['admin']) {\n updatePassword($userID, $newPassword);\n return true;\n }\n\n return 'Unauthorized.';\n }\n\n return 'Incorrect username.';\n}", "public function setPassword(){\n\t}", "public function testLogin()\n {\n $unUsuario =User::findOrFail(1);\n $this->browse(function ($browser) use ($unUsuario) {\n $browser->visit('/')\n ->type('identity', $unUsuario->name)\n ->type('password', 'secret')\n ->press('Accedeix')\n ->assertTrue(true);\n });\n }" ]
[ "0.78235793", "0.7722775", "0.75935626", "0.7270856", "0.7265933", "0.71615094", "0.71007156", "0.70509136", "0.6986568", "0.694256", "0.69261557", "0.689512", "0.6885558", "0.6871294", "0.6844385", "0.68216217", "0.6814565", "0.681415", "0.6812753", "0.6812753", "0.68124205", "0.67646444", "0.6763005", "0.67531455", "0.67525285", "0.67515475", "0.67511666", "0.6746161", "0.6744161", "0.67413116", "0.67299765", "0.67118293", "0.6697061", "0.66861653", "0.66635555", "0.6658023", "0.6637962", "0.661348", "0.661265", "0.66042215", "0.6566732", "0.6566628", "0.65598255", "0.6556286", "0.6554997", "0.6554676", "0.6545177", "0.65439", "0.6543583", "0.6536814", "0.65290225", "0.6528515", "0.6527332", "0.6517872", "0.65160215", "0.65123475", "0.6509144", "0.65072066", "0.65060025", "0.64987826", "0.6491009", "0.648495", "0.64809084", "0.6478593", "0.64580095", "0.6453738", "0.64512044", "0.6446314", "0.64440054", "0.643973", "0.6435698", "0.6430043", "0.64236975", "0.6420971", "0.64153975", "0.6413469", "0.6402195", "0.6400047", "0.63998324", "0.6380536", "0.6379411", "0.63772315", "0.63738346", "0.6364528", "0.6363483", "0.63617206", "0.6357618", "0.63546294", "0.63391787", "0.63238204", "0.63167465", "0.63153696", "0.63078165", "0.630438", "0.6302487", "0.63006794", "0.629541", "0.6292999", "0.6286489", "0.6280255" ]
0.8191769
0
Test non logged user visits change password page and is redirected to login.
public function testNonLoggedUserVisitsChangePasswordPageRedirectsToLogin() { // Request $response = $this->call('GET', $this->accountChangePasswordPageUrl); // Asserts $response->assertStatus(302); $response->assertRedirect('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNonLoggedUserUpdatePasswordRedirectsToLogin()\n {\n $response = $this->call('POST', $this->accountChangePasswordPostUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testLoggedUserVisitsChangePasswordPageOk()\n {\n // Prepare\n $user = factory(User::class)->create();\n\n // Request\n $response = $this->actingAs($user)->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(200);\n $response->assertViewIs('account.profile.changePassword');\n }", "public function testTryToAccessForgotPasswordPageAsLoggedInUser() {\n\t\t$user = factory(User::class)->create();\n\n\t\t$response = $this\n\t\t\t->actingAs($user)\n\t\t\t->get('/password/reset');\n\n\t\t$response->assertStatus(302);\n\t}", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testLoginWithAdminRedirect()\n {\n $this->visit('/admin')\n ->seePageIs('/auth/login')\n ->see('Login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n\n }", "public function change_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['old_pass'])) {\n if($_POST['new_pass']==$_POST['new_pass_verify']){\n $this->User->setPassword($User->getId(), $_POST['new_pass']);\n session_write_close();\n header(\"Location: \".app::site_url(''));\n exit(0);\n } else {\n $flash = \"I'm sorry, but the new passwords did not match.\";\n }\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array('flash' => $flash);\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function testLoginActionPass()\n {\n // creating a new user\n $user = $this->Users->newEntity([\n 'email' => '[email protected]',\n 'password' => 'test',\n ]);\n\n $user->set('role_id', 1);\n $user->set('active', 1);\n\n $this->Users->save($user);\n\n $login = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $this->post('/users/login', $login);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/admin/manager/users');\n\n $this->assertSession(5, 'Auth.User.id');\n $this->assertSession('[email protected]', 'Auth.User.email');\n }", "public function testResetPasswordLoggedIn()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/resetPassword/[email protected]/');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect();\n }", "protected function changePassword() {}", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function testRedirectToLogin()\n {\n $this->visit('/')\n ->see('Email');\n }", "public function post_changePassword() {\n //try to change the password\n $status = AuxUser::changePassword();\n if ($status[0]) {\n //if the password change process worked, redirect to the profile page\n echo '<script>alert(\"Password Changed\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"'.$status[1].'\");</script>';\n Response::redirect('/profile');\n }\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginCorrect()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login')\n ->assertSee('Password')\n ->type('username', 'peinfant')\n ->type('password', 'pablo1')\n ->press('Login')\n ->assertPathIs('/admin/index')\n ->assertSee('Welcome')\n ->clickLink('Logout');\n\n $browser->assertSee('Login')\n ->assertSee('Password');\n });\n }", "public function testApplicationLogin()\n {\n $this->visit('/login')\n ->type($this->user->email, 'email')\n ->type('password', 'password')\n ->press('submit')\n ->seeIsAuthenticatedAs($this->user)\n ->seePageIs('/admin/post');\n }", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public function testGetForgotPageWithAuth()\n\t{\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::forgot@index');\n\t\t$this->assertRedirectedTo(handles('orchestra'));\n\t}", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "public function testLoginRedirect()\n {\n $this->session([\n 'Auth' => [\n 'User' => [\n 'id' => 5,\n 'role_id' => 1,\n 'email' => '[email protected]'\n ]\n ]\n ]);\n\n $this->get('/login');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/admin/manager/users');\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "public function testRedirect()\n {\n //$member = $this->objFromFixture(Member::class, \"joebloggs\");\n //$this->logInAs($member);\n $this->markTestIncomplete('Test user config CMS fields');\n }", "public function testLoginButLogin(){\n $user = User::find(1);\n $this->be($user);\n\n $response =$this->get(route('login'));\n $response->assertRedirect(route('home'));\n }", "public function testVisitUserAccountProfilePageRedirectsToLogin()\n {\n $response = $this->call('GET', $this->accountProfilePageUrl);\n $response->assertRedirect('login');\n }", "function can_change_password() {\n return false;\n }", "public function testViewLogin() {\n $this->visit('http://londonce.lan/login')\n ->see('Login');\n }", "public function testCorrectCredentialsLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'password' );\n $browser->click( '.button.is-primary' );\n $browser->waitFor( 'header' );\n $browser->assertSee( 'Dashboard' );\n });\n }", "public function action_password() {\n\tif (Session::get(\"username\", null) != null) {\n\t $this->template->title = \"Already authenticated!\";\n\t $this->template->content = 'You have already loggend in! You are ' .\n\t\t Session::get(\"username\") . ' your role is ' .\n\t\t Session::get(\"role\");\n\t return;\n\t}\n\n\tif (Input::post(\"username\", null) == null) {\n\t //there was no user input\n\t $this->template->title = \"Please, authenticate\";\n\t $this->template->content = View::forge(\"account/password\");\n\t} else {\n\t //user is trying to authenticate\n\n\t $user = Model_Orm_Passworduser::password_login(Input::post(\"username\"), Input::post(\"password\"));\n\n\t if ($user == null) {\n\t\tSession::set_flash(\"error\", \"User name or password incorrect\");\n\t\t//and returning the same login form\n\t\t$this->template->title = \"Please, authenticate\";\n\t\t$this->template->content = View::forge(\"account/password\");\n\t } else {\n\t\t//tried to authenticate and succeeded\n\t\t$this->template->title = 'Authentication successful';\n\t\t$this->template->content = 'Authentication was successful, you are ' .\n\t\t\t$user->user_name . ' your role is ' .\n\t\t\t$user->user_role;\n\t\tSession::set(\"username\", $user->user_name);\n\t\tSession::set(\"role\", $user->user_role);\n\t }\n\t}\n }", "function can_change_password() {\n\t\treturn false;\n\t}", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "public function testLoginSubmissionRightEmailAndWrongPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function testGetResetPasswordPage()\n\t{\n\t\t$meta = \\Orchestra\\Memory::make('user');\n\t\t$hash = \\Str::random(32);\n\t\t$meta->put('reset_password_hash.1', $hash);\n\n\t\t$this->call('orchestra::forgot@reset', array(1, $hash));\n\t\t$this->assertRedirectedTo(handles('orchestra::login'));\n\n\t\t$user = \\Orchestra\\Model\\User::find(1);\n\t\t$this->assertFalse(\\Hash::check('123456', $user->password));\n\t}", "public function testLoginActionWithBadPassword()\n {\n $data = [\n '_username' => 'user1',\n '_password' => 'badpassword',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('The presented password is invalid.', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "public function testTryToAccessForgotPasswordPageAsGuest() {\n\t\t$response = $this->get('/password/reset');\n\n\t\t$response->assertStatus(200);\n\t}", "public function can_change_password() {\n return false;\n }", "public function testLoginSubmissionWrongEmailAndPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "function user_changed_password($user_id, $new_password) {\n \n }", "public function test_login2()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('123456','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function postChangepassword() {\n if ($this->_adminUserRepository->updatePassword ()) {\n return redirect ( 'users/changepassword' )->withSuccess ( trans ( 'user::adminuser.changepassword.success' ) );\n } else {\n return redirect ( 'users/changepassword' )->withErrors ( trans ( 'user::adminuser.changepassword.incorrect' ) );\n }\n }", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "public function testLoginExample()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('1234567', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n }", "function changepass()\r\n{\r\n\t$session = $_SESSION[\"username\"];\t\r\n $Password = $_POST['txtPassword'];\r\n $Password2 = $_POST['txtPassword2'];\r\n\t\r\n\tif ($Password != $Password2)\r\n\t{\r\n\theader('Location: index.php?view=changepassword&alert=' . urlencode('PassWord Do not Match'));\r\n\t}\r\n\telse\r\n\t{\r\n\t\r\n\t$sql = \"UPDATE tbl_user \r\n\t SET user_password = PASSWORD('$Password')\r\n\t\t\t WHERE user_name = '$session'\";\r\n\r\n\tdbQuery($sql);\r\n\theader('Location: index.php?view=changepassword&alert=' . urlencode('You have Successfully Modified this User'));\r\n}\r\n}", "public function testUserLogin()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Login')\n ->seePageIs('/dashboard');\n }", "public function change_organizer_password(){\r\n\t\tif(isset($this->session->userdata['logged_in'])){\r\n\t\t\t$viewArr['viewPage'] = \"change_organizer_password\";\r\n\t\t\t$this->load->view('frontend/layout', $viewArr);\r\n\t\t}else{\r\n\t\t\t redirect('frontend/home', 'refresh');\r\n\t\t}\r\n\t}", "public function loggingWithWrongPasswordTest(FunctionalTester $I){\n HelperController::common_login($I, $this->name, $this->email, $this->password);\n HelperController::logout($I);\n $I->fillField('email', $this->email);\n $I->fillField('password', 'wrong_password');\n $I->click( '#login_form_button' );\n $I->see( trans('auth.failed') );\n }", "public function DoChangePassword($form)\n\t{\n\t\tif ($form->GetValue('Pw') == $form->GetValue('Pw2'))\n\t\t{\n\t\t\t$this->user->ChangePassword($form->GetValue('OldPw'), $form->GetValue('Pw'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->AddMessage('info', 'Password didn\\'t match.');\n\t\t}\n\t\t\n\t\t$this->RedirectToController('profile');\n\t}", "public function testUserCanNotLoginWithIncorrectPassword()\n {\n $user = factory(User::class)->create();\n $login = factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => $login->email,\n 'password' => 'wrong_pass',\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "public function login_redirect_test()\n {\n $response = $this->get('/');\n\n $response->assertRedirect('/login');\n }", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function Forgotpassword()\n\t{\n\t\t$login = get_cookie(sha1('besaf'));\n\t\tif ($login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t} elseif (!$login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\n\t\t$this->session->set_userdata(['reset' => true]);\n\n\t\t$this->load->view('Front/template/header');\n\t\t$this->load->view('Front/Forgot_password');\n\t\t$this->load->view('Front/template/footer');\n\t}", "public function testRegularUserChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(false);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo', 'currentPassword' => 'blue']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n $changePasswordModel->setCurrentPassword('blue');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayHasKey('currentPassword',$view->children);\n }", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "public function change_admin_password_form() {\n\t if ($this->lang->line('admin_menu_change_password') != '') \n\t\t$this->data['heading']= stripslashes($this->lang->line('admin_menu_change_password')); \n\t\telse $this->data['heading'] = 'Change Password';\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n \n $this->load->view(ADMIN_ENC_URL.'/templates/header.php', $this->data);\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/changepassword.php', $this->data);\n $this->load->view(ADMIN_ENC_URL.'/templates/footer.php', $this->data);\n }\n }", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function actionPasswordChange() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$old_password = \"\";\n\t\t$password = \"\";\n\t\t$password_confirmation = \"\";\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$old_password = $_POST['old_password'];\n\t\t\t$password = $_POST['password'];\n\t\t\t$password_confirmation = $_POST['password_confirmation'];\n\n\t\t\t$errors = array();\n\n\t\t\tif (User::passwordCheck($userId, $old_password)) {\n\t\t\t\tif (Validator::checkPassword($password)) $errors['password'] = Validator::checkPassword($password);\n\t\t\t\tif (Validator::checkPasswordConfirmation($password, $password_confirmation)) $errors['password_confirmation'] =\n\t\t\t\t\tValidator::checkPasswordConfirmation($password, $password_confirmation);\n\t\t\t} else $errors['old_password'] = \"Wrong old password\";\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::passwordChange($userId, $password);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Password Change\";\n\t\trequire_once(ROOT . '/views/account/password_change.php');\n\n\t\treturn true;\n\t}", "public function testAdminLoginForm(): void\n {\n $this->client->request('GET', '/admin/dashboard');\n $this->assertTrue(\n $this->client->getResponse()->isRedirect('http://localhost/admin/login')\n );\n $crawler = $this->client->followRedirect();\n $this->assertSame(\n Response::HTTP_OK,\n $this->client->getResponse()->getStatusCode()\n );\n $this->assertSame(\n 'Authentication',\n $crawler->filter('div.login-box-body > p.login-box-msg')->text()\n );\n }", "public function actionChangepassword()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "protected function _change_pass_submit()\n\t{\n\t\t$user = user_get_account_info();\n\t\t$password = $this->input->post('password');\n\t\t$password = mod('user')->encode_password($password, $user->email);\n\n\n\t\t$data['password'] = $password;\n\t\tt('session')->set_userdata('change_password', $data);\n\t\t$user_security_type = setting_get('config-user_security_change_password');\n\t\tif (in_array($user_security_type, config('types', 'mod/user_security'))) {\n\t\t\tmod('user_security')->send('change_password');\n\t\t\t$location = $this->_url('confirm/change_password');\n\t\t} else {\n\n\t\t\tmodel('user')->update($user->id, compact('password'));\n\t\t\tset_message(lang('notice_update_success'));\n\t\t\t$location = $this->_url('change_pass');\n\n\t\t}\n\n\t\treturn $location;\n\t}", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function account_change_password()\n\t{\n\t\t$data = array('password' => $this->input->post('new_password'));\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function test_users_update_unauthenticated_redirects_login(){\n $response = $this->patch(route('users.update', ['user' => 5]));\n $response->assertStatus(302);\n $response->assertRedirect(route('login'));\n }", "public function change_password()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->change_password($this->mUser->id, $this->input->post('new_password'));\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully changed password.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to changed password.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function actionchangePassword() {\n if (isset($_POST['password'])) {\n\n $userid = Yii::app()->user->getState('userid');\n $model = HhUsers::model()->findByPk($userid);\n if ($model->password == md5($_POST['password'])) {\n\n $model->password = md5($_POST['newpassword']);\n if ($model->save()) {\n $this->redirect('index');\n }\n }\n }\n $this->render('changePassword');\n }", "function password_protected(){\r\n if(!is_user_logged_in() && (ENVIRONMENT == 'development' || ENVIRONMENT == 'staging')){\r\n wp_redirect(get_option('siteurl') .'/wp-login.php');\r\n }\r\n}", "public function actionLogin()\r\n\t{\r\n\t $this->redirect(array('//user/auth'));\r\n\t}", "function user_changed_password($user_id, $new_password)\n\t{\n\t}", "public function password_change_verification() {\n\n $criteria = array(\"id\" => $this->ci->input->post(\"id\"));\n\n $passed = $this->verify_password($criteria, $this->ci->input->post(\"old_password\")); // variable to mark the user is allowed to pass or not.\n\n if (!$passed) {\n $this->ci->form_validation->set_message(\"password_change_verification\", \"Invalid password.\");\n }\n\n return $passed;\n }", "public function testLoginValidationLog() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'aaaaa', 'password' => ''])\n ->see('Please enter a valid password.');\n }", "public function testInvalidLogin()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n ->seePageIs('/auth/login')\n ->type('[email protected]', 'email')\n ->type('password', 'password')\n ->press('Login')\n ->seePageIs('/auth/login')\n ->see('These credentials do not match our records.');\n\n }", "public function testGetAccountPasswordForgotOut()\n {\n // Get forgot pass page\n $result = $this->visit('account/password/forgot')\n ->see('RESET YOUR PASSWORD')\n ->seePageIs('/account/password/forgot');\n }", "public function test_default_login()\n {\n $data = ['email' => '[email protected]', 'password' => 'default'];\n\n $response = $this->post('/login', $data);\n\n $response->assertStatus(302);\n\n $response->assertRedirect('/home');\n }", "public function changePasswordAction()\n {\n $user = $this->get('security.context')->getToken()->getUser();\n if (!is_object($user) || !$user instanceof UserInterface) {\n $this->createAccessDeniedException('This user does not have access to this section.');\n }\n\n $this->page = $this->getDoctrine()->getRepository('PageBundle:Page')->findOneByAlias($this::PASSWORD_CHANGE_PAGE_ALIAS);\n\n if (!$this->page) {\n return $this->get('bardiscms_page.services.show_error_page')->errorPageAction(Page::ERROR_404);\n }\n\n // Simple publishing ACL based on publish state and user Allowed Publish States\n $accessAllowedForUserRole = $this->get('bardiscms_page.services.helpers')->isUserAccessAllowedByRole(\n $this->page->getPublishState(),\n $this->publishStates\n );\n\n if (!$accessAllowedForUserRole) {\n return $this->get('bardiscms_page.services.show_error_page')->errorPageAction(Page::ERROR_401);\n }\n\n $this->page = $this->get('bardiscms_settings.set_page_settings')->setPageSettings($this->page);\n\n $form = $this->get('fos_user.change_password.form');\n $formHandler = $this->get('fos_user.change_password.form.handler');\n\n $process = $formHandler->process($user);\n if ($process) {\n $this->setFlash('fos_user_success', 'change_password.flash.success');\n\n return $this->redirect($this->getRedirectionUrl($user));\n }\n\n $pageData = array(\n 'page' => $this->page,\n 'mobile' => $this->serveMobile,\n 'logged_username' => $this->userName,\n 'form' => $form->createView(),\n );\n\n // Render Password change page\n $response = $this->render('SonataUserBundle:ChangePassword:changePassword.html.twig', $pageData);\n\n return $response;\n }", "public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function testLogin()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->check('remember')\n ->press('Login')\n ->seePageIs('/home')\n ->see('You are logged in!');\n\n });\n }", "public function testLogin()\n {\n $unUsuario =User::findOrFail(1);\n $this->browse(function ($browser) use ($unUsuario) {\n $browser->visit('/')\n ->type('identity', $unUsuario->name)\n ->type('password', 'secret')\n ->press('Accedeix')\n ->assertTrue(true);\n });\n }", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "public function user_password_change($id){\n\t\tif($this->facebook_password_completed($this->session->userdata('id'))){\n\t\t\t$data = $this->array_from_post(array('password', 'facebook_signup' ));\n\t\t}\n\t\telse{\n\t\t\t$data = $this->array_from_post(array('password'));\n\t\t}\n\t\t$data['password'] = $this->hash($data['password']);\n\t\t//Saving data and redirecting\n\t\t$this->save($data, $id);\n\t}", "function change_pwd()\r\n {\r\n include 'database/session.php';\r\n $OldPwd = htmlspecialchars($_POST['OldPwd']);\r\n $NewPwd1 = htmlspecialchars($_POST['NewPwd1']);\r\n $NewPwd2 = htmlspecialchars($_POST['NewPwd2']);\r\n \r\n if ($NewPwd1!=$NewPwd2) return false;\r\n \r\n return(changePassword($OldPwd, $NewPwd1));\r\n }", "public function test_login6()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.');\n }", "public function changePasswordAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Thay đổi mật khẩu';\r\n\r\n\t\tif ($this->_arrParam['form']['token'] > 0) {\r\n\r\n\t\t\t$new = $this->_arrParam['form']['new-password'];\r\n\t\t\t$enter = $this->_arrParam['form']['enter-password'];\r\n\r\n\t\t\tif ($new != $enter) {\r\n\t\t\t\t$this->_view->error = 'Mật khẩu không khớp. Xin kiểm tra lại';\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$this->_model->changePassword($this->_arrParam);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// URL::redirect($this->_arrParam['module'], $this->_controller, 'index');\r\n\r\n\r\n\r\n\t\t$this->_view->render(\"{$this->_controller}/change_password\");\r\n\t}", "public function testResetPasswordPass()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $this->assertEquals(0, $user->active);\n\n $data = [\n 'new_password' => 'test',\n 'confirm_password' => 'test',\n ];\n\n $this->post('/users/resetPassword/' . $user->email . '/' . $user->activation_key . '/', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testUpdatePasswordOk()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => $currentPassword,\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHas('success', trans('home.password_changed'));\n }", "public function test_users_edit_unauthenticated_redirects_to_login(){\n $response = $this->get(route('users.edit', ['user'=> 5])); \n $response->assertStatus(302);\n $response->assertRedirect(route('login'));\n }", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }", "public function resetPassword(): Response\n {\n // if they were only logged in via a remember me cookie, they\n // will be redirected to the login page\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n\n // ...\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function changePasswordAction()\n {\n $form = new Form\\Password();\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $userModel = new Model\\Users();\n $identity = $this->_auth ->getIdentity();\n $userId = $identity->getId();\n $user = $userModel->getUser($userId);\n $result = $userModel->savePassword($user, $form->getValue('new_password'), $form->getValue('password'));\n\n if ($result) {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was changed.'); \n } else {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was NOT changed.');\n }\n $this->_redirect($this->getRequest()->getRequestUri());\n }\n $this->view->passwordForm = $form;\n }", "public function test_login4()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('12345678','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }" ]
[ "0.8130224", "0.76846206", "0.74548304", "0.7331636", "0.7075464", "0.7070842", "0.702937", "0.7026317", "0.69889915", "0.6943756", "0.69010633", "0.6864637", "0.68545234", "0.6849441", "0.6838149", "0.6819933", "0.6791801", "0.6738044", "0.67214483", "0.6685236", "0.6641869", "0.6640781", "0.66188914", "0.6618057", "0.6610143", "0.6608572", "0.659104", "0.6579397", "0.6569576", "0.6565044", "0.65471536", "0.65389866", "0.6533427", "0.65332985", "0.6530841", "0.65271425", "0.65247256", "0.6519305", "0.65066844", "0.65059024", "0.65021545", "0.650088", "0.6497346", "0.64896023", "0.6483427", "0.64639205", "0.645977", "0.64488184", "0.6438868", "0.64341754", "0.64286196", "0.642352", "0.6418159", "0.64148057", "0.6409807", "0.63995254", "0.6398755", "0.6391267", "0.63896525", "0.6389157", "0.6384994", "0.6384385", "0.6375847", "0.63483256", "0.63475186", "0.6346006", "0.63398063", "0.633727", "0.6335654", "0.6325105", "0.6322615", "0.63208395", "0.63147694", "0.6314417", "0.6310165", "0.63055384", "0.63033926", "0.63007295", "0.6300316", "0.62989104", "0.62985605", "0.6298063", "0.6295973", "0.62865233", "0.6284816", "0.62825584", "0.6276865", "0.6275457", "0.6275283", "0.6275219", "0.6273108", "0.6272406", "0.62704724", "0.62697774", "0.62639403", "0.6259931", "0.62521625", "0.62512684", "0.62512445", "0.6251208" ]
0.85326576
0
Test update password ok.
public function testUpdatePasswordOk() { // Config $currentPassword = '123456789'; $newPassword = 'abcdef123456'; // Prepare $user = factory(User::class)->create([ 'password' => bcrypt($currentPassword), ]); $requestData = [ 'currentpassword' => $currentPassword, 'newpassword' => $newPassword, ]; $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData); // Asserts $response->assertStatus(302); $response->assertRedirect($this->accountChangePasswordPageUrl); $response->assertSessionHas('success', trans('home.password_changed')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function testUpdatePasswordNotGiven(): void { }", "public function testUpdateCPasswordNotGiven(): void { }", "public function testChangeMemberPassword()\n {\n }", "public function test_users_update_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testUpdatePasswordsDontMatch(): void { }", "function update_password()\n {\n }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function test_users_update_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function test_users_update_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_users_update_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testUpdatePassword_passwordSpecChars()\n {\n $oRealInputValidator = \\OxidEsales\\Eshop\\Core\\Registry::getInputValidator();\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('password_new', $sPass);\n $this->setRequestParameter('password_new_confirm', $sPass);\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('checkPassword'));\n oxTestModules::addModuleObject('oxuser', $oUser);\n\n $oInputValidator = $this->getMock('oxInputValidator');\n $oInputValidator->expects($this->once())->method('checkPassword')->with($this->equalTo($oUser), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(true))->will($this->returnValue(new oxException()));\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oInputValidator);\n\n $oView = oxNew('ForgotPwd');\n $oView->updatePassword();\n\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oRealInputValidator);\n }", "public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }", "function testActivatePasswordSuccess() {\r\n $this->User = new User();\r\n \t\r\n\t\t$expected = $this->User->field('password', array('id'=>'1'));\t\r\n \t\r\n \t// should return the new password\r\n $password = $this->User->activatePassword('1bc29b36f623ba82aaf6724fd3b16718');\r\n $this->assertTrue($password);\r\n \r\n //checkk if the password has changed\r\n\t\t$result = $this->User->field('password', array('id'=>'1'));\t\r\n \t$this->assertNotEqual($result, $expected);\r\n \t\r\n \t//check if the returned password is the same as in the database\r\n \t$this->assertEqual(md5($password), $result);\r\n \t\r\n \t\r\n \t\r\n \t//test done set data to the original values\r\n \t$this->User->id=1;\r\n \t$this->User->saveField('password', $expected);\r\n \t$this->User->saveField('password_key', '1bc29b36f623ba82aaf6724fd3b16718');\r\n }", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "public function testUpdatePasswordValidationError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = '123';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => '123456789',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "function testPasswordGet()\n {\n $this->assertEqual($this->referenceHash, auth::getPassword(1), \"Testing password retrieval.\");\n }", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function testSetAndGetPassword()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Password\r\n $testObj->setPassword('myTestPassword');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that Password field was updated\r\n $this->assertEquals('myTestPassword', $testObj->getPassword());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Password');\r\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "protected function changePassword() {}", "public function testUpdatePasswordProblemsWithPass()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $oView = oxNew('forgotpwd');\n\n // no pass\n $this->setRequestParameter('password_new', null);\n $this->setRequestParameter('password_new_confirm', null);\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS');\n }\n $this->assertTrue($blExcp);\n\n // pass does not match\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'bbbbbb');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH');\n }\n $this->assertTrue($blExcp);\n\n // pass too short\n $this->setRequestParameter('password_new', 'aaa');\n $this->setRequestParameter('password_new_confirm', 'aaa');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT');\n }\n\n $this->assertTrue($blExcp);\n }", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "public function testAdminChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(true);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayNotHasKey('current_password',$view->children);\n }", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "function testResendPassword() {\n $this->assertFalse($this->oObject->resendPassword());\n }", "public function vxUserPasswordUpdateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['pswitch'] = 'a';\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_touched'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_touched'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\n\t\t/* S check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_password_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_confirm_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'a'; /* both blank */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'b'; /* both touched */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'c'; /* first touched */\n\t\t}\n\t\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'd'; /* second touched */\n\t\t}\n\t\t\n\t\tswitch ($rt['pswitch']) {\n\t\t\tdefault:\n\t\t\tcase 'a':\n\t\t\t\t/* nothing will happen */\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t/* a lot check here */\n\t\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t$rt['usr_confirm_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\t$rt['usr_password_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function testLoggedUserVisitsChangePasswordPageOk()\n {\n // Prepare\n $user = factory(User::class)->create();\n\n // Request\n $response = $this->actingAs($user)->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(200);\n $response->assertViewIs('account.profile.changePassword');\n }", "function update_paypassword()\n {\n }", "public function testRegistrationPasswordsDontMatch(): void { }", "public function testResetPassword()\n {\n }", "public function update_password($id, $password);", "public function actionUpdatePassword()\n\t{\n\t\t$emp_id=isset($_POST['emp_id'])?$_POST['emp_id']:'';\n\t\t$old_password=isset($_POST['old_password'])?$_POST['old_password']:'';\n\t\t$new_password=isset($_POST['password'])?$_POST['password']:'';\n\t\tif($emp_id)\n\t\t{\n\t\t\t$model=$this->loadModel($emp_id);\t\n\t\t}\n\t\t\n\t\tif(md5($old_password)==$model->password)\n\t\t{\n\t\t\t$model->password=md5($new_password);\n\t\t\tif($model->save())\n\t\t\t\techo 1;\n\t\t}\n\t\telse{\n\t\t echo 2;\t\n\t\t}\n\t\t\n\t\t}", "public function setPassword($newPassword);", "function testGuessPassword() {\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pass'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.psword'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pwd'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.password'), 'password');\n\t}", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "public function testResetPasswordPass()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $this->assertEquals(0, $user->active);\n\n $data = [\n 'new_password' => 'test',\n 'confirm_password' => 'test',\n ];\n\n $this->post('/users/resetPassword/' . $user->email . '/' . $user->activation_key . '/', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }", "public function testRegularUserChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(false);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo', 'currentPassword' => 'blue']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n $changePasswordModel->setCurrentPassword('blue');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayHasKey('currentPassword',$view->children);\n }", "public function testPasswordSetVerify()\n {\n $password = \"testPasswordForTesting\";\n $user = new User();\n\n // Set our password\n $user->setPassword($password);\n\n // Verify that our password works\n $this->assertTrue($user->verifyPassword($password));\n\n // Verify that an invalid password doesn't work\n $password .= \"ThisIsNowInvalid\";\n $this->assertFalse($user->verifyPassword($password));\n }", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function testUpdatePasswordOnlyUpperCase(): void { }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function testNonLoggedUserUpdatePasswordRedirectsToLogin()\n {\n $response = $this->call('POST', $this->accountChangePasswordPostUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "function update_password(){\n\t\t$old_password=$_POST['old_password'];\n\t\t$new_password=$_POST['new_password'];\n\t\tif(!empty($old_password) && !empty($new_password)){\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif(!empty($admin_records)){\n\t\t\t\t$data['admin_password']=md5($new_password);\n\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('pg_track_admin', 'admin_status',1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t}else{\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\",'old_password'=>$old_password,'new_password'=>$new_password);\n\t}\n\techo $this -> json($post);\n\t}", "public function updatePwd(){\n if(\n !empty($_POST['pwd1']) &&\n !empty($_POST['pwd2']) &&\n $_POST['pwd1'] == $_POST['pwd2']){\n $pwd = $_POST['pwd1'];\n $id = $_SESSION['userID'];\n $user = new User();\n $user->updatePwd($pwd, $id);\n }\n else {\n echo \"false\";\n }\n }", "public function update()\n {\n $new_password = $this->input->post('inputNewPassword');\n if ($this->authentication->change_password($new_password))\n {\n $this->flash_message('Password Akun Berhasil di Update');\n } else {\n $this->flash_message('Password Akun Gagal di Update');\n }\n redirect($this->data['user'].'/editPassword');\n }", "public function checkPassword($value);", "public function testUpdatePasswordOnlyNumbers(): void { }", "public function changePasswordAction()\n {\n if ($this->request->isPost()) {\n // Request data\n $data = $this->request->getPost();\n\n $formValidator = $this->createValidator([\n 'input' => [\n 'source' => $data,\n 'definition' => [\n 'password' => new Pattern\\Password,\n 'confirmation' => new Pattern\\PasswordConfirmation($data['password'])\n ]\n ]\n ]);\n\n if ($formValidator->isValid()) {\n // Update current password\n $userService = $this->getModuleService('userService');\n $userService->updatePasswordById($this->getUserId(), $data['password']);\n\n $this->flashBag->set('success', 'Your password has been updated successfully');\n return 1;\n\n } else {\n return $formValidator->getErrors();\n }\n \n } else {\n // Just render empty form\n return $this->view->render('settings/change-password');\n }\n }", "public function testUpdateUserAndHashPasswordIfProvided()\n {\n $user = factory(User::class)->make();\n $this->hasher->shouldReceive('make')->with('raw_pass')->once()->andReturn('enc_pass');\n $this->repository->shouldReceive('update')->with($user->id, ['password' => 'enc_pass'])->once()->andReturnNull();\n\n $response = $this->getService()->handle($user, ['password' => 'raw_pass']);\n $this->assertInstanceOf(Collection::class, $response);\n $this->assertTrue($response->has('model'));\n $this->assertTrue($response->has('exceptions'));\n }", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "function adminUpdateUserPassword()\n {\n \t# retrieve username passed in from GET Superglobal\n \tif(isset($_GET['userName']))\n\t{\n\t\t$userName=filter_input(INPUT_GET,'userName',FILTER_SANITIZE_STRING);\n\t}\n\t\n\t# submit update and check if was success\n \t$success=updatePassWord($userName);\n\t\n\techo 'Successful='.$success;\n }", "public function ask_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser');\n $cmd->expectsQuestion('Password', 'testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "function testForgotPassword()\n {\n $result = $this->mailgunModel->forgotPassword($this->dataTest->to,\n $this->dataTest->pass,\n $this->dataTest->html\n );\n $this->assertEquals(\"200\", $result->http_response_code);\n $this->assertEquals(\"Queued. Thank you.\", $result->http_response_body->message);\n $this->assertNotNull($result->http_response_body->id);\n }", "public function testUpdatePasswordCurrentIsIncorrectError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => 'thisisnotthepassword',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function testLoginWrongPassword(): void { }", "public function setPassword($value);", "public function setPassword($newPassword){\n\t}", "public function test_SubmitChangePasswordForm_Valid() {\n $postArray = array(\n 'username'=>'bbrummtest',\n 'emailAddress'=>'[email protected]'\n );\n\n $output = $this->request('POST', ['ForgotPassword', 'submitChangePasswordForm', true], $postArray);\n $expected = \"<h2>Almost Done!</h2>\";\n\n $this->assertContains($expected, $output);\n }", "public function set_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "public function modifpassword($user,$passwd){\n \n }", "public function password_update_by_name($username, $randpwd)\n {\n\t $query = \"UPDATE \".$this->db_table_prefix . \"users SET password='\".md5($randpwd).\"' WHERE username = '\".$username.\"'\";\n \n $result = $this->commonDatabaseAction($query);\n //echo $query; exit;\n if ($this->sqlAffected > 0)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function setPassword(){\n\t}", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function testExpiredPassword()\n {\n pdo_query(\"UPDATE password SET date='2011-07-22 15:37:57' WHERE userid=$this->UserId\");\n\n // Make sure we get redirected when visiting a non-Angular page.\n $this->login('jane@smith', '12345');\n $content = $this->get($this->url . '/upgrade.php');\n if (strpos($content, 'Your password has expired') === false) {\n $this->fail(\"'Your password has expired' not found when expected\");\n return 1;\n }\n\n // Make sure API endpoints tell the controller to redirect.\n $content = $this->connect($this->url . '/api/v1/index.php?project=InsightExample');\n $jsonobj = json_decode($content, true);\n if (!array_key_exists('redirect', $jsonobj)) {\n $this->fail(\"No 'redirect' key found when expected\");\n return 1;\n }\n $expected = 'editUser.php?reason=expired';\n $found = $jsonobj['redirect'];\n if (strpos($found, $expected) === false) {\n $this->fail(\"Expected $expected, found $found\");\n return 1;\n }\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function actionUpdatePassword(){\r\n //common view data\r\n $mainCategories = $this->mainCategories;\r\n $brands = $this->brands;\r\n \r\n $errors = [];\r\n $success = null;\r\n \r\n //check if the user is logged in and get User $user properties from the database\r\n $userID = $this->checkLogged();\r\n $success = null;\r\n \r\n //check if the form has been submitted and process form data\r\n if($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n $currentPassword = filter_input(INPUT_POST, 'currentPassword', FILTER_SANITIZE_SPECIAL_CHARS);\r\n $newPassword = filter_input(INPUT_POST, 'newPassword', FILTER_SANITIZE_SPECIAL_CHARS);\r\n $confirmNewPassword = filter_input(INPUT_POST, 'confirmNewPassword', FILTER_SANITIZE_SPECIAL_CHARS);\r\n \r\n $model = new ChangePasswordForm($userID, $currentPassword, $newPassword, $confirmNewPassword);\r\n \r\n if(!$model->validate()) {\r\n $errors = $model->errors;\r\n } else if(!$model->verifyPassword()) {\r\n $errors['currentPassword'][0] = 'Incorrect password';\r\n } else {\r\n $success = $model->updatePassword() ? 'PASSWORD SUCCESSFULLY UPDATED' : 'ERROR UPDATING PASSWORD';\r\n }\r\n }\r\n \r\n include_once ROOT . '/views/profile/changepass.php';\r\n \r\n }", "public function run_chg_pass_if()\n\t{\n\t\t$msg='';\n\t\tif(isset($_POST['old_pass']))\n\t\t{\n\t\t\tif(md5($_POST['old_pass'])==$_SESSION['waf_user']['pass'])\n\t\t\t\t{\n\t\t\t\t\tif($_POST['pass']!=$_POST['pass1'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg='Passwords not equal! Try again.';\n\t\t\t\t\t}else{\n\t\t\t\t\t$this->change_password($_SESSION['waf_user']['id'],$_POST['pass']);\n\t\t\t\t\t$msg='Password successfully changed';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t$msg='Old Password wrong! Password not changed';\t\n\t\t\t\t}\n\t\t}\n\t\t$this->error=$msg;\n\t}", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public function testChangeUser_noRedirect_setPasswordWithSpecChars()\n {\n $this->setExpectedException('oxException', 'Change user test');\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('invadr', null);\n\n $oSession = $this->getMock(\\OxidEsales\\Eshop\\Core\\Session::class, array('checkSessionChallenge'));\n $oSession->expects($this->once())->method('checkSessionChallenge')->will($this->returnValue(true));\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('changeUserData'));\n $oUser->oxuser__oxusername = new oxField('test_username', oxField::T_RAW);\n $oUser->oxuser__oxpassword = new oxField($sPass, oxField::T_RAW);\n $oUser->expects($this->once())\n ->method('changeUserData')\n ->with($this->equalTo('test_username'), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(null), $this->equalTo(null))\n ->will($this->throwException(new oxException('Change user test')));\n\n $oView = $this->getMock($this->getProxyClassName('oxcmp_user'), array('_getDelAddressData', 'getUser', 'getSession'));\n $oView->expects($this->once())->method('getUser')->will($this->returnValue($oUser));\n $oView->expects($this->once())->method('getSession')->will($this->returnValue($oSession));\n $oView->UNITchangeUser_noRedirect();\n }", "public function testShouldNotChangePassword()\n {\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'',\n 'password_confirmation'=>''\n );\n\n // Should not call changePassword of the repository\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive( 'changePassword' )\n ->never();\n\n // Should call validate method\n ConfideUser::$app['confide.repository']->shouldReceive('validate')\n ->andReturn( false )\n ->times(4);\n\n ConfideUser::$app['confide.repository']->shouldReceive('model')\n ->andReturn( new ConfideUser )\n ->times(4);\n\n $this->populateUser();\n\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Additional asserts\n // Password should not be changed because it is too short\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'39a',\n 'password_confirmation'=>'39a'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is too long\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'1a2f34g5uj887n',\n 'password_confirmation'=>'1a2f34g5uj887n'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is not confirmed\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'987987',\n 'password_confirmation'=>'562906'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\n\t}", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function updatepassword()\n\t\t{\n\t\t\t$user = Session::get('loggedinuser');\n\t\t\t$userid = DB::table('users')->where('username', $user)->pluck('id');\n\t\t\t$updateduser = User::find($userid);\n\t\t\t$newpassword = Input::get('password');\n\t\t\tif($newpassword == Input::get('confirm')) {\n\t\t\t\t$updateduser->password = Hash::make($newpassword);\n\t\t\t\t$updateduser->save();\n\t\t\t\tSession::flash('successMessage', 'Password successfully updated');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your passwords do not match!');\n\t\t\t\treturn Redirect::back();\n\t\t\t}\n\t\t}", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function testValidPassword()\n {\n $client = static::createClient();\n $crawler = $client->request('GET', '/register');\n $form = $crawler->selectButton('Envoyer')->form();\n\n $form['user[nickName]'] = 'JoJo';\n $form['user[email]'] = '[email protected]';\n $form['user[plainPassword][first]'] = 'JoJo1234';\n $form['user[plainPassword][second]'] = 'JoJo1234';\n\n $crawler = $client->submit($form);\n\n $this->assertTrue(\n $client->getResponse()->isRedirect('/login')\n );\n }" ]
[ "0.8264717", "0.8246426", "0.77617496", "0.7682547", "0.76659894", "0.76399857", "0.76286733", "0.7627595", "0.75964403", "0.7580876", "0.75775284", "0.7561588", "0.75533015", "0.7513989", "0.7501955", "0.7501955", "0.750077", "0.742609", "0.73942196", "0.73900354", "0.7388088", "0.7330885", "0.7270214", "0.72541034", "0.7171466", "0.71569884", "0.71410537", "0.71276814", "0.7112346", "0.71059716", "0.7098525", "0.70906496", "0.7078746", "0.7076116", "0.70733184", "0.7052865", "0.7032069", "0.69936293", "0.69845605", "0.69842684", "0.6962677", "0.69612056", "0.6942908", "0.6942668", "0.69359046", "0.6929204", "0.6926625", "0.69200057", "0.6911275", "0.68885446", "0.6887134", "0.6882839", "0.685699", "0.6846437", "0.68458456", "0.6842773", "0.6840183", "0.68298733", "0.6821503", "0.68145496", "0.6813009", "0.68079364", "0.68026626", "0.68003917", "0.67929935", "0.67821205", "0.6780625", "0.67706245", "0.6767166", "0.67533547", "0.6750615", "0.6747822", "0.67450404", "0.67441916", "0.67256343", "0.67123026", "0.670677", "0.6699211", "0.6694181", "0.6691613", "0.6690632", "0.66862136", "0.6685906", "0.6679266", "0.6665549", "0.6663454", "0.66617715", "0.6646229", "0.66408306", "0.66334194", "0.6626584", "0.66219676", "0.6621364", "0.662002", "0.6618186", "0.6611604", "0.66010755", "0.65763736", "0.65712374", "0.65678376" ]
0.7896249
2
Test update password throws an error if the current one is incorrect.
public function testUpdatePasswordCurrentIsIncorrectError() { // Config $currentPassword = '123456789'; $newPassword = 'abcdef123456'; // Prepare $user = factory(User::class)->create([ 'password' => bcrypt($currentPassword), ]); $requestData = [ 'currentpassword' => 'thisisnotthepassword', 'newpassword' => $newPassword, ]; $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData); // Asserts $response->assertStatus(302); $response->assertRedirect($this->accountChangePasswordPageUrl); $response->assertSessionHasErrors('password'); $response->assertSessionMissing('success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePasswordNotGiven(): void { }", "public function testUpdatePasswordValidationError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = '123';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => '123456789',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function testUpdateCPasswordNotGiven(): void { }", "public function testUpdatePasswordOk()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => $currentPassword,\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHas('success', trans('home.password_changed'));\n }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function test_users_update_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_users_update_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function test_users_update_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function test_users_update_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testUpdatePasswordsDontMatch(): void { }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function testUpdatePasswordProblemsWithPass()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $oView = oxNew('forgotpwd');\n\n // no pass\n $this->setRequestParameter('password_new', null);\n $this->setRequestParameter('password_new_confirm', null);\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS');\n }\n $this->assertTrue($blExcp);\n\n // pass does not match\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'bbbbbb');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH');\n }\n $this->assertTrue($blExcp);\n\n // pass too short\n $this->setRequestParameter('password_new', 'aaa');\n $this->setRequestParameter('password_new_confirm', 'aaa');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT');\n }\n\n $this->assertTrue($blExcp);\n }", "public function testUpdatePassword_passwordSpecChars()\n {\n $oRealInputValidator = \\OxidEsales\\Eshop\\Core\\Registry::getInputValidator();\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('password_new', $sPass);\n $this->setRequestParameter('password_new_confirm', $sPass);\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('checkPassword'));\n oxTestModules::addModuleObject('oxuser', $oUser);\n\n $oInputValidator = $this->getMock('oxInputValidator');\n $oInputValidator->expects($this->once())->method('checkPassword')->with($this->equalTo($oUser), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(true))->will($this->returnValue(new oxException()));\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oInputValidator);\n\n $oView = oxNew('ForgotPwd');\n $oView->updatePassword();\n\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oRealInputValidator);\n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }", "function update_password()\n {\n }", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "public function testChangeMemberPassword()\n {\n }", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }", "public function testUpdateMethodGivenFailed()\n {\n $listener = m::mock('\\Orchestra\\Contracts\\Auth\\Listener\\PasswordReset');\n $validator = m::mock('\\Orchestra\\Foundation\\Validations\\AuthenticateUser');\n $password = m::mock('\\Illuminate\\Contracts\\Auth\\PasswordBroker');\n\n $input = $this->getUpdateInput();\n\n $stub = new PasswordBroker($validator, $password);\n\n $password->shouldReceive('reset')->once()\n ->with($input, m::type('Closure'))\n ->andReturnUsing(function ($d, $c) {\n return Password::INVALID_TOKEN;\n });\n $listener->shouldReceive('passwordResetHasFailed')->once()->with(Password::INVALID_TOKEN)->andReturn('reset.failed');\n\n $this->assertEquals('reset.failed', $stub->update($listener, $input));\n }", "public function testExpiredPassword()\n {\n pdo_query(\"UPDATE password SET date='2011-07-22 15:37:57' WHERE userid=$this->UserId\");\n\n // Make sure we get redirected when visiting a non-Angular page.\n $this->login('jane@smith', '12345');\n $content = $this->get($this->url . '/upgrade.php');\n if (strpos($content, 'Your password has expired') === false) {\n $this->fail(\"'Your password has expired' not found when expected\");\n return 1;\n }\n\n // Make sure API endpoints tell the controller to redirect.\n $content = $this->connect($this->url . '/api/v1/index.php?project=InsightExample');\n $jsonobj = json_decode($content, true);\n if (!array_key_exists('redirect', $jsonobj)) {\n $this->fail(\"No 'redirect' key found when expected\");\n return 1;\n }\n $expected = 'editUser.php?reason=expired';\n $found = $jsonobj['redirect'];\n if (strpos($found, $expected) === false) {\n $this->fail(\"Expected $expected, found $found\");\n return 1;\n }\n }", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "public function vxUserPasswordUpdateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['pswitch'] = 'a';\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_touched'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_touched'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\n\t\t/* S check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_password_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_confirm_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'a'; /* both blank */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'b'; /* both touched */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'c'; /* first touched */\n\t\t}\n\t\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'd'; /* second touched */\n\t\t}\n\t\t\n\t\tswitch ($rt['pswitch']) {\n\t\t\tdefault:\n\t\t\tcase 'a':\n\t\t\t\t/* nothing will happen */\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t/* a lot check here */\n\t\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t$rt['usr_confirm_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\t$rt['usr_password_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "function testPasswordGet()\n {\n $this->assertEqual($this->referenceHash, auth::getPassword(1), \"Testing password retrieval.\");\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "public function testSetAndGetPassword()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Password\r\n $testObj->setPassword('myTestPassword');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that Password field was updated\r\n $this->assertEquals('myTestPassword', $testObj->getPassword());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Password');\r\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "protected function changePassword() {}", "public function testUpdatePasswordUnableToLoadUserByUid()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $this->setRequestParameter('uid', 'aaaaaa');\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'aaaaaa');\n\n $oView = oxNew('forgotpwd');\n\n try {\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == 'ERROR_MESSAGE_PASSWORD_LINK_EXPIRED';\n }\n\n $this->assertTrue($blExcp);\n }", "public function testRegistrationPasswordsDontMatch(): void { }", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }", "function testActivatePasswordSuccess() {\r\n $this->User = new User();\r\n \t\r\n\t\t$expected = $this->User->field('password', array('id'=>'1'));\t\r\n \t\r\n \t// should return the new password\r\n $password = $this->User->activatePassword('1bc29b36f623ba82aaf6724fd3b16718');\r\n $this->assertTrue($password);\r\n \r\n //checkk if the password has changed\r\n\t\t$result = $this->User->field('password', array('id'=>'1'));\t\r\n \t$this->assertNotEqual($result, $expected);\r\n \t\r\n \t//check if the returned password is the same as in the database\r\n \t$this->assertEqual(md5($password), $result);\r\n \t\r\n \t\r\n \t\r\n \t//test done set data to the original values\r\n \t$this->User->id=1;\r\n \t$this->User->saveField('password', $expected);\r\n \t$this->User->saveField('password_key', '1bc29b36f623ba82aaf6724fd3b16718');\r\n }", "public function testNonLoggedUserUpdatePasswordRedirectsToLogin()\n {\n $response = $this->call('POST', $this->accountChangePasswordPostUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "function testGuessPassword() {\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pass'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.psword'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pwd'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.password'), 'password');\n\t}", "public function setPassword($newPassword);", "public function ask_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser');\n $cmd->expectsQuestion('Password', 'testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function testResendPassword() {\n $this->assertFalse($this->oObject->resendPassword());\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "public function testPasswordSetVerify()\n {\n $password = \"testPasswordForTesting\";\n $user = new User();\n\n // Set our password\n $user->setPassword($password);\n\n // Verify that our password works\n $this->assertTrue($user->verifyPassword($password));\n\n // Verify that an invalid password doesn't work\n $password .= \"ThisIsNowInvalid\";\n $this->assertFalse($user->verifyPassword($password));\n }", "public function testUpdatePasswordOnlyNumbers(): void { }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function testShouldNotChangePassword()\n {\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'',\n 'password_confirmation'=>''\n );\n\n // Should not call changePassword of the repository\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive( 'changePassword' )\n ->never();\n\n // Should call validate method\n ConfideUser::$app['confide.repository']->shouldReceive('validate')\n ->andReturn( false )\n ->times(4);\n\n ConfideUser::$app['confide.repository']->shouldReceive('model')\n ->andReturn( new ConfideUser )\n ->times(4);\n\n $this->populateUser();\n\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Additional asserts\n // Password should not be changed because it is too short\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'39a',\n 'password_confirmation'=>'39a'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is too long\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'1a2f34g5uj887n',\n 'password_confirmation'=>'1a2f34g5uj887n'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is not confirmed\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'987987',\n 'password_confirmation'=>'562906'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n }", "public function testUpdatePasswordOnlyUpperCase(): void { }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function checkPassword($value);", "static public function tryToSetNewPassword() {\r\n\t\tif (!isset($_POST['chpw_hash']) || !isset($_POST['new_pw']) || !isset($_POST['new_pw_again']) || !isset($_POST['chpw_username']))\r\n\t\t\treturn;\r\n\r\n\t\tif ($_POST['chpw_username'] == self::getUsernameForChangePasswordHash()) {\r\n\t\t\tif ($_POST['new_pw'] != $_POST['new_pw_again'])\r\n\t\t\t\treturn array( __('The passwords have to be the same.') );\r\n\t\t\telseif (strlen($_POST['new_pw']) < self::$PASS_MIN_LENGTH)\r\n\t\t\t\treturn array( sprintf( __('The password has to contain at least %s signs.'), self::$PASS_MIN_LENGTH) );\r\n\t\t\telse {\r\n\t\t\t\tself::updateAccount($_POST['chpw_username'],\r\n\t\t\t\t\tarray('password', 'changepw_hash', 'changepw_timelimit'),\r\n\t\t\t\t\tarray(self::passwordToHash($_POST['new_pw']), '', 0));\r\n\t\t\t\theader('Location: login.php');\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn array( __('Something went wrong.') );\r\n\t}", "public function test_if_failed_update()\n {\n }", "public function testLoginWrongPassword(): void { }", "public function testRegistrationPasswordNotMatch()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234qw')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function set_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser --password=testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function should_return_unprocessable_entity_if_old_password_not_match_actual()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'someMadeUpPassword',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'old_password' => ['The old password is not correct.']\n ]);\n }", "public function testAuthFailWithInvalidPassword()\n {\n $user = new User(['name' => 'test', 'email' => '[email protected]']);\n $playload = [\n 'email' => $user->email,\n 'password' => 'fg'\n ];\n $this\n ->json('POST', '/api/' . self::API_V1 . '/auth', $playload)\n ->assertStatus(422)\n ->assertJson([\n 'password' => [\"The password must be at least 3 characters.\"]\n ]);\n }", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "public function testResetPassword()\n {\n }", "public function setPassword($newPassword){\n\t}", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function update_password($id, $password);", "public function test_users_store_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }", "public function test_users_store_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function passwordUpdated()\n {\n $message = \\trans('orchestra/foundation::response.account.password.update');\n\n return $this->redirectWithMessage(\\handles('orchestra::account/password'), $message);\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "function update_paypassword()\n {\n }", "public function can_change_password() {\n return false;\n }", "public function testUpdateUserAndHashPasswordIfProvided()\n {\n $user = factory(User::class)->make();\n $this->hasher->shouldReceive('make')->with('raw_pass')->once()->andReturn('enc_pass');\n $this->repository->shouldReceive('update')->with($user->id, ['password' => 'enc_pass'])->once()->andReturnNull();\n\n $response = $this->getService()->handle($user, ['password' => 'raw_pass']);\n $this->assertInstanceOf(Collection::class, $response);\n $this->assertTrue($response->has('model'));\n $this->assertTrue($response->has('exceptions'));\n }", "public function post_password()\n\t{\n\t\t$input = Input::all();\n\t\t$rules = array(\n\t\t\t'current_password' => array(\n\t\t\t\t'required',\n\t\t\t),\n\t\t\t'new_password' => array(\n\t\t\t\t'required',\n\t\t\t\t'different:current_password',\n\t\t\t),\n\t\t\t'confirm_password' => array(\n\t\t\t\t'same:new_password',\n\t\t\t),\n\t\t);\n\n\t\tif (Auth::user()->id !== $input['id']) return Response::error('500');\n\n\t\t$val = Validator::make($input, $rules);\n\n\t\tif ($val->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles('orchestra::account/password'))\n\t\t\t\t\t->with_input()\n\t\t\t\t\t->with_errors($val);\n\t\t}\n\n\t\t$msg = Messages::make();\n\t\t$user = Auth::user();\n\n\t\tif (Hash::check($input['current_password'], $user->password))\n\t\t{\n\t\t\t$user->password = $input['new_password'];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDB::transaction(function () use ($user)\n\t\t\t\t{\n\t\t\t\t\t$user->save();\n\t\t\t\t});\n\n\t\t\t\t$msg->add('success', __('orchestra::response.account.password.update'));\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$msg->add('error', __('orchestra::response.db-failed'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.account.password.invalid'));\n\t\t}\n\n\t\treturn Redirect::to(handles('orchestra::account/password'));\n\t}", "public function testWithInvalidPasswordKo()\n\t{\n\t\ttry {\n\t\t\t$orient = new Orientdb\\Orientdb($this->host, $this->port);\n\t\t\t\n\t\t\t$orient->DBOpen($this->db, $this->type, $this->pass, '');\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t// Check the exception thrown is an instance clientException\n\t\t\t$this->assertEquals($e->GetMessage(), \"User or password not valid for database: 'test'\");\n\t\t}\n\t}", "public function test_users_store_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testAdminChangePassword()\n {\n $this->authorizationChecker->shouldReceive('isGranted')->withAnyArgs()->andReturn(true);\n\n $form = $this->factory->create(ChangePasswordType::class);\n\n $form->submit(['newPassword' => 'moomoo']);\n\n Assert::assertTrue($form->isSynchronized());\n\n $changePasswordModel = new ChangePasswordModel();\n $changePasswordModel->setNewPassword('moomoo');\n Assert::assertEquals($changePasswordModel, $form->getData());\n\n $view = $form->createView();\n\n Assert::assertArrayHasKey('newPassword',$view->children);\n\n Assert::assertArrayNotHasKey('current_password',$view->children);\n }", "public function setPassword($value);", "public function test_users_store_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "function testBug11661() \n {\n $sText = <<<SCRIPT\n<?php\nif (empty(\\$user_password) AND empty(\\$user_password2)) {\n \\$user_password = makepass();\n\n } elseif (\\$user_password != \\$user_password2) {\n\n title(_NEWUSERERROR);\n\n OpenTable();\n\n echo '<center><b>'._PASSDIFFERENT.'</b><br /><br />'._GOBACK.'</center>'; \n\n CloseTable();\n\n include_once('footer.php');\n\n die();\n\n } elseif (\\$user_password == \\$user_password2 AND\nstrlen(\\$user_password) < \\$minpass) {\n\n title(_NEWUSERERROR);\n\n OpenTable();\n\n echo '<center>'._YOUPASSMUSTBE.' <b>'.\\$minpass.'</b>' . _CHARLONG . '<br /><br />' . _GOBACK . '</center>';\n\n CloseTable();\n\n include_once ('footer.php');\n\n die();\n\n }\n?>\nSCRIPT;\n\n$this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nif (empty(\\$user_password) AND empty(\\$user_password2)) {\n \\$user_password = makepass();\n} elseif (\\$user_password != \\$user_password2) {\n title(_NEWUSERERROR);\n OpenTable();\n echo '<center><b>' . _PASSDIFFERENT . '</b><br /><br />' . _GOBACK . '</center>';\n CloseTable();\n include_once ('footer.php');\n die();\n} elseif (\\$user_password == \\$user_password2 AND strlen(\\$user_password) < \\$minpass) {\n title(_NEWUSERERROR);\n OpenTable();\n echo '<center>' . _YOUPASSMUSTBE . ' <b>' . \\$minpass . '</b>' . _CHARLONG . '<br /><br />' . _GOBACK . '</center>';\n CloseTable();\n include_once ('footer.php');\n die();\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function loggingWithWrongPasswordTest(FunctionalTester $I){\n HelperController::common_login($I, $this->name, $this->email, $this->password);\n HelperController::logout($I);\n $I->fillField('email', $this->email);\n $I->fillField('password', 'wrong_password');\n $I->click( '#login_form_button' );\n $I->see( trans('auth.failed') );\n }", "public function testResetPasswordPass()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $this->assertEquals(0, $user->active);\n\n $data = [\n 'new_password' => 'test',\n 'confirm_password' => 'test',\n ];\n\n $this->post('/users/resetPassword/' . $user->email . '/' . $user->activation_key . '/', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "function password($pass)\n\t{\n\t\tif (strcmp($pass, AUCTION_PASSWORD))\n\t\t\texit(\"Wrong password\");\n\t}", "function testForgotPassword()\n {\n $result = $this->mailgunModel->forgotPassword($this->dataTest->to,\n $this->dataTest->pass,\n $this->dataTest->html\n );\n $this->assertEquals(\"200\", $result->http_response_code);\n $this->assertEquals(\"Queued. Thank you.\", $result->http_response_body->message);\n $this->assertNotNull($result->http_response_body->id);\n }" ]
[ "0.82564646", "0.79485625", "0.7762527", "0.77401745", "0.7594728", "0.7558566", "0.752568", "0.7524672", "0.7460376", "0.7403721", "0.7399635", "0.7377772", "0.73503923", "0.7348224", "0.7317573", "0.7250018", "0.7227501", "0.7166284", "0.71307653", "0.7129662", "0.7115438", "0.7082191", "0.7046942", "0.7015173", "0.70044416", "0.7000619", "0.69757676", "0.6974531", "0.69500744", "0.6939941", "0.68970585", "0.6889897", "0.6855928", "0.6833706", "0.6833706", "0.68315715", "0.68103695", "0.6792448", "0.67781126", "0.6738409", "0.6732166", "0.67105347", "0.6704465", "0.6694829", "0.66884726", "0.6684168", "0.6680727", "0.66694844", "0.66686827", "0.6655752", "0.66513383", "0.6630414", "0.66115046", "0.6607913", "0.66058195", "0.6599736", "0.6590339", "0.6589961", "0.65813357", "0.65728736", "0.65597147", "0.6559335", "0.654982", "0.6545311", "0.65270877", "0.6524496", "0.6507059", "0.65064657", "0.6505436", "0.65046567", "0.6500463", "0.64905185", "0.64805317", "0.6478036", "0.6477131", "0.64764893", "0.64631855", "0.64461035", "0.6443202", "0.64346284", "0.6430146", "0.642192", "0.6405911", "0.63947284", "0.63944894", "0.6393119", "0.6391918", "0.639123", "0.63900685", "0.6389662", "0.63886464", "0.63874453", "0.63806325", "0.63799375", "0.63783264", "0.63693357", "0.6363091", "0.6358747", "0.63559407", "0.6351393" ]
0.7571848
5
Test update password with invalid data returns errors.
public function testUpdatePasswordValidationError() { // Config $currentPassword = '123456789'; $newPassword = '123'; // Prepare $user = factory(User::class)->create([ 'password' => bcrypt($currentPassword), ]); $requestData = [ 'currentpassword' => '123456789', 'newpassword' => $newPassword, ]; $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData); // Asserts $response->assertStatus(302); $response->assertRedirect($this->accountChangePasswordPageUrl); $response->assertSessionHasErrors('password'); $response->assertSessionMissing('success'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePasswordNotGiven(): void { }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function test_users_update_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function testUpdatePasswordsDontMatch(): void { }", "public function test_users_update_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testUpdateCPasswordNotGiven(): void { }", "public function testUpdatePasswordProblemsWithPass()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $oView = oxNew('forgotpwd');\n\n // no pass\n $this->setRequestParameter('password_new', null);\n $this->setRequestParameter('password_new_confirm', null);\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS');\n }\n $this->assertTrue($blExcp);\n\n // pass does not match\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'bbbbbb');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH');\n }\n $this->assertTrue($blExcp);\n\n // pass too short\n $this->setRequestParameter('password_new', 'aaa');\n $this->setRequestParameter('password_new_confirm', 'aaa');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT');\n }\n\n $this->assertTrue($blExcp);\n }", "public function test_users_update_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function test_users_update_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }", "public function vxUserPasswordUpdateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['pswitch'] = 'a';\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_touched'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t5 => modify empty\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_touched'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配', 5 => '你修改密码时需要将新密码输入两遍');\n\n\t\t/* S check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_password_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_touched'] = 0;\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\t$rt['usr_confirm_touched'] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_touched'] = 0;\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'a'; /* both blank */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'b'; /* both touched */\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_touched'] == 1) && ($rt['usr_confirm_touched'] == 0)) {\n\t\t\t$rt['pswitch'] = 'c'; /* first touched */\n\t\t}\n\t\t\t\n\t\tif (($rt['usr_password_touched'] == 0) && ($rt['usr_confirm_touched'] == 1)) {\n\t\t\t$rt['pswitch'] = 'd'; /* second touched */\n\t\t}\n\t\t\n\t\tswitch ($rt['pswitch']) {\n\t\t\tdefault:\n\t\t\tcase 'a':\n\t\t\t\t/* nothing will happen */\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t/* a lot check here */\n\t\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\t$rt['usr_confirm_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\t$rt['usr_password_error'] = 5;\n\t\t\t\t$rt['errors']++;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function testAuthFailWithInvalidPassword()\n {\n $user = new User(['name' => 'test', 'email' => '[email protected]']);\n $playload = [\n 'email' => $user->email,\n 'password' => 'fg'\n ];\n $this\n ->json('POST', '/api/' . self::API_V1 . '/auth', $playload)\n ->assertStatus(422)\n ->assertJson([\n 'password' => [\"The password must be at least 3 characters.\"]\n ]);\n }", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "function m_verifyEditPass()\n\t{\n\t\t$this->errMsg=MSG_HEAD.\"<br>\";\n\t\tif(empty($this->request['password']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif(empty($this->request['verify_pw']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_VERIFYPASS_EMPTY.\"<br>\";\n\t\t}\n\t\tif($this->request['password']!=$this->request['verify_pw'])\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg.=MSG_PASS_NOTMATCHED.\"<br>\";\n\t\t}\n\t\treturn $this->err;\n\t}", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "public function testRegistrationPasswordsDontMatch(): void { }", "public function testUpdatePassword_passwordSpecChars()\n {\n $oRealInputValidator = \\OxidEsales\\Eshop\\Core\\Registry::getInputValidator();\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('password_new', $sPass);\n $this->setRequestParameter('password_new_confirm', $sPass);\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('checkPassword'));\n oxTestModules::addModuleObject('oxuser', $oUser);\n\n $oInputValidator = $this->getMock('oxInputValidator');\n $oInputValidator->expects($this->once())->method('checkPassword')->with($this->equalTo($oUser), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(true))->will($this->returnValue(new oxException()));\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oInputValidator);\n\n $oView = oxNew('ForgotPwd');\n $oView->updatePassword();\n\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oRealInputValidator);\n }", "public function testExpiredPassword()\n {\n pdo_query(\"UPDATE password SET date='2011-07-22 15:37:57' WHERE userid=$this->UserId\");\n\n // Make sure we get redirected when visiting a non-Angular page.\n $this->login('jane@smith', '12345');\n $content = $this->get($this->url . '/upgrade.php');\n if (strpos($content, 'Your password has expired') === false) {\n $this->fail(\"'Your password has expired' not found when expected\");\n return 1;\n }\n\n // Make sure API endpoints tell the controller to redirect.\n $content = $this->connect($this->url . '/api/v1/index.php?project=InsightExample');\n $jsonobj = json_decode($content, true);\n if (!array_key_exists('redirect', $jsonobj)) {\n $this->fail(\"No 'redirect' key found when expected\");\n return 1;\n }\n $expected = 'editUser.php?reason=expired';\n $found = $jsonobj['redirect'];\n if (strpos($found, $expected) === false) {\n $this->fail(\"Expected $expected, found $found\");\n return 1;\n }\n }", "function resetPassword($data){\n try{\n if(!empty($data)){\n $sql = \"UPDATE users SET password = ? WHERE id = ?\";\n if($query = $this->db->query($sql,$data)){\n return true;\n }\n }\n }catch(Exception $e){\n echo \"Cause error \".$e->getMessege().\"<br>\";\n }\n return false;\n }", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }", "public function testUpdatePasswordOnlyNumbers(): void { }", "public function testUpdatePasswordUnableToLoadUserByUid()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $this->setRequestParameter('uid', 'aaaaaa');\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'aaaaaa');\n\n $oView = oxNew('forgotpwd');\n\n try {\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == 'ERROR_MESSAGE_PASSWORD_LINK_EXPIRED';\n }\n\n $this->assertTrue($blExcp);\n }", "public function testWithInvalidPasswordKo()\n\t{\n\t\ttry {\n\t\t\t$orient = new Orientdb\\Orientdb($this->host, $this->port);\n\t\t\t\n\t\t\t$orient->DBOpen($this->db, $this->type, $this->pass, '');\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t// Check the exception thrown is an instance clientException\n\t\t\t$this->assertEquals($e->GetMessage(), \"User or password not valid for database: 'test'\");\n\t\t}\n\t}", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function testUpdatePasswordCurrentIsIncorrectError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => 'thisisnotthepassword',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function should_return_unprocessable_entity_if_old_password_not_match_actual()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'someMadeUpPassword',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'old_password' => ['The old password is not correct.']\n ]);\n }", "public function testPasswordIsNotValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n \n\n $this->assertDoesNotMatchRegularExpression($pattern,$data);\n\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }", "public function testUpdateMethodGivenFailed()\n {\n $listener = m::mock('\\Orchestra\\Contracts\\Auth\\Listener\\PasswordReset');\n $validator = m::mock('\\Orchestra\\Foundation\\Validations\\AuthenticateUser');\n $password = m::mock('\\Illuminate\\Contracts\\Auth\\PasswordBroker');\n\n $input = $this->getUpdateInput();\n\n $stub = new PasswordBroker($validator, $password);\n\n $password->shouldReceive('reset')->once()\n ->with($input, m::type('Closure'))\n ->andReturnUsing(function ($d, $c) {\n return Password::INVALID_TOKEN;\n });\n $listener->shouldReceive('passwordResetHasFailed')->once()->with(Password::INVALID_TOKEN)->andReturn('reset.failed');\n\n $this->assertEquals('reset.failed', $stub->update($listener, $input));\n }", "public function testInvalidRegisterPassword()\n {\n $this->json('post', '/register', [\n 'email' => '[email protected]',\n 'password' => ''\n ])->seeJson([\n 'status' => 'failed'\n ])->assertResponseStatus(422);\n }", "public function test_users_store_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public function testUpdatePasswordOk()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => $currentPassword,\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHas('success', trans('home.password_changed'));\n }", "function testResendPassword() {\n $this->assertFalse($this->oObject->resendPassword());\n }", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "function update_password()\n {\n }", "public function test_users_store_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function testShouldNotChangePassword()\n {\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'',\n 'password_confirmation'=>''\n );\n\n // Should not call changePassword of the repository\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive( 'changePassword' )\n ->never();\n\n // Should call validate method\n ConfideUser::$app['confide.repository']->shouldReceive('validate')\n ->andReturn( false )\n ->times(4);\n\n ConfideUser::$app['confide.repository']->shouldReceive('model')\n ->andReturn( new ConfideUser )\n ->times(4);\n\n $this->populateUser();\n\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Additional asserts\n // Password should not be changed because it is too short\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'39a',\n 'password_confirmation'=>'39a'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is too long\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'1a2f34g5uj887n',\n 'password_confirmation'=>'1a2f34g5uj887n'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is not confirmed\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'987987',\n 'password_confirmation'=>'562906'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n }", "public function password($data){\n\n\n \t$q = \"SELECT password FROM user_table WHERE password='$data[current_pass]'\";\n\n \t$result = $this->connection->query($q);\n\n \t // check if current password is correct\n\n \tif($result->num_rows >0){\n\n \n \t\t$id = $_SESSION['id'];\n\n\t \t\tif($data['new_pass']==$data['re_pass'])\n\t \t\t{\n\n\t \t\t\tif(strlen($data['new_pass'])<8){\n\n\t\t\t\t$_SESSION['message'] = \"Password must contain 8 letters\";\n\t\t\t\t $_SESSION['msg_type'] = \"danger\";\n\t\t\t\t}else{\n\n\t \t\t$q=\"UPDATE user_table SET password='$data[new_pass]' WHERE id='$id'\";\n\n\t \t\t$result = $this->connection->query($q);\n\n\t \t\t$_SESSION['message'] = \"Successfully changed\";\n\t \t\t$_SESSION['msg_type'] = \"success\";\n\n\t\t \t}\n\t \n\n\t \t}\n\t \telse\n\t \t{\n\n\t \t\t$_SESSION['message'] = \"New password does not match\";\n\t \t\t$_SESSION['msg_type'] = \"warning\";\n \n\t \t}\n\t }\n\t else\n\t {\n\n\t \t$_SESSION['message']= \"Invalid current password\";\n\t \t$_SESSION['msg_type'] = \"danger\";\n \n\t }\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function testChangeMemberPassword()\n {\n }", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "public function test_if_failed_update()\n {\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "public function testMalformedData(){\n $array_test = ['email' => '[email protected]', 'pubid' => 4];\n\n $api = new ApiConnection();\n $dataCheck = [\n 'status' => 402,\n 'message' => \"data is malformed. email only content text and number.\",\n 'data' => []\n ];\n $this->assertEquals($dataCheck, $api->updateAccount($array_test));\n }", "public function testInvalidRegisterPasswordFailed()\n {\n $this->json('post', '/register', [\n 'email' => '[email protected]',\n 'password' => 'testing123',\n 'password_confirmation' => 'testing',\n ])->seeJson([\n 'status' => 'failed'\n ])->assertResponseStatus(422);\n }", "public function should_return_unprocessable_entity_if_old_password_not_provided()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'old_password' => ['The old password field is required.']\n ]);\n }", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "public function testAuthFailRequiredPassword()\n {\n $user = new User(['name' => 'test', 'email' => '[email protected]']);\n $playload = [\n 'email' => $user->email,\n 'password' => ''\n ];\n $this\n ->json('POST', '/api/' . self::API_V1 . '/auth', $playload)\n ->assertStatus(422)\n ->assertJson([\n 'password' => [\"The password field is required.\"]\n ]);\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "function error_password($pass, $pass_bis)\n{\n $error = array();\n if (strlen($pass) < 8 || strlen($pass) >= 255)\n array_push($error, \"error password must be longer than 8 and shorter than 255 \");\n if ($pass !== $pass_bis)\n array_push($error, \"password do not match\");\n if (!preg_match(\"/.*[0-9].*/\", $pass))\n array_push($error, \"password must have at least a number in it\");\n return ($error);\n}", "public function checkPassword($value);", "public function test_users_store_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "public function testLoginValidationFailPassword()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/login', ['email' => 'email'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"password\":[\"The password field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }", "public function test_users_store_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "function validate_resetPwd($data)\n {\n \n $errors=array();\n \n if(trim($data['Users']['password'])==\"\")\n {\n $errors['password'][]= \"Please enter your password\";\n }\n else \n {\n $length=strlen($data['Users']['password']);\n if($length < 6)\n {\n $errors['password'][]= \"Please enter minimum 6 characters\";\n }\n\n \n }\n if(trim($data['Users']['re_password'])==\"\")\n {\n $errors['re_password'][]=\"Please enter your Confirm password\";\n }\n else \n {\n if($data['Users']['password'] != $data['Users']['re_password'])\n {\n $errors['re_password'][] = \"Password does not match\";\n }\n }\n \n return $errors;\n }", "public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "public function testLoginWrongPassword(): void { }", "public function testRegisterValidationFailPassword()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"token\": \"QpwL5tke4Pnpja7X4\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->post('api/user/create-user', ['email' => 'email'], $this->headers)\n ->assertStatus(422)\n ->assertJson(json_decode('{\"errors\":{\"password\":[\"The password field is required.\"]},\"message\":\"The given data was invalid.\"}', true));\n\n }", "public function test_users_store_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->post(route('users.store'), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function test_users_update_long_email_error(){\n $this->signInUser();\n $this->user['email'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "protected function changePassword() {}", "function ll_psw_error_hook( $errors, $update, $user ) { \n\t\tglobal $ll_psw_check_failed;\n\n\t\tif ( '' != $ll_psw_check_failed ) { \n\t\t $errors->add( 'pass', __( '<strong>ERROR:</strong> ' . $ll_psw_check_failed ) );\n\t\t}\n\n\t\tif ( count( $errors->errors ) <= 0 && !empty( $user->ID ) ) { \n\t\t $this->save_psw_hash( $user );\n\t\t delete_user_meta( $user->ID, 'll_force_password_change_now');\n\t\t}\n\n\t}", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function testUserCanNotLoginWithIncorrectPassword()\n {\n $user = factory(User::class)->create();\n $login = factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => $login->email,\n 'password' => 'wrong_pass',\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function should_return_unprocessable_entity_if_new_password_not_provided()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'new_password' => ['The new password field is required.']\n ]);\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function test_users_update_bad_email_error(){\n $this->signInUser();\n $this->user['email'] = 'email';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['email']);\n }", "public function testPasswordSetVerify()\n {\n $password = \"testPasswordForTesting\";\n $user = new User();\n\n // Set our password\n $user->setPassword($password);\n\n // Verify that our password works\n $this->assertTrue($user->verifyPassword($password));\n\n // Verify that an invalid password doesn't work\n $password .= \"ThisIsNowInvalid\";\n $this->assertFalse($user->verifyPassword($password));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "public static function changePassword($data)\n {\n $msgValidate = [];\n $rule = [\n 'password' => 'required|confirmed|min:6'\n ];\n $validateRs = Frontend::validateForm($data, $rule, $msgValidate);\n if ($validateRs['rs'] == System::FAIL) {\n return $validateRs;\n } else {\n $user = Auth::guard('users')->user();\n $user->update(['password' => Hash::make($data['password'])]);\n Session::flash(System::FLASH_SUCCESS, STheme::lang('lang.msg.change_password_success'));\n return [\n 'rs'=>System::SUCCESS,\n 'msg'=>'',\n 'redirect_url'=>'/user/change-password'\n ];\n }\n }", "public function testRegistrationPasswordNotMatch()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234qw')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function isUpdateValid($data, $user)\n {\n $valid = parent::isValid($data);\n\n $hasErrors = false;\n if (!empty($data[User::INPUT_PASSWORD_OLD])) {\n /**\n * Something was typed in the old password field\n */\n if ($user->{User::COLUMN_PASSWORD} != md5($data[User::INPUT_PASSWORD_OLD])) {\n /**\n * Old password is incorrect, stop right here\n */\n $this->getElement(User::INPUT_PASSWORD_OLD)->clearErrorMessages()->addError('wrongPassword');\n $hasErrors = true;\n } else {\n /**\n * Old password is correct, check for updates in new password fields\n */\n if ($data[User::INPUT_PASSWORD_CONFIRM] !== $data[User::INPUT_PASSWORD]) {\n $this->getElement(User::INPUT_PASSWORD)->clearErrorMessages();\n $this->getElement(User::INPUT_PASSWORD_CONFIRM)->clearErrorMessages()\n ->addError(Zend_Validate_Identical::NOT_SAME);\n $hasErrors = true;\n }\n }\n } else {\n /**\n * Nothing was typed in the old password field\n */\n if (!empty($data[User::INPUT_PASSWORD_CONFIRM]) || !empty($data[User::INPUT_PASSWORD])) {\n /**\n * New passwords were given, but we need the old one !\n */\n $this->getElement(User::INPUT_PASSWORD_OLD)->clearErrorMessages()->addError('isEmpty');\n $hasErrors = true;\n }\n }\n\n $valid = $valid && !$hasErrors;\n return $valid;\n }", "public function testUpdatePasswordOnlyLowerCase(): void { }", "public function testEnterIncorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => '',\n 'password' => '',\n '_token' => csrf_token()\n ]);\n \n $this->assertNotEquals(200, $response->getStatusCode());\n\n $response = $this->call('POST', '/admin/signin', [\n 'email' => '[email protected]',\n 'password' => '123',\n '_token' => csrf_token()\n ]);\n $this->assertEquals(422, $response->decodeResponseJson()['status']);\n\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "public function test_create_user_invalid_password()\n {\n\n $response = $this->json('POST', '/user_create',\n ['name' => $this->name, \n 'email' => $this->email,\n 'password' => '1234']);\n $response\n ->assertStatus(200)\n ->assertExactJson([\n $this->all_message => $this->user_create_invalid_password,\n ]);\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function testPlainPassword()\n {\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setPlainPassword('dd');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n\n $user->setPlainPassword($this->createString(128));\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n }", "function changePassword($data){\r\n if(!empty($this->user_id) || $this->matchPasswordForUsername($data['userName'],$data['code'])){\r\n if(!empty($this->user_id)){\r\n $data['userName'] = $this->user_profile['username'];\r\n }\r\n if($data['newpwd']==$data['newpwdagn']){\r\n\r\n\t\t\t// check if the password is strong\r\n\t\t\tif(!$this->isPasswordStrong($data['newpwd'])){\r\n\t\t\t\t$this->setStdError('weak_password');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n // if the password is one of last n passwords\r\n if($this->isOneOfLastNPasswords($data['newpwd'])){\r\n $this->setError('Your password is one of last '.$this->app_config['password_no_repeat'].' passwords.');\r\n return false;\r\n }\r\n\r\n global $pdo;\r\n try{\r\n $update=$pdo->prepare(\"UPDATE users SET `password`=?, `status` = 1 WHERE id= ?\");\r\n $userid = $this->getUserIdFromUsername($data['userName']);\r\n $update->execute(array($this->getPasswordHashOfUser($data['userName'],$data['newpwd']), $userid));\r\n //update the password log\r\n if(empty($this->user_id)){\r\n $this->user_id = $userid;\r\n }\r\n $this->updatePasswordLog($this->getPasswordHashOfUser($data['userName'],$data['newpwd']));\r\n\r\n $this->updatePasswordResetQueue($userid);\r\n\t\t\t\t\t$log = debug_backtrace();\r\n\t\t\t\t\t$this->createActionLog($log);\r\n return true;\r\n }\r\n catch(PDOException $e){\r\n $this->setError($e->getMessage());\r\n return false;\r\n }\r\n\r\n }else{\r\n $this->setError(\"Passwords entered do not match. Please check and type again.\");\r\n return false;\r\n }\r\n }\r\n else{\r\n $this->setError(\"Password was not reset.\");\r\n return false;\r\n }\r\n }", "function testGuessPassword() {\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pass'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.psword'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.pwd'), 'password');\n\t\t$this->assertEqual($this->helper->__guessInputType('Test.password'), 'password');\n\t}" ]
[ "0.80951166", "0.7657526", "0.75642294", "0.7556839", "0.75410205", "0.74994135", "0.74828386", "0.727857", "0.7263414", "0.72617084", "0.7240414", "0.72130615", "0.72080964", "0.71844363", "0.7133836", "0.7106586", "0.7089023", "0.70880187", "0.70252365", "0.69993776", "0.69908744", "0.6981872", "0.69611514", "0.6960606", "0.69488335", "0.69330764", "0.69276327", "0.6909507", "0.6893749", "0.6871641", "0.6859076", "0.6854524", "0.68476325", "0.6820545", "0.6805594", "0.68002045", "0.67923284", "0.6750041", "0.674837", "0.6740321", "0.6739865", "0.6735303", "0.67299575", "0.6726699", "0.6710998", "0.66901493", "0.6685693", "0.66576695", "0.6641925", "0.66336405", "0.6631066", "0.6608571", "0.66064936", "0.6593973", "0.6587156", "0.65749", "0.65739906", "0.65558267", "0.6553288", "0.655126", "0.65408766", "0.65362424", "0.6534655", "0.65323377", "0.6531339", "0.65241027", "0.6519806", "0.65186167", "0.65013254", "0.64980716", "0.64970076", "0.64961636", "0.64919215", "0.64854306", "0.64739347", "0.6469786", "0.6455895", "0.6453334", "0.6438559", "0.6430938", "0.6428759", "0.6420672", "0.6416525", "0.63984704", "0.63958526", "0.639531", "0.6386338", "0.6370412", "0.6364013", "0.63486916", "0.6348286", "0.634658", "0.6343853", "0.6339621", "0.6336277", "0.6333106", "0.6332743", "0.63288796", "0.6327817", "0.6316259" ]
0.76093113
2
Test that a nonlogged user can't update a password.
public function testNonLoggedUserUpdatePasswordRedirectsToLogin() { $response = $this->call('POST', $this->accountChangePasswordPostUrl); // Asserts $response->assertStatus(302); $response->assertRedirect('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePasswordNotGiven(): void { }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function testUserEditNonMatchingPasswords()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaa')\n ->type('last_name', 'aaaa')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcder1234')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function testverifyIfPasswordIsFalse()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"bill\",\"cool\");\n $this->assertFalse($state);\n }", "public function test_users_update_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasNoErrors(['password']);\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function testUpdatePasswordsDontMatch(): void { }", "function testActivatePasswordFail() {\r\n $this->User = new User();\r\n \r\n //get the current password-hash\r\n \t$expected = $this->User->field('password', array('id'=>'1'));\r\n \t\r\n \t//activate with wrong key - should fail\r\n $result = $this->User->activatePassword('wrongkey');\r\n $this->assertFalse($result);\r\n \r\n //check if the password in the database has changed\r\n \t$result = $this->User->field('password', array('id'=>'1'));\r\n \t$this->assertEqual($result, $expected);\r\n }", "function can_change_password() {\n return false;\n }", "function can_change_password() {\n\t\treturn false;\n\t}", "public function testUpdateCPasswordNotGiven(): void { }", "public function testUserCanNotLoginWithIncorrectPassword()\n {\n $user = factory(User::class)->create();\n $login = factory(Login::class)->create([\n 'user_id' => $user->id,\n 'password' => bcrypt($password = 'boss'),\n ]);\n\n $response = $this->from(route('login'))->post(route('login'), [\n 'email' => $login->email,\n 'password' => 'wrong_pass',\n ]);\n\n $response->assertRedirect(route('login'));\n $response->assertSessionHasErrors('email');\n $this->assertGuest();\n }", "public function test_users_update_valid_no_password_no_affect(){\n $this->signInUser();\n $user = User::find(5);\n unset($this->user['password']);\n unset($this->user['password_confirmation']);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'password' => $user->password\n ]);\n }", "public function testUpdatePasswordUnableToLoadUserByUid()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $this->setRequestParameter('uid', 'aaaaaa');\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'aaaaaa');\n\n $oView = oxNew('forgotpwd');\n\n try {\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == 'ERROR_MESSAGE_PASSWORD_LINK_EXPIRED';\n }\n\n $this->assertTrue($blExcp);\n }", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "public function can_change_password() {\n return false;\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function test_users_update_long_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function testRegistrationPasswordNotMatch()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'abcd1234')\n ->type('password_confirmation', 'abcd1234qw')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password confirmation does not match.')\n ->assertSee('The password confirmation does not match.');\n });\n }", "public function testShouldNotChangePassword()\n {\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'',\n 'password_confirmation'=>''\n );\n\n // Should not call changePassword of the repository\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive( 'changePassword' )\n ->never();\n\n // Should call validate method\n ConfideUser::$app['confide.repository']->shouldReceive('validate')\n ->andReturn( false )\n ->times(4);\n\n ConfideUser::$app['confide.repository']->shouldReceive('model')\n ->andReturn( new ConfideUser )\n ->times(4);\n\n $this->populateUser();\n\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Additional asserts\n // Password should not be changed because it is too short\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'39a',\n 'password_confirmation'=>'39a'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is too long\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'1a2f34g5uj887n',\n 'password_confirmation'=>'1a2f34g5uj887n'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n\n // Password should not be changed because it is not confirmed\n $credentials = array(\n 'email'=>'[email protected]',\n 'password'=>'987987',\n 'password_confirmation'=>'562906'\n );\n $this->assertFalse( $this->confide_user->resetPassword( $credentials ) );\n }", "public function testRegistrationPasswordsDontMatch(): void { }", "public function test_users_update_short_password_error(){\n $this->signInUser();\n $this->user['password'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_users_update_long_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 256);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "function testResendPassword() {\n $this->assertFalse($this->oObject->resendPassword());\n }", "public function testUpdatePasswordValidationError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = '123';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => '123456789',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function testLoginPassword(){\r\n\t\t\t$testLogin = [\r\n\t\t\t\t'username' => 'Right',\r\n\t\t\t\t'password' => ''\r\n\t\t\t];\r\n\t\t\t$validLogin = loginTest($testLogin);\r\n\t\t\t$this->assertFalse($validLogin);\r\n\t\t}", "public function testLoginActionWithBadPassword()\n {\n $data = [\n '_username' => 'user1',\n '_password' => 'badpassword',\n ];\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/login');\n $form = $crawler->filter('form[action$=\"login_check\"].form-horizontal button[type=\"submit\"]')->form();\n $client->submit($form, $data);\n $crawler = $client->followRedirect();\n $this->assertSame('The presented password is invalid.', $crawler->filter('div.alert.alert-error')->text());\n $security = $client->getContainer()->get('security.context');\n $this->assertFalse($security->isGranted('ROLE_USER'));\n }", "public function testExpiredPassword()\n {\n pdo_query(\"UPDATE password SET date='2011-07-22 15:37:57' WHERE userid=$this->UserId\");\n\n // Make sure we get redirected when visiting a non-Angular page.\n $this->login('jane@smith', '12345');\n $content = $this->get($this->url . '/upgrade.php');\n if (strpos($content, 'Your password has expired') === false) {\n $this->fail(\"'Your password has expired' not found when expected\");\n return 1;\n }\n\n // Make sure API endpoints tell the controller to redirect.\n $content = $this->connect($this->url . '/api/v1/index.php?project=InsightExample');\n $jsonobj = json_decode($content, true);\n if (!array_key_exists('redirect', $jsonobj)) {\n $this->fail(\"No 'redirect' key found when expected\");\n return 1;\n }\n $expected = 'editUser.php?reason=expired';\n $found = $jsonobj['redirect'];\n if (strpos($found, $expected) === false) {\n $this->fail(\"Expected $expected, found $found\");\n return 1;\n }\n }", "public function setPasswordcheck($password)\n {\n // Do nothing\n }", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function test_users_update_unconfirmed_password_error(){\n $this->signInUser();\n $this->user['password'] = 'Different password';\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password']);\n }", "public function test_users_update_short_confirmed_password_error(){\n $this->signInUser();\n $this->user['password_confirmation'] = str_repeat('A', 2);\n $response = $this->patch(route('users.update', ['user' => 5]), $this->user); \n $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function loggingWithWrongPasswordTest(FunctionalTester $I){\n HelperController::common_login($I, $this->name, $this->email, $this->password);\n HelperController::logout($I);\n $I->fillField('email', $this->email);\n $I->fillField('password', 'wrong_password');\n $I->click( '#login_form_button' );\n $I->see( trans('auth.failed') );\n }", "public function should_return_unprocessable_entity_if_old_password_not_match_actual()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'someMadeUpPassword',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'old_password' => ['The old password is not correct.']\n ]);\n }", "public function testForgotPasswordFailLoggedin()\n {\n $this->session(['Auth.User' => [\n 'id' => 1,\n 'role_id' => 1,\n ]]);\n\n $this->get('/users/forgotPassword');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n }", "public function testForgotPasswordFailNonActive()\n {\n $user = $this->Users->get(1);\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $data = [\n 'email' => $user->get('email'),\n ];\n\n $this->assertEmpty($user->get('activation_key'));\n\n $this->post('/users/forgotPassword', $data);\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n\n $user = $this->Users->get(1);\n\n $this->assertEmpty($user->get('activation_key'));\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function testUpdatePasswordProblemsWithPass()\n {\n // overriding utility function\n oxTestModules::addFunction(\"oxUtilsView\", \"addErrorToDisplay\", \"{ throw new Exception( \\$aA[0] ); }\");\n\n $oView = oxNew('forgotpwd');\n\n // no pass\n $this->setRequestParameter('password_new', null);\n $this->setRequestParameter('password_new_confirm', null);\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS');\n }\n $this->assertTrue($blExcp);\n\n // pass does not match\n $this->setRequestParameter('password_new', 'aaaaaa');\n $this->setRequestParameter('password_new_confirm', 'bbbbbb');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH');\n }\n $this->assertTrue($blExcp);\n\n // pass too short\n $this->setRequestParameter('password_new', 'aaa');\n $this->setRequestParameter('password_new_confirm', 'aaa');\n try {\n $blExcp = false;\n $oView->updatePassword();\n } catch (Exception $oExcp) {\n $blExcp = $oExcp->getMessage() == oxRegistry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT');\n }\n\n $this->assertTrue($blExcp);\n }", "public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }", "function allowPasswordChange() {\n return false;\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->postScriptumServer->adminSetServerPassword('secret'));\n }", "function allowPasswordChange() {\r\n\t\treturn true;\r\n\t}", "public function testAuthFailWithInvalidPassword()\n {\n $user = new User(['name' => 'test', 'email' => '[email protected]']);\n $playload = [\n 'email' => $user->email,\n 'password' => 'fg'\n ];\n $this\n ->json('POST', '/api/' . self::API_V1 . '/auth', $playload)\n ->assertStatus(422)\n ->assertJson([\n 'password' => [\"The password must be at least 3 characters.\"]\n ]);\n }", "public function should_return_unprocessable_entity_if_new_password_not_confirmed()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'new_password' => ['The new password confirmation does not match.']\n ]);\n }", "public function testAuthFailRequiredPassword()\n {\n $user = new User(['name' => 'test', 'email' => '[email protected]']);\n $playload = [\n 'email' => $user->email,\n 'password' => ''\n ];\n $this\n ->json('POST', '/api/' . self::API_V1 . '/auth', $playload)\n ->assertStatus(422)\n ->assertJson([\n 'password' => [\"The password field is required.\"]\n ]);\n }", "public function should_return_unprocessable_entity_if_old_password_not_provided()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'old_password' => ['The old password field is required.']\n ]);\n }", "public function testJoinPrivateRoomWithWrongPassword() {\n $room = $this->createRoomWithPassword('Test Password');\n $user = factory(User::class)->create();\n\n $response = $this->actingAs($user)->withHeaders([\n 'Authorization' => 'Bearer '.$user->api_token\n ])->json('POST', '/api/room/'.$room->id.'/membership', [\n 'name' => 'Test Room',\n 'password' => 'Wrong Password'\n ]);\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function modifpassword($user,$passwd){\n \n }", "public function should_return_unprocessable_entity_if_new_password_not_provided()\n {\n factory(User::class)->create();\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::UNPROCESSABLE_ENTITY);\n $this->seeJsonContains([\n 'new_password' => ['The new password field is required.']\n ]);\n }", "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "public function test_admin_set_password()\n {\n $this->assertTrue($this->btwServer->adminSetServerPassword('secret'));\n }", "function setPassword($password) {\n return false;\n }", "public function allowPasswordChange()\n {\n return false;\n }", "protected function changePassword() {}", "function userCanSetDbPassword(){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function isPasswordChangeEnabled();", "function mysql_auth_can_change_password($username = \"\")\n{\n /*\n * By default allow the password to be modified, unless the existing\n * user is explicitly prohibited to do so.\n */\n\n if (empty($username) || !mysql_auth_user_exists($username))\n {\n return 1;\n } else {\n return dbFetchCell(\"SELECT `can_modify_passwd` FROM `users` WHERE `username` = ?\", array($username));\n }\n}", "public function test_users_store_no_password_error(){\n $this->signInUser();\n unset($this->user['password']);\n $response = $this->post(route('users.store', $this->user)); $response->assertSessionHasErrors(['password']);\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function testChangeMemberPassword()\n {\n }", "public function testLoginWrongPassword(): void { }", "public function testChangeUser_noRedirect_setPasswordWithSpecChars()\n {\n $this->setExpectedException('oxException', 'Change user test');\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('invadr', null);\n\n $oSession = $this->getMock(\\OxidEsales\\Eshop\\Core\\Session::class, array('checkSessionChallenge'));\n $oSession->expects($this->once())->method('checkSessionChallenge')->will($this->returnValue(true));\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('changeUserData'));\n $oUser->oxuser__oxusername = new oxField('test_username', oxField::T_RAW);\n $oUser->oxuser__oxpassword = new oxField($sPass, oxField::T_RAW);\n $oUser->expects($this->once())\n ->method('changeUserData')\n ->with($this->equalTo('test_username'), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(null), $this->equalTo(null))\n ->will($this->throwException(new oxException('Change user test')));\n\n $oView = $this->getMock($this->getProxyClassName('oxcmp_user'), array('_getDelAddressData', 'getUser', 'getSession'));\n $oView->expects($this->once())->method('getUser')->will($this->returnValue($oUser));\n $oView->expects($this->once())->method('getSession')->will($this->returnValue($oSession));\n $oView->UNITchangeUser_noRedirect();\n }", "public function should_return_not_found_if_user_not_in_database()\n {\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secret123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::NOT_FOUND);\n $this->seeJsonContains(['message' => 'The user with id: 1, was not found']);\n }", "function update_password()\n {\n }", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function checkPassword($value);", "public function testWithInvalidPasswordKo()\n\t{\n\t\ttry {\n\t\t\t$orient = new Orientdb\\Orientdb($this->host, $this->port);\n\t\t\t\n\t\t\t$orient->DBOpen($this->db, $this->type, $this->pass, '');\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t// Check the exception thrown is an instance clientException\n\t\t\t$this->assertEquals($e->GetMessage(), \"User or password not valid for database: 'test'\");\n\t\t}\n\t}", "public function testTwoFactorCanBeDisabledOnAccount()\n {\n Carbon::setTestNow(Carbon::now());\n\n /** @var \\Pterodactyl\\Models\\User $user */\n $user = User::factory()->create(['use_totp' => true]);\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'invalid',\n ]);\n\n $response->assertStatus(Response::HTTP_BAD_REQUEST);\n $response->assertJsonPath('errors.0.code', 'BadRequestHttpException');\n $response->assertJsonPath('errors.0.detail', 'The password provided was not valid.');\n\n $response = $this->actingAs($user)->deleteJson('/api/client/account/two-factor', [\n 'password' => 'password',\n ]);\n\n $response->assertStatus(Response::HTTP_NO_CONTENT);\n\n $user = $user->refresh();\n $this->assertFalse($user->use_totp);\n $this->assertNotNull($user->totp_authenticated_at);\n $this->assertSame(Carbon::now()->toIso8601String(), $user->totp_authenticated_at->toIso8601String());\n }", "public function disable_testValidateTryWithWrongSecret()\n {\n $this->callMigration(); \n \n $credentials = [ \n\n 'email' => '[email protected]',\n 'password' => 'failed'\n ];\n \n $this->assertFalse(\\Auth::validate($credentials)); \n }", "public function testPasswordSetVerify()\n {\n $password = \"testPasswordForTesting\";\n $user = new User();\n\n // Set our password\n $user->setPassword($password);\n\n // Verify that our password works\n $this->assertTrue($user->verifyPassword($password));\n\n // Verify that an invalid password doesn't work\n $password .= \"ThisIsNowInvalid\";\n $this->assertFalse($user->verifyPassword($password));\n }", "public function test_users_store_no_confirmed_password_error(){\n $this->signInUser();\n unset($this->user['password_confirmation']);\n $response = $this->post(route('users.store', $this->user)); $response->assertSessionHasErrors(['password_confirmation']);\n }", "public function testNonLoggedUserVisitsChangePasswordPageRedirectsToLogin()\n {\n // Request\n $response = $this->call('GET', $this->accountChangePasswordPageUrl);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect('login');\n }", "public function testInvalidCredentialsCantLogin()\n {\n $this->browse( function( Browser $browser ){\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'wrongpassword' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }", "public function testUpdatePassword_passwordSpecChars()\n {\n $oRealInputValidator = \\OxidEsales\\Eshop\\Core\\Registry::getInputValidator();\n\n $sPass = '&quot;&#34;\"o?p[]XfdKvA=#3K8tQ%';\n $this->setRequestParameter('password_new', $sPass);\n $this->setRequestParameter('password_new_confirm', $sPass);\n\n $oUser = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\User::class, array('checkPassword'));\n oxTestModules::addModuleObject('oxuser', $oUser);\n\n $oInputValidator = $this->getMock('oxInputValidator');\n $oInputValidator->expects($this->once())->method('checkPassword')->with($this->equalTo($oUser), $this->equalTo($sPass), $this->equalTo($sPass), $this->equalTo(true))->will($this->returnValue(new oxException()));\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oInputValidator);\n\n $oView = oxNew('ForgotPwd');\n $oView->updatePassword();\n\n \\OxidEsales\\Eshop\\Core\\Registry::set(\\OxidEsales\\Eshop\\Core\\InputValidator::class, $oRealInputValidator);\n }", "public function test_users_update_admin_leads_403(){\n $this->signInUser();\n $response = $this->patch(route('users.update', ['user' => 1]), $this->user); \n $response->assertStatus(403);\n }", "public function testCorrectCredentialsButNoAdminRole()\n {\n $this->browse( function( Browser $browser ) {\n $browser->visit( '/admin' );\n $browser->type( 'email', '[email protected]' );\n $browser->type( 'password', 'password' );\n $browser->click( '.button.is-primary' );\n $browser->assertSee( 'Your username or password were incorrect' );\n });\n }", "public function test_update_user_as_unauthorized_admin()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->put(route('api.users.update', [$user2->id]), [\n 'name' => 'My third brand new user',\n ]);\n\n $response->assertStatus(403);\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "public function ask_password()\n {\n factory(User::class)->create(['username' => 'testuser']);\n\n $cmd = $this->artisan('user:password testuser');\n $cmd->expectsQuestion('Password', 'testing');\n $cmd->assertExitCode(0);\n\n $cmd->execute();\n\n $user = User::query()->where('username', 'testuser')->first();\n $this->assertTrue(Hash::check('testing', $user->password));\n }", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "function allowPasswordChange()\n\t{\n\t\tglobal $ilUser, $ilSetting;\n\t\t\n\t\t\n\t\treturn ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));\n\t\t\n\t\t// Moved to ilAuthUtils\n\t\t\n\t\t// do nothing if auth mode is not local database\n\t\tif ($ilUser->getAuthMode(true) != AUTH_LOCAL &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get(\"cas_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get(\"shib_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get(\"soap_auth_allow_local\")) &&\n\t\t\t($ilUser->getAuthMode(true) != AUTH_OPENID)\n\t\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->userSettingVisible('password') ||\n\t\t\t$this->ilias->getSetting('usr_settings_disable_password'))\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\n\t\treturn true;\n\t}", "public function setPassword($value);", "function allowPasswordChange() {\n global $shib_pretend;\n\n return $shib_pretend;\n\n }", "public function testResetPasswordWrongKey()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $user->set('active', 0);\n\n $this->Users->save($user);\n\n $this->assertEquals(0, $user->active);\n\n $this->get('/users/resetPassword/' . $user->email . '/');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect();\n\n $this->get('/users/resetPassword/' . $user->email . '/THISISTHEWRONGKEY');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect();\n }", "function can_change_password() {\n return !empty($this->config->changepasswordurl);\n }", "function reset_user_passwd($user_id) {\r\n\r\n //set the new password\r\n $new_passwd = \"newpasswod\";\r\n \r\n if ($new_passwd == false) {\r\n throw new Exception ('Could not generate the new password.');\r\n }\r\n \r\n //add numbers to the new passwd to increase the securtiy\r\n $rand_number = rand(0, 999);\r\n $new_passwd . $rand_number;\r\n \r\n //update the new passwd with db\r\n $conn = db_connect();\r\n\r\n $result = $conn->query(\"update users set user_passwd = sha1('\".$new_passwd.\"') where user_id = '\".$user_id.\"'\");\r\n if (!$result) {\r\n throw new Exception ('Could not reset the password.');\r\n }\r\n else {\r\n return true; \r\n }\r\n\r\n }", "public function testSetAndGetPassword()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Password\r\n $testObj->setPassword('myTestPassword');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that Password field was updated\r\n $this->assertEquals('myTestPassword', $testObj->getPassword());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'Password');\r\n }", "function enforce_temporary_passwords($member)\n{\n if ((get_forum_type() == 'cns') && (running_script('index')) && ($member != db_get_first_id()) && (!$GLOBALS['IS_ACTUALLY_ADMIN']) && ($GLOBALS['FORUM_DRIVER']->get_member_row_field($member, 'm_password_compat_scheme') == 'temporary') && (get_page_name() != 'lost_password') && ((get_page_name() != 'members') || (get_param_string('type', 'browse') != 'view'))) {\n require_code('users_active_actions');\n _enforce_temporary_passwords($member);\n }\n}", "public function changePasswordTest(FunctionalTester $I){\n $I->amOnPage( route('change_password') );\n $I->seeResponseCodeIs(403);\n $user = HelperController::common_login($I, $this->name, $this->email, $this->password);\n\n $current_password = $user->password;\n\n $I->amOnPage( route('change_password') );\n # blank field test\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.required', ['attribute' => 'current password']) );\n $I->see( trans('validation.required', ['attribute' => 'password']) );\n\n # fill wrong password, see min password requirements and wrong password\n $I->fillField('current_password', '12345');\n\n $I->click('#change_password_button');\n $I->see( trans('validation.min.string', ['attribute' => 'current password', 'min' => '6']) );\n $I->see( trans('validation.current_password') );\n\n # now test password confirmation attribute\n\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.confirmed', ['attribute' => 'password']) );\n $I->dontSee( trans('validation.current_password') );\n\n # test new password strength requirements\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', 'weakp');\n $I->fillField('password_confirmation', 'weakp');\n $I->click('#change_password_button');\n\n $I->assertEquals( User::find($user->id)->password, $current_password ); # check that no change accoured\n $I->see( trans('validation.min.string', ['attribute' => 'password', 'min' => '6']) );\n $I->see('The password must be at least 6 characters.');\n \n # Test proper password change\n\n $I->fillField('current_password', $this->password);\n $I->fillField('password', $this->new_password);\n $I->fillField('password_confirmation', $this->new_password);\n $I->click('#change_password_button');\n\n # check that no change accoured\n $I->see( trans('text.password_change_email_body', ['name' => Auth::user()->name]) );\n\n $I->assertTrue( Hash::check( $this->new_password , User::find($user->id)->password ));\n\n # Test email confirmation\n\n $log_path = storage_path('logs/laravel.log');\n \n $date = date('Y-m-d G:i:s') . '.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n.*\\n\\n.*';\n $match = preg_grep( \"/$date/\" , file($log_path));\n \n # assert single entry was found\n\n $cmd = \"tail \" . storage_path('logs/laravel.log') .\" | grep 'Hello, \" . $this->name . \", your password has been'\";\n $output = system($cmd);\n $I->assertEquals( trans('text.password_change_email_body', ['name' => $this->name]), $output );\n }", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "public function should_return_ok_after_user_changed_password()\n {\n factory(User::class)->create();\n $this->expectsEvents(PasswordChanged::class);\n\n $this->put('/v1/users/1/password', [\n 'old_password' => 'secrete123',\n 'new_password' => 'new123password',\n 'new_password_confirmation' => 'new123password'\n ]);\n\n $this->seeStatusCode(HttpStatus::OK);\n $this->seeJsonContains(['message' => 'The password has been changed successfully.']);\n\n // Just verifying if old password has been invalidated\n $user = User::find(1);\n $this->assertFalse(Hash::check('secrete123', $user->password));\n $this->assertTrue(Hash::check('new123password', $user->password));\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function testWrongLoginNotWorks()\n {\n // Create a user\n $user = User::create([\n 'password' => Hash::make('password1234'),\n 'email' => '[email protected]',\n 'name' => 'John Doe',\n ]);\n\n // Create room with post\n $response = $this->from('/login')->post('/login', [\n 'email' => '[email protected]',\n 'password' => 'not-the-password',\n ]);\n\n // Redirect back\n $response->assertStatus(302);\n $response->assertRedirect('/login');\n\n // Error: These credentials do not match our records.\n $response->assertSessionHasErrors();\n\n $this->assertGuest();\n }", "public function testUpdatePasswordCurrentIsIncorrectError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = 'abcdef123456';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => 'thisisnotthepassword',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "function testPasswordGet()\n {\n $this->assertEqual($this->referenceHash, auth::getPassword(1), \"Testing password retrieval.\");\n }", "public function setPassword($newPassword);", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "protected function checkInstallToolPasswordNotSet() {}" ]
[ "0.7796244", "0.76890045", "0.764302", "0.7574587", "0.7435431", "0.7415566", "0.73423636", "0.7340406", "0.7256946", "0.72518325", "0.7232729", "0.7171286", "0.7167536", "0.7141771", "0.7140488", "0.7090425", "0.7072432", "0.7060646", "0.70548844", "0.7013561", "0.7008948", "0.69969195", "0.6961566", "0.6933787", "0.69251376", "0.6917338", "0.6915922", "0.6908682", "0.69041723", "0.687818", "0.6824138", "0.6816061", "0.6814403", "0.67906946", "0.67705446", "0.6768001", "0.67664194", "0.67634946", "0.6760912", "0.671918", "0.6709125", "0.6702617", "0.67017627", "0.6685395", "0.6680245", "0.66489714", "0.6648934", "0.66428626", "0.6634545", "0.6630373", "0.66214615", "0.66211337", "0.66211337", "0.66131467", "0.66115797", "0.6598174", "0.6587602", "0.6582925", "0.65716136", "0.65430707", "0.65350366", "0.65240836", "0.65227425", "0.6519685", "0.6513843", "0.65129447", "0.6507051", "0.6503086", "0.6497606", "0.64897794", "0.6483382", "0.64599836", "0.6456854", "0.64498514", "0.6443699", "0.6441537", "0.64371395", "0.64214575", "0.6420857", "0.64168155", "0.6408414", "0.6405455", "0.6402987", "0.6394182", "0.6387673", "0.63866657", "0.6381946", "0.63810706", "0.6380457", "0.6378627", "0.6363164", "0.63605183", "0.6354638", "0.6349031", "0.63307", "0.63243115", "0.6309152", "0.63036513", "0.62966186", "0.6296186" ]
0.7112312
15
iterator.php Require php 7.1
function dumpAll(iterable $items) { foreach ($items as $item) { var_dump($item); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function iterator();", "public function getIterator() {}", "public function getIterator() {}", "abstract public function getIterator();", "public function getIterator(): Iterator {}", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator()\n {\n throw new NotImplementedException(\"This resource does not support iteration\");\n }", "public function getIterator()\n {\n }", "public function getIterator(): \\Traversable;", "public function getIterator(): \\Traversable;", "public function executeIterator();", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->getPackages());\n\t}", "function getIterator()\n {\n return new \\ArrayIterator($this->items);\n }", "public function all(): \\Iterator;", "function getIterator() {\r\n\t\treturn new \\ArrayIterator($this->data);\r\n\t}", "public function testIterator()\n {\n foreach ($this->pool as $code => $class) {\n $this->assertEquals($this->pool[$code], $class);\n }\n }", "public function getEnumerator() { }", "public function next();", "public function next();", "public function next();", "public function next();", "public function testIter()\n {\n $reader = new \\ArrayIterator($this->allRandom);\n $reader = new Core\\SortReader($reader, 'num');\n $this->assertEquals($this->numSorted, iterator_to_array($reader));\n return;\n }", "public function getIterator() { return new mfp_iterator($this->list); }", "public function getTrueIterator();", "public function getIterator()\n {\n return new \\ArrayIterator([$this->contents]);\n }", "#[\\ReturnTypeWillChange]\n public function getIterator()\n {\n }", "#[\\ReturnTypeWillChange]\n public function getIterator()\n {\n }", "abstract protected function getIteratorArray();", "abstract protected function getTemplateFilenameIterator(): \\Traversable;", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function next() {}", "public function getIterator() {\n return new \\ArrayIterator($this->cast);\n }", "public function provideTestRepeatedIteratorUse()\n {\n AutoloaderTestHelper::deleteDirectory(\"testRepeatedIteratorUse\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n\n $alTestHelper->makeClass(\"A\", \"testRepeatedIteratorUse\");\n $alTestHelper->makeClass(\"B\", \"testRepeatedIteratorUse\");\n $alTestHelper->makeClass(\"C\", \"testRepeatedIteratorUse/C\");\n $alTestHelper->makeClass(\"D\", \"testRepeatedIteratorUse/D\");\n $alTestHelper->makeClass(\"E\", \"testRepeatedIteratorUse/D\");\n $alTestHelper->makeClass(\"F\", \"testRepeatedIteratorUse/D\");\n $alTestHelper->makeClass(\"G\", \"testRepeatedIteratorUse/D/G\");\n $alTestHelper->makeClass(\"H\", \"testRepeatedIteratorUse\");\n\n $autoloader = new Autoloader(\n AutoloaderTestHelper::getClassDirectory(\"testRepeatedIteratorUse\")\n );\n\n\n $simpleIterator = new AutoloaderFileIterator_Simple();\n $simpleIterator->setAutoloader($autoloader);\n\n $simpleCachedIterator = new AutoloaderFileIterator_SimpleCached();\n $simpleCachedIterator->setAutoloader($autoloader);\n\n $priorityIterator = new AutoloaderFileIterator_PriorityList();\n $priorityIterator->setAutoloader($autoloader);\n\n return array(\n array($simpleIterator, 1),\n array($simpleIterator, 3),\n array($simpleIterator, 0),\n array($simpleIterator),\n array($simpleIterator, 1),\n array($simpleIterator, 3),\n array($simpleIterator, 0),\n array($simpleCachedIterator, 1),\n array($simpleCachedIterator, 3),\n array($simpleCachedIterator, 0),\n array($simpleCachedIterator),\n array($simpleCachedIterator, 1),\n array($simpleCachedIterator, 3),\n array($simpleCachedIterator, 0),\n array($priorityIterator, 1),\n array($priorityIterator, 3),\n array($priorityIterator, 0),\n array($priorityIterator),\n array($priorityIterator, 1),\n array($priorityIterator, 3),\n array($priorityIterator, 0)\n );\n }", "public function testGetIterator()\n\t{\n\t\t$iterator = $this->instance->getIterator();\n\n\t\t$this->assertInstanceOf('ArrayIterator', $iterator);\n\n\t\t$this->assertEquals(\n\t\t\tDomHelper::minify('<option>foo</option>'),\n\t\t\tDomHelper::minify($iterator[0])\n\t\t);\n\t}", "abstract protected function getQueryIterator();", "public function iterator()\n {\n return $this->getIterator();\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->sitemaps);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->hash);\n }", "public function getIterator(){\n\t\treturn new \\ArrayIterator($this->getConstantsList());\n\t}", "public function testOrderedQueueIterator_implementation() {\n\t\t\t$this->assertTrue($this->oq InstanceOf \\Iterator);\n\t\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->items->all());\n }", "public function pulled(): Iterator;", "public function getIterator ()\r\n\t{\r\n\t\treturn new \\ArrayIterator ( $this->_qts );\r\n\t}", "public function getIterator()\r\n {\r\n return new \\ArrayIterator($this->data);\r\n }", "public function isIterator($iterator);", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return $this->iterator();\n }", "public function iterator () {\n\t\t$ret = new \\Array_hx();\n\t\tBalancedTree::iteratorLoop($this->root, $ret);\n\t\treturn new ArrayIterator($ret);\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->_items);\n }", "public function getIterator()\n {\n return new \\ArrayIterator(\\Resursi\\PodaciSlikeArrayConverter::toArray($this));\n }", "public function testRepeatedIteratorUse(AutoloaderFileIterator $iterator)\n {\n\n $foundFiles = array();\n foreach ($iterator as $file) {\n $foundFiles[] = $file;\n\n }\n\n $this->_assertEqualFoundFiles($foundFiles, $iterator);\n $this->_assertEqualFoundFiles($foundFiles, $iterator);\n $this->_assertEqualFoundFiles($foundFiles, $iterator);\n }", "abstract public function iterateCollection();", "public function iterator($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->__data);\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_data);\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->array);\n\t}", "public function testIterMultiKey()\n {\n $reader = new \\ArrayIterator($this->allRandom);\n $reader = new Core\\SortReader($reader, array('mod', 'num'));\n $this->assertEquals($this->modSorted, iterator_to_array($reader));\n return;\n }", "public function getIterator()\n {\n return $this->iterator;\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_cache);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->result);\n }", "public function next()\n {\n }", "public function next()\n {\n }", "public function next()\n {\n }", "public function next()\n {\n }", "public function getIterator()\n {\n return new ArrayIterator($this->export());\n }", "public function getIterator(): \\Iterator\n {\n return new \\ArrayIterator($this->headers);\n }", "public function getIterator()\n {\n return $this->multi()->load();\n }", "public function getIterator(): Iterator\n {\n return $this->{$this->fnDoGetIterator}();\n }", "function iterateur_php_dist($b, $iteratorName) {\n\t$b->iterateur = $iteratorName; # designe la classe d'iterateur\n\t$b->show = array(\n\t\t'field' => array(\n\t\t\t'cle' => 'STRING',\n\t\t\t'valeur' => 'STRING',\n\t\t)\n\t);\n\tforeach (get_class_methods($iteratorName) as $method) {\n\t\t$b->show['field'][ strtolower($method) ] = 'METHOD';\n\t}\n\t/*\n\tforeach (get_class_vars($iteratorName) as $property) {\n\t\t$b->show['field'][ strtolower($property) ] = 'PROPERTY';\n\t}\n\t*/\n\treturn $b;\n}", "public function hasNext(): bool;", "public function hasNext(): bool;", "#[\\ReturnTypeWillChange]\n public function getIterator()\n {\n foreach ($this->iteratePages() as $page) {\n foreach ($page as $key => $element) {\n yield $key => $element;\n }\n }\n }", "public function testIterCustomKey()\n {\n $reader = new \\ArrayIterator($this->allRandom);\n $keyfunc = __NAMESPACE__.'\\SortReaderTest::keyFunc';\n $reader = new Core\\SortReader($reader, $keyfunc);\n $this->assertEquals($this->modSorted, iterator_to_array($reader));\n return;\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->elements(true));\n }", "public function getIterator()\n {\n return new ArrayIterator($this->pages);\n }", "public function getIterator(): \\Traversable\n {\n yield from $this->generator;\n }", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->items);\n\t}", "public function next()\r\n\t{\r\n\t}", "public function testIterGroup()\n {\n $reader = new \\ArrayIterator($this->numRandom);\n $reader = new Core\\SortReader($reader, 'num', 'mod');\n $this->assertEquals($this->modSorted, iterator_to_array($reader));\n return;\n }", "public function containsIterator($iterator)\n {\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->params);\n\t}", "public function getIterator(){\n\t\treturn $this->config->getAll();\n\t}", "public function iterateToolVersions(): Generator;", "function next();", "abstract protected function getListTraversable();", "public function getIteratorScheme();" ]
[ "0.72776145", "0.7210779", "0.7210779", "0.69972295", "0.6885342", "0.6885028", "0.6885028", "0.6885028", "0.6885028", "0.6885028", "0.6885028", "0.66760206", "0.65136063", "0.6434301", "0.6434301", "0.6361123", "0.63606405", "0.6359576", "0.6261085", "0.6191362", "0.60566735", "0.6019576", "0.5997705", "0.597981", "0.597981", "0.597981", "0.597981", "0.5939951", "0.59290284", "0.592492", "0.59237045", "0.5922326", "0.5922326", "0.58943295", "0.5890531", "0.58743995", "0.57831067", "0.57831067", "0.57831067", "0.57831067", "0.57831067", "0.57831067", "0.57831067", "0.57831067", "0.57727456", "0.5752461", "0.5744696", "0.5733513", "0.572866", "0.5728375", "0.5715728", "0.5701914", "0.5694016", "0.5688257", "0.56799155", "0.56771255", "0.56635827", "0.56557775", "0.5654474", "0.5653659", "0.5653659", "0.5642868", "0.5634809", "0.56262803", "0.5621969", "0.5616765", "0.5597116", "0.559027", "0.5586063", "0.55851173", "0.5576932", "0.55738664", "0.55704826", "0.5569538", "0.5559557", "0.5556093", "0.5556093", "0.5556093", "0.5556093", "0.5546752", "0.5544001", "0.5537866", "0.55267406", "0.55189437", "0.55137014", "0.55137014", "0.5512507", "0.55020255", "0.54999715", "0.54928005", "0.548586", "0.54688567", "0.5468468", "0.54652184", "0.5463809", "0.5457691", "0.5456922", "0.54545575", "0.54502445", "0.54456204", "0.54341614" ]
0.0
-1
Perform an installation using the given configuration
public function install(array $config, $configKey = 'config') { // Validate source if (!is_dir($this->source) && !file_exists($this->source)) { return "No valid source given : {$this->source} is neither a folder nor a zip file"; } // Do whatever it takes with the source $this->handleSource(); // At this point source should be a folder with a "setup" folder if (!is_dir($this->source) || !is_dir("{$this->source}/setup")) { return "No valid setup folder found in the source : {$this->source}"; } if (is_dir("{$this->source}/_build")) { // We have extract a zip file from the git repository, let's build the core! $this->handleSource(); } // Move folders to their destinations, if any $this->handleCustomFolders(); $installed = $this->isAlreadyInstalled($configKey); if ($installed) { $core = $this->getCorePath(); $args = "upgrade --core_path={$core}"; } else { // @TODO validate config if any ? // Build configFile (XML) $configFile = $this->buildConfigFile($config); $args = "new --config={$configFile}"; } // Run install script // @TODO check passthru passthru("php {$this->source}/setup/index.php --installmode={$args}"); if (!$installed) { // Remove config file unlink($configFile); } // Return a modX instance return $this->getInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function install() {}", "public function install();", "public function install();", "function install(){}", "public function install() {\n\n\n }", "public function install(){\r\n\t\t\r\n\t}", "public static function install(){\n\t}", "public function install()\n {\n }", "public function install()\n {\n }", "public function install() {\r\n \r\n }", "function install()\n {\n }", "public function install(){\n\n\t\t$model = Advertikon::getCurrentModel();\n\n\t\ttry {\n\t\t\t$this->_checkCompatibility();\n\t\t}\n\t\tcatch( Exception\\Transport $e ) {\n\t\t\t$this->errorPage( $e->getData() , 424 , 'Failed Dependency' );\n\t\t}\n\n\t\t$this->_install();\n\n\t\t$config = Advertikon::getXmlConfig();\n\t\t$settingsModel = Advertikon::getExtendedModel( 'setting_setting' );\n\t\t$settings = $model->stripPrefix( $settingsModel->getSetting() );\n\t\t$model->merge( $settings , $config->getValues( '/' ) );\n\t\t$settingsModel->editSetting( $settings );\n\n\t\t//mark the extension as installed\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->setSettingValue( 'installed' , 1 );\n\t}", "function insta_f_install(){\n}", "public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-Finnish-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}", "public function install(): bool;", "public function install() {\n\t\t\t$date = Symphony::Configuration()->get('date_format', 'region');\n\t\t\t$time = Symphony::Configuration()->get('time_format', 'region');\n\t\t\t$separator = Symphony::Configuration()->get('datetime_separator', 'region');\n\n\t\t\t// Store current date and time settings\n\t\t\tSymphony::Configuration()->set('date_format', $date, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('time_format', $time, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->set('datetime_separator', $separator, 'lang-slovak-storage');\n\t\t\tSymphony::Configuration()->write();\n\t\t}", "public function install()\n {\n $this->shareDependenciesFolder();\n\n return $this->runWithBeforeAfterEvents(function () {\n return $this->getBinary()->runForApplication('install', [], $this->getInstallationOptions('install'));\n });\n }", "abstract public function installPhp();", "public function install()\n {\n // initialisation successful\n return true;\n }", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "public function install()\n\t{\n\t\treturn true;\n\t}", "abstract public function installVirtuoso();", "function install() {\n\t\t$config ['username'] = '';\n\t\t$config ['password'] = '';\n\t\t;\n\t\t$config ['signature'] = '';\n\t\t$config ['currency'] = 'EUR'; // default\n\t\t\n\n\t\t$config ['SANDBOX'] = true;\n\t\t\n\t\t$config ['enabled'] = \"0\";\n\t\t\n\t\t//not normally user configurable\n\t\t$config ['return_url'] = \"\";\n\t\t$config ['cancel_url'] = \"\";\n\t\t\n\t\t$this->CI->Settings_model->save_settings ( 'bnp_parisbas', $config );\n\t}", "public function install()\n {\n xtc_db_query(\n \"delete from \" . TABLE_CONFIGURATION\n . \" where configuration_key in ('MODULE_PAYMENT_SHOPGATE_STATUS', 'MODULE_PAYMENT_SHOPGATE_ALLOWED', 'MODULE_PAYMENT_SHOPGATE_ORDER_STATUS_ID')\"\n );\n xtc_db_query(\n \"insert into \" . TABLE_CONFIGURATION\n . \" (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_SHOPGATE_STATUS', 'True', '6', '1', 'xtc_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\"\n );\n xtc_db_query(\n \"insert into \" . TABLE_CONFIGURATION\n . \" (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_SHOPGATE_ALLOWED', '0', '6', '1', now())\"\n );\n xtc_db_query(\n \"insert into \" . TABLE_CONFIGURATION\n . \" (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_SHOPGATE_SORT_ORDER', '0', '6', '1', now())\"\n );\n $result = xtc_db_query(\n 'select configuration_key,configuration_value from configuration as c where c.configuration_key = \"'\n . ShopgateInstallHelper::SHOPGATE_DATABASE_CONFIG_KEY . '\"'\n );\n $row = xtc_db_fetch_array($result);\n if (empty($row)) {\n xtc_db_query(\n \"insert into \" . TABLE_CONFIGURATION\n . \" ( configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_SHOPGATE_IDENT' , '0', '6', '\"\n . $this->sort_order . \"', now())\"\n );\n }\n\n $this->installTable();\n $this->updateDatabase();\n $this->grantAdminAccess();\n $installHelper = new ShopgateInstallHelper();\n $installHelper->sendData();\n }", "protected function install()\n {\n $this->modx->runProcessor('workspace/packages/scanLocal');\n $answer = $this->modx->runProcessor('workspace/packages/install',\n ['signature' => join('-', [self::PKG_NAME, self::PKG_VERSION, self::PKG_RELEASE])]\n );\n\n if ($answer) {\n $response = $answer->getResponse();\n echo $response['message'] . PHP_EOL;\n }\n\n $this->modx->getCacheManager()->refresh();\n $this->modx->reloadConfig();\n }", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "protected function install(){ return true;}", "protected function install() {\n\n\t\t// include settings so we can install defaults\n\t\t$settings = $this->load_class( '/includes/admin/class-wc-avatax-settings.php', 'WC_AvaTax_Settings' );\n\n\t\t// install default settings for each section\n\t\tforeach ( $settings->get_settings() as $setting ) {\n\n\t\t\tif ( isset( $setting['default'] ) ) {\n\n\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\n\t\t$this->maybe_migrate();\n\t}", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Nochex Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept Nochex payments?', '6', '44', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Nochex Email Address', 'MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS','\".STORE_OWNER_EMAIL_ADDRESS.\"', 'Registered email address for your Nochex account.<br />NOTE: This must match <strong>EXACTLY </strong>the registered email address on your Nochex account.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Nochex Account Type', 'MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE', 'Seller', 'Please select the type of Nochex account you are accepting payments with.', '6', '44', 'zen_cfg_select_option(array(\\'Seller\\',\\'Merchant\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_NOCHEX_MERCHANT_ID', '', 'For Nochex Merchant account holders, allows you to accept payments using a different merchant ID. Has no effect on Seller accounts.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '44', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_NOCHEX_PROCESSING_STATUS_ID', '\" . DEFAULT_ORDERS_STATUS_ID . \"', 'Set the status of orders made with this payment module that are not yet completed to this value<br />(\\'Pending\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br />(\\'Processing\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '44', now())\");\r\n\r\n // Nochex testing options go here\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_NOCHEX_APC_DEBUG', 'Off', 'Enable debug logging? <br />NOTE: This can REALLY clutter your email inbox!<br />Logging goes to the /includes/modules/payment/nochex_apc/logs folder<br />Email goes to the store-owner address.<strong>Leave OFF for normal operation.</strong>', '6', '44', 'zen_cfg_select_option(array(\\'Off\\',\\'Log File\\',\\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Status Live/Testing', 'MODULE_PAYMENT_NOCHEX_TESTING', 'Live', 'Set Nochex module to Live or Test. In Test mode no money is transferred.', '6', '44', 'zen_cfg_select_option(array(\\'Live\\', \\'Test\\'), ', now())\");\r\n\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_INSTALLED');\r\n }", "function run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( is_array( $this->install->saved_data ) and count( $this->install->saved_data ) )\n\t\t{\n\t\t\tforeach( $this->install->saved_data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#^__sql__#\", $k ) )\n\t\t\t\t{\n\t\t\t\t\t$k = str_replace( \"__sql__\", \"\", $k );\n\t\t\t\t\n\t\t\t\t\t$this->install->ipsclass->vars[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Switch */\n\t\tswitch( $this->install->ipsclass->input['sub'] )\n\t\t{\n\t\t\tcase 'sql':\n\t\t\t\t$this->install_sql();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'settings':\n\t\t\t\t$this->install_settings();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'acpperms':\n\t\t\t\t$this->install_acpperms();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'templates':\n\t\t\t\t$this->install_templates();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'other':\n\t\t\t\t$this->install_other();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'caches':\n\t\t\t\t$this->install_caches();\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t/* Output */\n\t\t\t\t$this->install->template->append( $this->install->template->install_page() );\t\t\n\t\t\t\t$this->install->template->next_action = '?p=install&sub=sql';\n\t\t\t\t$this->install->template->hide_next = 1;\n\t\t\tbreak;\t\n\t\t}\n\t}", "public function runInstallTasks();", "public function install() {\n\t\t// Are we installed?\n\t\t$current = config_item('mojoblog_version');\n\t\t\n\t\t// Begone!\n\t\tif ($current) {\n\t\t\t$this->data['title'] = 'Already installed!';\n\t\t\t$this->data['message'] = 'MojoBlog is already installed, so there\\'s nothing to do here. Enjoy using MojoBlog!';\n\t\t\t$this->_view('installer');\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Check that we're setup and the DB table exists\n\t\t$this->mojo->blog_model->install();\n\t\t\n\t\t// Make sure we update the routing\n\t\t$this->mojo->blog_model->install_routing();\n\t\t\n\t\t// Let the user know about it\n\t\t$this->data['title'] = 'Installation successful';\n\t\t$this->data['message'] = 'MojoBlog has been successfully installed. Thanks for purchasing, and please remember to read the documentation thoroughly before using. If you have any concerns or issues with MojoBlog, don\\'t hesitate to report them at our dedicated support site. Enjoy!';\n\t\t$this->_view('installer');\n\t\t\n\t\texit;\n\t}", "public static function install(Event $event)\n {\n\n \n\n if($event->getIO()->askConfirmation('Do you want run admin installers? [y/N] ', false))\n {\n\n $options = static::getOptions($event);\n\n $configPath = $options['symfony-app-dir'] . '/config/config.yml';\n $config = Yaml::parse(file_get_contents($configPath));\n \n static::prepareBundlesInstall($event, $options);\n static::installBundles($event, $options);\n static::installSkeletons($event, $options);\n static::mergeBowerFiles($event, $options);\n static::installBowerDepedencies($event, $options);\n static::addParameters($event, $options);\n static::createSchema($event, $options);\n static::loadFixturies($event, $options);\n static::runExternal($event);\n }\n\n }", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net (eCheck) Module', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'True', 'Do you want to accept eCheck payments via Authorize.net?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'testing', 'The API Login ID used for the Authorize.net service', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'Test', 'Transaction Key used for encrypting TP data<br />(See your Authorizenet Account->Security Settings->API Login ID and Transaction Key for details.)', '6', '0', now(), 'zen_cfg_password_display')\"); \r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('MD5 Hash', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', '*Set A Hash Value at AuthNet Admin*', 'Encryption key used for validating received transaction data (MAX 20 CHARACTERS)', '6', '0', now(), 'zen_cfg_password_display')\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'zen_cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'zen_cfg_select_option(array(\\'Authorize\\', \\'Authorize+Capture\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Database Storage', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'True', 'Do you want to save the gateway communications data to the database?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net email a receipt to the customer?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'False', 'Should Authorize.Net email a receipt to the merchant?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\\'Off\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Wells Fargo SecureSource Merchant', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'False', 'Are you a Wells Fargo SecureSource merchant? eCheck transactions will collect additional information from customers. Set to True only if your account has been configured to use Wells Fargo SecureSource.', '6', '0', 'zen_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\r\n }", "public function install()\n {\n if (!parent::install()) {\n $this->_errors[] = 'Unable to install module';\n\n return false;\n }\n\n foreach ($this->hooks as $hook) {\n $this->registerHook($hook);\n }\n\n if (!$this->pendingOrderState()) {\n $this->_errors[] = 'Unable to install Mollie pending order state';\n\n return false;\n }\n\n $this->initConfig();\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return true;\n }", "function install() {\n\t\tglobal $errorMessage;\n\n\t\tif ($_POST['command'] == 'install' && is_writable('.')) {\n\t\t\t// upzip and install files\n\t\t\t$files = explode(',', data('index'));\n\t\t\tforeach ($files as $file) {\n\t\t\t\tif (!$file)\n\t\t\t\t\tcontinue;\n\t\t\t\t$path = pathinfo($file);\n\t\t\t\t$dir = explode('/', $path['dirname']);\n\t\t\t\t$folder = '';\n\t\t\t\tforeach($dir as $d) {\n\t\t\t\t\t$folder.= ($folder ? '/' : '').$d;\n\t\t\t\t\tif (!file_exists($folder)) mkdir($folder, 0755);\n\t\t\t\t}\n\t\t\t\tfile_put_contents($file, data($file));\n\t\t\t\tchmod($file, 0664);\n\t\t\t}\n\n\t\t\t// Needed for password hashing\n\t\t\trequire_once('system/core/crypto.php');\n\n\t\t\t// create data folders\n\t\t\tmkdir('data/pages', 0755);\n\t\t\tmkdir('data/images', 0755);\n\n\t\t\t// create default page\n\t\t\t$id = uniqid();\n\t\t\t$xml = new DomDocument('1.0', 'UTF-8');\n\t\t\t$xml->preserveWhiteSpace = false;\n\t\t\t$xml->formatOutput = true;\n\t\t\t$hypha = $xml->createElement('hypha');\n\t\t\t$hypha->setAttribute('type', 'textpage');\n\t\t\t$hypha->setAttribute('multiLingual', 'on');\n\t\t\t$hypha->setAttribute('versions', 'on');\n\t\t\t$hypha->setAttribute('schemaVersion', 1);\n\t\t\t$language = $xml->createElement('language', '');\n\t\t\t$language->setAttribute('xml:id', $_POST['setupDefaultLanguage']);\n\t\t\t$version = $xml->createElement('version', '<p>welcome to your brand new hypha website.</p>');\n\t\t\t$version->setAttribute('xml:id', 't'.time());\n\t\t\t$version->setAttribute('author', '');\n\t\t\tsetNodeHtml($version, '<p>welcome to your brand new hypha website.</p>');\n\t\t\t$language->appendChild($version);\n\t\t\t$hypha->appendChild($language);\n\t\t\t$xml->appendChild($hypha);\n\t\t\t$xml->save('data/pages/'.$id);\n\n\t\t\t// build hypha.xml\n\t\t\t$xml = new DomDocument('1.0', 'UTF-8');\n\t\t\t$xml->preserveWhiteSpace = false;\n\t\t\t$xml->formatOutput = true;\n\t\t\t$hypha = $xml->createElement('hypha');\n\t\t\t$hypha->setAttribute('type', 'project');\n\t\t\t$hypha->setAttribute('defaultLanguage', $_POST['setupDefaultLanguage']);\n\t\t\t$hypha->setAttribute('defaultPage', $_POST['setupDefaultPage']);\n\t\t\t$hypha->setAttribute('email', $_POST['setupEmail']);\n\t\t\t$hypha->setAttribute('digestInterval', '21600');\n\t\t\t$hypha->setAttribute('schemaVersion', 1);\n\t\t\t$hypha->appendChild($xml->createElement('title', $_POST['setupTitle']));\n\t\t\t$header = $xml->createElement('header', $_POST['setupTitle']);\n\t\t\t$hypha->appendChild($header);\n\t\t\t$footer = $xml->createElement('footer', '');\n\t\t\tsetNodeHtml($footer, '<a href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img alt=\"Creative Commons License\" style=\"border-width: 0pt; float: right; margin-left: 5px;\" src=\"//i.creativecommons.org/l/by-sa/3.0/88x31.png\" /></a> This work is licensed under a <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. Website powered by <a href=\"http://www.hypha.net\">hypha</a>.');\n\t\t\t$hypha->appendChild($footer);\n\t\t\t$menu = $xml->createElement('menu', '');\n\t\t\tsetNodeHtml($menu, '<a href=\"hypha:'.$id.'\"/>');\n\t\t\t$hypha->appendChild($menu);\n\t\t\t$userList = $xml->createElement('userList', '');\n\t\t\t$user = $xml->createElement('user', '');\n\t\t\t$user->setAttribute('id', uniqid());\n\t\t\t$user->setAttribute('username', $_POST['setupUsername']);\n\t\t\t$user->setAttribute('password', hashPassword($_POST['setupPassword']));\n\t\t\t$user->setAttribute('fullname', $_POST['setupFullname']);\n\t\t\t$user->setAttribute('email', $_POST['setupEmail']);\n\t\t\t$user->setAttribute('rights', 'admin');\n\t\t\t$userList->appendChild($user);\n\t\t\t$hypha->appendChild($userList);\n\t\t\t$pageList = $xml->createElement('pageList', '');\n\t\t\t$page = $xml->createElement('page', '');\n\t\t\t$page->setAttribute('id', $id);\n\t\t\t$page->setAttribute('type', 'textpage');\n\t\t\t$page->setAttribute('private', 'off');\n\t\t\t$language = $xml->createElement('language', '');\n\t\t\t$language->setAttribute('id', $_POST['setupDefaultLanguage']);\n\t\t\t$language->setAttribute('name', $_POST['setupDefaultPage']);\n\t\t\t$page->appendChild($language);\n\t\t\t$pageList->appendChild($page);\n\t\t\t$hypha->appendChild($pageList);\n\t\t\t$hypha->appendChild($xml->createElement('digest', ''));\n\t\t\t$xml->appendChild($hypha);\n\t\t\t$xml->save('data/hypha.xml');\n\n\t\t\t// goto hypha site\n\t\t\theader('Location: '.$_POST['setupBaseUrl']);\n\t\t\texit;\n\t\t}\n\t\telse {\n\t\t\tif (!is_writable('.')) $errorMessage.= 'php has no write access to the hypa installation directory on the server<br/>';\n\n\t\t\t// extract list of languages\n\t\t\t$iso639 = json_decode(data('system/languages/languages.json'), true);\n\t\t\t$languageOptionList = '';\n\t\t\tforeach($iso639 as $code => $langName) $languageOptionList.= '<option value=\"'.$code.'\"'.( $code=='en' ? ' selected' : '').'>'.$code.': '.$langName.'</option>';\n\n\t\t\t// build html\n\t\t\tob_start();\n?>\n\t\t<div style=\"width:800px;\">\n\t\t\t<h1>hypha installer</h1>\n\t\t\tIn order to set up this new hypha site you need to fill out a few things. This is a once only procedure. The entered data will be used to create some folders, include scripts and config files in the folder where the hypha script resides.\n\t\t\t<h2>system configuration</h2>\n\t\t\tThe following settings are used to set up your project website. All settings can be changed after the initial installation.<br/>\n\t\t\t<table style=\"width:800px;\" class=\"section\">\n\t\t\t\t<tr><td width=\"240\"></td><td></td><td width=\"400\"></td></tr>\n\t\t\t\t<tr><th>title</th><td><input name=\"setupTitle\" size=\"40\" value=\"<?=$_POST['setupTitle'];?>\" /></td><td class=\"help\">The name of your site as it will appear in the browers title bar.</td></tr>\n\t\t\t\t<tr><th>base url</th><td><input name=\"setupBaseUrl\" size=\"40\" value=\"http://<?=$_SERVER[\"SERVER_NAME\"].str_replace('/hypha.php', '', $_SERVER[\"REQUEST_URI\"])?>\" /></td><td class=\"help\">This is the address where the hypha site can be found.</td></tr>\n\t\t\t\t<tr><th>default page</th><td><input name=\"setupDefaultPage\" size=\"40\" value=\"home\" value=\"<?=$_POST['setupDefaultPage'];?>\" /></td><td class=\"help\">Hypha lets you create wiki style pages which can link to each other. If no particular page is selected the site will default to this page.</td></tr>\n\t\t\t\t<tr><th>default language</th><td><select name=\"setupDefaultLanguage\"><?=$languageOptionList?></select></td><td class=\"help\">All pages can be multilingual. If a user does not choose a language the site will default to this language.</td></tr>\n\t\t\t\t<tr><th>login</th><td><input name=\"setupUsername\" size=\"40\" value=\"<?=$_POST['setupUsername'];?>\" /></td><td class=\"help\">This first user account will automatically have admin rights for site maintenance.</td></tr>\n\t\t\t\t<tr><th>password</th><td><input name=\"setupPassword\" size=\"40\" value=\"<?=$_POST['setupPassword'];?>\" /></td><td class=\"help\">The superuser password.</td></tr>\n\t\t\t\t<tr><th>full name</th><td><input name=\"setupFullname\" size=\"40\" value=\"<?=$_POST['setupFullname'];?>\" /></td><td class=\"help\">This name will be used for email messages generated by the system.</td></tr>\n\t\t\t\t<tr><th>email</th><td><input name=\"setupEmail\" size=\"40\" value=\"<?=$_POST['setupEmail'];?>\" /></td><td class=\"help\">This email adress will be the reply-to address of system sent messages. You may want to use an email alias that forwards messages to all collaborators in the group.</td></tr>\n\t\t\t\t<tr><td colspan=\"3\" style=\"text-align:right;\"><input type=\"submit\" name=\"command\" value=\"install\" /></td></tr>\n\t\t\t</table>\n\t\t</div>\n<?php\n\t\t\treturn ob_get_clean();\n\t\t}\n\t}", "public function install(){\n\n return true;\n\n }", "public function installAction()\r\n\t{\r\n\t try {\r\n \t // run the install command\r\n \t $packageName = $this->_runCommand(\r\n \t $command = Faett_Core_Interfaces_Service::COMMAND_INSTALL\r\n \t );\r\n // attach a message to the session\r\n \t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n \t\t Mage::helper('adminhtml')->__(\r\n \t\t '201.success.package-install', $packageName\r\n \t\t )\r\n \t\t);\r\n\t } catch(Faett_Manager_Exceptions_InvalidCommandException $ice) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t $ice->getMessage()\r\n \t\t);\r\n\t } catch(Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t Mage::helper('manager')->__(\r\n \t\t '900.pear.exception',\r\n \t\t $e->getMessage()\r\n \t\t )\r\n \t\t);\r\n\t }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "public function install()\n\t{\n\t\t$filename = cms_join_path($this->get_module_path(), 'method.install.php');\n\t\tif (@is_file($filename))\n\t\t{\n\t\t\t{\t\t\t\t\n\t\t\t\t$gCms = cmsms(); //Backwards compatibility\n\t\t\t\t$db = cms_db();\n\t\t\t\t$config = cms_config();\n\t\t\t\t$smarty = cms_smarty();\n\n\t\t\t\tinclude($filename);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function install() {\n return $this->installer->install();\n }", "public function install()\n {\n // create the table\n try {\n DoctrineHelper::createSchema($this->entityManager, array('Downloads_Entity_Download',\n 'Downloads_Entity_Categories'));\n } catch (Exception $e) {\n return false;\n }\n\n // Set up config variables\n $this->setVars(Downloads_Util::getModuleDefaults());\n $this->createUploadDir();\n $category = $this->createSampleCategory();\n $this->createSampleDownload($category);\n\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n\n return true;\n }", "function test_install(){\n \t}", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "function writeInstall() \n {\n $file = new CodeGen_Tools_Outbuf($this->dirpath.\"/INSTALL\");\n\n $title = $this->archivePrefix.\"-\".$this->name.\" \".$this->release->getVersion();\n\n echo \"$title\\n\";\n echo str_repeat(\"=\", strlen($title)).\"\\n\";\n\n echo \"\\n== Configuration ==\\n\\n\";\n\n if ($this->needSource) {\n?>\nThis user defined function module relies on information only \navailable in the MySQL source code, it can't be compiled if\nyou've only installed MySQL binary packages.\n\nTo compile this package you need to first tell configure \nwhere to find the MySQL source directory you want to compile\nagainst using the --with-mysql-src configure option, e.g:\n\n configure --with-mysql-src=/home/username/src/mysql-5.0.37\n\n<?php\n } else {\n?>\nYou can configure this package as usual, in the simplest case\nyou just need to invoke \n\n configure \n\nwithout options. This requires that the \"mysql_config\" binary \nof the server installation you want to compile this UDF module\nfor is in your environments $PATH\n\nYou may specify an explicit mysql installation to compile \nagainst by using the\n\n --with-mysql=...\n\noption, this option expects either the path of this installations\n\"mysql_config\" binary or the installations base dir (assuming\nthat \"mysql_config\" is in the \"$prefix/bin\" directory) as argument.\n\nSo any of the following may be used to configure the package\nagainst a server installed in a \"/usr/local/mysql\" prefix \n(the default if you compiled mysql yourself or used one of the\ntar.gz distribution packages provided by mysql.com):\n\n configure --with-mysql=/usr/local/mysql\n\n configure --with-mysql=/usr/local/mysql/bin/mysql_config\n\n<?php\n }\n?>\n\nFor a full list of configure options see \n\n configure --help\n\nBy default the UDF library created by this package will install\ninto /usr/local/lib. The mysql server may not be able to load\nit from there though as this directory may not be in its\nlibrary search path. \n\nYou may solve this by:\n\n - adding /usr/local/lib to the LD_LIBRARY_PATH before\n invoking the mysql server\n\n - changing the UDF install prefix by using either the\n --prefix or --libdir configure option so that the\n UDF library gets installed into a directory that is\n in the servers load path\n\n - or both of the above\n\n== Compilation ==\n\nOnce you have successfully configured the package \nyou should be able to compile it by simply typing\n\n make\n \n== Testing ==\n\nThis package includes test cases that can be invoked using\n \n mysql test\n\nThis relies on the following mysql binaries being available\nin your environments search $PATH to function as the tests\nrely on the mysql server test framework:\n\n * mysql - the mysql command line client\n * mysqld - the mysql server\n * mysqladmin - the mysql administration command line tool\n * mysql_install_db - the database server initialisation tool\n * mysqltest - the actual test framework tool\n\n== Installing the library ==\n\nTo install the generated UDF library you simply need to invoke\n\n make install\n\nDepending on the target directories user permissions you might\nneed to do this as superuser though, eg. by using \"sudo\":\n\n sudo make install\n\nRemember that the mysql server will only be able to load the\nlibrary if it is installed in a directory in its library load\npath, you may modify this search path by invoking the server\nwith the $LD_LIBRARY_PATH environment variable set appropriately\nbefore starting.\n\n== Installing the actual functions ==\n\nTo actually enable the functions provided by this UDF module\nyou need to make them known to the MySQL server using \n\"CREATE FUNCTION\" SQL commands:\n\n<?php\n echo \"Register the functions provided by this UDF module using\\n\";\n foreach ($this->functions as $function) {\n echo $function->createStatement($this).\"\\n\";\n }\n echo \"\\n\"; \n echo \"Unregister the functions provided by this UDF module using\\n\"; \n foreach ($this->functions as $function) {\n echo $function->dropStatement($this).\"\\n\";\n }\n?>\n\n== Changing the source ==\n\nChanges applied to any of the files in this project may be \noverwritten by further invocations of the udf-gen tool so\nyou should always try to apply all necessary changes to the\nXML specification file the project was generated from instead\nand then regenerate the project from the spec file instead.\n\nThe udf-gen tool will only overwrite files that actually \nchanged, so preserving file system time stamps of unmodified\nfiles, to play nice with \"make\" and to avoid unnecessary\nrecompilation of source files.\n\n<?php\n\n $file->write();\n }", "function install() {\n global $db;\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paymentech Module', 'MODULE_PAYMENT_PAYMENTECH_STATUS', 'True', 'Do you want to accept Paymentech payments?', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYMENTECH_TESTMODE', 'Test', 'Transaction mode used for processing orders.', '6', '0', 'cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (Test Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a test account. This is only used when in testing mode.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (USD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have USD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (CAD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a CAD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bin Number', 'MODULE_PAYMENT_PAYMENTECH_BIN', '000002', 'Bin Number assigned by Paymentech.', '6', '0', now())\"); \n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Terminal ID', 'MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID', '001', 'Most are 001. Only change if instructed by Paymentech', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE', 'Authorize/Capture', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'cfg_select_option(array(\\'Authorize\\', \\'Authorize/Capture\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Request CVV Number', 'MODULE_PAYMENT_PAYMENTECH_USE_CVV', 'True', 'Do you want to ask the customer for the card\\'s CVV number', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYMENTECH_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currencies Accepted', 'MODULE_PAYMENT_PAYMENTECH_CURRENCIES', 'USD only', 'Accept Canadian dollars, US dollars, or both? If you have a Merchant ID set up for both then the currency will matched appropriately.', '6', '0', 'cfg_select_option(array(\\'CAD only\\', \\'USD only\\', \\'CAD and USD\\'), ', now())\");\n }", "public function install () {\n $this->_log_version_number();\n }", "public function install()\n {\n return $this->process->install();\n }", "public function install($env = \"dev\")\n {\n if (!file_exists(\".built\")) {\n $this->build($env);\n }\n $this->buildDrushTask()\n ->siteName('Rock Solid')\n ->siteMail('[email protected]')\n ->locale('en')\n ->accountMail('[email protected]')\n ->accountName('dustin')\n ->siteInstall('standard')\n ->run();\n }", "function jbInstall($step){\n\t}", "public function runInstallation()\n {\n if (!$this->isInstalled()){\n $msg = 'Configuration of this plug-in is not done.';\n $msg .= \"<br/>\\n\".$this->testDossierDeadlineConfigServer();\n throw new BizException('' , 'Server', null, $msg);\n }\n }", "public function setup (){\n\t\techo \"\\n\";\n\t\techo \"Setting up: `\".$this->installedComponents[0]->name.\"`\\n\";\n\t\techo \"version: `\".$this->installedComponents[0]->version.\"`\\n\";\n\t\t//$installed[0]->version_normalized;\n\t\t\n\t\t\n\t\t#var_dump(\"xyz\");\n\t\techo \"-----------------------------------------\\n\";\n\t\t\n\t\t$searchDir = realpath($this->vendorDir . '/../..');\n\t\tif( file_exists($searchDir.\"/configuration.ini\") ){\n\t\t\techo \"found a previous `configuration.ini` ( \".$searchDir.\"/configuration.ini\".\" ) \\n\";\t\n\t\t\t\n\t\t\t$app = $this->readConfiguration($searchDir.\"/configuration.ini\" );\n\t\t\t$coreComponent = $this->getComponentVersion($this->installedComponents);\n\t\t\t\n\t\t\techo \"\\nsettings\\n\";\n\t\t\t//print_r($app->settings['conn']);\n\t\t\t\n\t\t\t//print_r();\n\t\t\t\n\t\t\t/* create the $this->pdo instance */\n\t\t\t$this->createPDO($app->configuration->role->conn);\n\t\t\t\n\t\t\t\n\t\t\t#echo \"\\npaths\\n\";\n\t\t\t#print_r($app->paths);\n\t\t\t#echo \"\\ncoreComponent\\n\";\n\t\t\t#print_r($coreComponent);\n\t\t\t\n\t\t\t#echo \"need to add config-parse code here..\\n\";\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->createdb($this->pdo);\n\t\t\t\n\t\t\t//echo \"\\n\\nFINISHED!!\\n\\n\";\n\t\t\t\n\t\t}else{\n\t\t\techo \"\\n No configuration found, starting setup.\\n\";\n\t\t\t$public_html = $this->public_html();\n\t\t\t$tempFolder = $this->tempFolder();\n\t\t\t\n\t\t\t/* create the $this->pdo instance from requested credentials */\n\t\t\t$dbCredentials = $this->dbCredentials();\n\t\t\t\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->pdo;\n\t\t\techo \"\\n\\nUNFINISHED!!\\n\\n\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo \"\\n\";\n\t}", "public function installAction() {\r\n try {\r\n\r\n $db = \\Zend_Db::factory($this->getParam(\"mysql_adapter\"),array(\r\n 'host' => $this->getParam(\"mysql_host\"),\r\n 'username' => $this->getParam(\"mysql_username\"),\r\n 'password' => $this->getParam(\"mysql_password\"),\r\n 'dbname' => $this->getParam(\"mysql_database\"),\r\n \"port\" => $this->getParam(\"mysql_port\")\r\n ));\r\n\r\n $db->getConnection();\r\n\r\n // check utf-8 encoding\r\n $result = $db->fetchRow('SHOW VARIABLES LIKE \"character\\_set\\_database\"');\r\n if ($result['Value'] != \"utf8\") {\r\n $errors[] = \"Database charset is not utf-8\";\r\n }\r\n }\r\n catch (\\Exception $e) {\r\n $errors[] = \"Couldn't establish connection to mysql: \" . $e->getMessage();\r\n }\r\n\r\n // check username & password\r\n if (strlen($this->getParam(\"admin_password\")) < 4 || strlen($this->getParam(\"admin_username\")) < 4) {\r\n $errors[] = \"Username and password should have at least 4 characters\";\r\n }\r\n\r\n if (empty($errors)) {\r\n\r\n $setup = new Tool\\Setup();\r\n\r\n // check if /website folder already exists, if not, look for /website_demo & /website_example\r\n // /website_install is just for testing in dev environment\r\n if(!is_dir(PIMCORE_WEBSITE_PATH)) {\r\n foreach([\"website_install\", \"website_demo\", \"website_example\"] as $websiteDir) {\r\n $dir = PIMCORE_DOCUMENT_ROOT . \"/\" . $websiteDir;\r\n if(is_dir($dir)) {\r\n rename($dir, PIMCORE_WEBSITE_PATH);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n $setup->config(array(\r\n \"database\" => array(\r\n \"adapter\" => $this->getParam(\"mysql_adapter\"),\r\n \"params\" => array(\r\n \"host\" => $this->getParam(\"mysql_host\"),\r\n \"username\" => $this->getParam(\"mysql_username\"),\r\n \"password\" => $this->getParam(\"mysql_password\"),\r\n \"dbname\" => $this->getParam(\"mysql_database\"),\r\n \"port\" => $this->getParam(\"mysql_port\"),\r\n )\r\n ),\r\n ));\r\n\r\n\t\t\t// look for a template dump\r\n\t\t\t// eg. for use with demo installer\r\n\t\t\t$dbDataFile = PIMCORE_WEBSITE_PATH . \"/dump/data.sql\";\r\n\t\t\t$contentConfig = array(\r\n\t\t\t\t\"username\" => $this->getParam(\"admin_username\"),\r\n\t\t\t\t\"password\" => $this->getParam(\"admin_password\")\r\n\t\t\t);\r\n\r\n\t\t\tif(!file_exists($dbDataFile)) {\r\n $setup->database();\r\n \\Pimcore::initConfiguration();\r\n\t\t\t\t$setup->contents($contentConfig);\r\n\t\t\t} else {\r\n\t\t\t\t$setup->insertDump($dbDataFile);\r\n \\Pimcore::initConfiguration();\r\n\t\t\t\t$setup->createOrUpdateUser($contentConfig);\r\n\t\t\t}\r\n\r\n $this->_helper->json(array(\r\n \"success\" => true\r\n ));\r\n }\r\n\r\n else {\r\n echo implode(\"<br />\", $errors);\r\n die();\r\n }\r\n\r\n }", "public function install()\n {\n Configuration::updateValue('APISFACT_PRESTASHOP_TOKEN', '');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEF', 'F001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROF', '0');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEB', 'B001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROB', '0');\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayAdminOrderLeft') &&\n $this->registerHook('displayAdminOrderMain');\n }", "public function installConfiguration()\n {\n $result = true;\n\n foreach (\\Shop::getShops(false, null, true) as $shopId) {\n /* todo: remove ignore when first configuration is added to the list */\n /* @phpstan-ignore-next-line */\n foreach (Config::CONFIGURATION_LIST as $name => $value) {\n if (false === \\Configuration::hasKey((string) $name, null, null, (int) $shopId)) {\n $result = $result && \\Configuration::updateValue(\n (string) $name,\n $value,\n false,\n null,\n (int) $shopId\n );\n }\n }\n }\n\n return $result;\n }", "function install()\n {\n \t// Creating tables\n\t\t\tinclude('db/tables.php');\n }", "public static function install() {\n\t\terror_log('INSTALLL plugin');\n\t\t$product_list = Product_List::get();\n\t\t$product_list->create_product_list_table();\n\t\t$product_list->create_product_list_detail_table();\n\t\tadd_option( 'product_list_version', Product_List::PRODUCT_LIST_VERSION );\n\n\t\twp_schedule_event( time(), 'hourly', 'my_cron_event' );\n\n\t}", "public function install($args, $assocArgs)\n {\n if (empty($args[0])) {\n \\WP_CLI::error('Missing destination alias.');\n }\n $this->copyInstall($args[0]);\n }", "public function install( $args = null, $assoc_args = array() ){\n\n\t\t# plugin check, download and activation\n\t\t$this->manage_plugins( $assoc_args['plugin'] );\n\n\t\t# download and import test data\n\t\t$this->import_test_data( $assoc_args['data'] );\n\n\t\t# update blog options\n\t\t$this->update_test_options( $assoc_args['option'] );\n\n\t\t# (optional) create custom menus\n\t\tif ( isset( $assoc_args['menus'] ) ):\n\t\t\t$this->create_test_menus();\n\t\tendif;\n\t}", "abstract public function installPhpMyAdmin();", "public function install()\n {\n if (extension_loaded('curl') == false)\n {\n $this->_errors[] = $this->l('You have to enable the cURL extension on your server to install this module');\n return false;\n }\n\n Configuration::updateValue('KUSHKIPAGOS_LIVE_MODE', false);\n Configuration::updateValue('KUSHKIPAGOS_TRANSFER', false);\n Configuration::updateValue('KUSHKIPAGOS_DEV', true);\n\n PrestaShopLogger::addLog('Instalación de módulo de pagos Kushki', 2);\n if( parent::install()\n && $this->registerHook('payment')\n && $this->registerHook('paymentOptions')\n && $this->registerHook('paymentReturn')\n && $this->registerHook('displayHeader')\n && $this->registerHook('actionProductCancel')\n && $this->registerHook('actionPaymentConfirmation')\n ){\n return true;\n }else{\n $this->_errors[] = $this->l('No se pudo registrar los hooks payment');\n return false;\n }\n\n // install DataBase\n if (!$this->installSQL()) {\n $this->_errors[] = $this->l('No se pudo ejecutar el sql');\n return false;\n }\n\n return true;\n\n }", "public function install()\n {\n if (!extension_loaded('curl')) {\n $this->_errors[] = 'You have to enable the cURL extension on your server to install this module';\n return false;\n }\n //multistore\n if (Shop::isFeatureActive()) {\n Shop::setContext(Shop::CONTEXT_ALL);\n }\n if (!parent::install() || !$this->registerHook('payment') || !$this->registerHook('paymentOptions') ||\n !$this->registerHook('paymentReturn') || !$this->registerHook('displayAdminOrder') ||\n !$this->registerHook('displayOrderDetail') || !$this->registerHook('header') ||\n !$this->registerHook('actionAdminControllerSetMedia') || !$this->registerHook('actionFrontControllerSetMedia') || !$this->registerHook('displayBackOfficeHeader')\n ) {\n return false;\n }\n try {\n ConfigFactory::buildIfthenpaySql()->createIfthenpayLogSql();\n return true;\n } catch (\\Throwable $th) {\n throw new \\Exception($th->getMessage());\n }\n }", "public function install()\n\t{\n\t\tif (Shop::isFeatureActive()) {\n\t\t\tShop::setContext(Shop::CONTEXT_ALL);\n\t\t}\n\n\t\t//initialize empty settings\n\t\tConfiguration::updateValue('CLERK_PUBLIC_KEY', '');\n\t\tConfiguration::updateValue('CLERK_PRIVATE_KEY', '');\n\n\t\tConfiguration::updateValue('CLERK_SEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_SEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_INCLUDE_CATEGORIES', 0);\n\t\tConfiguration::updateValue('CLERK_LIVESEARCH_TEMPLATE', '');\n\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_ENABLED', 0);\n\t\tConfiguration::updateValue('CLERK_POWERSTEP_TEMPLATES', '');\n\n\t\treturn parent::install() &&\n $this->registerHook('top') &&\n\t\t\t$this->registerHook('footer') &&\n\t\t\t$this->registerHook('displayOrderConfirmation');\n\t}", "public function install()\n {\n $this->initConfig();\n $this->loadConfig();\n $this->config['installed']=ASTAT_VERSION2;\n $this->config['newInstall']='y';\n $this->saveConfig();\n\n GPCCore::register($this->getPluginName(), ASTAT_VERSION, ASTAT_GPC_NEEDED);\n\n return(true);\n }", "private function pageInstall() {\n\t//expect $_FILE['install']\n\t//extract file to /tmp/\n\t//read module information file\n\t//put files into modules/$module/\n\t//run install class in modules/$module/install.php\n\t//install class may have a custom install form and should return information if install is done.\n\t}", "static function install_config($conn,$url,&$file_data)\n\t{\n\t\t$config = CmsConfig::get_instance();\n\t\t$config_data = $config->params;\n\t\t//Update the defaults with what we have. Start with database\n\t\t$drivers = CmsInstallOperations::get_loaded_database_modules();\n\t\t$config_data['dbms'] = $drivers[$conn['driver']];\n\t\t$config_data['db_username'] = $conn['username'];\n\t\t$config_data['db_hostname'] = $conn['hostname'];\n\t\t$config_data['db_password'] = $conn['password'];\n\t\t$config_data['db_name'] = $conn['dbname'];\n\t\t$config_data['db_prefix'] = $conn['table_prefix'];\n\t\t//Now location stuff\n\t\t$config_data['root_path'] = $url['rootpath'];\n\t\t$config_data['root_url'] = $url['rooturl'];\n\t\t$config_data[\"previews_path\"] = $config_data[\"root_path\"] . \"/tmp/cache\";\n\t\t$config_data[\"uploads_path\"] = $config_data[\"root_path\"] . \"/uploads\";\n\t\t$config_data[\"uploads_url\"] = $config_data[\"root_url\"] . \"/uploads\";\n\t\t$config[\"image_uploads_path\"] = $config_data[\"root_path\"] . \"/uploads/images\";\n\t\t$config[\"image_uploads_url\"] = $config_data[\"root_url\"] . \"/uploads/images\";\n\t\t//Generate the file\n\t\t$file_data = \"<?php\\n\";\n\t\t$file_data .= $config->config_text($config_data);\n\t\t$file_data .= \"\\n?>\";\n\t\t//Write the file\n\t\treturn @file_put_contents(CONFIG_FILE_LOCATION,$file_data) > 0;\n\t}", "public function install()\n {\n\n if (!function_exists('curl_version')) {\n $this->_errors[] = $this->l('You have to enable the cURL extension on your server to install this module.');\n return false;\n }\n\n if (!parent::install() || !$this->registerHook('invoice') || !$this->registerHook('payment') || !$this->registerHook('paymentReturn') || !$this->registerHook('paymentOptions')) {\n return false;\n }\n\n /**\n * Create Becopay order table\n */\n $this->__createBecopayTable();\n\n return true;\n }", "public function install() {\n\t\t$api_key = String::generate_key();\n\t\t$get_existing_key = get_option( $this->api_key_option_name );\n\t\tif ( false == $get_existing_key ) {\n\t\t\tupdate_option( $this->api_key_option_name, $api_key );\n\t\t}\n\t}", "public static function install()\n\t{\n\t\tmanpower_create_page_with_slug(MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_catalog_slug', MANPOWER_DEFAULT_CATALOG_SLUG);\n\t\tupdate_option('mp_worker_slug', MANPOWER_DEFAULT_WORKER_SLUG);\t\t\n\t}", "public function install()\n {\n // create table\n try {\n DoctrineHelper::createSchema($this->entityManager, array(\n 'Tasks_Entity_Tasks',\n 'Tasks_Entity_Participants',\n 'Tasks_Entity_Categories'\n ));\n } catch (Exception $e) {\n LogUtil::registerStatus($e->getMessage());\n return false;\n }\n\n $this->createdefaultcategories();\n\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n \n // Initialisation successful\n return true;\n }", "function install($data='') {\r\n parent::install();\r\n }", "function install($data='') {\r\n parent::install();\r\n }", "public function runSetupScripts()\n\t\t{\n\t\t\t$xmlResources = \\Z::getConfig()->getResources();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tcatch (\\Sys\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->initialInstall();\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tforeach ($xmlResources as $name => $resource)\n\t\t\t{\n\t\t\t\t// this is the version we should have installed on our system\n\t\t\t\t$latestVersion = $resource['requiredVersion'];\n\t\t\t\t// this is the version we currently have on our system, if the\n\t\t\t\t// extension is installed at all\n\t\t\t\t$installedExtension = $installedResources->isInstalled($name);\n\t\t\t\tif ($installedExtension)\n\t\t\t\t\t$installedVersion = $installedExtension->getVersion();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$installedVersion = '0.0.0';\n\t\t\t\t\t$installedExtension = \\Z::getModel('core/extension');\n\t\t\t\t}\n\t\t\t\t$end = 'install-'.$latestVersion.'.php';\n\t\t\t\t$start = 'install-'.$installedVersion.'.php';\n\t\t\t\tif ($latestVersion != $installedVersion)\n\t\t\t\t{\n\t\t\t\t\t$installerFilesLocation = \\Z::getConfig()->getModule($resource['module'])->getPath('sql/'.$name.'/');\n\t\t\t\t\t$handle = opendir($installerFilesLocation);\n\t\t\t\t\tif ($handle)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (FALSE !== ($file = readdir($handle)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strpos($file, '.php') > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($file > $start) && ($file <= $end))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->_executedFiles[] = $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t//echo $installerFilesLocation.$file.'<br/>';\n\t\t\t\t\t\t\t\t\tinclude $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t// after the script is executed, set the\n\t\t\t\t\t\t\t\t\t// current version in the extension table\n\t\t\t\t\t\t\t\t\tif ($installedExtension->getCode() != '')\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion)\n\t\t\t\t\t\t\t\t\t\t\t->setCode($name);\n\t\t\t\t\t\t\t\t\t$installedExtension->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// execute the install script for $file\n\t\t\t\t\t\t\t\t// update the version in the table\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new \\Sys\\Exception('Cannot open the location => %s of the setup install scripts',\n\t\t\t\t\t\t\t$installerFilesLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function install()\n {\n // create tables\n try {\n DoctrineHelper::createSchema($this->entityManager, array('PostCalendar_Entity_CalendarEvent',\n 'PostCalendar_Entity_EventCategory',\n 'PostCalendar_Entity_RecurException'));\n } catch (Exception $e) {\n LogUtil::registerError($this->__f('Error! Could not create tables (%s).', $e->getMessage()));\n return false;\n }\n\n // insert default category\n try {\n $this->createCategoryTree();\n } catch (Exception $e) {\n LogUtil::registerError($this->__f('Did not create default categories (%s).', $e->getMessage()));\n }\n\n\n // PostCalendar Default Settings\n $defaultsettings = PostCalendar_Util::getdefaults();\n $result = $this->setVars($defaultsettings);\n if (!$result) {\n return LogUtil::registerError($this->__('Error! Could not set the default settings for PostCalendar.'));\n }\n\n $this->createinstallevent();\n\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n HookUtil::registerProviderBundles($this->version->getHookProviderBundles());\n\n // register handlers\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'get.pending_content', array('PostCalendar_Handlers', 'pendingContent'));\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'installer.module.uninstalled', array('PostCalendar_HookHandlers', 'moduleDelete'));\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'module_dispatch.service_links', array('PostCalendar_HookHandlers', 'servicelinks'));\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'controller.method_not_found', array('PostCalendar_HookHandlers', 'postcalendarhookconfig'));\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'controller.method_not_found', array('PostCalendar_HookHandlers', 'postcalendarhookconfigprocess'));\n EventUtil::registerPersistentModuleHandler('PostCalendar', 'module.content.gettypes', array('PostCalendar_Handlers', 'getTypes'));\n\n return true;\n }", "public function install(array $module_list, $enable_dependencies = TRUE);", "public function install()\n {\n $logger = $this->container->get('logger');\n $userName = $this->container->get('zikula_users_module.current_user')->get('uname');\n \n // Check if upload directories exist and if needed create them\n try {\n $container = $this->container;\n $uploadHelper = new \\MU\\FilesModule\\Helper\\UploadHelper(\n $container->get('translator.default'),\n $container->get('filesystem'),\n $container->get('session'),\n $container->get('logger'),\n $container->get('zikula_users_module.current_user'),\n $container->get('zikula_extensions_module.api.variable'),\n $container->getParameter('datadir')\n );\n $uploadHelper->checkAndCreateAllUploadFolders();\n } catch (\\Exception $exception) {\n $this->addFlash('error', $exception->getMessage());\n $logger->error('{app}: User {user} could not create upload folders during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n // create all tables from according entity definitions\n try {\n $this->schemaTool->create($this->listEntityClasses());\n } catch (\\Exception $exception) {\n $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());\n $logger->error('{app}: Could not create the database tables during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n \n // set up all our vars with initial values\n $this->setVar('allowedExtensions', 'pdf,doc,docx,odt');\n $this->setVar('maxSize', '200k');\n $this->setVar('onlyParent', false);\n $this->setVar('specialCollectionMenue', false);\n $this->setVar('collectionEntriesPerPage', 10);\n $this->setVar('linkOwnCollectionsOnAccountPage', true);\n $this->setVar('fileEntriesPerPage', 10);\n $this->setVar('linkOwnFilesOnAccountPage', true);\n $this->setVar('showOnlyOwnEntries', false);\n $this->setVar('moderationGroupForCollections', 2);\n $this->setVar('moderationGroupForFiles', 2);\n $this->setVar('allowModerationSpecificCreatorForCollection', false);\n $this->setVar('allowModerationSpecificCreationDateForCollection', false);\n $this->setVar('allowModerationSpecificCreatorForFile', false);\n $this->setVar('allowModerationSpecificCreationDateForFile', false);\n $this->setVar('enabledFinderTypes', 'collection###file');\n \n // add default entry for category registry (property named Main)\n $categoryHelper = new \\MU\\FilesModule\\Helper\\CategoryHelper(\n $this->container->get('translator.default'),\n $this->container->get('request_stack'),\n $logger,\n $this->container->get('zikula_users_module.current_user'),\n $this->container->get('zikula_categories_module.category_registry_repository'),\n $this->container->get('zikula_categories_module.api.category_permission')\n );\n $categoryGlobal = $this->container->get('zikula_categories_module.category_repository')->findOneBy(['name' => 'Global']);\n if ($categoryGlobal) {\n $categoryRegistryIdsPerEntity = [];\n $entityManager = $this->container->get('doctrine.orm.default_entity_manager');\n \n $registry = new CategoryRegistryEntity();\n $registry->setModname('MUFilesModule');\n $registry->setEntityname('CollectionEntity');\n $registry->setProperty($categoryHelper->getPrimaryProperty('Collection'));\n $registry->setCategory($categoryGlobal);\n \n try {\n $entityManager->persist($registry);\n $entityManager->flush();\n } catch (\\Exception $exception) {\n $this->addFlash('warning', $this->__f('Error! Could not create a category registry for the %entity% entity. If you want to use categorisation, register at least one registry in the Categories administration.', ['%entity%' => 'collection']));\n $logger->error('{app}: User {user} could not create a category registry for {entities} during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'entities' => 'collections', 'errorMessage' => $exception->getMessage()]);\n }\n $categoryRegistryIdsPerEntity['collection'] = $registry->getId();\n }\n \n // initialisation successful\n return true;\n }", "public function install(Module $module);", "public function install() {\n\n if (!parent::install()\n || !$this->registerHook('payment')\n || !$this->config->install()\n ) {\n return false;\n }\n return true;\n }", "public function install_OSF()\n {\n $this->span(\"You are about to install the Open Semantic Framework.\");\n $this->span(\"This installation process installs all the software components that are part of the OSF stack. It will take 10 minutes of your time, but the process will go on for a few hours because of the many pieces of software that get compiled.\\n\");\n $this->span(\"The log of this installation is available here: \".$this->log_file);\n $this->span(\"\\n\\nCopyright 2008-15. Structured Dynamics LLC. All rights reserved.\\n\\n\");\n\n $this->h1(\"General Settings Initialization\");\n $this->prepareDistro();\n\n // Dependency chain:\n // PHP stack for OSF\n $this->installApache();\n $this->installPHP();\n // Java stack for Solr, Owl and Scones\n $this->installJava();\n $this->installTomcat();\n // Backends\n $this->installVirtuoso();\n $this->installSolr();\n $this->installMemcached();\n\n // Generate some OSF API key is none has been defined by the user\n if(empty($this->api_key) || $this->api_key == \"some-key\") \n {\n $this->span(\"Generating a OSF API Key...\", 'info');\n $this->api_key = strtoupper(bin2hex(openssl_random_pseudo_bytes(16)));\n $this->span(\"The generated API Key is {$this->api_key}\", 'notice');\n }\n\n // OSF Tools, Components and Web Service\n $this->switch_OSF_PermissionsManagementTool('install');\n $this->switch_OSF_DatasetsManagementTool('install');\n $this->switch_OSF_OntologiesManagementTool('install');\n $this->switch_OSF_DataValidatorTool('install');\n $this->switch_OSF_TestsSuites('install');\n $this->switch_OSF_WSPHPAPI('install');\n $this->switch_OSF_WebServices('install');\n\n $this->install_OSF_vhost();\n $this->setupSolr();\n $this->installARC2();\n $this->installOWLAPI();\n $this->setupVirtuoso();\n $this->load_OSF_OntologiesManagementTool();\n\n $this->installPHPUnit();\n $this->runOSFTestsSuites($this->osf_web_services_folder);\n\n $this->span(\"Now that the OSF instance is installed, you can install OSF for Drupal on the same server using this command:\\n\\n\", 'notice');\n $this->span(\" ./osf-installer -d --install-osf-drupal\\n\\n\", 'notice');\n }", "public function install() {\n $this->load->model('extension/module/export_yml');\n $this->model_extension_module_export_yml->installPromCategoryTable();\n $this->model_extension_module_export_yml->installPromProductTable();\n }", "public function install($env = \"dev\")\n {\n if (!file_exists(\".built\")) {\n $this->build();\n }\n $this->buildDrushTask()\n ->siteName(getenv('SITE_NAME'))\n ->siteMail(getenv('SITE_MAIL'))\n ->locale(getenv('LOCALE'))\n ->accountMail(getenv('ADMIN_MAIL'))\n ->accountName(getenv('ADMIN_NAME'))\n ->siteInstall(getenv('SITE_PROFILE'))\n ->run();\n }", "public function install()\n {\n $this->initConfig();\n $this->loadConfig();\n $this->config['installed']=GPC_VERSION2;\n $this->saveConfig();\n\n $result=GPCRequestBuilder::createTables();\n return($result);\n }", "function install($moduleName);", "function install(){\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Activar módulo Pagosonline', 'MODULE_PAYMENT_PAYCO_STATUS', 'True', 'Quiere aceptar pagos usando Payco?', '6', '3', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Id Usuario', 'MODULE_PAYMENT_PAYCO_ID_COM', '', 'Codigo de usuario (usuarioId) proporcionado por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Llave secreta', 'MODULE_PAYMENT_PAYCO_ID_SEED', '', 'Clave de encriptación proporcionada por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('URL de la pasarela de pago', 'MODULE_PAYMENT_PAYCO_URL', 'https://secure2.payco.co/payment.php', 'Direccion en internet de la pasarela de pago', '6', '4', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Prueba', 'MODULE_PAYMENT_PAYCO_PRUEBA', '1', 'Prueba es la variable para poner su carrito en modo de pruebas, si quiere hacer transacciones en modo de pruebas debe ingresar 1 y si si quiere estar en produccion debe dejarlo en o', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Orden de aparicion.', 'MODULE_PAYMENT_PAYCO_SORT_ORDER', '0', 'Orden de aparicion. Numero menor es mostrado antes que los mayores.', '6', '0', now())\");\n\n tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Zona de pago', 'MODULE_PAYMENT_PAYCO_ZONE', '0', 'Si selecciona una zona, este módulo sólo estará disponible en esa zona.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Estado del pedido', 'MODULE_PAYMENT_PAYCO_ORDER_STATUS_ID', '0', 'Seleccione el estado del pedido un vez procesado con este módulo', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n \n\t}", "function com_install() {\n\tglobal $mosConfig_absolute_path;\n\tmkdir($mosConfig_absolute_path . '/mambots/ajax');\n}", "public function install($data = array()) {\n\t\t$this->pkg = parent::install();\n\n\t// Installing\n\t\t $this->installOrUpgrade($data);\n\t}", "public function install()\n {\n // Install default\n if (!parent::install()) {\n return false;\n }\n\n if (!$this->registrationHook()) {\n return false;\n }\n\n if (!Configuration::updateValue('EPUL_USERNAME', '')\n || !Configuration::updateValue('EPUL_PASSWORD', '')\n ) {\n return false;\n }\n\n return true;\n }", "public function install()\n {\n // Save the new component\n $this->component = $this->createComponent();\n\n // Create the necessary fields for the component\n $this->createComponentFields();\n\n // Register all necessary events to handle the data.\n $this->registerEvents();\n\n return true;\n }", "public function install()\n {\n if (!parent::install())\n {\n return false;\n }\n\n if (!$this->registerHooks(array('displayPayment', 'displayPaymentReturn')))\n {\n return false;\n }\n\n if (!$this->createPaynetPaymentsTable())\n {\n return false;\n }\n\n if (Shop::isFeatureActive())\n {\n Shop::setContext(Shop::CONTEXT_ALL);\n }\n\n if (!$this->saveConfig())\n {\n return false;\n }\n\n return true;\n }", "public function install()\n {\n /**\n * Add the information into the database.\n * This is commented out so we don't actually\n * create anything.\n */\n $this->uninstall();\n $sql = Schema::createTable(\n $this->tablename,\n true,\n array(\n 'rID',\n 'rName',\n 'rDesc',\n 'rCreatedBy',\n 'rCreatedTime'\n ),\n array(\n 'INTEGER',\n 'VARCHAR(255)',\n 'LONGTEXT',\n 'VARCHAR(40)',\n 'TIMESTAMP'\n ),\n array(\n false,\n false,\n false,\n false,\n false\n ),\n array(\n false,\n false,\n false,\n false,\n 'CURRENT_TIMESTAMP'\n ),\n array(\n 'rID',\n 'rName'\n ),\n 'MyISAM',\n 'utf8',\n 'rID',\n 'rID'\n );\n\n if (!self::$DB->query($sql)) {\n return false;\n } else {\n $sql = sprintf(\n \"INSERT INTO `%s` VALUES\"\n . \"(1, 'Administrator', 'FOG Administrator', 'fog', NOW()),\"\n . \"(2, 'Technician', 'FOG Technician', 'fog', NOW())\",\n $this->tablename\n );\n self::$DB->query($sql);\n }\n return self::getClass('AccessControlAssociationManager')->install();\n }", "public function install(){\r\n\r\n\t\t$this->load->library('module_installer');\r\n\r\n\t\t$lang_avail = $this->config->item('lang_avail');\r\n\t\t\r\n\t\t$data['dbprefix'] = $this->db->dbprefix;\r\n\t\t\t\r\n\t\t\r\n\t\t//echo \" FLAG1 \";\r\n\t\t\t\t\r\n\t\tforeach($lang_avail AS $langcode=>$language){ \r\n\t\t\r\n\t\t\t$data['langcode'] = $langcode;\r\n\t\t\r\n\t\t\t$this->module_installer->process_file(dirname(dirname(__FILE__)) . \"/install/mydata.sql\",$data);\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// now copy any required css or js fles to the assets folder\r\n\t\t$this->module_installer->copy_assets(\"/custom_modules/\" . $this->router->class);\r\n\r\n\t\t\r\n\t}", "function xh_install($db_name)\r\n\t{\r\n\t}", "protected function install()\n {\n // 3 Full multi user mode (with networking)\n // 4 unused (but set anyway)\n // 5 X11\n\n if(file_exists('/etc/init.d/anyterm')){\n echo \"Anyterm daemon already installed\\n\";\n exit;\n }\n\n if(!is_writable('/etc/init.d')){\n echo \"Cant install daemon, please execute as root or use sudo\\n\";\n exit;\n }\n\n\n $initd = file_get_contents(dirname(__DIR__).'/Resources/anyterm/anyterm');\n $initd = str_replace('#path#', dirname(dirname(dirname(dirname(dirname(__DIR__))))).'/app/console', $initd);\n file_put_contents('/etc/init.d/anyterm', $initd);\n chmod('/etc/init.d/anyterm', 777);\n\n shell_exec('chkconfig --add anyterm');\n shell_exec('chkconfig --level 126 anyterm off');\n shell_exec('chkconfig --level 345 anyterm on');\n }", "public function install(){\n\t\ttry{\n\n\t\t\t$settings = Setting::first();\n\t\t\tif($settings){\n\t\t\t\treturn Redirect::to('/');\n\t\t\t} else {\n\t\t\t\tthrow new Exception('settings not set, first install the script');\n\t\t\t}\n\n\t\t}catch(Exception $e){\n\n\t\t\t\treturn Redirect::to('/install.php');\n\n\t\t}\n\t}", "public function manualInstallAction()\r\n\t{\r\n\t $helper = Mage::helper('manager');\r\n // initialize the channel model\r\n $chn = Mage::getModel('manager/channel');\r\n // load by given channel_id if there is an id\r\n if ($channel_id = $this->getRequest()->getParam('channel_id')) {\r\n \t$chn->load($channel_id);\r\n \t// set channel name\r\n \t$channelName = $chn->getUrl();\r\n \t// get package name from post data\r\n \t$packageName = $this->getRequest()->getParam('package_name');\r\n \t// try to get package information for given package_name\r\n \t$package = $this->_service->packageInfo(\r\n \t\t$packageName,\r\n \t $channelName\r\n \t);\r\n \tif ($package) {\r\n\t \t// initialize the package model\r\n\t $pkg = Mage::getModel('manager/package');\r\n\t // try to load the package from the database by its name\r\n\t $id = $pkg->loadByName($packageName)->getId();\r\n\t if (empty($id)) {\r\n\t // if the package is new, create it\r\n\t $pkg->setChannelIdFk($chn->getId());\r\n\t $pkg->setName($packageName);\r\n\t $pkg->setSummary($package['summary']);\r\n\t $pkg->setVersionInstalled($package['installed']);\r\n\t if (is_array($package['releases'])) {\r\n\t $pkg->setVersionLatest(\r\n\t reset(\r\n\t array_keys($package['releases'])\r\n\t )\r\n\t );\r\n\t }\r\n\t $pkg->setCreatedTime(now());\r\n\t \t\t\t$pkg->setUpdateTime(now());\r\n\t } else {\r\n\t // if the package already exists update it\r\n\t $pkg->setSummary($package['summary']);\r\n\t $pkg->setVersionInstalled($package['installed']);\r\n\t if (is_array($package['releases'])) {\r\n\t $pkg->setVersionLatest(\r\n\t reset(\r\n\t array_keys($package['releases'])\r\n\t )\r\n\t );\r\n\t }\r\n\t \t\t\t$pkg->setUpdateTime(now());\r\n\t }\r\n\t // set the package state\r\n $pkg->setState($helper->getPackageState($pkg));\r\n // save the package\r\n \t $pkg->save();\r\n \t // set package id to request params\r\n \t $this->getRequest()->setParam('id', $pkg->getId());\r\n \t $this->_forward('install');\r\n \t}\r\n } else {\r\n \tMage::getSingleton('adminhtml/session')->addError(\r\n $helper->__(\r\n '201.error.package-no-id'\r\n )\r\n );\r\n }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "public function install()\n {\n // Set up module config variables\n $this->setVar('ztools_backupsdir', 'userdata/Ztools/backups');\n $this->setVar('ztools_scriptsdir', 'userdata/Ztools/scripts');\n $this->setVar('ztools_scriptssort', '0');\n $this->setVar('ztools_scriptseditor', '1');\n $this->setVar('ztools_showphpinfo', '1');\n $this->setVar('ztools_downloaduseranges', '0');\n $this->setVar('ztools_url_cpanel', '');\n $this->setVar('ztools_url_phpmyadmin', '');\n $this->setVar('ztools_exportmethod', '2');\n $this->setVar('ztools_exportcompress', '0');\n $this->setVar('ztools_expmethodshow', '1');\n $this->setVar('ztools_mysqldumpexe', '');\n\n // Register hooks\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n\n return true;\n }", "public function install()\n\t{\n\t\t$data = array(\n\t\t\t'module_name' => $this->module_name,\n\t\t\t'module_version' => $this->version,\n\t\t\t'has_cp_backend' => 'y',\n\t\t\t'has_publish_fields' => 'n'\n\t\t);\n\n\t\t$this->EE->db->insert('modules', $data);\n\n\t\treturn TRUE;\n\t}", "function install($data='') {\n parent::install();\n\n\n }", "function install_site() {\n \n}", "public static function install(): void\n {\n static::updatePackages();\n static::updatePackages(false);\n static::updateComposerPackages();\n static::updateComposerPackages(false);\n static::updateComposerScripts();\n static::updatePackagesScripts();\n static::updateStyles();\n static::updateBootstrapping();\n static::updateWelcomePage();\n static::updatePagination();\n static::updateLayout();\n static::removeNodeModules();\n }", "public function configuration() {\r\n\t\t$status = $this->Installation_model->set_configuration();\r\n\t\tif ($status == 'error') {\r\n\t\t\t$this->session->set_flashdata('flash', 'error');\r\n\t\t\t$this->session->set_flashdata('title', 'Installation has failed! Please try again.');\r\n\t\t} elseif ($status == 'success') {\r\n\t\t\t$this->Installation_model->install_sql_database();\r\n\t\t\t$this->session->set_flashdata('flash', 'success');\r\n\t\t\t$this->session->set_flashdata('title', 'Successfully installed!');\r\n\t\t}\r\n\t\t\r\n\t\t$this->load->view('installation/config_form');\r\n\r\n\t}" ]
[ "0.73395854", "0.728869", "0.728869", "0.72383934", "0.69494647", "0.694625", "0.6924911", "0.6838052", "0.6838052", "0.67896235", "0.67401373", "0.6446998", "0.6415371", "0.6376755", "0.63511974", "0.6327017", "0.6307957", "0.62990814", "0.6296765", "0.6290088", "0.627937", "0.62782866", "0.62573415", "0.62348723", "0.62190104", "0.6201382", "0.6188091", "0.6158144", "0.61230874", "0.6119102", "0.60778105", "0.60345936", "0.6029738", "0.6017715", "0.60026354", "0.5964114", "0.5960529", "0.5920508", "0.591996", "0.589276", "0.5884726", "0.5867077", "0.58492124", "0.58418524", "0.5826653", "0.5822448", "0.57985574", "0.5779609", "0.5763867", "0.5757756", "0.5743114", "0.5740287", "0.5731987", "0.57196856", "0.57122713", "0.5699262", "0.5698272", "0.5691091", "0.56762314", "0.56753176", "0.56722265", "0.5670914", "0.56670535", "0.5666879", "0.56556904", "0.5625728", "0.5619327", "0.5614755", "0.5595242", "0.5591522", "0.5591522", "0.5591035", "0.5589622", "0.5587672", "0.55801415", "0.556889", "0.556602", "0.55545795", "0.5553511", "0.5550712", "0.5540651", "0.55400664", "0.5530373", "0.55276424", "0.5525439", "0.55223095", "0.55113804", "0.55094755", "0.5509078", "0.55080676", "0.55029047", "0.54946715", "0.54875976", "0.54862684", "0.5484376", "0.54792124", "0.547231", "0.5470524", "0.54599285", "0.54473746" ]
0.61865216
27
Check whether or not a Revo installation is available
protected function isAlreadyInstalled($key = 'config') { $path = $this->getCorePath(); return file_exists(realpath("{$path}/config/{$key}.inc.php")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasInstall();", "public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function checkInstallationStatus() {\n global $configFile, $_PATHCONFIG;\n\n $result = @include_once'..'.$configFile;\n if ($result === false) {\n return false;\n } else {\n return (defined('CONTREXX_INSTALLED') && CONTREXX_INSTALLED);\n }\n }", "private function checkinstallrequirement()\r\n\t{\r\n\t\t$userCount = Core_User::getUsers(array(), '', '', '', true);\r\n\t\t\r\n\r\n\t\t\r\n\t\tif($userCount > 0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public function isInstalled(){\n return true;\n }", "public function is_installed() {\n return function_exists('solr_get_version');\n }", "function is_installed()\n{\n return has_account() && has_meta();\n}", "public static function isAvailable(): bool\n {\n // Don't want this to warn\n @exec('which latexmk', $output, $return);\n\n return $return === 0;\n }", "public function isAvailable()\n\t{\n\t\ttry {\n\t\t\t$output = $this->execute('x = 3;');\n\t\t} catch (ExternalRuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "public function isAvailable() {\n return (function_exists('apc_fetch') || function_exists('apcu_fetch')) &&\n ini_get('apc.enabled') &&\n (ini_get('apc.enable_cli') || php_sapi_name() != 'cli');\n }", "public function isValidInstall() {\n\t\treturn $this->install !== null;\n\t}", "public function isAvailable() {\n $path = $this->path();\n return file_exists($path);\n }", "function neosIsInstalled(): bool\n{\n return test('[ -f {{deploy_path}}/shared/Configuration/Settings.yaml ]');\n}", "public function is_installed() {\n\n }", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "public function install(): bool;", "function ppom_pro_is_installed() {\n\t\n\t$return = false;\n\t \n if( class_exists('PPOM_PRO') ) \n $return = true;\n return $return;\n}", "function isAvailable() ;", "function isAvailable() ;", "public static function installToolEnableFileExists() {}", "public static function available()\n\t{\n\t\treturn function_exists('curl_init');\n\t}", "function isAvailable()\n {\n }", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "function fiorello_mikado_revolution_slider_installed() {\n\t\treturn class_exists( 'RevSliderFront' );\n\t}", "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 }", "function is_available() {\n global $CFG;\n\n //we need the curriculum directory\n if (!file_exists($CFG->dirroot.'/curriculum/config.php')) {\n return false;\n }\n\n //we also need the curr_admin block\n if (!record_exists('block', 'name', 'curr_admin')) {\n return false;\n }\n\n //everything needed is present\n return true;\n }", "public function isAvailable(): bool;", "function available() {\n\t\treturn function_exists('curl_init');\n\t}", "function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}", "function check_software_license()\n {\n $q = $this->db->where('license', $this->input->post('license_num'))->where('action_type', 'install')->where('company_id', $this->session->userdata('company_id'))->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "function getIsAvailable() ;", "public static function is_available()\n {\n }", "public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }", "public static function isAvailable()\n\t{\n\t\treturn true;\n\t}", "public function isAvailable(): bool\n {\n return true;\n }", "function sloodle_is_installed()\n {\n // Is there a Sloodle entry in the modules table?\n return sloodle_record_exists('modules', 'name', 'sloodle');\n }", "public function checkForManager() {\n\t\t\t// if activated return version\n\t\t\tif ( defined( 'WPFCM_VERSION' ) ) {\n\t\t\t\treturn WPFCM_VERSION;\n\t\t\t}\n\n\t\t\t// if installed return true\n\t\t\tif ( is_dir( $this->wpfcm_path ) || is_link( $this->wpfcm_path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}", "function check_fresh_install_sc($params) {\n\tif (empty($_SERVER['PEPPER'])) {\n\t\tset_variable('fresh_install', 'yes');\n\t} else {\n\t\tset_variable('fresh_install', 'no');\n\t}\n}", "public static function isInstalled(){\n $localxml = BP . DS . self::CLIENT_DIR . DS . self::getClientCode() . DS . 'etc'. DS . 'local.xml';\n \n if(!file_exists($localxml))\n return false;\n\n $xmlObj = new Varien_Simplexml_Config($localxml); \n $date = (string)$xmlObj->getNode('global/install/date');\n if(!strtotime($date))\n return false;\n \n return true;\n }", "abstract function has_premium_version();", "public function requireInstallation() {\n return is_object($this->installer);\n }", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isInstalled(){\n if(self::$isInstalled === true){\n return true; \n }\n \n exec('type diatheke', $output, $returnVal);\n if($returnVal === 0){\n self::$isInstalled = true;\n return true;\n }else{\n return false;\n }\n \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() {}", "protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}", "public function checkOperationality()\n {\n if (!extension_loaded('vips')) {\n throw new SystemRequirementsNotMetException('Required Vips extension is not available.');\n }\n\n if (!function_exists('vips_image_new_from_file')) {\n throw new SystemRequirementsNotMetException(\n 'Vips extension seems to be installed, however something is not right: ' .\n 'the function \"vips_image_new_from_file\" is not available.'\n );\n }\n\n // TODO: Should we also test if webp is available? (It seems not to be neccessary - it seems\n // that webp be well intergrated part of vips)\n }", "function has_release_on_freemius() {\n\t\t\treturn ! $this->is_org_repo_compliant() ||\n\t\t\t $this->has_premium_version();\n\t\t}", "function __requirements(){\n\nglobal $__settings, $error, $software;\n\n\t//If there are some shorfalls then pass it to $error and return false\n\tif(sversion_compare($__settings['ver'], '5.5.2.1', '<')){\n\t\t$error[] = 'You cannot upgrade to '.$software['ver'].' unless you have upgraded to 5.5.2.1';\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\n}", "public function is_installed() { \n\n $sql = \"DESCRIBE `localplay_mpd`\";\n $db_results = Dba::query($sql);\n\n return Dba::num_rows($db_results);\n\n\t}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "function plugin_satisfactionsmiley_check_prerequisites() {\n global $DB;\n\n $version = rtrim(GLPI_VERSION, '-dev');\n if (version_compare($version, '9.5', 'lt')) {\n //echo \"This plugin requires GLPI 9.5\";\n //return false;\n }\n\n if (!isset($_SESSION['glpi_plugins'])) {\n $_SESSION['glpi_plugins'] = [];\n }\n\n if (version_compare(GLPI_VERSION, '9.5-dev', '!=')\n && version_compare(GLPI_VERSION, '9.5', 'lt')\n || version_compare(GLPI_VERSION, '9.6', 'ge')) {\n if (method_exists('Plugin', 'messageIncompatible')) {\n echo Plugin::messageIncompatible('core', '9.5', '9.6');\n } else {\n echo __('Your GLPI version not compatible, require >= 9.5 and < 9.6', 'satisfactionsmiley');\n }\n return false;\n }\n return true;\n}", "public function hasInstalled()\n {\n return $this->installed !== null;\n }", "public function hasUninstall();", "public function isInstalled()\n {\n $installed = false;\n // check configuration options\n if (!$this->testDossierDeadlineConfigServer()) {\n $installed = true;\n }\n \n return $installed;\n }", "private function isInstalled()\n\t{\n\t\tif(file_exists(ITEMDATA) && file_exists(IM_DATABASE_DIR.IM_DATABASE)){return true;}\n\t\telse return false;\n\t}", "public static function isEnabled()\n\t{\n\t\treturn Main\\ModuleManager::isModuleInstalled('recyclebin');\n\t}", "public static function checkInstallToolEnableFile() {}", "protected function checkPcreVersion() {}", "public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}", "public function check_wp_version_check_exists()\n {\n }", "public function check() {\n\t\trequire_once 'PEAR/Registry.php';\n\t\t$registry = new PEAR_Registry();\n\n\t\t$installedVersion = $registry->packageInfo($this->name, 'version', $this->channel);\n\t\tif (is_null($installedVersion)) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->min && version_compare($installedVersion, $this->min, '<')) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. >= '.$this->min.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\tif ($this->max && (version_compare($installedVersion, $this->max, '>'))) {\n\t\t\t$this->log('Package \"'.$this->name.'\" from \"'.$this->channel.'\" is '.$installedVersion.'. <= '.$this->max.' is required', Project::MSG_ERR);\n\t\t\treturn 1;\n\t\t}\n\t\t$this->log('Package \"'.$this->name.'\" '.$installedVersion.' is passed', Project::MSG_VERBOSE);\n\n\t\treturn 0;\n\t}", "public function hasPackageManager() {}", "public static function isAvailable ()\n\t{\n\t\tif (!function_exists('curl_version')){\n\t\t\treturn false;\n\t\t}\n\n\t\t$versionInfo = curl_version();\n\t\t$versionTab = explode('.', $versionInfo['version']);\n\n\t\tif ($versionTab[0] < 7 || ($versionTab[0] == 7 && $versionTab[1] < 10) || ($versionTab[0] == 7 && $versionTab[1] == 10 && $versionTab[2] < 5)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected static function isInstallToolSession() {}", "public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}", "public function isInstalled()\n {\n return $this->getDataVersion() && $this->getOldStores();\n }", "public function hasVersions(): bool;", "function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}", "function isInstalled($moduleName);", "function stockremove_check_license_use()\n {\n $q = $this->db->where('action_type', 'install')\n ->where('license', $this->input->post('license_num'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n\n }", "abstract public function isAvailable() ;", "function installCheck() {\n // Check if user table exists for check.\n $result = $this->db->exec('SELECT name FROM sqlite_master WHERE type=\"table\" AND name=\"users\"');\n if (empty($result)) {\n $this->installSetupForm();\n } else {\n echo 'The site has already been installed.';\n }\n }", "public function isInstalledVersionAReleasedVersion() {}", "protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }", "public function isYoungerReleaseAvailableReturnsFalseIfNoYoungerReleaseExists() {}", "function check_software_name()\n {\n $q = $this->db\n ->where('action_type', \"install\")\n ->where('computer_ser', $this->input->post('computer'))\n ->where('name', $this->input->post('sw_name'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function isFromVendor(): bool;", "function has_valid_calibre_dir()\n{\n global $globalSettings;\n return (has_global_setting(CALIBRE_DIR) &&\n Calibre::checkForCalibre($globalSettings[CALIBRE_DIR]));\n}", "function cj_authorship_check()\n{\n if (get_site_option(CJ_AUTHORSHIP_VERSION_OPTION) != \\CJ_Authorship\\CJ_Authorship_Handler::VERSION) {\n cj_authorship_install();\n }\n}", "function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function isAvailable(){\n\t\treturn is_dir($this->path);\n\t}", "public function isInstalled(Server $server): bool;", "public function isVconnetEnabled() {\n\t\n\t\t$installed = Mage::helper('core')->isModuleEnabled('Vconnect_Postnord');\n\t\t\n\t\tif($installed == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\n\t}" ]
[ "0.6990328", "0.6768682", "0.66783124", "0.66378236", "0.6504721", "0.6484646", "0.6481667", "0.64459", "0.64318126", "0.6416151", "0.63962257", "0.63912135", "0.63909775", "0.6390712", "0.63529384", "0.63208705", "0.6317318", "0.631451", "0.62875044", "0.62875044", "0.62777334", "0.62727505", "0.625999", "0.6251307", "0.624374", "0.62395275", "0.6221274", "0.62098485", "0.6206094", "0.617464", "0.61722386", "0.61686623", "0.6142826", "0.61389256", "0.6137668", "0.6102861", "0.6091472", "0.6088225", "0.60868204", "0.60863686", "0.60724217", "0.60576284", "0.60504097", "0.6046382", "0.60460854", "0.60460854", "0.60460854", "0.60456884", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.6044973", "0.60448116", "0.60387546", "0.6019926", "0.6009427", "0.6008363", "0.60047525", "0.6004074", "0.6003172", "0.6002057", "0.59931624", "0.5985838", "0.5984235", "0.59582764", "0.5955619", "0.5953079", "0.59511155", "0.59392256", "0.59354675", "0.5934011", "0.5933712", "0.59294635", "0.5918261", "0.59161747", "0.5905872", "0.59058535", "0.5900563", "0.5899734", "0.5881184", "0.58786047", "0.5876507", "0.58757573", "0.58610845", "0.58610195", "0.585472", "0.58493763", "0.58394295", "0.5827817", "0.5826897", "0.5822565" ]
0.0
-1
Try to find the core_path
protected function getCorePath() { $path = $this->source . '/core/'; if (array_key_exists('core', $this->destinations)) { // Custom core destination $path = $this->destinations['core']; } return realpath($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function discoverCurrentCoreSymlink() {}", "function core_path($path = '')\n {\n return phanda()->corePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public function getCoreDir()\n {\n if(!Config::has('MAIN/core_path'))\n {\n Config::set('MAIN/core_path', $this->guessCoreDir());\n }\n\n return Config::get('MAIN/core_path');\n }", "public function getCorePath()\n {\n return WP::applyFilters('wpmvc_core_path', $this->corePath);\n }", "public function core_dir(){\n return $this->plugin_dir() . 'core/';\n }", "public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}", "protected function _Load_Core() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/core');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_core_init',$this);\r\n }", "private function IncludeCore()\n {\n foreach ($this->core_files as $core_file) {\n $path = \"Core/\" . $core_file . \".php\";\n if (file_exists($path))\n include $path;\n else\n throw new Exception(\"There is no a file named '{$path}'.\", 404);\n }\n }", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }", "function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}", "protected static function getDrupalCorePath(Event $event) {\n $composer = $event->getComposer();\n $repositoryManager = $composer->getRepositoryManager();\n $installationManager = $composer->getInstallationManager();\n $localRepository = $repositoryManager->getLocalRepository();\n $packages = $localRepository->getPackages();\n foreach ($packages as $package) {\n if ($package->getName() == 'drupal/core') {\n $installPath = $installationManager->getInstallPath($package);\n return $installPath . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;\n }\n }\n\n return NULL;\n }", "protected function _checkCoreExists(){\n if(!in_array($this->_core,$this->_getCores())){\n throw new Pas_Solr_Exception('That is not a valid core',500);\n } else {\n return true;\n }\n }", "protected function getCoreFolder() {\n return 'core/' . $this->getCollectionDirectory();\n }", "protected static function checkMainPathsExist() {}", "public function isCore()\n {\n return $this->extension === 'core';\n }", "public static function getCoreRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '//www.palmettonewmedia.com/foodfinder/core';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'] . '/core';\n }\n }", "public function pass_core_to_widgets( $core, $path ) {\n\t\t\t$path = str_replace( '\\\\', '/', $path );\n\t\t\t$current_core = str_replace( '\\\\', '/', $this->settings['extra_base_dir'] );\n\n\t\t\tif ( false !== strpos( $path, $current_core ) ) {\n\t\t\t\treturn self::get_instance();\n\t\t\t}\n\n\t\t\treturn $core;\n\t\t}", "function _check_core_module($type) {\n global $config;\n if (!isset($config[\"core_$type\"])) {\n echo(\"No $type module set\");\n die();\n }\n $name = $config[\"core_$type\"];\n $file = PT::$ABSPATH . \"/core_modules/$type/\" . $name . \"/module.php\";\n if (!file_exists($file)) {\n echo(\"$name module not found\");\n die();\n }\n return $file;\n}", "function _maybe_update_core()\n {\n }", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "public function getPublicAframeCoreDir()\n {\n return $this->public_core_dir ?? $this->getPublicRoot() . DIRECTORY_SEPARATOR . 'core';\n }", "private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }", "function requireCoreFile($file)\n{\n require __DIR__ . '/' . $file . '.php';\n}", "function papi_get_core_type_base_path( $file ) {\n\tif ( empty( $file ) || ! is_string( $file ) ) {\n\t\treturn;\n\t}\n\n\t$directories = papi_filter_settings_directories();\n\n\tforeach ( $directories as $directory ) {\n\t\tif ( strpos( $file, $directory ) !== false ) {\n\t\t\t$file = str_replace( $directory . '/', '', $file );\n\t\t}\n\t}\n\n\t$file = explode( '.', $file );\n\n\treturn $file[0];\n}", "public function core_url(){\n return $this->plugin_url() . 'core/';\n }", "protected static function loadCore($class_name)\n\t{\n require_once(COREPATH .\"$class_name.php\");\n }", "public function isCoreClass($path){\n $coreFolders = array(\n UTIL_PATH,\n CONTROLLER_PATH,\n ENTITY_PATH,\n RESOURCES_PATH,\n ERROR_PATH,\n VIEW_PATH\n );\n foreach($coreFolders as $folder){\n $path = str_replace(array('/', '\\\\'), array('', ''), $path);\n $folder = str_replace(array('/', '\\\\'), array('', ''), $folder);\n if(strpos($path, $folder) === 0){\n return true;\n }\n }\n return false;\n }", "protected function _initPaths()\n {\n defined('PROJECT_PATH') || define('PROJECT_PATH', $this->_getProjectPath());\n defined('APPLICATION_PATH') || define('APPLICATION_PATH', $this->_getApplicationPath());\n defined('LIBRARY_PATH') || define('LIBRARY_PATH', $this->_getLibraryPath());\n defined('DOCUMENT_ROOT') || define('DOCUMENT_ROOT', $this->_getDocumentRoot());\n }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "public function get_core_url() {\n\t\t\treturn trailingslashit( $this->settings['base_url'] );\n\t\t}", "private function findPaths() {\n\t\tif(ini_get('open_basedir')) {\n\t\t\t$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));\n\t\t\t$dirs = array();\n\t\t\tforeach ($searchPath as $path) {\n\t\t\t\t// Silencing against https://bugs.php.net/69240\n\t\t\t\tif(@is_dir($path)) $dirs[] = $path;\n\t\t\t}\n\t\t} else {\n\t\t\t$dirs = array_merge(\n\t\t\t\texplode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')),\n\t\t\t\t$this->optimizersExtraPaths\n\t\t\t);\n\t\t\treturn implode(PATH_SEPARATOR . ' ', array_filter($dirs));\n\t\t}\n\t}", "private function getHomeDir()\n\t{\n\t\t// are we in default_www or library?\n\t\t$posDefWWW = strpos($this->workingDir, 'default_www');\n\t\t$posDefLib = strpos($this->workingDir, 'library');\n\n\t\t// we're not in one of forks working dirs\n\t\tif(empty($posDefWWW) && empty($posDefLib))\n\t\t{\n\t\t\t// is there a library path and default_www path available?\n\t\t\tif(!is_dir($this->workingDir . '/default_www') && !is_dir($this->workingDir . '/library'))\n\t\t\t{\n\t\t\t\techo \"This is not a valid Fork NG path. Please initiate in your home folder of your project. \\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// create working paths\n\t\t\t$this->frontendPath = $this->workingDir . '/default_www/frontend/';\n\t\t\t$this->backendPath = $this->workingDir . '/default_www/backend/';\n\t\t\t$this->libraryPath = $this->workingDir . '/library/';\n\t\t\t$this->basePath = $this->workingDir . '/';\n\t\t}\n\t\t// we're in one\n\t\telse\n\t\t{\n\t\t\t// where to split on\n\t\t\t$splitChar = (!empty($posDefWWW)) ? 'default_www' : 'library';\n\n\t\t\t// split the directory to go into default_www\n\t\t\t$workingDir = explode($splitChar, $this->workingDir);\n\t\t\t$workingDir = $workingDir[0];\n\n\t\t\t// create paths\n\t\t\t$this->frontendPath = $workingDir . 'default_www/frontend/';\n\t\t\t$this->backendPath = $workingDir . 'default_www/backend/';\n\t\t\t$this->libraryPath = $workingDir . 'library/';\n\t\t\t$this->basePath = $workingDir;\n\t\t}\n\n\t\t// read the version\n\t\t$oVersion = fopen($this->basePath . 'VERSION.md', 'r');\n\t\t$rVersion = fread($oVersion, filesize($this->basePath . 'VERSION.md'));\n\t\t$rVersion = (int) str_replace('.', '', $rVersion);\n\n\t\t// check if the frontend and backend exist (old fork doesn't have this)\n\t\tif(!is_dir($this->frontendPath) || !is_dir($this->backendPath) || $rVersion < 200)\n\t\t{\n\t\t\techo\"This is an older version of Fork. The Fork tool only works with V2+.\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// create real cli path\n\t\t$this->cliPath = substr($this->cliPath, 0, -6);\n\n\t\t// set paths for overall use\n\t\tdefine('CLIPATH', $this->cliPath);\n\t\tdefine('FRONTENDPATH', $this->frontendPath);\n\t\tdefine('BACKENDPATH', $this->backendPath);\n\t}", "function wsod_detect_drupal_path(&$output, $start_dir = __FILE__) {\n $drupal_path = FALSE; // set init variable\n $path_arr = wsod_pathposall(dirname($start_dir));\n $bootstrap_file = '/includes/bootstrap.inc';\n $buff_output = '';\n foreach ($path_arr as $path) {\n if (file_exists($path.$bootstrap_file)) {\n $drupal_path = $path;\n return $drupal_path;\n } else {\n $buff_output .= \"Couldn't find $path$bootstrap_file!<br>\\n\";\n }\n // FIXME: file_exists() [function.file-exists]: open_basedir restriction in effect. File(//includes/bootstrap.inc) is not within the allowed path(s)\n }\n $output .= $buff_output;\n return NULL;\n}", "function find_core_auto_update()\n {\n }", "protected static function getFirstInstallFilePaths() {}", "protected function checkCurrentDirectoryIsInIncludePath() {}", "private function getPath()\r\n\t{\r\n\t\treturn WORDWEBPRESS_INCLUDE . \r\n\t\t\t\tWordwebpress::getInstance()->configuration()->get_cfn_value('core_path') .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Wordwebpress' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Admin' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Html' .\r\n\t\t\t\tDIRECTORY_SEPARATOR;\r\n\t}", "public static function get_core_data()\n {\n }", "function getPathToAppRoot() {\r\n\r\n\t\t$currdirectory = getcwd();\r\n\t\t$count = 0;\r\n\t\t$path = \"\";\r\n\r\n\t\t//We need to find the applications root\r\n\t\twhile(!file_exists(\"phpbmsversion.php\") && $count < 9){\r\n\r\n\t\t\t$path.=\"../\";\r\n\t\t\t@ chdir(\"../\");\r\n\t\t\t$count++;\r\n\r\n\t\t}//end while\r\n\r\n\t\tchdir($currdirectory);\r\n\r\n\t\tif($count < 9)\r\n\t\t\treturn $path;\r\n\t\telse\r\n\t\t\treturn NULL;\r\n\r\n}", "private function core()\n\t{\n\t\treturn $this->core;\n\t}", "abstract public function getCurrentPath();", "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }", "static private function buildIncludePath() {\n\n foreach (self::$config['modules_locations'] as $location) {\n\n foreach (new DirectoryIterator($location) as $folder) {\n\n if (!$folder->isDir() || $folder->isDot()) {\n continue;\n }\n\n // Remember modules.\n self::$modules[] = $folder->getBasename();\n\n $paths[] = realpath($folder->getPathname()) . DIRECTORY_SEPARATOR . 'libraries';\n }\n }\n\n // Combine modules and core\n $paths = array_merge(array('.',\n realpath(APPPATH) . DIRECTORY_SEPARATOR . 'extensions',\n realpath(APPPATH) . DIRECTORY_SEPARATOR . 'libraries'\n ), $paths);\n\n // Build the new include path & return\n $include_path = join($paths, PATH_SEPARATOR);\n\n return $include_path;\n }", "abstract public function getClassPath();", "public function testTestingPackageMissingCoreCoreVersionRequirement() {\n $missing_core_and_core_version_requirement = <<<MISSING_CORE_AND_CORE_VERSION_REQUIREMENT\n# info.yml for testing core and core_version_requirement.\npackage: Testing\nversion: VERSION\ntype: module\nname: Skynet\nMISSING_CORE_AND_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'missing_core_and_core_version_requirement.info.txt' => $missing_core_and_core_version_requirement,\n ],\n ]);\n $info_values = $this->infoParser->parse(vfsStream::url('modules/fixtures/missing_core_and_core_version_requirement.info.txt'));\n $this->assertSame($info_values['core_version_requirement'], \\Drupal::VERSION);\n }", "protected static function getTestsRuntimePath()\n {\n return __DIR__ . '/runtime';\n }", "public function getCore() {\n require_once 'Scenario/Core.php';\n return Scenario_Core::getInstance();\n }", "public function getCore() {\n require_once 'Scenario/Core.php';\n return Scenario_Core::getInstance();\n }", "function papi_get_core_type_file_path( $file_path ) {\n\tif ( empty( $file_path ) ) {\n\t\treturn [];\n\t}\n\n\t$directories = papi_filter_settings_directories();\n\t$result = [];\n\n\tforeach ( $directories as $directory ) {\n\t\t$directory = rtrim( $directory, '/' ) . '/';\n\t\t$file_path = str_replace( $directory, '', $file_path );\n\t\t$path = $directory . $file_path;\n\n\t\tif ( file_exists( $path ) ) {\n\t\t\t$result[] = $path;\n\t\t}\n\t}\n\n\treturn array_pop( $result );\n}", "private function _getCoreHelper()\n {\n return Mage::helper('core');\n }", "function _esf_tc_helper_get_solr_default_page_path() {\n $solr_page = apachesolr_search_page_load(apachesolr_search_default_search_page());\n return $solr_page['search_path'];\n}", "public function testMissingCoreCoreVersionRequirement() {\n $missing_core_and_core_version_requirement = <<<MISSING_CORE_AND_CORE_VERSION_REQUIREMENT\n# info.yml for testing core and core_version_requirement.\nversion: VERSION\ntype: module\nname: Skynet\ndependencies:\n - self_awareness\nMISSING_CORE_AND_CORE_VERSION_REQUIREMENT;\n\n vfsStream::setup('modules');\n vfsStream::create([\n 'fixtures' => [\n 'missing_core_and_core_version_requirement.info.txt' => $missing_core_and_core_version_requirement,\n 'missing_core_and_core_version_requirement-duplicate.info.txt' => $missing_core_and_core_version_requirement,\n ],\n ]);\n $exception_message = \"The 'core' or the 'core_version_requirement' key must be present in vfs://modules/fixtures/missing_core_and_core_version_requirement\";\n // Set the expected exception for the 2nd call to parse().\n $this->expectException('\\Drupal\\Core\\Extension\\InfoParserException');\n $this->expectExceptionMessage(\"$exception_message-duplicate.info.txt\");\n\n try {\n $this->infoParser->parse(vfsStream::url('modules/fixtures/missing_core_and_core_version_requirement.info.txt'));\n }\n catch (InfoParserException $exception) {\n $this->assertSame(\"$exception_message.info.txt\", $exception->getMessage());\n\n $this->infoParser->parse(vfsStream::url('modules/fixtures/missing_core_and_core_version_requirement-duplicate.info.txt'));\n }\n }", "function resolve_extension_dir() {\n\t\t// proper extension_dir is available in php.ini or passed via\n\t\t// cmd-line, explicitly or automagically inside run-tests.php\n\t\t$extension_dir = ini_get(\"extension_dir\");\n\n\t\t// may make life easier while testing at development stage for php\n\t\t// built from sources, but rather not on end-user machines\n\t\tif (!strlen($extension_dir)) {\n\t\t\t// while building for win modules (like php_mysql_xdevapi.dll) are\n\t\t\t// located in the same dir as php binary\n\t\t\t$extension_dir = pathinfo(PHP_BINARY, PATHINFO_DIRNAME);\n\t\t\tif (!is_running_on_windows()) {\n\t\t\t\t// for Linux\n\t\t\t\t// php binary located in\n\t\t\t\t//\t\tconnector-php/sapi/cli or connector-php/sapi/cgi\n\t\t\t\t// while mysql_xdevapi.so in\n\t\t\t\t//\t\tconnector-php/modules\n\t\t\t\t$extension_dir .= \"/../../modules\";\n\t\t\t}\n\t\t}\n\n\t\treturn $extension_dir;\n\t}", "public static function getClassPath();", "public function getCore() {\n return $this->core;\n }", "function get_home_path()\n {\n }", "protected function loadCoreClasses() {\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'View.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php';\r\n }", "public static function getPath()\n {\n return rex_path::coreData('system.log');\n }", "protected function includeAndStartCoreBootstrap() {}", "function base_path()\n {\n return dirname(__DIR__);\n }", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "public static function getCoreServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/core/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/core/service';\n }\n }", "protected function determineSourcePath()\n {\n $this->sourcePath = realpath(__DIR__ . '/../');\n\n if ($this->sourcePath == '/' || empty($this->sourcePath))\n {\n CLI::error('Unable to determine the correct source directory. Bailing.');\n exit();\n }\n }", "public function getCoreId(): ?string;", "public function getExtrasPath()\n {\n // get options from configuration\n $options = Config::inst()->get('FAQSearchIndex', 'options');\n\n $globalOptions = Solr::solr_options();\n if (isset($options['extraspath']) && file_exists($options['extraspath'])) {\n $globalOptions['extraspath'] = $options['extraspath'];\n }\n return $this->extrasPath ? $this->extrasPath : $globalOptions['extraspath'];\n }", "public function getAframeCoreSrcDir()\n {\n return $this->public_src_dir ?? $this->public_src_dir = $this->getVendorDir() . DIRECTORY_SEPARATOR . 'mkungla' . DIRECTORY_SEPARATOR . 'aframe' . DIRECTORY_SEPARATOR . 'dist';\n }", "private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }", "function getPackagePath() ;", "function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }", "abstract protected function getConfigPath();", "public function core();", "public function get_active_core(): core {\n\t\t\treturn $this::$active_core;\n\t\t}", "protected function action_getUserMainDir() {}", "function test_common_get_url_by_path() {\n\t\t$thing = \\trailingslashit(\\ABSPATH) . 'tmp.php';\n\t\t$result = \\common_get_url_by_path($thing);\n\t\t$this->assertNotEquals(false, $result);\n\t\t$this->assertEquals(0, \\strpos($thing, \\site_url()));\n\t}", "public function testGetCommonSourcePath()\n {\n $test = array(\n array('path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'folder/and/files'),\n array('path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'files'),\n array('path' => '/path/to/my' . DIRECTORY_SEPARATOR . 'other/source/directory')\n );\n \n $result = $this->_cbErrorHandler->getCommonSourcePath($test);\n \n $this->assertEquals('/path/to/my', $result);\n }", "function __getTestFilesPath($isApp = true) {\n\t\t$manager = CodeCoverageManager::getInstance();\n\t\t$path = ROOT . DS;\n\n\t\tif ($isApp) {\n\t\t\t$path .= APP_DIR . DS;\n\t\t} elseif (!!$manager->pluginTest) {\n\t\t\t$pluginPath = APP . 'plugins' . DS . $manager->pluginTest . DS;\n\n\t\t\t$pluginPaths = App::path('plugins');\n\t\t\tforeach ($pluginPaths as $tmpPath) {\n\t\t\t\t$tmpPath = $tmpPath . $manager->pluginTest . DS;\n\t\t\t\tif (file_exists($tmpPath)) {\n\t\t\t\t\t$pluginPath = $tmpPath;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$path = $pluginPath;\n\t\t} else {\n\t\t\t$path = TEST_CAKE_CORE_INCLUDE_PATH;\n\t\t}\n\n\t\treturn $path;\n\t}", "public function checkHtaccess(){\n\t\t$this->htaccess = false;\n\t\tif(realpath(dirname(__DIR__ . \"/../core.php\")) == realpath($_SERVER['DOCUMENT_ROOT']) && is_file(__DIR__ . \"/../.htaccess\")){\n\t\t\t$this->htaccess = true;\n\t\t}\n\t}", "function test_common_get_path_by_url() {\n\t\t$thing = \\site_url('tmp.php');\n\t\t$result = \\common_get_path_by_url($thing);\n\t\t$this->assertNotEquals(false, $result);\n\t\t$this->assertEquals(0, \\strpos($thing, \\ABSPATH));\n\t}", "function debug_paths()\n{\n\techo 'WEB_PATH :'.api_get_path(WEB_PATH).'<br />';\n\techo 'SYS_PATH :'.api_get_path(SYS_PATH).'<br />';\n\techo 'REL_PATH :'.api_get_path(REL_PATH).'<br />';\n\techo 'WEB_COURSE_PATH :'.api_get_path(WEB_COURSE_PATH).'<br />';\n\techo 'SYS_COURSE_PATH :'.api_get_path(SYS_COURSE_PATH).'<br />';\n\techo 'REL_COURSE_PATH :'.api_get_path(REL_COURSE_PATH).'<br />';\n\techo 'REL_CLARO_PATH :'.api_get_path(REL_CODE_PATH).'<br />';\n\techo 'WEB_CODE_PATH :'.api_get_path(WEB_CODE_PATH).'<br />';\n\techo 'SYS_CODE_PATH :'.api_get_path(SYS_CODE_PATH).'<br />';\n\techo 'SYS_LANG_PATH :'.api_get_path(SYS_LANG_PATH).'<br />';\n\techo 'WEB_IMG_PATH :'.api_get_path(WEB_IMG_PATH).'<br />';\n\techo 'GARBAGE_PATH :'.api_get_path(GARBAGE_PATH).'<br />';\n\techo 'PLUGIN_PATH :'.api_get_path(PLUGIN_PATH).'<br />';\n\techo 'SYS_ARCHIVE_PATH :'.api_get_path(SYS_ARCHIVE_PATH).'<br />';\n\techo 'INCLUDE_PATH :'.api_get_path(INCLUDE_PATH).'<br />';\n\techo 'LIBRARY_PATH :'.api_get_path(LIBRARY_PATH).'<br />';\n\techo 'CONFIGURATION_PATH :'.api_get_path(CONFIGURATION_PATH).'<br />';\n\t\n}", "protected static function getInstallToolEnableFilePath() {}", "function checkCMSPath() {\n global $_ARRLANG, $arrFiles;\n\n $statusMsg = \"\";\n\n if (!ini_get('safe_mode')) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].'/index.php')) {\n return str_replace(\"[PATH]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'], $_ARRLANG['TXT_PATH_DOES_NOT_EXIST']);\n } else {\n foreach (array_keys($arrFiles) as $file) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file)) {\n $statusMsg .= str_replace(\"[FILE]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file, $_ARRLANG['TXT_CANNOT_FIND_FIlE']);\n }\n }\n if (empty($statusMsg)) {\n return true;\n } else {\n return $statusMsg;\n }\n }\n } else {\n return true;\n }\n }", "public function setCorePath($path)\n {\n $this->corePath = $path;\n return $this;\n }", "public static function isCoreOnly() {\n return self::$_is_core_only;\n }", "public function getAdditionalSearchPath() {}", "function base_path($path)\n{\n return __DIR__.'/../'.$path;\n}", "public function getFoundPath() {}", "public function setCoreHome($value){\n $this->coreHome = $value;\n }", "private function checkBaseDir() { \n $path = __DIR__; \n return self::checkDirRecursive($path);\n }", "private function getResultPath()\n {\n return __DIR__ . '/provider/result/cstring';\n }", "private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }", "function getPathFromDocRoot()\n{\n $doc_root = $_SERVER['DOCUMENT_ROOT'];\n if (FILE_SEPARATOR != '/') {\n $doc_root = eregi_replace('/', FILE_SEPARATOR, $doc_root);\n }\n $doc_root_folders = explode(FILE_SEPARATOR, $doc_root);\n $cwd_folders = explode(FILE_SEPARATOR, getcwd());\n $folders_from_doc_root = array_diff($cwd_folders, $doc_root_folders);\n $path = implode(FILE_SEPARATOR, $folders_from_doc_root);\n //maybe we're in admin or scripts or so\n //echo($path.\"|\".strstr($path, 'admin').\"|\".utf8_substr( $path, 0, utf8_strpos( $path, \"admin\" ) ).\"|\");\n if (eregi('admin',$path) != false or $path == 'admin') {\n $path = substr($path, 0, strpos($path, \"admin\" ) ) ;\n }\n if (eregi('scripts',$path) != false or $path == 'scripts') {\n $path = substr($path, 0, strpos($path, \"scripts\" ) ) ;\n }\n if (eregi('plugins',$path)!= false or $path == 'plugins') {\n $path = substr($path, 0, strpos($path, \"plugins\" ) ) ;\n }\n if (eregi('user',$path) != false or $path == 'user') {\n $path = substr($path, 0, strpos($path, \"user\" ) ) ;\n }\n if ($path == \"\") {\n $path = FILE_SEPARATOR;\n }\n if (substr($path, 0, 1) != FILE_SEPARATOR) {\n $path = FILE_SEPARATOR.$path;\n }\n if (substr($path, strlen($path)-1, strlen($path)) != FILE_SEPARATOR) $path = $path.FILE_SEPARATOR;\n return $path;\n}", "protected function initialize()\n {\n // if basepath hasn't been set, attempt to discover it by working back up the directory structure\n if( ! $this->basepath )\n {\n $path = __DIR__;\n $last = '';\n while($path !== $last)\n {\n $last = $path;\n $path = realpath($path . '/../');\n $config = $path . '/paths.php';\n if(file_exists($config))\n {\n $this->option('basepath', $this->fix($path));\n break;\n }\n }\n\n // check if the paths configuration was found\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The paths configuration file `paths.php` was not found anywhere on the path \"' .__DIR__. '\" ');\n }\n\n }\n\n // test that the base path (supplied or found) exists\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The supplied base path \"' .$this->basepath. '\" does not exist');\n }\n }", "public function setCore($core) {\n $this->core = $core;\n }", "private function setPlatform(){\n $sig = $_SERVER['DOCUMENT_ROOT'];\n $sig2 = getenv('PWD');\n if (\n strpos ($sig,'usr/home/digitalm') !== false\n || strpos ($sig2,'usr/home/digitalm') !== false\n ) {\n $platform = 'pair';\n } elseif (\n strpos ($sig,'Users/john') !== false\n || strpos ($sig2,'Users/john') !== false\n ) {\n $platform = 'ayebook';\n } else {\n throw new Exception( \"Init cannot determine platform from ROOT '$sig' or PWD '$sig2'\");\n }\n return $platform;\n }", "function plugin_depends_core($core_version)\n\t{\n\t\tglobal $version;\n\t\t$core_version = (int) $core_version;\n\t\t\n\t\tif ($version < $core_version)\n\t\t\tthrow new PluginException(sprintf(_echo('plugins:exception:platformdependency'), $core_version, $version)); \n\t\t\t\n\t\treturn true;\n\t}", "public function loadCoreNode()\n {\n $query = '//ns:archive/ns:core';\n $this->core = $this->xml->xpathQuery($query, true);\n }", "protected function get_path()\n {\n $path_found = false;\n $found_path = null;\n foreach ($this->get_paths() as $path) {\n if ($path_found) {\n continue;\n }\n $path = wp_normalize_path($path);\n if (file_exists($path)) {\n $path_found = true;\n $found_path = $path;\n }\n }\n\n return $found_path;\n\n }", "private function locateRoot(): string\n {\n $root = false;\n $level = 1;\n\n while (!$root) {\n $dirname = \\dirname(__DIR__, $level);\n\n if (\\file_exists($dirname . '/vendor/autoload.php')) {\n $root = \\rtrim($dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n }\n \n $level++;\n }\n\n return $root;\n }", "public function core($file)\n {\n\t\t//echo self::$base_path.'/luser/src/'.$file .'.php';\n if (file_exists( self::$framework . DIRECTORY_SEPARATOR . $file . '.php')) {\n require self::$framework . DIRECTORY_SEPARATOR . $file . '.php';\n\t\t\t\t //echo \"success load ->\".self::$framework . DIRECTORY_SEPARATOR . $file . '.php'.\"<br>\";\n } \n }", "protected function getSearchPaths() {}" ]
[ "0.7166644", "0.68837386", "0.6590716", "0.65312123", "0.65274215", "0.6433731", "0.6151726", "0.6001143", "0.5992857", "0.5898198", "0.5805828", "0.58023995", "0.5763925", "0.5707701", "0.5672437", "0.56689316", "0.56508523", "0.563743", "0.56120026", "0.5578994", "0.55705357", "0.5544458", "0.5520972", "0.5492381", "0.5437609", "0.5404376", "0.53996307", "0.5393682", "0.5385412", "0.53604585", "0.534587", "0.5338627", "0.5324585", "0.52948433", "0.52557665", "0.523084", "0.52195525", "0.52163815", "0.51892155", "0.5187819", "0.51807535", "0.5176505", "0.51667166", "0.5162663", "0.51493883", "0.51470923", "0.51423824", "0.51423824", "0.5140467", "0.5138971", "0.5080852", "0.5056878", "0.5052483", "0.50487876", "0.5047798", "0.5033721", "0.5029319", "0.5027396", "0.502138", "0.5021056", "0.50201035", "0.5007788", "0.4997634", "0.49925247", "0.49874815", "0.49859676", "0.49790555", "0.49740705", "0.49726823", "0.49700364", "0.49621484", "0.4961276", "0.49601176", "0.49550474", "0.49500838", "0.4940293", "0.49252984", "0.49204338", "0.49062058", "0.4900086", "0.4896682", "0.4896543", "0.48960772", "0.48955905", "0.48942757", "0.488517", "0.48830658", "0.48750314", "0.48747337", "0.4873289", "0.48690763", "0.48660585", "0.48360482", "0.48321497", "0.48193052", "0.48185417", "0.4812389", "0.48088956", "0.4806658", "0.48054492" ]
0.7097137
1
Handle the source. Either Build the core.transport.zip package (git source) Extract the zip archive
public function handleSource() { if (is_dir($this->source) && file_exists("{$this->source}/_build/")) { copy("{$this->source}/_build/build.config.sample.php", "{$this->source}/_build/build.config.php"); copy("{$this->source}/_build/build.properties.sample.php", "{$this->source}/_build/build.properties.php"); // @TODO check pcntl_fork passthru("php {$this->source}/_build/transport.core.php"); } else if (file_exists($this->source)) { $isZip = is_resource(zip_open($this->source)); if ($isZip) { $zip = new \ZipArchive(); if ($zip->open($this->source) === true) { $path = pathinfo($this->source, PATHINFO_DIRNAME); $file = pathinfo($this->source, PATHINFO_BASENAME); // Extract in same folder $extracted = $zip->extractTo($path); if ($extracted) { // Cleanup file name to get the extracted folder name $extractedFolder = str_replace(array( '.zip', '-advanced', '-sdk' ), '', $file); // Make our newly extract folder our source $this->source = $path .'/'. $extractedFolder; } $zip->close(); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function extractSource(): void\n {\n $uncompressedDir = $this->getUncompressedRoute();\n\n $sourceZip = new ZipArchive();\n $sourceZip->open($this->getHeaderFile());\n $sourceZip->extractTo($uncompressedDir);\n $sourceZip->close();\n }", "private function extractZipFile()\n {\n if (! file_exists('/tmp/' . self::VERSION)) {\n throw new \\Exception(\"Release file not found\");\n }\n \n $file = new \\ZipArchive();\n $file->open('/tmp/' . self::VERSION);\n \n if (! $file->extractTo($this->target)) {\n throw new \\Exception(\"Cannot extract Fennec CMS to {$this->target}\");\n }\n }", "public function process()\n {\n parent::process();\n try {\n $this->profile = Teleport::loadProfile($this->profile);\n\n $this->getMODX($this->profile);\n\n $this->tpl = $this->loadTpl($this->tpl);\n\n $this->package = $this->createPackage($this->getName(), $this->getVersion(), $this->getSequence());\n\n if (isset($this->tpl['attributes'])) {\n foreach ($this->tpl['attributes'] as $attribute => $attributeValue) {\n if (is_array($attributeValue) && isset($attributeValue['sourceType']) && isset($attributeValue['source'])) {\n switch ($attributeValue['sourceType']) {\n case 'fileContent':\n $attributeValue = file_get_contents($attributeValue['source']);\n break;\n }\n }\n $this->package->setAttribute($attribute, $attributeValue);\n }\n }\n\n foreach ($this->tpl['vehicles'] as $vehicle) {\n $this->createVehicles($vehicle);\n }\n\n if (!$this->package->pack()) {\n throw new ActionException($this, \"Error packing {$this->package->signature}.transport.zip\");\n }\n $this->request->log(\"Successfully extracted {$this->package->signature}.transport.zip from instance {$this->profile->code}\");\n if ($this->target && $this->push) {\n if (!$this->push($this->package->path . $this->package->signature . '.transport.zip', $this->target . $this->package->signature . '.transport.zip')) {\n throw new ActionException($this, \"Error pushing {$this->package->signature}.transport.zip to {$this->target}\");\n }\n\n if (!$this->preserveWorkspace && $this->modx->getCacheManager()) {\n $this->modx->cacheManager->deleteTree($this->package->path . $this->package->signature);\n @unlink($this->package->path . $this->package->signature . '.transport.zip');\n }\n\n $this->request->log(\"Successfully pushed {$this->package->signature}.transport.zip to {$this->target}\");\n $this->request->log(\"{$this->target}{$this->package->signature}.transport.zip\", false);\n } else {\n $this->request->log(\"{$this->package->path}{$this->package->signature}.transport.zip\", false);\n }\n } catch (\\Exception $e) {\n throw new ActionException($this, \"Error Extracting snapshot: \" . $e->getMessage(), $e);\n }\n }", "public function extract() {\n $this->fileInfo();\n\n $zip = new ZipArchive;\n $res = $zip->open($this->filePath);\n\n if ($res === TRUE) {\n // Extract the file.\n $zip->extractTo($this->extractPath);\n $zip->close();\n $this->path = $this->extractPath;\n }\n else {\n // couldn't extract the zip file, display an error message and watchdog.\n $params = array(\n '@file' => $this->filePath,\n '@path' => $this->extractPath,\n );\n\n $message = t('Unable to extract @file to @path', $params);\n watchdog('subtheme', $message);\n drupal_set_message($message, 'error');\n }\n }", "function extract()\n {\n $v_result=1;\n\n // ----- Reset the error handler\n $this->privErrorReset();\n\n // ----- Check archive\n if (!$this->privCheckFormat()) {\n return(0);\n }\n\n // ----- Set default values\n $v_options = array();\n// $v_path = \"./\";\n $v_path = '';\n $v_remove_path = \"\";\n $v_remove_all_path = false;\n\n // ----- Look for variable options arguments\n $v_size = func_num_args();\n\n // ----- Default values for option\n $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;\n\n // ----- Look for arguments\n if ($v_size > 0) {\n // ----- Get the arguments\n $v_arg_list = func_get_args();\n\n // ----- Look for first arg\n if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {\n\n // ----- Parse the options\n $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,\n array (PCLZIP_OPT_PATH => 'optional',\n PCLZIP_OPT_REMOVE_PATH => 'optional',\n PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',\n PCLZIP_OPT_ADD_PATH => 'optional',\n PCLZIP_CB_PRE_EXTRACT => 'optional',\n PCLZIP_CB_POST_EXTRACT => 'optional',\n PCLZIP_OPT_SET_CHMOD => 'optional',\n PCLZIP_OPT_BY_NAME => 'optional',\n PCLZIP_OPT_BY_EREG => 'optional',\n PCLZIP_OPT_BY_PREG => 'optional',\n PCLZIP_OPT_BY_INDEX => 'optional',\n PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',\n PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',\n PCLZIP_OPT_REPLACE_NEWER => 'optional'\n ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'\n ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',\n PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',\n PCLZIP_OPT_TEMP_FILE_ON => 'optional',\n PCLZIP_OPT_TEMP_FILE_OFF => 'optional'\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n if ($v_result != 1) {\n return 0;\n }\n\n // ----- Set the arguments\n if (isset($v_options[PCLZIP_OPT_PATH])) {\n $v_path = $v_options[PCLZIP_OPT_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {\n $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {\n $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];\n }\n if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {\n // ----- Check for '/' in last path char\n if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {\n $v_path .= '/';\n }\n $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];\n }\n }\n\n // ----- Look for 2 args\n // Here we need to support the first historic synopsis of the\n // method.\n else {\n\n // ----- Get the first argument\n $v_path = $v_arg_list[0];\n\n // ----- Look for the optional second argument\n if ($v_size == 2) {\n $v_remove_path = $v_arg_list[1];\n }\n else if ($v_size > 2) {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, \"Invalid number / type of arguments\");\n\n // ----- Return\n return 0;\n }\n }\n }\n\n // ----- Look for default option values\n $this->privOptionDefaultThreshold($v_options);\n\n // ----- Trace\n\n // ----- Call the extracting fct\n $p_list = array();\n $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,\n\t $v_remove_all_path, $v_options);\n if ($v_result < 1) {\n unset($p_list);\n return(0);\n }\n\n // ----- Return\n return $p_list;\n }", "public function copy_source() {\n\t\t\t$source_file = ABSPATH . '/templates/wp/' . $this->data['version'] . '.zip';\n\t\t\tif ( file_exists( $source_file ) ) {\n\t\t\t\t$zip = new \\ZipArchive;\n\t\t\t\t$res = $zip->open( $source_file );\n\t\t\t\tif ( $res === true ) {\n\t\t\t\t\t$zip->extractTo( $this->data['document_root'] );\n\t\t\t\t\t$zip->close();\n\t\t\t\t\tif ( file_exists( $this->data['document_root'] . 'wordpress/index.php' ) ) {\n\t\t\t\t\t\tshell_exec( 'cp -r ' . $this->data['document_root'] . 'wordpress/* ' . $this->data['document_root'] );\n\t\t\t\t\t\tsystem( \"rm -rf \" . escapeshellarg( $this->data['document_root'] . 'wordpress/' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->danger( 'Unable To Open WordPress Source Zip File @ <code>' . $source_file . '</code>' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->danger( 'WordPress Version Does Not Exists.' );\n\t\t\t}\n\t\t}", "private function extract(): void\n {\n if (file_exists($this->tmpDir) && is_dir($this->tmpDir)) {\n $this->rrmdir($this->tmpDir);\n }\n\n mkdir($this->tmpDir);\n\n $this->zipClass->open($this->path);\n $this->zipClass->extractTo($this->tmpDir);\n\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {\n $this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));\n $index++;\n }\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getFooterName($index))) {\n $this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));\n $index++;\n }\n\n $this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());\n\n $this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());\n\n $this->document = file_get_contents(sprintf('%s%sword%sdocument.xml', $this->tmpDir, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));\n }", "public function execZip($sourcePath) { \n if (!file_exists($this->getPathZip())){\n mkdir($this->getPathZip());\n } \n $pathInfo = pathInfo($sourcePath); \n $parentPath = $pathInfo['dirname']; \n $dirName = $pathInfo['basename']; \n \n $z = new \\ZipArchive(); \n $z->open($this->getPathZip(). DIRECTORY_SEPARATOR . $dirName.'.zip' , \\ZIPARCHIVE::CREATE | \\ZIPARCHIVE::OVERWRITE); \n $z->addEmptyDir($dirName); \n self::folderToZip($sourcePath, $z, strlen(\"$parentPath/\")); \n $z->close(); \n }", "protected function compile() {\n\t\tglobal $objPage;\n\n\t\t$downloadPath = TL_ROOT.'/web/bundles/siowebdownloadfolder/downloads/';\n\t\t$downloadFile = 'bundles/siowebdownloadfolder/downloads/'.$this->downloadFileTitle.'.zip';\n\n\t\tif(is_file($downloadFile)) {\n\t\t\tunlink($downloadFile);\n\t\t}\n\t\t\n\t\t$files = array();\n\t\t$auxDate = array();\n\n\t\t$objFiles = $this->objFiles;\n\t\t$allowedDownload = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\n\n\t\tif(!is_dir($downloadPath)) {\n\t\t\tSystem::log('Try to Zip files, can\\'t find folder \\'dowloads\\' in '.TL_ROOT.'/bundles/siowebdownloadfolder/','compile ZIP-Download',false);\n\t\t\treturn false;\n\t\t}\n\t\tif(!$this->downloadFileTitle) {\n\t\t\tSystem::log('No downloadfile-title found, please add a filename.','compile ZIP-Download',false);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get all files\n\t\twhile($objFiles->next()) {\n\t\t\t// Continue if the files has been processed or does not exist\n\t\t\tif(isset($files[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path))\n\t\t\t\tcontinue;\n\n\t\t\t// Single files\n\t\t\tif($objFiles->type == 'file') {\n\t\t\t\t$objFile = new \\File($objFiles->path, true);\n\n\t\t\t\tif(!in_array($objFile->extension, $allowedDownload) || preg_match('/^meta(_[a-z]{2})?\\.txt$/', $objFile->basename)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$Pathinfo = pathinfo($objFiles->path);\n\t\t\t\t/* The Zip-Path D: */\n\t\t\t\t// echo \"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"<br>\";\n\t\t\t\t// echo '<pre>'.print_r($Pathinfo,1).'</pre>';\n\t\t\t\texec(\"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"\",$var);\n\t\t\t\t// echo 'Dirname: '.$Pathinfo['dirname'].'<br>';\n\t\t\t\t// echo '<pre>'.print_r($var,1).'</pre>';\n\t\t\t} else {\n\t\t\t\t$objSubfiles = \\FilesModel::findByPid($objFiles->uuid);\n\t\t\t\t\n\t\t\t\tif($objSubfiles === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twhile($objSubfiles->next()) {\n\t\t\t\t\tif(isset($files[$objFiles->path]) || !file_exists(TL_ROOT . '/' . $objFiles->path)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$Pathinfo = pathinfo($objSubfiles->path);\n\t\t\t\t\t/* The Zip-Path D: */\n\t\t\t\t\t// echo \"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"<br>\";\n\t\t\t\t\t// echo '<pre>'.print_r($Pathinfo,1).'</pre>';\n\t\t\t\t\texec(\"cd '\".TL_ROOT.\"/\".$Pathinfo['dirname'].\"' && ls -la && zip \\\"\".TL_ROOT.\"/web/\".$downloadFile.\"\\\" \\\"\".$Pathinfo['basename'].\"\\\"\",$var);\n\t\t\t\t\t// echo 'Dirname: '.$Pathinfo['dirname'].'<br>';\n\t\t\t\t\t// echo '<pre>'.print_r($var,1).'</pre>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->Template->title = $this->Template->link = $this->Template->name = $this->downloadFileTitle;\n\t\t$this->Template->href = $downloadFile;\n\t\t$this->Template->icon = TL_ASSETS_URL . 'assets/contao/images/iconRAR.gif';\n\t\t$this->Template->extension = 'zip';\n\t\t$this->Template->mime = 'application/zip';\n\t\t$this->Template->path = $newDownloadPath;\n\t}", "function _extract($archive, $destination, $options) \n {\n // Initialize variables\n $this->_data = null;\n $this->_metadata = null;\n\n \n if (!extension_loaded('zlib')) {\n return VWP::raiseError(\"Zlib Not Supported\",get_class($this),null,false);\n }\n \n $this->_data = $this->_vfile->read($archive);\n \n if (VWP::isWarning($this->_data)) {\n $this->set('error.message', 'Unable to read archive');\n return VWP::raiseWarning(\"Unable to read archive :\" . $this->_data->errmsg,get_class($this),$this->_data->errno,false);\n }\n\n if (VWP::isWarning($this->_getZipInfo($this->_data))) {\n return VWP::raiseWaring(\"Missing zip archive headers!\",get_class($this),null,false);\n }\n\n $vpath =& v()->filesystem()->path();\n \n for ($i=0,$n=count($this->_metadata);$i<$n;$i++) {\n if (substr($this->_metadata[$i]['name'], -1, 1) != '/' && substr($this->_metadata[$i]['name'], -1, 1) != '\\\\') {\n $buffer = $this->_getFileData($i);\n $path = $vpath->clean($destination.DS.$this->_metadata[$i]['name']);\n // Make sure the destination folder exists\n\n $w = $this->_vfolder->create(dirname($path)); \n if (VWP::isWarning($w)) {\n return $w;\n }\n \n $w = $this->_vfile->write($path, $buffer);\n if (VWP::isWarning($w)) {\n return $w;\n }\n }\n }\n return true;\n }", "function buildzip() {\n\t\t// make list of files to include\n\t\t$files = array_keys(index());\n\t\tforeach($_POST as $p => $v) if (substr($p, 0, 6) == 'build_') $files[] = substr($p, 6).'.php';\n\n\t\t// get the base script to modify\n\t\t$hypha = file_get_contents('hypha.php');\n\n\t\t// insert superuser name and password\n\t\t$hypha = preg_replace('/\\$username = \\'.*?\\';/', '\\$username = \\''.$_POST['username'].'\\';', $hypha);\n\t\t$hypha = preg_replace('/\\$password = \\'.*?\\';/', '\\$password = \\''.$_POST['password'].'\\';', $hypha);\n\n\t\t// build data library of zipped files to include\n\t\t$data = \"\t\t\t//START_OF_DATA\\n\";\n\t\t$data .= '\t\t\tcase \\'index\\': $zip = \"'.base64_encode(gzencode(implode(',', array_keys(index())), 9)).'\"; break;'.\"\\n\";\n\t\tforeach ($files as $file) $data.= '\t\t\tcase \\''.$file.'\\': $zip = \"'.base64_encode(gzencode(file_get_contents($file), 9)).'\"; break;'.\"\\n\";\n\t\t$data .= \"\t\t\t//END_OF_DATA\\n\";\n\n\t\t// include data library\n\t\t$hypha = preg_replace('#^\\t*//START_OF_DATA\\n.*//END_OF_DATA\\n#ms', $data, $hypha);\n\n\t\t// push script to client\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename=\"hypha.php\"');\n\t\techo $hypha;\n\t\texit;\n\t}", "private function downloadZipFile()\n {\n if (! is_writable('/tmp/')) {\n throw new \\Exception(\"Unable to download release: /tmp/ dir is not writable\");\n }\n \n $ch = curl_init(self::RELEASE_URL . 'v' . self::VERSION . '.zip');\n curl_setopt($ch, \\CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, \\CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, \\CURLOPT_RETURNTRANSFER, true);\n $zipData = curl_exec($ch);\n $curlInfo = curl_getinfo($ch);\n if ($curlInfo['http_code'] != 200) {\n throw new \\Exception(\"Unable to download release: server returned code \" . $curlInfo['http_code']);\n }\n \n $zipFile = fopen('/tmp/' . self::VERSION, 'w+');\n fwrite($zipFile, $zipData);\n fclose($zipFile);\n }", "function UnZip(){\n global $controller;\n $zip = new ZipArchive;\n $res = $zip->open(getcwd().\"/filemanager.zip\");\n if ($res === TRUE) {\n $zip->extractTo(\"/etc/sentora/panel/etc/apps\");\n $zip->close();\n chmod (\"/etc/sentora/panel/etc/apps/filemanager\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/module.xml\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/module.zpm\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/end.php\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/code\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/code/controller.ext.php\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/assets\", 0777);\n chmod (\"/etc/sentora/panel/modules/filemanager/assets/icon.png\", 0777);\n copy(\"/etc/sentora/panel/modules/filemanager/auth.class1.php\" , \"/etc/sentora/panel/dryden/ctrl/auth.class1.php\");\n unlink(\"/etc/sentora/panel/dryden/ctrl/auth.class.php\");\n copy(\"/etc/sentora/panel/modules/filemanager/auth.class2.php\" , \"/etc/sentora/panel/dryden/ctrl/auth.class.php\");\n chmod (\"/etc/sentora/panel/dryden/ctrl/auth.class.php\", 0777);\n chmod (\"/etc/sentora/panel/dryden/ctrl/auth.class1.php\", 0777);\n return true;\n } else {\n return false;\n }\n}", "public function testZipArchiveZipExtract()\n {\n }", "private function prepareFiles() {\n $zip = new ZipArchive;\n if ($zip->open(self::PARSE_DIR . '/' . self::ARCHIVE_FILENAME) === TRUE) {\n $zip->extractTo($this->tmpFolder);\n $zip->close();\n } else {\n $this->errors[] = 'Невозможно распаковать архив!';\n }\n }", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $url = \"https://github.com/teamdigitalde/sitepackage-v10/archive/master.zip\";\n $extDir = Environment::getPublicPath().'/typo3conf/ext/';\n $ch = curl_init();\n\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Downloade Zip-Archiv.');\n\n $f = fopen($extDir.'/master.zip', 'w+');\n $opt = [\n CURLOPT_URL => $url,\n CURLOPT_FILE => $f,\n CURLOPT_FOLLOWLOCATION => true,\n // CURLOPT_RETURNTRANSFER => true,\n CURLOPT_BINARYTRANSFER => true,\n CURLOPT_HEADER => false,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n ];\n curl_setopt_array($ch, $opt);\n $file = curl_exec($ch);\n\n curl_close($ch);\n fclose($f);\n\n $zip = new \\ZipArchive();\n $res = $zip->open($extDir.'/master.zip');\n if ($res === TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('File wurde gefunden und wird nun entzippt.');\n $zip->extractTo($extDir); // wohin soll es entpackt werden\n $zip->close();\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Zip-Archiv wurde nicht gefunden.');\n }\n\n // Sync sitepackages\n $test = $this->smartCopy($extDir.'sitepackage-v10-master/',$extDir.'sitepackage/');\n if($test == TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat synchonisiert');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat nicht synchonisiert');\n return false;\n }\n\n // Remove Files and Sitepackage\n if(file_exists($extDir.'sitepackage/'.'index.php')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> index.php');\n unlink($extDir.'sitepackage/'.'index.php');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> index.php konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'kickstart.sql')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> kickstart.sql');\n unlink($extDir.'sitepackage/'.'kickstart.sql');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> kickstart.sql konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.htaccess')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .htaccess');\n unlink($extDir.'sitepackage/'.'.htaccess');\n } else {\n \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .htaccess konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.editorconfig')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .editorconfig');\n unlink($extDir.'sitepackage/'.'.editorconfig');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .editorconfig konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.gitignore')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .gitignore');\n unlink($extDir.'sitepackage/'.'.gitignore');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .gitignore konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/Build')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Build');\n $this->rrmdir($extDir.'sitepackage/Build');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Build konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/autoload')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Autoload');\n $this->rrmdir($extDir.'sitepackage/autoload');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Autoload konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/sites')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sites');\n $this->rrmdir($extDir.'sitepackage/sites');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Sites konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage-v10-master')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sitepackage-Master');\n $this->rrmdir($extDir.'sitepackage-v10-master');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage-Master konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'master.zip')) {\n unlink($extDir.'master.zip');\n }\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Das Sitepackage wurde erfolgreich aktualisiert.');\n $io = new SymfonyStyle($input, $output);\n $io->title($this->getDescription());\n $io->write('Write something');\n return 0;\n }", "private function extractZip($zipfilename)\n \t{\n\t\t$zip = new ZipArchive;\n\t\t$zipfilename;\n\t\tif ($zip->open($zipfilename) === TRUE)\n\t\t\t {\n\t\t\t \t\n\t\t\t\t\t$unzippath=ROOT_FOLDER.'css/'.$_POST['skinname'].'/';\n \t\t\t\t$zip->extractTo($unzippath);\n \t\t\t\t \t$zip->close();\n\t\t\t\t\tunlink($zipfilename);\n \t\t\t\t \treturn $this->insertSkin();\t\t\t\t\t\n\t\t\t }\n\t\telse \n\t\t\t{\n \t\t\t\t echo 'Failed to Extract ';\n\t\t\t}\n\t}", "protected function compile()\n\t{\n#\t\t$objArchive = new \\ZipWriter('system/tmp/'. $strTmp);\n\t\tif(\\Input::Get('download') && FE_USER_LOGGED_IN)\n\t\t{\n\t\t\t$objDownload = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE id=?\")->execute(\\Input::Get('download'));\n\t\t\t$objFile = \\FilesModel::findByUuid($objDownload->fileSRC);\n\n\t\t\t$this->sendFileToBrowser($objFile->path);\n\t\t}\n\n\t\t$objPage = \\PageModel::findById($GLOBALS['objPage']->id);\n\t\t$strUrl = $this->generateFrontendUrl($objPage->row(), '/download/%s');\n\n\t\t$objCategory = $this->Database->prepare(\"SELECT * FROM tl_download_category WHERE alias=?\")->execute(\\Input::Get('category'));\n\t\t$objArchiv = $this->Database->prepare(\"SELECT * FROM tl_download_archiv WHERE id=?\")->execute($objCategory->pid);\n\n\t\t$objData = $this->Database->prepare(\"SELECT * FROM tl_download_item WHERE pid=? && published=1 ORDER BY sorting ASC\")->execute($objCategory->id);\n\t\twhile($objData->next())\n\t\t{\n\t\t\t$objItem = (object) $objData->row();\n\n#\t\t\t$objItem->archiv = $objArchiv->title;\n#\n#\t\t\tif($objCategory->singleSRC)\n#\t\t\t{\n#\t\t\t\t$objItem->archivIcon = \\FilesModel::findByUuid($objCategory->singleSRC)->path;\n#\t\t\t}\n#\n#\t\t\t$objItem->category = $objCategory->title;\n#\t\t\t$objItem->singleSRC = deserialize($objItem->singleSRC);\n#\n#\t\t\t$arrImages = array();\n#\t\t\tif(is_array($objItem->singleSRC))\n#\t\t\t{\n#\t\t\t\tforeach($objItem->singleSRC as $image)\n#\t\t\t\t{\n#\t\t\t\t\t$arrImages[] = (object) array\n#\t\t\t\t\t(\n#\t\t\t\t\t\t'css' => '',\n#\t\t\t\t\t\t'path' => \\FilesModel::findByUuid($image)->path\n#\t\t\t\t\t);\n#\t\t\t\t}\n#\n#\t\t\t\t$arrImages[0]->css = 'first';\n#\t\t\t}\n#\n#\n#\t\t\tif(FE_USER_LOGGED_IN)\n#\t\t\t{\n#\t\t\t\t$objItem->url = sprintf($strUrl, $objItem->id);\n#\t\t\t\t$objItem->css = 'active';\n#\t\t\t\t$objItem->preview = $arrImages;\n#\t\t\t}\n#\t\t\telse\n#\t\t\t{\n#\t\t\t\t$objItem->css = 'inactive';\n#\t\t\t\t$objItem->preview = array($arrImages[0]);\n#\n#\t\t\t}\n\n\t\t\t$arrData[] = $objItem;\n\t\t}\n\n#\t\tif(!count($arrDaata)) { $arrData = array(); }\n\n\t\t$this->Template->items = $arrData;\n\t}", "protected function downloadAndConfigTheBasicExtension()\n {\n self::$zip_target_name = 'basicExtension.zip';\n self::$zip_target_path = self::sanitizePath(WB_PATH . '/temp/unzip');\n\n // clean up the temporary directory\n @array_map('unlink', glob(WB_PATH . '/temp/unzip/*'));\n\n // get the Basic Extension with CURL\n $info = array();\n if (! $this->curlDownload(self::$basicExtension_zip_url, self::$zip_target_path . '/' . self::$zip_target_name, $info)) {\n if (isset($info['http_code']) && ($info['http_code'] == '302') && isset($info['redirect_url']) && ! empty($info['redirect_url'])) {\n // follow the redirect URL!\n $redirect_url = $info['redirect_url'];\n $info = array();\n $this->curlDownload($redirect_url, self::$zip_target_path . '/' . self::$zip_target_name, $info);\n } elseif (isset($info['http_code']) && ($info['http_code'] != '200')) {\n throw new \\Exception(sprintf('[GitHub Error] HTTP Code: %s - no further informations available!', $info['http_code']));\n }\n }\n\n // unzip the Basic Extension to the target path\n $unzip = new unZip();\n\n // create target directory\n $unzip->checkDirectory(self::sanitizePath(WB_PATH . '/temp/unzip/basic'));\n $unzip->setUnZipPath(self::sanitizePath(WB_PATH . '/temp/unzip/basic'));\n\n $unzip->extract(self::$zip_target_path . '/' . self::$zip_target_name);\n\n // GitHub ZIP's contain a subdirectory with name we don't know ...\n $source_dir = '';\n $handle = opendir(self::sanitizePath(WB_PATH . '/temp/unzip/basic'));\n // we loop through the temp dir to get the first subdirectory ...\n while (false !== ($file = readdir($handle))) {\n if ('.' == $file || '..' == $file)\n continue;\n if (is_dir(self::sanitizePath(WB_PATH . '/temp/unzip/basic/' . $file))) {\n // ... here we got it!\n $source_dir = self::sanitizePath(WB_PATH . '/temp/unzip/basic/' . $file);\n break;\n }\n }\n\n if ($source_dir == '')\n throw new \\Exception('The unzipped archive has an unexpected structure, please contact the support!');\n\n // create the directory for the Basic extension\n if (!mkdir(self::sanitizePath(WB_PATH . '/kit2/extension/phpmanufaktur/phpManufaktur/Basic'))) {\n throw new \\Exception(\"Can't create the target directory for the kitFramework Basic extension!\");\n }\n // move all files from the temporary directory to the target\n if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {\n // linux only: just rename\n if (! rename($source_dir, WB_PATH . '/kit2/extension/phpmanufaktur/phpManufaktur/Basic'))\n throw new \\Exception(\"Can't move the unzipped kitFramework extension to the target directory!\");\n }\n else {\n // windows: use copy\n $this->xcopy($source_dir, self::sanitizePath(WB_PATH . '/kit2/extension/phpmanufaktur/phpManufaktur/Basic'));\n }\n\n // delete not needed GIT files\n $delete_files = array(\n '.gitattributes',\n '.gitignore'\n );\n foreach ($delete_files as $file) {\n // we don't want any error prompt at this point\n @unlink(self::sanitizePath(WB_PATH . '/kit2/extension/phpmanufaktur/phpManufaktur/Basic/' . $file));\n }\n\n // clean up the temporary directory\n @array_map('unlink', glob(self::sanitizePath(WB_PATH . '/temp/unzip/*')));\n\n }", "public function init(): void\n {\n $res = $this->zipArchive->open($this->path, \\ZipArchive::CREATE | \\ZipArchive::OVERWRITE);\n if ($res !== true) {\n throw new Package($this->message($res), $res);\n }\n }", "public function get()\n {\n // Remove old one\n if(file_exists(Cyaneus::path()->draft)) {\n exec(escapeshellcmd('rm -r '.Cyaneus::path()->draft).' 2>&1', $rmr_output, $rmr_error);\n }\n\n $wget = '/usr/bin/wget --no-check-certificate ';\n $url = Cyaneus::path()->repositoryUrl;\n $file = __DIR__.DIRECTORY_SEPARATOR.'file.zip';\n\n exec(escapeshellcmd($wget.$url.' -O '.$file).' 2>&1', $wget_output, $wget_error);\n\n if($wget_error) {\n throw new \\RuntimeException('An error has occurred with wget: '.var_export($wget_output, true));\n }\n\n $this->extract($file);\n }", "public function downloadArchive() {\n\t\t$parsedUrl = parse_url($this->archive);\n\t\t$prefix = 'package';\n\t\t\n\t\t// file transfer via hypertext transfer protocol.\n\t\tif ($parsedUrl['scheme'] == 'http') {\n\t\t\t$this->archive = FileUtil::downloadFileFromHttp($this->archive, $prefix);\n\t\t}\n\t\t// file transfer via file transfer protocol.\n\t\telseif ($parsedUrl['scheme'] == 'ftp') {\n\t\t\t$this->archive = FTPUtil::downloadFileFromFtp($this->archive, $prefix);\n\t\t}\n\t\t\n\t\t// unzip tar\n\t\t$this->archive = self::unzipPackageArchive($this->archive);\n\t\t\n\t\treturn $this->archive;\n\t}", "function _extractNative($archive, $destination, $options) \n {\n $archive = v()->filesystem()->path()->clean($archive);\n $destination = v()->filesystem()->path()->clean($destination);\n \n if ($zip = zip_open($archive)) {\n if (is_resource($zip)) {\n // Make sure the destination folder exists\n $mk = $this->_vfolder->create($destination);\n if (VWP::isWarning($mk)) { \n return $mk;\n }\n // Read files in the archive\n while ($file = @zip_read($zip)) {\n if (zip_entry_open($zip, $file, \"r\")) {\n if (substr(zip_entry_name($file), strlen(zip_entry_name($file)) - 1) != \"/\") {\n $buffer = zip_entry_read($file, zip_entry_filesize($file));\n $wr = $this->_vfile->write($destination.DS.zip_entry_name($file), $buffer);\n if (VWP::isWarning($wr)) { \n return $wr;\n }\n zip_entry_close($file);\n }\n } else {\n return VWP::raiseError('Unable to read entry',get_class($this).\":_extractNative\",null,false);\n }\n }\n @zip_close($zip);\n } else {\n return VWP::raiseError('Unable to open archive',get_class($this).\":_extractNative\",510,false); \n }\n } else {\n return VWP::raiseError('Unable to open archive',get_class($this).\":_extractNative\",500,false);\n }\n \n return true;\n }", "function write_zip($repo) {\n $p = basename($repo);\n $proj = explode(\".\", $p);\n $proj = $proj[0];\n //TODO: clean this up\n exec(\"cd /tmp && git-clone $repo && rm -Rf /tmp/$proj && zip -r $proj.zip $proj && rm -Rf /tmp/$proj\");\n\n $filesize = filesize(\"/tmp/$proj.zip\");\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Type: application/x-zip\");\n header(\"Content-Length: \" . $filesize);\n header(\"Content-Disposition: attachment; filename=\\\"$proj.zip\\\";\");\n echo file_get_contents(\"/tmp/$proj.zip\");\n die();\n}", "protected function prepareSequenzes ($blZip = true) {\n if (!MLCache::gi()->exists($this->sCacheName)) {\n $this->blUseZip = false;\n if ($blZip && class_exists('ZipArchive', false)) {\n try {\n if (count(\n MLHelper::getFilesystemInstance()\n ->rm($this->getPath('zip'))\n ->write($this->getPath('zip'))\n ->readDir($this->getPath('zip').'/', array())\n ) == 0\n ) {\n try {\n $sBuild = MLSetting::gi()->get('sClientBuild');\n } catch (Exception $ex) {\n $sBuild = '';\n }\n foreach (array(\n 'files.list?format=zip&build='.$sBuild => '__plugin', \n 'external.list?format=zip&shopsystem='.MLShop::gi()->getShopSystemName().'&build='.$sBuild => '__external'\n ) as $sRequest => $sType) {\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: $sType = '.$sType.')' => __LINE__, '$sRequest' => $sRequest));\n @set_time_limit(60 * 10); // 10 minutes\n $sZipName = 'updater'.$sType.'.zip';\n MLCache::gi()->delete($sZipName);\n $warnings = null;\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start-zip: $sType = '.$sType.')' => __LINE__));\n $sContent = MLHelper::gi('remote')->fileGetContents($this->getPath('server').$sRequest, $warnings, 20);\n MLCache::gi()->set($sZipName, $sContent, 60);\n $oZip = new ZipArchive();\n $oZip->open(MLFilesystem::getCachePath('updater'.$sType.'.zip'));\n @set_time_limit(60 * 10); // 10 minutes\n $oZip->extractTo($this->getPath('zip').$sType);\n $oZip->close();\n if (count(MLHelper::getFilesystemInstance()->readDir($this->getPath('zip').'/'.$sType.'/', array())) < 1) {\n throw new Exception('Problems with archiv files.', 1462872613);\n }\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end-zip: $sType = '.$sType.')' => __LINE__));\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: $sType = '.$sType.')' => __LINE__, '$sRequest' => $sRequest));\n }\n @set_time_limit(60 * 10); // 10 minutes\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: rm-__plugin-start)' => __LINE__));\n $this->rm(array('dst' => $this->getPath('staging').'/__plugin/'));// in zip mode dont scan staging again - all data comes from zip\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: rm-__plugin-start)' => __LINE__));\n $this->blUseZip = true;\n }\n } catch (Exception $oEx) {\n// echo $oEx->getMessage();\n }\n }\n $aMerged = array();\n foreach(array('server', 'plugin', 'staging') as $sFolder ) {\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(start: $sFolder = '.$sFolder.')' => __LINE__));\n @set_time_limit(60 * 10); // 10 minutes\n if ($this->blUseZip == true && $sFolder == 'plugin') {// add customer and dev-module to staging, plugin dont have external files\n foreach ($this->aCopyLocal2Staging as $sCopyLocal2Staging) {\n $aPluginOrExtenal = MLHelper::gi('remote')->getFileList(MLFilesystem::getLibPath($sCopyLocal2Staging));\n foreach ($aPluginOrExtenal['__plugin'] as $sFolderFileIdent => $aFolderFilesData) {\n $aMerged[$sCopyLocal2Staging.$sFolderFileIdent]['plugin'] = array(\n 'src' => $sCopyLocal2Staging.$aFolderFilesData['src'],\n 'dst' => $sCopyLocal2Staging.$aFolderFilesData['dst'],\n 'hash' => $aFolderFilesData['hash'],\n );\n }\n $aMerged[$sCopyLocal2Staging]['plugin'] = array(\n 'src' => $sCopyLocal2Staging,\n 'dst' => $sCopyLocal2Staging,\n 'hash' => 0,\n );\n }\n } else {\n foreach (MLHelper::gi('remote')->getFileList($this->getPath($sFolder)) as $aPluginOrExtenal) {\n foreach ($aPluginOrExtenal as $sIdentPath => $aData) {\n if ($sIdentPath == '__/') { // path dont comes from server.lst, but path is part of plugin\n continue;\n }\n $aMerged[$sIdentPath][$sFolder] = $aData;\n }\n }\n }\n MLLog::gi()->add('update', array('METHOD' => __METHOD__, 'LINE(end: $sFolder = '.$sFolder.')' => __LINE__));\n }\n foreach ($this->aCopyLocal2Staging as $sCopyLocal2Staging) {\n $aPluginOrExtenal = MLHelper::gi('remote')->getFileList(MLFilesystem::getLibPath($sCopyLocal2Staging));\n foreach ($aPluginOrExtenal['__plugin'] as $sFolderFileIdent => $aFolderFilesData) {\n $aMerged[$sCopyLocal2Staging.$sFolderFileIdent]['server'] = array(\n 'src' => $sCopyLocal2Staging.$aFolderFilesData['src'],\n 'dst' => $sCopyLocal2Staging.$aFolderFilesData['dst'],\n 'hash' => $aFolderFilesData['hash'],\n );\n }\n $aMerged[$sCopyLocal2Staging]['server'] = array(\n 'src' => $sCopyLocal2Staging,\n 'dst' => $sCopyLocal2Staging,\n 'hash' => 0,\n );\n }\n \n /* @var $aSequences output array */\n $aSequences = array();\n \n //prefill actions\n foreach (array(\n 'staging', // (server||plugin) => staging\n 'plugin', // staging => plugin\n ) as $sDstType) {\n $aSequences[$sDstType] = array(\n '' => array(), // do nothing just statistic\n 'mkdir' => array(), // create folders before copy\n 'cp' => array(),\n 'rm' => array(),\n 'rmdir' => array(), // delete folders afer delete files\n );\n }\n foreach ($aMerged as $sIdentPath => &$aFolderData) {\n \n // check ignore patterns\n foreach($this->aIgnorePatterns as $sPattern){\n if(preg_match('/'.$sPattern.'/Uis', $sIdentPath)){\n continue 2;\n }\n }\n \n // fill plugin data dynamicly, plugin dont know external files before\n $this->addPluginDataDynamicly($aFolderData, $sIdentPath);\n \n // (plugin || server) => staging\n $aStaging = $this->calcStagingSequence($aFolderData, $sIdentPath);\n if ($this->blDebug) {\n $aStaging['data']['data'] = $aFolderData;\n }\n $aSequences['staging'][$aStaging['action']][$sIdentPath] = $aStaging['data'];\n \n // now staging is equal to server\n if (isset($aFolderData['server'])) {\n $aFolderData['staging'] = $aFolderData['server'];\n }\n \n // staging => plugin\n $aPlugin = $this->calcPluginSequence($aFolderData, $sIdentPath);\n if ($this->blDebug) {\n $aPlugin['data']['data'] = $aFolderData;\n }\n $aSequences['plugin'][$aPlugin['action']][$sIdentPath] = $aPlugin['data'];\n }\n //sorting\n foreach ($aSequences as $sSequence => $aSequence) {\n if (isset($aSequence['mkdir'])) { // create dirs ascending\n ksort($aSequences[$sSequence]['mkdir']);\n }\n if (isset($aSequence['rmdir'])) { // delete dirs descending\n krsort($aSequences[$sSequence]['rmdir']);\n }\n }\n foreach ($aSequences as $sSequence => $aSequence) {\n foreach ($aSequence as $sSequenceType => $aSequenceData) { // remote actions\n if (!empty($sSequenceType)) {\n foreach ($aSequenceData as $sActionIdent => $aActionData) {\n if (strpos($sActionIdent, '__/') === 0) {\n $this->aMeta['remoteActions'][$sSequence][$sActionIdent] = array($sSequenceType =>$aActionData);\n }\n }\n }\n }\n }\n $this->aSequences = $aSequences;\n } elseif (empty($this->aSequences)) {// load cached\n $aCached = MLCache::gi()->get($this->sCacheName);\n $this->aSequences = $aCached['sequences'];\n $this->aMeta = $aCached['meta'];\n } \n if (empty($this->aSequences)) {\n MLCache::gi()->delete($this->sCacheName);\n } else {\n MLCache::gi()->set($this->sCacheName, array('sequences' => $this->aSequences, 'meta' => $this->aMeta), 10 * 60);\n }\n return $this;\n }", "function extractArchive( $source , $destination )\n{\n\t// Cleanup path\n\t$destination\t= JPath::clean( $destination );\n\t$source\t\t\t= JPath::clean( $source );\n\n\treturn JArchive::extract( $source , $destination );\n}", "function createPackage() {\n\t\t$package = new ZipArchive();\n\t\t$package->open($this->getPackageFilePath(), ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE);\n\t\tforeach ($this->_files as $fileName => $filePath) {\n\t\t\t$package->addFile($filePath, $fileName);\n\t\t}\n\t\t$package->close();\n\t}", "function bls_sf_svn_extractPackage($addr, $unpacklocation)\n{\n\n}", "protected function downloadAndConfigTheFramework()\n {\n self::$zip_target_name = 'kitFramework.zip';\n self::$zip_target_path = self::sanitizePath(WB_PATH . '/temp/unzip');\n\n if (!file_exists(self::$zip_target_path)) {\n if (!mkdir(self::$zip_target_path, 0777, true)) {\n throw new \\Exception($this->app['translator']->trans(\"Can not create the directory %directory%!\",\n array('%directory%' => '/temp/unzip')));\n }\n }\n\n // clean up the temporary directory\n @array_map('unlink', glob(self::sanitizePath(WB_PATH . '/temp/unzip/*')));\n\n // get the kitFramework with CURL\n $info = array();\n if (! $this->curlDownload(self::$kitFramework_zip_url, self::$zip_target_path . '/' . self::$zip_target_name, $info)) {\n if (isset($info['http_code']) && ($info['http_code'] == '302') && isset($info['redirect_url']) && ! empty($info['redirect_url'])) {\n // follow the redirect URL!\n $redirect_url = $info['redirect_url'];\n $info = array();\n $this->curlDownload($redirect_url, self::$zip_target_path . '/' . self::$zip_target_name, $info);\n } elseif (isset($info['http_code']) && ($info['http_code'] != '200')) {\n throw new \\Exception(sprintf('[GitHub Error] HTTP Code: %s - no further informations available!', $info['http_code']));\n }\n }\n\n // unzip the kitFramework to the target path\n $unzip = new unZip();\n\n // create target directory\n $unzip->checkDirectory(self::sanitizePath(WB_PATH . '/temp/unzip/kit2'));\n $unzip->setUnZipPath(self::sanitizePath(WB_PATH . '/temp/unzip/kit2'));\n\n $unzip->extract(self::$zip_target_path . '/' . self::$zip_target_name);\n\n // GitHub ZIP's contain a subdirectory with name we don't know ...\n $source_dir = '';\n $handle = opendir(WB_PATH . '/temp/unzip/kit2');\n // we loop through the temp dir to get the first subdirectory ...\n while (false !== ($file = readdir($handle))) {\n if ('.' == $file || '..' == $file)\n continue;\n if (is_dir(WB_PATH . '/temp/unzip/kit2/' . $file)) {\n // ... here we got it!\n $source_dir = WB_PATH . '/temp/unzip/kit2/' . $file;\n break;\n }\n }\n\n if ($source_dir == '')\n throw new \\Exception('The unzipped archive has an unexpected structure, please contact the support!');\n\n // create the directory for the kitFramework\n if (!mkdir(WB_PATH . '/kit2'))\n throw new \\Exception(\"Can't create the target directory for the KIT framework!\");\n\n // move all files from the temporary directory to the target\n if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {\n // linux only: just rename\n if (!rename(self::sanitizePath($source_dir), self::sanitizePath(WB_PATH . '/kit2')))\n throw new \\Exception(\"Can't move the unzipped framework to the target directory!\");\n }\n else {\n // at windows copy file per file ...\n $this->xcopy(self::sanitizePath($source_dir), self::sanitizePath(WB_PATH . '/kit2'));\n }\n // delete not needed GIT files\n $delete_files = array(\n '.gitattributes',\n '.gitignore'\n );\n foreach ($delete_files as $file) {\n // we don't want any error prompt at this point\n @unlink(self::sanitizePath(WB_PATH . '/kit2/' . $file));\n }\n\n // clean up the temporary directory\n @array_map('unlink', glob(self::sanitizePath(WB_PATH . '/temp/unzip/*')));\n\n if (!file_exists(self::sanitizePath(WB_PATH . '/kit2/config'))) {\n if (!mkdir(self::sanitizePath(WB_PATH . '/kit2/config')))\n throw new \\Exception(\"Can't create the directory for the framework configuration files!\");\n }\n\n // create the configuration for SwiftMailer\n $this->createEMailConfiguration();\n\n // create the configuration for Doctrine\n $this->createDoctrineConfiguration();\n\n // create the CMS configuration\n $this->createCMSConfiguration();\n\n // update the framework configuration\n $this->updateFrameworkConfiguration();\n\n // create directory protection\n $this->createProtection(WB_PATH . '/kit2/config');\n\n // create the /media directory for the kitFramework\n $directories = array(\n WB_PATH . '/kit2/media',\n WB_PATH . '/kit2/media/public',\n WB_PATH . '/kit2/media/protected'\n );\n foreach ($directories as $directory) {\n if (! file_exists($directory)) {\n if (! mkdir($directory))\n throw new \\Exception('Can\\'t create the \\media directory for kitFramework!');\n }\n }\n\n // create directory protection\n $this->createProtection(WB_PATH . '/kit2/media/protected');\n }", "public function process(Payload $payload) {\n\t\t$sha1 = $payload->getHead()->getId();\n\t\t$tag = substr($payload->getRef(), strlen(self::PATTERN_TAG_HEAD));\n\t\t$this->validateVersionNumber($tag);\n\n\t\t// additional settings not requiring validation.\n\t\t$url = $this->getSettingValue(self::OPTION_URL, $payload->getRepository()->resolveApiUrl(Repository::API_URL_CLONE));\n\t\t// look for an upload comment in settings; if not found there, use Payload HEAD's message body\n\t\t$comment = $this->getSettingValue(self::OPTION_COMMENT, $payload->getHead()->getMessage());\n\n\t\t// validation: credentials file and local directory path.\n\t\t$directory = $this->getSettingValue(self::OPTION_DIRECTORY);\n\t\t$directory = rtrim($directory, '/') . '/';\n\t\t$directory .= $sha1 . '/' . $this->getWorkingDirectoryName($payload);\n\t\t$credentialsFile = $this->getSettingValue(self::OPTION_CREDENTIALSFILE, GIZZLE_HOME . self::CREDENTIALS_FILE);\n\t\t$this->validateCredentialsFile($credentialsFile);\n\t\tlist ($username, $password) = $this->readUploadCredentials($credentialsFile);\n\n\t\t// initializing build directory and cloning source\n\t\t$clone = $this->getGitClonePlugin();\n\t\t$clonePluginSettings = $this->getSubPluginSettings('\\NamelessCoder\\GizzleGitPlugins\\GizzlePlugins\\ClonePlugin', array(\n\t\t\tClonePlugin::OPTION_GITCOMMAND => $this->getSettingValue(self::OPTION_GITCOMMAND, ClonePlugin::DEFAULT_GITCOMMAND),\n\t\t\tClonePlugin::OPTION_DIRECTORY => $directory,\n\t\t\tClonePlugin::OPTION_SINGLE => TRUE,\n\t\t\tClonePlugin::OPTION_BRANCH => $tag,\n\t\t\tClonePlugin::OPTION_DEPTH => 1\n\t\t));\n\t\t$clone->initialize($clonePluginSettings);\n\t\t$this->createWorkingDirectory($directory);\n\t\t$this->validateDirectory($directory);\n\t\t$clone->process($payload);\n\n\t\t// a large, properly formatted data file.\n\t\t$comment = sprintf($comment, $url);\n\t\ttry {\n\t\t\t$output = $this->getUploader()->upload($directory, $username, $password, $comment);\n\t\t} catch (\\SoapFault $error) {\n\t\t\tthrow new \\RuntimeException($error->getMessage(), $error->getCode());\n\t\t}\n\n\t\t// cleanup and messages\n\t\tif (TRUE === (boolean) $this->getSettingValue(self::OPTION_REMOVEBUILD, FALSE)) {\n\t\t\t$this->removeWorkingDirectory($this->getSettingValue(self::OPTION_DIRECTORY), $sha1);\n\t\t}\n\t\t$payload->getResponse()->addOutputFromPlugin($this, $output);\n\t}", "public function extractPacks(){\n\n\t\t$this->load->model('functions');\n\n $newdir = NEW_DIRECTORY;\n\t\t$scandir = SCANNING_DIRECTORY;\n\t\t$sql = \"SELECT * from Packs where `scanned` = '0' AND `filetype` = 'zip'\";\n\t\t$query = $this->db->query($sql);\n\t\t$i=0;\n\t\tforeach($query->result_array() as $pack){\n\t\t\tif ($pack['filetype'] == 'zip'){\n\n\t\t\t\t$file = $newdir.$pack['packname'].\".\".$pack['filetype'];\n\t\t\t\t$zip = new ZipArchive;\n\n\t\t\t\t//This is much better, only extract sm and dwi files, nothing else.\n\t\t\t\t//this fixed broken zips with incorrect directories\n\t\t\t\tif ($zip->open($file) === TRUE) {\n \t\t\t\t\t//$zip->extractTo($scandir);\n\t\t\t\t\tfor ($i = 0; $i < $zip->numFiles; $i++){\n\t\t\t\t\t\tif(stripos($zip->getNameIndex($i), \".png\") || stripos($zip->getNameIndex($i), \".jpg\") ||\n\t\t\t\t\t \t \tstripos($zip->getNameIndex($i), \".sm\") || stripos($zip->getNameIndex($i), \".dwi\") ||\n\t\t\t\t\t\t\tstripos($zip->getNameIndex($i), \".ssc\")){\n\t\t\t\t \t\t//Packs with sm.old files....\n\t\t\t\t\t\t\tif(!stripos($zip->getNameIndex($i), \".old\")){\n\t\t\t\t\t\t\t\t$zip->extractTo($scandir, array($zip->getNameIndex($i)));\n\t\t\t\t\t\t\t\t//echo $zip->getNameIndex($i).\"\\n\";\n\t\t\t\t\t\t\t\t$foldername = explode('/', $zip->getNameIndex($i))[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//echo $foldername;\n\t\t\t\t\t$zip->close();\n\t\t\t\t\t//exit();\n\t\t\t\t\t//echo $pack['packname'];\n\t\t\t\t\t//If ZIP extracted correctly, scan the directory.\n\t\t\t\t\techo \"Scanning: $pack[packname]\\n\";\n\t\t\t\t\t$this->scanDirectory($scandir.$foldername, $pack['id']);\n\t\t\t\t\t//exit();\n\t\t\t\t\t$sql = \"UPDATE Packs SET `scanned` = '1' WHERE id = $pack[id]\";\n\t\t\t\t\t$query = $this->db->query($sql);\n\n\t\t\t\t\t//Delete extracted directory\n\t\t\t\t\t$this->functions->rrmdir($scandir.$foldername);\n\t\t\t\t\techo \"Scanned: \".$pack['packname'].\"\\n\";\n\t\t\t\t} else\n \t\t\t\t\techo 'Failed to open: '.$pack['packname'].\"\\n\";\n\t\t\t//one pack at a time\n\t\t\t//exit();\n\t\t\t}//end if pack is zip\n\t\t}//end foreach pack\n\n\n\n\n\n\t}", "protected function package()\n {\n $zip = new \\ZipArchive();\n if ($zip->open($this->outputFile, \\ZipArchive::CREATE) !== TRUE) {\n throw new \\Exception('Couldn\\'t create zip archive');\n }\n\n $zip->addFromString('document.html', $this->htmlDom->saveHTML());\n\n if (\n !isset($this->config['html_includes']) or\n !is_dir($this->config['html_includes'])\n ) {\n throw new \\Exception('Invalid HTML includes directory');\n }\n\n // Add the contents of the HTML includes directory to the ZIP file\n $it = new RecursiveDirectoryIterator($this->config['html_includes']);\n $files = new RecursiveIteratorIterator(\n $it,\n RecursiveIteratorIterator::CHILD_FIRST\n );\n foreach ($files as $file) {\n if ($file->getType() == 'dir') { continue; }\n $zipPath = $file->getPathname();\n $zipPath = str_replace($this->config['html_includes'] . '/', '', $zipPath);\n $zip->addFile($file->getRealPath(), $zipPath);\n }\n\n // Add metypeset media files\n $mediaDir = dirname($this->inputFile) . '/metypeset/media';\n if (is_dir($mediaDir)) {\n $it = new RecursiveDirectoryIterator($mediaDir);\n $files = new RecursiveIteratorIterator(\n $it,\n RecursiveIteratorIterator::CHILD_FIRST\n );\n foreach ($files as $file) {\n if ($file->getType() == 'dir') { continue; }\n $zipPath = $file->getPathname();\n $zipPath = str_replace($mediaDir, 'media', $zipPath);\n $zip->addFile($file->getRealPath(), $zipPath);\n }\n }\n\n $zip->close();\n }", "protected function openArchive() {\n $zipname = $this->tempPath() . self::ZIPTEMP_STUB;\n\n // get size of $zipname, save to $this->zip_size\n $this->zip_size = file_exists($zipname) ? filesize($zipname) : 0;\n\n if (class_exists('ZipArchive')) {\n $this->writeLog(true, '<p>Archiving with ZipArchive</p>');\n $this->zip = new ZipArchive();\n if (file_exists($zipname)) {\n $res = $this->zip->open($zipname);\n } else {\n $res = $this->zip->open($zipname, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n }\n\n if ($res !== true) {\n foreach ($this->zip_errors as $const => $message) {\n if (constant('ZipArchive::'.$const) === $res) {\n $this->writeLog('<code>ZipArchive::open()</code> failure:', $this->zip_errors[$const], '<br>');\n return;\n }\n }\n }\n } else {\n $this->writeLog(true, '<p>Archiving with Splitbrain_Zip</p>');\n include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_inc' . DIRECTORY_SEPARATOR . 'class.Splitbrain_Zip.php');\n $this->zip = new Splitbrain_Zip();\n\n if (file_exists($zipname)) {\n $this->zip->open($zipname);\n } else {\n $this->zip->create($zipname);\n }\n }\n\n $this->zip_ulimit = 0;\n\n return $zipname;\n }", "public function index()\n {\n $fileName = 'itsolutionstuff.txt';\n $fileData = 'This file created by Itsolutionstuff.com';\n \n $this->zip->add_data($fileName, $fileData);\n \n $fileName2 = 'itsolutionstuff_file2.txt';\n $fileData2 = 'This file created by Itsolutionstuff.com - 2';\n \n $this->zip->add_data($fileName2, $fileData2);\n \n $this->zip->download('Itsolutionstuff_zip.zip');\n }", "public function testZipSuccess()\n {\n $mock_response = new MockHttpResponse(\n 200,\n $this->mock_response_json\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n\n $sources = [\n 'https://d1wtqaffaaj63z.cloudfront.net/images/20150617_143146.jpg',\n $this->test_file_handle\n ];\n\n $store_options = ['filename' => 'mycollage_file.png'];\n $filelink = $client->zip($sources, $store_options);\n $this->assertNotNull($filelink);\n }", "public function zipPath($source) {\r\n $this->zipBackupFilename = 'code_' . date('YmdHis') . '_' . MD5(microtime()) . '.zip';\r\n\r\n // setup the zip backup path\r\n $sqlBackupFilePath = $this->getBackupPath() . '/' . $this->zipBackupFilename;\r\n if (extension_loaded('zip')) {\r\n $zip = new ZipArchive();\r\n if ($zip->open($sqlBackupFilePath, ZIPARCHIVE::CREATE)) {\r\n $source = realpath($source);\r\n if (is_dir($source)) {\r\n $iterator = new RecursiveDirectoryIterator($source);\r\n $filtered = new DirFilter($iterator, $this->skipFolderContents);\r\n\r\n // skip dot files while iterating \r\n $files = new RecursiveIteratorIterator($filtered, RecursiveIteratorIterator::SELF_FIRST);\r\n foreach ($files as $file) {\r\n // double check path\r\n $file = realpath($file);\r\n if ($source != substr($file, 0, strlen($source))) {\r\n continue;\r\n }\r\n\r\n if (is_dir($file)) {\r\n $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));\r\n }\r\n else if (is_file($file)) {\r\n $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));\r\n }\r\n }\r\n }\r\n else if (is_file($source)) {\r\n $zip->addFromString(basename($source), file_get_contents($source));\r\n }\r\n }\r\n\r\n // add empty directories back in\r\n $zip->addEmptyDir('files');\r\n $zip->addEmptyDir('core/cache');\r\n $zip->addEmptyDir('core/logs');\r\n\r\n return $zip->close();\r\n }\r\n\r\n return false;\r\n }", "function unpack_to_return_the_exe($zip_location){\n $zip = new ZipArchive;\n $zip->open(realpath($zip_location)); //opens the zip file\n\n $result_array = array(\"file_to_obfuscate\" => '', \"dependencies\" => array());\n //defines the array return ^\n\n for ($i = 0; $i < $zip->numFiles; $i++) { //get all the files in the zip file\n $filename = $zip->getNameIndex($i); //get the name of the current file\n $info = pathinfo($filename); //path info of the file\n\n if($info[\"extension\"] == \"exe\"){ //in case the file is an exe, gen a random name to it and save it and link the name to the array return\n $file_to_obfuscate = \"uploads/\" . uniqid() . '.' . $info[\"extension\"];\n fwrite(fopen($file_to_obfuscate, \"w\"), $zip->getFromName($filename));\n $result_array[\"file_to_obfuscate\"] = $file_to_obfuscate;\n }\n else if($info[\"extension\"] == \"dll\"){ //add data foreach dll dependency\n $dll_dependency = \"uploads/\" . $filename;\n fwrite(fopen($dll_dependency, \"w\"), $zip->getFromName($filename));\n\n array_push($result_array[\"dependencies\"], $dll_dependency);\n }\n else {\n $zip->close();\n\n foreach(@$result_array[\"dependencies\"] as &$val)\n @unlink(realpath($val));\n //im not sure if the arrays are really defined, so i use @ to not throw exceptions\n\n @unlink($zip_location);\n @unlink($result_array[\"file_to_obfuscate\"]);\n @unlink(\"uploads/\" . $filename);\n\n die(\"there are files that arent .exe/.dll in the zip\");\n }\n }\n $zip->close();\n unlink($zip_location);\n\n return $result_array;\n}", "function fm_unzip_file ($zipfile, $destination = '', $showstatus = false, $currentdir=0, $groupid) {\r\n//Both parameters must be FULL paths\r\n//If destination isn't specified, it will be the\r\n//SAME directory where the zip file resides.\r\n// Modded for Myfiles \r\n// Michael Avelar 1/24/06 \r\n global $CFG, $USER;\r\n\r\n //Extract everything from zipfile\r\n $path_parts = pathinfo(cleardoubleslashes($zipfile));\r\n $zippath = $path_parts[\"dirname\"]; //The path of the zip file\r\n $zipfilename = $path_parts[\"basename\"]; //The name of the zip file\r\n $extension = $path_parts[\"extension\"]; //The extension of the file\r\n\r\n //If no file, error\r\n if (empty($zipfilename)) {\r\n return false;\r\n }\r\n\r\n //If no extension, error\r\n if (empty($extension)) {\r\n return false;\r\n }\r\n\r\n //If no destination, passed let's go with the same directory\r\n if (empty($destination)) {\r\n $destination = $zippath;\r\n }\r\n\r\n //Clear $destination\r\n $destpath = rtrim(cleardoubleslashes($destination), \"/\");\r\n\r\n //Check destination path exists\r\n if (!is_dir($destpath)) {\r\n return false;\r\n }\r\n\r\n //Check destination path is writable. TODO!!\r\n\r\n //Everything is ready:\r\n // -$zippath is the path where the zip file resides (dir)\r\n // -$zipfilename is the name of the zip file (without path)\r\n // -$destpath is the destination path where the zip file will uncompressed (dir)\r\n\r\n if (empty($CFG->unzip)) { // Use built-in php-based unzip function\r\n\r\n include_once(\"$CFG->libdir/pclzip/pclzip.lib.php\");\r\n $archive = new PclZip(cleardoubleslashes(\"$zippath/$zipfilename\"));\r\n if (!$list = $archive->extract(PCLZIP_OPT_PATH, $destpath,\r\n PCLZIP_CB_PRE_EXTRACT, 'unzip_cleanfilename')) {\r\n notice($archive->errorInfo(true));\r\n return false;\r\n }\r\n\r\n } else { // Use external unzip program\r\n\r\n $separator = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? ' &' : ' ;';\r\n $redirection = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? '' : ' 2>&1';\r\n\r\n $command = 'cd '.escapeshellarg($zippath).$separator.\r\n escapeshellarg($CFG->unzip).' -o '.\r\n escapeshellarg(cleardoubleslashes(\"$zippath/$zipfilename\")).' -d '.\r\n escapeshellarg($destpath).$redirection;\r\n //All converted to backslashes in WIN\r\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n $command = str_replace('/','\\\\',$command);\r\n }\r\n Exec($command,$list);\r\n }\r\n\t// Inserts unzipped objects into myfiles api\r\n\t$afolder = $currentdir;\r\n\t// Reorders list so that folders are inserted into database before links\r\n\t$list2 = array();\r\n\tforeach($list as $l) {\r\n\t\tif ($l['folder'] == 1) {\r\n\t\t\t$list2[] = $l;\r\n\t\t}\r\n\t}\r\n\t// Reorders folders list to extract them in order, so the database has the folder before\r\n\t// inserting stuff into that folder\r\n\r\n\tusort($list2, 'fm_reorder_folders_list');\r\n\t// Recompiles the completed list...with ordered folders first, then files\r\n\tforeach($list as $l) {\r\n\t\tif ($l['folder'] != 1) {\r\n\t\t\t$list2[] = $l;\r\n\t\t}\r\n\t}\r\n\tforeach($list2 as $l) {\r\n\t\tif ($l['folder'] == 1) {\t// is an unzipped folder\r\n\t\t\t$newfolder = NULL;\r\n\t\t\t\r\n\t\t\tif($groupid ==0){\r\n\t\t\t\t$newfolder->owner = $USER->id;\r\n\t\t\t}else{\r\n\t\t\t\t$newfolder->owner = $groupid;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$tmp = explode('/',$l['stored_filename']);\r\n\t\t\t// compiles the path of the folder\r\n\t\t\t$tmppath = '/';\r\n\t\t\tforeach ($tmp as $t) {\r\n\t\t\t\tif ($t != '') {\r\n\t\t\t\t\t$tmppath .= $t.\"/\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$tmp = array_reverse($tmp);\r\n\t\t\t$tmppath = substr($tmppath, 0, (strrpos($tmppath, $tmp[1])));\r\n\t\t\t$newfolder->name = $tmp[1];\r\n\t\t\t$newfolder->category = 0;\r\n\t\t\tif ($tmp[2] == NULL) {\t\t\t// Folder is root folder\r\n\t\t\t\t$newfolder->path = '/';\r\n\t\t\t\t$newfolder->pathid = 0;\r\n\t\t\t} else {\r\n\t\t\t\t// Puts all folders in their place :)\r\n\t\t\t\t$pathtmp = '/';\r\n\t\t\t\t$count = count($tmp);\r\n\t\t\t\twhile ($count > 3) {\r\n\t\t\t\t\t$pathtmp .= $tmp[$count - 1].'/';\r\n\t\t\t\t\t$count--;\r\n\t\t\t\t}\r\n\t\t\t\t$rec = get_record('fmanager_folders',\"name\",$tmp[2],\"path\",$pathtmp);\r\n\t\t\t\t$afolder = $rec->id;\r\n\t\t\t\t$newfolder->path = fm_get_folder_path($afolder, false, $groupid).\"/\";\r\n\t\t\t\t$newfolder->pathid = $afolder;\r\n\t\t\t}\r\n\t\t\t$newfolder->timemodified = time();\r\n\t\t\tif (!$afolder = insert_record('fmanager_folders',$newfolder)) {\r\n\t\t\t\terror(get_string('errnoinsert','block_file_manager'));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$tmp = explode('/', $l['stored_filename']);\r\n\t\t\t$newlink = NULL;\r\n\t\t\tif($groupid ==0){\t\r\n\t\t\t\t$newlink->owner = $USER->id;\r\n\t\t\t}else{\r\n\t\t\t\t$newlink->owner = $groupid;\r\n\t\t\t}\r\n\t\t\t$newlink->type = TYPE_FILE;\t\r\n\t\t\t$rootlinkstr = '';\r\n\t\t\t// Compiles path string\r\n\t\t\t$count = count($tmp);\r\n\t\t\t$count = $count - 2;\r\n\t\t\tforeach($tmp as $t) {\r\n\t\t\t\tif ($count > 0) {\r\n\t\t\t\t\tif ($t != '') {\r\n\t\t\t\t\t\t$rootlinkstr .= '/'.$t;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$count--;\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\tif (substr($rootlinkstr,0,1) != '/') {\r\n\t\t\t\t$rootlinkstr = '/'.$rootlinkstr;\r\n\t\t\t}\r\n\t\t\tif ($rootlinkstr != '/') {\r\n\t\t\t\t$rootlinkstr = $rootlinkstr.'/';\r\n\t\t\t}\r\n\t\t\t$tmp = array_reverse($tmp);\r\n\t\t\tif($groupid==0){\r\n\t\t\t\t$owner = $USER->id;\r\n\t\t\t\t$newlink->ownertype = 0;\r\n\t\t\t}else{\r\n\t\t\t\t$owner = $groupid;\r\n\t\t\t\t$newlink->ownertype = 1;\r\n\t\t\t}\r\n\t\t\tif (!$foldstr = get_record('fmanager_folders',\"owner\",$owner,\"name\",$tmp[1],\"path\",$rootlinkstr)) {\r\n\t\t\t\t$foldstr->id = $currentdir;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$newlink->folder = $foldstr->id;\r\n\t\t\t$newlink->category = 0;\r\n\t\t\t$newlink->name = substr($tmp[0],0,-4);\r\n\t\t\t$newlink->description = '';\r\n\t\t\t$newlink->link = $tmp[0];\r\n\t\t\t$newlink->timemodified = time();\r\n\t\t\tif (!$alink = insert_record('fmanager_link',$newlink)) {\r\n\t\t\t\terror(get_string('errnoinsert','block_file_manager'));\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n //Display some info about the unzip execution\r\n if ($showstatus) {\r\n fm_unzip_show_status($list,$destpath);\r\n }\r\n\r\n return $list;\r\n}", "function download() {\r\n $this->zip->read_dir('./uploads/',FALSE);\r\n // create zip file on server\r\n $this->zip->archive('./downloads/'.'images.zip');\r\n // prompt user to download the zip file\r\n $this->zip->download('images.zip');\r\n }", "public function prepareExtraction($archive, $destination = '') {\n // Determine paths.\n if (empty($destination)) {\n $extpath = $this->localdir;\n }\n else {\n $extpath = $this->localdir . '/' . $destination;\n // Todo: move this to extraction function.\n if (!is_dir($extpath)) {\n mkdir($extpath);\n }\n }\n // Only local existing archives are allowed to be extracted.\n if (in_array($archive, $this->zipfiles)) {\n self::extract($archive, $extpath);\n }\n }", "public function getZip() {}", "function privExtractFileUsingTempFile(&$p_entry, &$p_options)\n {\n $v_result=1;\n\n // ----- Creates a temporary file\n $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';\n if (($v_dest_file = @fopen($v_gzip_temp_name, \"wb\")) == 0) {\n fclose($v_file);\n PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary write mode');\n return PclZip::errorCode();\n }\n\n\n // ----- Write gz file format header\n $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));\n @fwrite($v_dest_file, $v_binary_data, 10);\n\n // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n $v_size = $p_entry['compressed_size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($this->zip_fd, $v_read_size);\n //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n @fwrite($v_dest_file, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Write gz file format footer\n $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);\n @fwrite($v_dest_file, $v_binary_data, 8);\n\n // ----- Close the temporary file\n @fclose($v_dest_file);\n\n // ----- Opening destination file\n if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\n $p_entry['status'] = \"write_error\";\n return $v_result;\n }\n\n // ----- Open the temporary gz file\n if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {\n @fclose($v_dest_file);\n $p_entry['status'] = \"read_error\";\n PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_gzip_temp_name.'\\' in binary read mode');\n return PclZip::errorCode();\n }\n\n\n // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n $v_size = $p_entry['size'];\n while ($v_size != 0) {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @gzread($v_src_file, $v_read_size);\n //$v_binary_data = pack('a'.$v_read_size, $v_buffer);\n @fwrite($v_dest_file, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n @fclose($v_dest_file);\n @gzclose($v_src_file);\n\n // ----- Delete the temporary file\n @unlink($v_gzip_temp_name);\n\n // ----- Return\n return $v_result;\n }", "function doArchive($course_id, $course_code) {\n global $webDir, $tool_content, $langGeneralError;\n\n // Remove previous back-ups older than 10 minutes\n touch(\"$webDir/courses/archive/index.html\");\n cleanup(\"$webDir/courses/archive\", 600);\n\n $basedir = \"$webDir/courses/archive/$_SESSION[csrf_token]/$course_code\";\n file_exists($basedir) or make_dir($basedir);\n\n $backup_date = date('Ymd-His');\n $backup_date_short = date('Ymd');\n\n $archivedir = $basedir . '/' . $backup_date;\n file_exists($archivedir) or make_dir($archivedir);\n\n archiveTables($course_id, $course_code, $archivedir);\n\n $zipfile = \"$webDir/courses/archive/$_SESSION[csrf_token]/$course_code-$backup_date_short.zip\";\n if (file_exists($zipfile)) {\n unlink($zipfile);\n }\n\n // create zip file\n $zip = new ZipArchive;\n if ($zip->open($zipfile, ZipArchive::CREATE) !== true) {\n //Session::Messages($langGeneralError, 'alert-danger');\n Session::flash('message',$langGeneralError);\n Session::flash('alert-class', 'alert-danger');\n redirect_to_home_page('modules/course_info/index.php?course=' . $course_code);\n }\n $result = $zip->addGlob($archivedir . '/*', GLOB_NOSORT, [\n 'remove_path' => \"$webDir/courses/archive/$_SESSION[csrf_token]\" ]) &&\n addDir($zip, \"$webDir/courses/$course_code\", \"$course_code/$backup_date/html\") &&\n addDir($zip, \"$webDir/video/$course_code\", \"$course_code/$backup_date/video_files\");\n $zip->close();\n removeDir($basedir);\n\n if (!$result) {\n //Session::Messages($langGeneralError, 'alert-danger');\n Session::flash('message',$langGeneralError);\n Session::flash('alert-class', 'alert-danger');\n redirect_to_home_page('modules/course_info/index.php?course=' . $course_code);\n }\n\n return $zipfile;\n}", "public function __construct() {\n parent::__construct();\n $this->load->library('zip');\n }", "protected function createArchive()\n {\n $branch = $this->getCurrenBranch();\n\n $dir = HOME.'/repos/'.$this->getRepoName().'/'.$branch.'/archives/';\n\n if (!$this->getFilesystem()->exists($dir)) {\n $this->getFilesystem()->makeDirectory($dir);\n }\n\n $output = $dir.time().'.zip';\n $this->repository->archive(['--format=zip', $branch, '--output='.$output]);\n\n return $output;\n }", "public function testZipArchiveZipCreate()\n {\n }", "public function unpackPackage()\n\t{\n\t\t$this->_unzipFolder = blx()->path->getTempPath().IOHelper::getFileName($this->_downloadFilePath, false);\n\n\t\tBlocks::log('Unzipping package to '.$this->_unzipFolder, \\CLogger::LEVEL_INFO);\n\t\tif (Zip::unzip($this->_downloadFilePath, $this->_unzipFolder))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function createZip(){\n $zipper = new \\Chumper\\Zipper\\Zipper;\n $files = glob(public_path('storage/*'));\n $zipper->make(public_path('allImages.zip'))->add($files);\n }", "public function createZipFileFromExtensionGeneratesCorrectArchive() {}", "public function unzip_package( $file ) {\n\t\t$base_name = $this->get_sanitized_zip_name( $file['name'] );\n\t\t$zip_file = \"{$this->tmp_dir}/{$base_name}.zip\";\n\n\t\t// Move the uploaded zip into the temporary directory.\n\t\tmove_uploaded_file( $file['tmp_name'], $zip_file );\n\n\t\t$unzip = escapeshellarg( self::UNZIP );\n\t\t$zip_file = escapeshellarg( $zip_file );\n\t\t$tmp_dir = escapeshellarg( $this->tmp_dir );\n\n\t\t// Unzip it into the theme directory.\n\t\t$this->exec_with_notify( escapeshellcmd( \"{$unzip} -DDn {$zip_file} -d {$tmp_dir}/{$base_name}\" ) );\n\n\t\t// Fix any permissions issues with the files. Sets 755 on directories, 644 on files.\n\t\t$this->exec_with_notify( escapeshellcmd( \"chmod -R 755 {$tmp_dir}/{$base_name}\" ) );\n\t\t$this->exec_with_notify( escapeshellcmd( \"find {$tmp_dir}/{$base_name} -type f -print0\" ) . ' | xargs -I% -0 chmod 644 %' );\n\n\t\t// Remove any unexpected entries, we only need basic files and directories, anything else will cause problems when installed onto a site.\n\t\t$this->exec_with_notify( escapeshellcmd( \"find {$tmp_dir}/{$base_name} -not -type f -not -type d -delete\" ) );\n\t}", "public function zip(Presentation $pres, Revision $rev, string $env, string $companyParentName, $process = \"zip\")\n {\n\t $this->pres = $pres;\n\t $this->rev = $rev;\n\t $this->param = $this->util->getPresentationParameter($rev->getPreSettings());\n\t // zip output\n\t $this->wideDir = $this->container->getParameter('zip_wide_directory').\"/\".$this->rev->getId();\n\t $this->zipName = $this->util->slugify($this->getZipName());\n\t $this->S3 = $this->awsMedia->getS3Client();\n\t $this->awsMedia->companyName = $companyParentName;\n\n\t // init shared with timestamp\n\t $currentDate = $this->initShared();\n\t // generate the zip name\n\t $zipName = $this->getZipName();\n\t // generate shared Resources\n\t $this->generateSharedResources();\n\t // generate references\n\t $this->generateReferences();\n\t $this->generatePopins();\n $this->setSharedResources();\n\t // generate folders and linkedScreens\n\t $folders = $this->generateFolders($currentDate);\n\t $tree = $this->generateSlidesTree($folders);\n\t $this->generateSlidesHtml($tree, $folders);\n // generate menu.html\n $this->generateMenuHtml($tree);\n // generate flows.js\n $this->generateFlowJs($folders);\n // generate Thumbnails\n $this->getThumbnailsByScreen($folders);\n $response = $this->awsMedia->generateZipByLambda($this->zipName, \"veeva\", $process);\n $response = \\GuzzleHttp\\json_decode($response);\n\n if($response and is_object($response) and property_exists($response, \"uploadedZipKey\") and $process == \"zip\"):\n/* $seperator = explode('veeva-wide', $response->{\"uploadedZipKey\"});\n $filename = $seperator[1];*/\n $foldername = $response->{\"uploadedZipKey\"};\n $pathToS3 = \"s3://\".$this->awsMedia->expectedBucketName.\"/\".$companyParentName.\"/zip/veeva-wide/\";\n $urlPath = $pathToS3.$response->{\"uploadedZipKey\"};\n $fileName = $foldername.\".zip\";\n $result = $this->setZipToEC2($urlPath, $foldername, $pathToS3, $fileName);\n if ($result && is_object($result)) {\n return $result;\n }\n endif;\n\n return $response;\n\n }", "private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }", "private function performExtraction()\n {\n $general_error = SELF::GENERAL_ERROR . $this->current_work . \"\\n\";\n foreach ($this->z_file_list as $z_file) {\n $raw_file = fopen($z_file, 'r');\n\n // 00 (8 bytes) signature (6 bytes) and format ver (2 bytes)\n $signature = fread($raw_file, 8);\n $unpacked_header = current(unpack(\"q\", $signature));\n\n // 08 (8 bytes) unpacked/uncompressed chunk size\n $uncompressed_chunk_size = fread($raw_file, 8);\n $unpacked_chunk_size = current(unpack(\"q\", $uncompressed_chunk_size));\n\n // 10 (8 bytes) packed/compressed full size\n $packed = fread($raw_file, 8);\n $packed_size = current(unpack(\"q\", $packed));\n\n // 18 (8 bytes) unpacked/uncompressed size\n $unpacked = fread($raw_file, 8);\n $unpacked_size = current(unpack(\"q\", $unpacked));\n\n //If the header is not equal to this size then the integrity of the archive is in question\n if ($unpacked_header == 2653586369 && (is_int($unpacked_chunk_size) && is_int($packed_size) && is_int($unpacked_size))) {\n //Obtain the Archive Compression Index\n $size_indexed = 0;\n $compression_index = [];\n while ($size_indexed < $unpacked_size) {\n $raw_compressed = fread($raw_file, 8);\n $raw_uncompressed = fread($raw_file, 8);\n $compressed = current(unpack(\"q\", $raw_compressed));\n $uncompressed = current(unpack(\"q\", $raw_uncompressed));\n $compression_index[] = ['compressed' => $compressed, 'uncompressed' => $uncompressed];\n $size_indexed += $uncompressed;\n }\n\n if ($unpacked_size != $size_indexed) {\n echo $general_error . \"Header-Index mismatch. Header indicates it should only have $unpacked_size bytes when uncompressed but the index indicates $size_indexed bytes.\\n\";\n continue;\n }\n\n $data_to_write = '';\n $read_data = 0;\n foreach ($compression_index as $index_array) {\n $compressed_data = fread($raw_file, $index_array['compressed']);\n $uncompressed_data = zlib_decode($compressed_data);\n\n //Verify the size of the data is consistent with the archive index\n if (strlen($uncompressed_data) == $index_array['uncompressed']) {\n $data_to_write .= $uncompressed_data;\n $read_data += 1;\n\n if(strlen($uncompressed_data) != $unpacked_chunk_size && $read_data != count($compression_index)) {\n echo $general_error . \"Index contains more than one partial chunk: was $uncompressed_data when the full chunk size is $unpacked_chunk_size, chunk $read_data/\" . count($compression_index) . \"\\n\";\n continue 2; \n }\n } else {\n echo $general_error . \"Uncompressed chunk size is not the same as the archive index\\n\";\n continue 2;\n }\n }\n } else {\n echo $general_error . \"Header or data types of chunks are not correct.\\n\";\n continue;\n }\n\n $destination_file = trim($z_file, '.z');\n $decompressed_file = fopen($destination_file, 'w');\n fwrite($decompressed_file, $data_to_write);\n fclose($decompressed_file);\n Errorhandler::call('unlink', $z_file);\n }\n }", "function privMerge(&$p_archive_to_add)\n {\n $v_result=1;\n\n // ----- Look if the archive_to_add exists\n if (!is_file($p_archive_to_add->zipname))\n {\n\n // ----- Nothing to merge, so merge is a success\n $v_result = 1;\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Look if the archive exists\n if (!is_file($this->zipname))\n {\n\n // ----- Do a duplicate\n $v_result = $this->privDuplicate($p_archive_to_add->zipname);\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Open the zip file\n if (($v_result=$this->privOpenFd('rb')) != 1)\n {\n // ----- Return\n return $v_result;\n }\n\n // ----- Read the central directory informations\n $v_central_dir = array();\n if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)\n {\n $this->privCloseFd();\n return $v_result;\n }\n\n // ----- Go to beginning of File\n @rewind($this->zip_fd);\n\n // ----- Open the archive_to_add file\n if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)\n {\n $this->privCloseFd();\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Read the central directory informations\n $v_central_dir_to_add = array();\n if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)\n {\n $this->privCloseFd();\n $p_archive_to_add->privCloseFd();\n\n return $v_result;\n }\n\n // ----- Go to beginning of File\n @rewind($p_archive_to_add->zip_fd);\n\n // ----- Creates a temporay file\n $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';\n\n // ----- Open the temporary file in write mode\n if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)\n {\n $this->privCloseFd();\n $p_archive_to_add->privCloseFd();\n\n PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \\''.$v_zip_temp_name.'\\' in binary write mode');\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Copy the files from the archive to the temporary file\n // TBC : Here I should better append the file and go back to erase the central dir\n $v_size = $v_central_dir['offset'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = fread($this->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Copy the files from the archive_to_add into the temporary file\n $v_size = $v_central_dir_to_add['offset'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Store the offset of the central dir\n $v_offset = @ftell($v_zip_temp_fd);\n\n // ----- Copy the block of file headers from the old archive\n $v_size = $v_central_dir['size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($this->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Copy the block of file headers from the archive_to_add\n $v_size = $v_central_dir_to_add['size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);\n @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Merge the file comments\n $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];\n\n // ----- Calculate the size of the (new) central header\n $v_size = @ftell($v_zip_temp_fd)-$v_offset;\n\n // ----- Swap the file descriptor\n // Here is a trick : I swap the temporary fd with the zip fd, in order to use\n // the following methods on the temporary fil and not the real archive fd\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Create the central dir footer\n if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)\n {\n $this->privCloseFd();\n $p_archive_to_add->privCloseFd();\n @fclose($v_zip_temp_fd);\n $this->zip_fd = null;\n\n // ----- Reset the file list\n unset($v_header_list);\n\n // ----- Return\n return $v_result;\n }\n\n // ----- Swap back the file descriptor\n $v_swap = $this->zip_fd;\n $this->zip_fd = $v_zip_temp_fd;\n $v_zip_temp_fd = $v_swap;\n\n // ----- Close\n $this->privCloseFd();\n $p_archive_to_add->privCloseFd();\n\n // ----- Close the temporary file\n @fclose($v_zip_temp_fd);\n\n // ----- Delete the zip file\n // TBC : I should test the result ...\n @unlink($this->zipname);\n\n // ----- Rename the temporary file\n // TBC : I should test the result ...\n //@rename($v_zip_temp_name, $this->zipname);\n PclZipUtilRename($v_zip_temp_name, $this->zipname);\n\n // ----- Return\n return $v_result;\n }", "public function handle()\n {\n if ($this->argument('packagename') != '') {\n $this->namePackage = $this->argument('packagename');\n $this->checkPath();\n } else {\n $this->enterName();\n }\n $data = file_get_contents($this->file);\n file_put_contents($this->directory . '/temp.zip', $data);\n $zip = new \\ZipArchive;\n if ($zip->open($this->directory . '/temp.zip') == true) {\n $zip->extractTo($this->directory . '/');\n $zip->close();\n File::copyDirectory($this->directory . '/evoPackage-master/', $this->directory . '/');\n File::deleteDirectory($this->directory . '/evoPackage-master/');\n unlink($this->directory . '/temp.zip');\n $serviceprovider = file_get_contents($this->directory . '/src/ExampleServiceProvider.php');\n $serviceprovider = str_replace('example', $this->namePackage, $serviceprovider);\n $serviceprovider = str_replace('Example', ucfirst($this->namePackage), $serviceprovider);\n file_put_contents($this->directory . '/src/' . ucfirst($this->namePackage) . 'ServiceProvider.php', $serviceprovider);\n //update composer part\n $composer = file_get_contents($this->directory . '/src/composer.json');\n $composer = str_replace('example', $this->namePackage, $composer);\n $composer = str_replace('Example', ucfirst($this->namePackage), $composer);\n file_put_contents($this->directory . '/src/composer.json', $composer);\n\n unlink($this->directory . '/src/ExampleServiceProvider.php');\n $dirForComposer = 'packages/' . $this->namePackage . '/src/';\n $namespaceForComposer = 'EvolutionCMS\\\\' . ucfirst($this->namePackage) . '\\\\';\n $this->call('package:installautoload', ['key' => $namespaceForComposer, 'value' => $dirForComposer]);\n }\n }", "public function test_zipHandling()\n {\n\n // Contents of zip file are not to spec\n $this->expectExceptionMessage(\"Error: Not a valid BLM file, Data field 'FEATURE1' is too small, minimum length is '1'\");\n\n $this->zip = new Filesystem(new Zip($this->zipFile));\n $this->assertCount(34, $this->zip->listContents());\n\n $blmFiles = $this->extractBlm();\n $this->checkBlm($blmFiles);\n\n $imgFiles = $this->extractImg();\n $this->checkImg($imgFiles);\n\n $this->checkContents($blmFiles);\n // Log::debug(\"=== \".\\basename(__FILE__).\" === EXIT ===\");\n }", "private function unzip_file_main($zipfile, $destination = '') {\n $pathparts = pathinfo(cleardoubleslashes($zipfile));\n $zippath = $pathparts[\"dirname\"]; // The path of the zip file.\n $zipfilename = $pathparts[\"basename\"]; // The name of the zip file.\n $extension = $pathparts[\"extension\"]; // The extension of the file.\n\n // If no file, error.\n if (empty($zipfilename)) {\n return false;\n }\n\n // If no extension, error.\n if (empty($extension)) {\n return false;\n }\n\n // Clear $zipfile.\n $zipfile = cleardoubleslashes($zipfile);\n\n // Check zipfile exists.\n if (!file_exists($zipfile)) {\n return false;\n }\n\n // If no destination, passed let's go with the same directory.\n if (empty($destination)) {\n $destination = $zippath;\n }\n\n // Clear $destination.\n $destpath = rtrim(cleardoubleslashes($destination), \"/\");\n\n // Check destination path exists.\n if (!is_dir($destpath)) {\n return false;\n }\n\n $packer = get_file_packer('application/zip');\n\n $result = $packer->extract_to_pathname($zipfile, $destpath);\n\n if ($result === false) {\n return false;\n }\n\n foreach ($result as $status) {\n if ($status !== true) {\n return false;\n }\n }\n\n return true;\n }", "function unzip($src_file, $dest_dir=false, $create_zip_name_dir=false, $overwrite=true)\r\n\t\t{\t\r\n\t\t if(function_exists(\"zip_open\"))\r\n\t\t { \r\n\t\t if(!is_resource(zip_open($src_file)))\r\n\t\t { \r\n\t\t $src_file=dirname($_SERVER['SCRIPT_FILENAME']).$src_file; \r\n\t\t }\r\n\t\t\t /*echo dirname($_SERVER['SCRIPT_FILENAME']); // '/home/xxxcom/domains/xxx.com/public_html/[WP Folder]/wp-admin'\r\n\t\t\t echo \"<br>\";\r\n\t\t\t echo $src_file; // '/tmp/phpTdXHxZ'\r\n\t\t\t die();*/\r\n\t\t if (is_resource($zip = zip_open($src_file)))\r\n\t\t { \r\n\t\t $splitter = ($create_zip_name_dir === true) ? \".\" : \"/\";\r\n\t\t if ($dest_dir === false) $dest_dir = substr($src_file, 0, strrpos($src_file, $splitter)).\"/\";\r\n\t\t \r\n\t\t // Create the directories to the destination dir if they don't already exist\r\n\t\t $this->create_dirs($dest_dir);\r\n\t\t\r\n\t\t\t\t // init File Array count\r\n\t\t\t\t $i = 0;\r\n\t\t\t\t \r\n\t\t // For every file in the zip-packet\r\n\t\t while ($zip_entry = zip_read($zip))\r\n\t\t {\r\n\t\t \t\r\n\t\t // Now we're going to create the directories in the destination directories\r\n\t\t \r\n\t\t // If the file is not in the root dir\r\n\t\t $pos_last_slash = strrpos(zip_entry_name($zip_entry), \"/\");\r\n\t\t if ($pos_last_slash !== false)\r\n\t\t {\r\n\t\t // Create the directory where the zip-entry should be saved (with a \"/\" at the end)\r\n\t\t $this->create_dirs($dest_dir.substr(zip_entry_name($zip_entry), 0, $pos_last_slash+1));\r\n\t\t }\r\n\t\t\r\n\t\t // Open the entry\r\n\t\t if (zip_entry_open($zip,$zip_entry,\"r\"))\r\n\t\t {\r\n\r\n\t\t //Check file Exist or Not , if Yes, rename.\r\n\t\t\t\t\t $seed = 1;\r\n\t\t\t\t\t $wud = wp_upload_dir();\r\n\t\t\t\t\t if (file_exists($wud['path'].'/'.sanitize_file_name(zip_entry_name($zip_entry))))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t\twhile (file_exists($wud['path'].'/'.sz_getFilename(sanitize_file_name(zip_entry_name($zip_entry))).$seed.'.'.sz_getFileExt(sanitize_file_name(zip_entry_name($zip_entry)))) )\r\n\t\t\t\t\t \t\t{\r\n\t\t\t\t\t\t \t\t$seed++;\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t// The name of the file to save on the disk\r\n\t\t\t\t\t\t \t$savefilename = sz_getFilename(sanitize_file_name(zip_entry_name($zip_entry))).$seed.'.'.sz_getFileExt(sanitize_file_name(zip_entry_name($zip_entry)));\r\n\t\t\t\t\t \t $file_name = $dest_dir.$savefilename;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\t// The name of the file to save on the disk\r\n\t\t\t\t\t\t\t$savefilename = sanitize_file_name(zip_entry_name($zip_entry));\r\n\t\t\t\t\t\t\t$file_name = $dest_dir.zip_entry_name($zip_entry);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t \r\n\t\t // Check if the files should be overwritten or not\r\n\t\t if ($overwrite === true || $overwrite === false && !is_file($file_name))\r\n\t\t {\r\n\t\t // Get the content of the zip entry\r\n\t\t $fstream = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); \r\n\t\t \r\n\t\t if(!is_dir($file_name)) \r\n\t\t file_put_contents($file_name, $fstream );\r\n\t\t // Set the rights\r\n\t\t if(file_exists($file_name))\r\n\t\t {\r\n\t\t chmod($file_name, 0777);\r\n\t\t //echo \"<span style=\\\"color:#1da319;\\\">file saved: </span>\".$file_name.\"<br />\";\r\n\t\t\t\t\t\t\t $file[$i] = array(\r\n \t\t \t\t\t\t\t\t\t\t\t\t\t\t 'name' => $savefilename,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'tmp_name' => $file_name,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'error' => '',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'size' => filesize($file_name)\r\n \t\t \t\t\t\t\t\t\t\t\t );\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t //echo \"<span style=\\\"color:red;\\\">file not found: </span>\".$file_name.\"<br />\";\r\n\t\t }\r\n\t\t }\r\n\t\t \r\n\t\t // Close the entry\r\n\t\t zip_entry_close($zip_entry);\r\n\t\t }\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t\t//End While\r\n\t\t }\r\n\t\t // Close the zip-file\r\n\t\t zip_close($zip);\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t //echo \"No Zip Archive Found.\";\r\n\t\t return $file;\r\n\t\t }\r\n\t\t //echo print_r($file).\"<br>\";\r\n\t\t return $file;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t if(version_compare(phpversion(), \"4.1.0\", \"<\"))\r\n\t\t $infoVersion=\"(use PHP 4.1.0 or later)\";\r\n\t\t //echo \"You need to install/enable the php_zip.dll extension $infoVersion\"; \r\n\t\t }\r\n\t\t}", "function plugin_package() {\n\t\t$this->response['package'] = site_url( '/wp-content/shopp-uploads/adsanity.zip' );\n\t}", "public function execute() {\n\n if ($this->getRequest()->getParams('zip_file')) {\n\n try {\n \n $filename = $_FILES[\"zip_file\"][\"name\"];\n $source = $_FILES[\"zip_file\"][\"tmp_name\"];\n $type = $_FILES[\"zip_file\"][\"type\"];\n\t\t\t\t$size = $_FILES['zip_file']['size'];\n $name = explode(\".\", $filename);\n\t\t\t\t$rowempty = 0;\n\t\t\t\t$lang = $this->getRequest()->getParam('language');\n\t\t\t\t$filenoextV = basename($filename);\n\t\t\t\t$filenoext = basename($filenoextV);\n\t\t\t\t\n\t\t\t\t\t\t$fh = fopen($_FILES['zip_file']['tmp_name'], 'r+');\n if (!$fh) {\n throw new Exception('File open failed. Please check the file permission');\n }\n $all_rows = array();\n\t\t\t\t\t\t$count_row = true;\n\t\t\t\t\t\t while (($rownew = fgetcsv($fh, 1024, \",\")) !== FALSE) {\n \t\t\t\t\t\t\t\tif(count($rownew ) < 2 )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rowempty = 1;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if($rownew[0] == \"\" || $rownew[1] == \"\" ) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$rowempty = 1;\n\t\t\t\t\t\t\t\t\t}\n }\n\t\t\t\t\t\t\n $row = fgetcsv($fh, 9999);\n fclose($fh);\n\t\t\t\t\t\t$row_count = count($row);\n\t\t\t\t\t\n\t\t\t\t\t$continue = strtolower($name[1]) == 'csv' ? true : false;\n echo $size;\n\t\t\t\t\techo \"<br/>\";\n\t\t\t\t\techo $row_count;\n\t\t\t\t \n\t\t\t\t\tif (!$continue) {\n\t\t\t\t\t\t$this->messageManager->addError('The file you are trying to upload is not a CSV file. Please try again.');\n\t\t\t\t\t}else if($rowempty == 1)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t $this->messageManager->addError('The file you are trying to upload is not a Valid Translation file. Please try again.');\n\t\t\t\t\t\t }else if($size != 0 && $row_count != 0){\n\t\t\t\t\t\t\n\t\t\t\t\tif($lang == 'nl'){\n\t\t\t\t\t\tif($filenoextV == 'nl_BE.csv'){\t\n\t\t\t\t\t\t\t$path = BP . '/app/i18n/orange/nl_be/nl_BE.csv';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->messageManager->addError('File Name Miss Match or Wrong. Please Make sure the file name \"nl_BE.csv\"');\n\t\t\t\t\t\t\t$resultRedirect = $this->resultRedirectFactory->create();\n\t\t\t\t\t\t\t$resultRedirect->setPath('*/*/');\n\t\t\t\t\t\t\treturn $resultRedirect;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if($lang == 'fr'){\n\t\t\t\t\t\tif($filenoextV == 'fr_FR.csv'){\t\n\t\t\t\t\t\t\t$path = BP . '/app/i18n/orange/fr_fr/fr_FR.csv';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$this->messageManager->addError('File Name Miss Match or Wrong. Please Make sure the file name \"fr_FR.csv\"');\n\t\t\t\t\t\t\t$resultRedirect = $this->resultRedirectFactory->create();\n\t\t\t\t\t\t\t$resultRedirect->setPath('*/*/');\n\t\t\t\t\t\t\treturn $resultRedirect;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t\t$targetdir = $path;\n\t\t\t\t\t$targetpath = $path;\n\n\t\t\t\t\tif (is_dir($targetdir)) {\n\t\t\t\t\t\t$this->rmdir_recursive($targetdir);\n\t\t\t\t\t}\n\t\t\t\t\tif (move_uploaded_file($source, $targetpath)) {\n\t\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t* If Need UTF8 Use utf8_encode\n\t\t\t\t\t**/\t\n\t\t\t\t\t//$log = file_get_contents($targetpath);\n\t\t\t\t\t//file_put_contents($targetpath, utf8_encode($log));\t \n\t\t\t\t //$this->clear();\n\t\t\t\t\t\n\t\t\t\t\t\t$this->messageManager->addSuccess('Your file was uploaded.Please Clear the Cache and Index');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->messageManager->addError('There was a problem with the upload. Please try again.');\n\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\n\t\t\t\t\t\t$this->messageManager->addError('Please Check The File Have Content.');\n\t\t\t\t\t\t$resultRedirect = $this->resultRedirectFactory->create();\n\t\t\t\t\t\t$resultRedirect->setPath('*/*/');\n\t\t\t\t\t\treturn $resultRedirect;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n } catch (Exception $ex) {\n\n $this->messageManager->addError('Please Insert File');\n }\n } else {\n $this->messageManager->addError('There was a problem with the upload. Please try again.');\n }\n\n $resultRedirect = $this->resultRedirectFactory->create();\n $resultRedirect->setPath('*/*/');\n return $resultRedirect;\n }", "function ready_zip_for_remote($copy)\n{\n\t$file_locs=json_decode($copy);\n\t$zip_file_name=date(\"Ymdhis\");\n\tcreate_zip($file_locs, \"tmp/\".$zip_file_name.\".zip\");\n\techo $zip_file_name;\n}", "public function processFile() {\n\t\tif (!$this->_unpacked) {\n\t\t\t$jinput = JFactory::getApplication()->input;\n\t\t\t$csvilog = $jinput->get('csvilog', null, null);\n\t\t\tjimport('joomla.filesystem.file');\n\t\t\tjimport('joomla.filesystem.archive');\n\t\t\t$this->fp = true;\n\t\t\t$this->linepointer = 1;\n\t\t\t$this->data = new ODSParser();\n\t\t\t// First we need to unpack the zipfile\n\t\t\t$unpackfile = $this->_unpackpath.'/ods/'.basename($this->filename).'.zip';\n\t\t\t$importfile = $this->_unpackpath.'/ods/content.xml';\n\n\t\t\t// Check the unpack folder\n\t\t\tJFolder::create($this->_unpackpath.'/ods');\n\n\t\t\t// Delete the destination file if it already exists\n\t\t\tif (JFile::exists($unpackfile)) JFile::delete($unpackfile);\n\t\t\tif (JFile::exists($importfile)) JFile::delete($importfile);\n\n\t\t\t// Now copy the file to the folder\n\t\t\tJFile::copy($this->filename, $unpackfile);\n\n\t\t\t// Extract the files in the folder\n\t\t\tif (!JArchive::extract($unpackfile, $this->_unpackpath.'/ods')) {\n\t\t\t\t$csvilog->AddStats('incorrect', JText::_('COM_CSVI_CANNOT_UNPACK_ODS_FILE'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// File is always called content.xml\n\t\t\telse $this->filename = $importfile;\n\n\t\t\t// Read the data to process\n\t\t\tif (!$this->data->read($this->filename)) return false;\n\n\t\t\t// Set the unpacked to true as we have unpacked the file\n\t\t\t$this->_unpacked = true;\n\t\t}\n\n\t\t// All good return true\n\t\treturn true;\n\t}", "public function execute()\n {\n $args = $this->getRemainingArgs();\n if (!isset($args[1])) {\n throw new Exception('Missing template argument');\n }\n\n $template = $args[1];\n if ('@php_bin@' !== '@'.'php_bin@') {\n passthru(\n 'pear install docblox/DocBlox_Template_' . $template . ' '\n . $this->getVersion()\n );\n return;\n }\n\n if (!$this->getVersion()) {\n throw new Exception(\n 'Version number is required if DocBlox is not installed via PEAR'\n );\n }\n\n $source = 'http://pear.docblox-project.org/get/DocBlox_Template_'\n . $template . '-' . $this->getVersion() . '.tar';\n\n $tmp = tempnam(sys_get_temp_dir(), 'DBX').'.tar';\n file_put_contents($tmp, file_get_contents($source));\n $folder = realpath(dirname(__FILE__) . '/../../../../data/templates')\n . DIRECTORY_SEPARATOR . $template;\n\n echo 'Installing to: '.$folder.PHP_EOL;\n\n $tmp_folder = sys_get_temp_dir() . DIRECTORY_SEPARATOR\n . 'DBX_TEMPLATE_INSTALL' . $template . '-' . $this->getVersion();\n $phar = new PharData($tmp);\n $phar->extractTo($tmp_folder, null, true);\n unlink($tmp);\n\n $this->copyRecursive(\n $tmp_folder . DIRECTORY_SEPARATOR . 'DocBlox_Template_' . $template\n . '-' . $this->getVersion(),\n $folder\n );\n\n echo 'Completed installation'.PHP_EOL;\n }", "function uploadCompile($file, $dir, $filename){\n\tcreateFolders($dir);\n\tcreateFolders($dir.'/wp');\t\n\tcleanDir($dir.'/wp');\t\n\tmove_uploaded_file($file['tmp_name'], $dir.'/'.$filename);\t\n\t$zip = new ZipArchive;\n if($zip->open($dir.'/'.$filename)==TRUE){\n\t $zip->extractTo($dir.'/wp');\t \n\t $zip->close();\n\t}\n\tif(prepareFolder($dir.'/wp', $dir, $filename)){\n\t\tcopy(COMPILER_PATH.'unpacking/index.php', $dir.'/wp/index.php');\n\t\tcopy(COMPILER_PATH.'unpacking/wp-config.php', $dir.'/wp/wp-config.php');\t\t\n\t}\n\treturn true;\n\t\n\t\n}", "function fn_decompress_files($archive_name, $dirname = '')\n{\n $result = false;\n\n if (empty($dirname)) {\n $dirname = Registry::get('config.dir.files');\n }\n\n try {\n /** @var \\Tygh\\Tools\\Archiver $archiver */\n $archiver = \\Tygh\\Tygh::$app['archiver'];\n $result = $archiver->extractTo($archive_name, $dirname);\n\n if (!$result) {\n fn_set_notification('E', __('error'), __('unable_to_unpack_file'));\n }\n } catch (Exception $e) {\n fn_set_notification('E', __('error'), $e->getMessage());\n }\n\n return $result;\n}", "function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)\n {\n $v_result=1;\n\n // ----- Read the file header\n if (($v_result = $this->privReadFileHeader($v_header)) != 1)\n {\n // ----- Return\n return $v_result;\n }\n\n\n // ----- Check that the file header is coherent with $p_entry info\n if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\n // TBC\n }\n\n // ----- Look for all path to remove\n if ($p_remove_all_path == true) {\n // ----- Look for folder entry that not need to be extracted\n if (($p_entry['external']&0x00000010)==0x00000010) {\n\n $p_entry['status'] = \"filtered\";\n\n return $v_result;\n }\n\n // ----- Get the basename of the path\n $p_entry['filename'] = basename($p_entry['filename']);\n }\n\n // ----- Look for path to remove\n else if ($p_remove_path != \"\")\n {\n if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)\n {\n\n // ----- Change the file status\n $p_entry['status'] = \"filtered\";\n\n // ----- Return\n return $v_result;\n }\n\n $p_remove_path_size = strlen($p_remove_path);\n if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)\n {\n\n // ----- Remove the path\n $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);\n\n }\n }\n\n // ----- Add the path\n if ($p_path != '') {\n $p_entry['filename'] = $p_path.\"/\".$p_entry['filename'];\n }\n\n // ----- Check a base_dir_restriction\n if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {\n $v_inclusion\n = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],\n $p_entry['filename']);\n if ($v_inclusion == 0) {\n\n PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,\n\t\t\t \"Filename '\".$p_entry['filename'].\"' is \"\n\t\t\t\t\t\t\t\t .\"outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION\");\n\n return PclZip::errorCode();\n }\n }\n\n // ----- Look for pre-extract callback\n if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\n if ($v_result == 0) {\n // ----- Change the file status\n $p_entry['status'] = \"skipped\";\n $v_result = 1;\n }\n\n // ----- Look for abort result\n if ($v_result == 2) {\n // ----- This status is internal and will be changed in 'skipped'\n $p_entry['status'] = \"aborted\";\n \t$v_result = PCLZIP_ERR_USER_ABORTED;\n }\n\n // ----- Update the informations\n // Only some fields can be modified\n $p_entry['filename'] = $v_local_header['filename'];\n }\n\n\n // ----- Look if extraction should be done\n if ($p_entry['status'] == 'ok') {\n\n // ----- Look for specific actions while the file exist\n if (file_exists($p_entry['filename']))\n {\n\n // ----- Look if file is a directory\n if (is_dir($p_entry['filename']))\n {\n\n // ----- Change the file status\n $p_entry['status'] = \"already_a_directory\";\n\n // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n // For historical reason first PclZip implementation does not stop\n // when this kind of error occurs.\n if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,\n\t\t\t \"Filename '\".$p_entry['filename'].\"' is \"\n\t\t\t\t\t\t\t\t .\"already used by an existing directory\");\n\n return PclZip::errorCode();\n\t\t }\n }\n // ----- Look if file is write protected\n else if (!is_writeable($p_entry['filename']))\n {\n\n // ----- Change the file status\n $p_entry['status'] = \"write_protected\";\n\n // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n // For historical reason first PclZip implementation does not stop\n // when this kind of error occurs.\n if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,\n\t\t\t \"Filename '\".$p_entry['filename'].\"' exists \"\n\t\t\t\t\t\t\t\t .\"and is write protected\");\n\n return PclZip::errorCode();\n\t\t }\n }\n\n // ----- Look if the extracted file is older\n else if (filemtime($p_entry['filename']) > $p_entry['mtime'])\n {\n // ----- Change the file status\n if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))\n\t\t && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {\n\t \t }\n\t\t else {\n $p_entry['status'] = \"newer_exist\";\n\n // ----- Look for PCLZIP_OPT_STOP_ON_ERROR\n // For historical reason first PclZip implementation does not stop\n // when this kind of error occurs.\n if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))\n\t\t && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {\n\n PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,\n\t\t\t \"Newer version of '\".$p_entry['filename'].\"' exists \"\n\t\t\t\t\t .\"and option PCLZIP_OPT_REPLACE_NEWER is not selected\");\n\n return PclZip::errorCode();\n\t\t }\n\t\t }\n }\n else {\n }\n }\n\n // ----- Check the directory availability and create it if necessary\n else {\n if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))\n $v_dir_to_check = $p_entry['filename'];\n else if (!strstr($p_entry['filename'], \"/\"))\n $v_dir_to_check = \"\";\n else\n $v_dir_to_check = dirname($p_entry['filename']);\n\n if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {\n\n // ----- Change the file status\n $p_entry['status'] = \"path_creation_fail\";\n\n // ----- Return\n //return $v_result;\n $v_result = 1;\n }\n }\n }\n\n // ----- Look if extraction should be done\n if ($p_entry['status'] == 'ok') {\n\n // ----- Do the extraction (if not a folder)\n if (!(($p_entry['external']&0x00000010)==0x00000010))\n {\n // ----- Look for not compressed file\n if ($p_entry['compression'] == 0) {\n\n \t\t // ----- Opening destination file\n if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)\n {\n\n // ----- Change the file status\n $p_entry['status'] = \"write_error\";\n\n // ----- Return\n return $v_result;\n }\n\n\n // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks\n $v_size = $p_entry['compressed_size'];\n while ($v_size != 0)\n {\n $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);\n $v_buffer = @fread($this->zip_fd, $v_read_size);\n /* Try to speed up the code\n $v_binary_data = pack('a'.$v_read_size, $v_buffer);\n @fwrite($v_dest_file, $v_binary_data, $v_read_size);\n */\n @fwrite($v_dest_file, $v_buffer, $v_read_size);\n $v_size -= $v_read_size;\n }\n\n // ----- Closing the destination file\n fclose($v_dest_file);\n\n // ----- Change the file mtime\n touch($p_entry['filename'], $p_entry['mtime']);\n\n\n }\n else {\n // ----- TBC\n // Need to be finished\n if (($p_entry['flag'] & 1) == 1) {\n PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \\''.$p_entry['filename'].'\\' is encrypted. Encrypted files are not supported.');\n return PclZip::errorCode();\n }\n\n\n // ----- Look for using temporary file to unzip\n if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF]))\n && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])\n || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])\n && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {\n $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);\n if ($v_result < PCLZIP_ERR_NO_ERROR) {\n return $v_result;\n }\n }\n\n // ----- Look for extract in memory\n else {\n\n\n // ----- Read the compressed file in a buffer (one shot)\n $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n // ----- Decompress the file\n $v_file_content = @gzinflate($v_buffer);\n unset($v_buffer);\n if ($v_file_content === FALSE) {\n\n // ----- Change the file status\n // TBC\n $p_entry['status'] = \"error\";\n\n return $v_result;\n }\n\n // ----- Opening destination file\n if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {\n\n // ----- Change the file status\n $p_entry['status'] = \"write_error\";\n\n return $v_result;\n }\n\n // ----- Write the uncompressed data\n @fwrite($v_dest_file, $v_file_content, $p_entry['size']);\n unset($v_file_content);\n\n // ----- Closing the destination file\n @fclose($v_dest_file);\n\n }\n\n // ----- Change the file mtime\n @touch($p_entry['filename'], $p_entry['mtime']);\n }\n\n // ----- Look for chmod option\n if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {\n\n // ----- Change the mode of the file\n @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);\n }\n\n }\n }\n\n \t// ----- Change abort status\n \tif ($p_entry['status'] == \"aborted\") {\n $p_entry['status'] = \"skipped\";\n \t}\n\n // ----- Look for post-extract callback\n elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\n\n // ----- Look for abort result\n if ($v_result == 2) {\n \t$v_result = PCLZIP_ERR_USER_ABORTED;\n }\n }\n\n // ----- Return\n return $v_result;\n }", "public function testZipArchiveZipDecrypt()\n {\n }", "public static function build_zip() {\n\n\t\t$file_uploads = isset($_POST['file_uploads']) ? $_POST['file_uploads'] : '';\n\n\t\t$all_file_paths = array();\n\t\tif($file_uploads){\n\t\t\tforeach ($file_uploads as $key => $id) {\n\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id( $id );\n\t\t\t\t$file_path = get_attached_file( $post_thumbnail_id ); \n\n\t\t\t\tif( file_exists( $file_path ) ){\n\t\t\t\t\t$all_file_paths[] = $file_path;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n \tini_set('max_execution_time', 0);\n\n \t$file_name = time() . '_all_banners.zip';\n \t$dirname = ABSPATH . trailingslashit( get_option('upload_path') ) . 'zip_downloads';\n\n \tif ( !is_dir( $dirname ) )\n \t\tmkdir( $dirname, 0777, true );\n\n \t$zip_path = $dirname . '/' . $file_name;//location of zip on server. set in construct\n\n \t$files_to_zip = $all_file_paths;\n\n \tif( count( $files_to_zip ) ){//check we have valid files\n\n\t \t$zip = new ZipArchive;\n\t \t$opened = $zip->open( $zip_path, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE );\n\n\t \tif( $opened !== true ){\n\t\n\t \tdie(\"cannot open file.zip for writing. Please try again in a moment.\");\n\t\n\t \t}//endif\n\t\n\t \tforeach ( $files_to_zip as $file ) {\n\t\n\t \t$short_name = basename( $file );\n\t \t$zip->addFile( $file, $short_name );\n\t\n\t }//end foreach\n\n \t\t$zip->close();\n\n \t}//endif\n\n \t\t$download_link = trailingslashit( get_site_url() ) . trailingslashit( get_option('upload_path') ) . 'zip_downloads'. '/' . $file_name;\n \t\techo $download_link;\n\n \tdie();\n\n\t}", "function restore_website($filename){\r\n\trequire('functions/pclzip.lib.php');\r\n\t$r_file = pathinfo($filename,PATHINFO_FILENAME).\".zip\";\r\n\t// Remove the current dir\r\n\trrmdir(dirname(__FILE__),$r_file); \r\n\t\r\n\t// Extract archive\r\n\t$archive = new PclZip($filename);\r\n\tif ($archive->extract(PCLZIP_OPT_PATH, \"./\") == 0) {\r\n\t\tdie(\"Error : \".$archive->errorInfo(true));\r\n\t}\r\n\t// Files restored successfully\r\n\tprint(\"Files restored successfully!<br>\\n\");\r\n\tprint(\"Backup used: \" . $filename . \"<br>\\n\");\r\n\t\r\n}", "public function extract(Package $package);", "function unzip($source , $destination){\n $zip = new ZipArchive;\n $res = $zip->open($source);\n if ($res === TRUE) {\n $zip->extractTo($destination);\n $zip->close();\n return true;\n } else {\n return false;\n }\n}", "public function extract($zip_file, $target_dir = NULL, $preserve_filepath = TRUE)\n {\n $this->_reinit();\n $this->_zip_file = $zip_file;\n $this->_target_dir = $target_dir ? $target_dir : dirname($this->_zip_file);\n\n if ( ! $files = $this->_list_files())\n {\n $this->set_error('ZIP folder was empty.');\n return FALSE;\n }\n\n $file_locations = array();\n foreach ($files as $file => $trash)\n {\n $dirname = pathinfo($file, PATHINFO_DIRNAME);\n $extension = pathinfo($file, PATHINFO_EXTENSION);\n\n $folders = explode('/', $dirname);\n $out_dn = $this->_target_dir . '/' . $dirname;\n\n // Skip stuff in stupid folders\n if (in_array(current($folders), $this->_skip_dirs))\n {\n continue;\n }\n\n // Skip any files that are not allowed\n if (is_array($this->_allow_extensions) AND $extension AND ! in_array($extension, $this->_allow_extensions))\n {\n continue;\n }\n\n if ( ! is_dir($out_dn) AND $preserve_filepath)\n {\n $str = \"\";\n foreach ($folders as $folder)\n {\n $str = $str ? $str . '/' . $folder : $folder;\n if ( ! is_dir($this->_target_dir . '/' . $str))\n {\n $this->set_debug('Creating folder: ' . $this->_target_dir . '/' . $str);\n\n if ( ! @mkdir($this->_target_dir . '/' . $str))\n {\n $this->set_error('Desitnation path is not writable.');\n return FALSE;\n }\n\n // Apply chmod if configured to do so\n $this->apply_chmod AND chmod($this->_target_dir . '/' . $str, $this->apply_chmod);\n }\n }\n }\n\n if (substr($file, -1, 1) == '/') continue;\n\n $file_locations[] = $file_location = $this->_target_dir . '/' . ($preserve_filepath ? $file : basename($file));\n\n $this->_extract_file($file, $file_location);\n }\n\n $this->compressed_list = array();\n\n return $file_locations;\n }", "function privExtractFileInOutput(&$p_entry, &$p_options)\n {\n $v_result=1;\n\n // ----- Read the file header\n if (($v_result = $this->privReadFileHeader($v_header)) != 1) {\n return $v_result;\n }\n\n\n // ----- Check that the file header is coherent with $p_entry info\n if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {\n // TBC\n }\n\n // ----- Look for pre-extract callback\n if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');\n $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);\n if ($v_result == 0) {\n // ----- Change the file status\n $p_entry['status'] = \"skipped\";\n $v_result = 1;\n }\n\n // ----- Look for abort result\n if ($v_result == 2) {\n // ----- This status is internal and will be changed in 'skipped'\n $p_entry['status'] = \"aborted\";\n \t$v_result = PCLZIP_ERR_USER_ABORTED;\n }\n\n // ----- Update the informations\n // Only some fields can be modified\n $p_entry['filename'] = $v_local_header['filename'];\n }\n\n // ----- Trace\n\n // ----- Look if extraction should be done\n if ($p_entry['status'] == 'ok') {\n\n // ----- Do the extraction (if not a folder)\n if (!(($p_entry['external']&0x00000010)==0x00000010)) {\n // ----- Look for not compressed file\n if ($p_entry['compressed_size'] == $p_entry['size']) {\n\n // ----- Read the file in a buffer (one shot)\n $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n // ----- Send the file to the output\n echo $v_buffer;\n unset($v_buffer);\n }\n else {\n\n // ----- Read the compressed file in a buffer (one shot)\n $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);\n\n // ----- Decompress the file\n $v_file_content = gzinflate($v_buffer);\n unset($v_buffer);\n\n // ----- Send the file to the output\n echo $v_file_content;\n unset($v_file_content);\n }\n }\n }\n\n\t// ----- Change abort status\n\tif ($p_entry['status'] == \"aborted\") {\n $p_entry['status'] = \"skipped\";\n\t}\n\n // ----- Look for post-extract callback\n elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {\n\n // ----- Generate a local information\n $v_local_header = array();\n $this->privConvertHeader2FileInfo($p_entry, $v_local_header);\n\n // ----- Call the callback\n // Here I do not use call_user_func() because I need to send a reference to the\n // header.\n $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);\n\n // ----- Look for abort result\n if ($v_result == 2) {\n \t$v_result = PCLZIP_ERR_USER_ABORTED;\n }\n }\n\n return $v_result;\n }", "protected function process($message)\n {\n $record = $this->getVersionFromDatabase($message->versionId);\n $context = ['versionId' => $message->versionId];\n\n // If the record does not exists in the database exit here\n if ($record === false) {\n $this->getLogger()->critical('Record does not exist in version table', $context);\n throw new \\Exception('Record does not exist in version table', 1398949998);\n }\n\n // If the file has already been extracted exit here\n if (isset($record['extracted']) === true && $record['extracted']) {\n $this->getLogger()->info('Record marked as already extracted', $context);\n return;\n }\n\n // If there is no file, exit here\n if (file_exists($message->filename) !== true) {\n $this->getLogger()->critical('File does not exist', ['filename' => $message->filename]);\n throw new \\Exception('File does not exist', 1398950024);\n }\n\n $pathInfo = pathinfo($message->filename);\n $folder = rtrim($pathInfo['dirname'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n chdir($folder);\n\n // Create folder first and change the target folder of tar command via -C parameter\n // via this way we ensure a parent folder for a extracted tar.gz archive every time\n\n // If the filename is 'typo3_6.2.2.tar.gz' we only want to get typo3_6.2.2.\n // pathinfo only cuts '.gz'\n $fileName = $pathInfo['filename'];\n $fileName = substr($fileName, 0, strrpos($fileName, '.'));\n $targetFolder = $folder . $fileName . DIRECTORY_SEPARATOR;\n\n if (file_exists($targetFolder) === false) {\n mkdir($targetFolder);\n }\n\n if (is_dir($targetFolder) === false) {\n $this->getLogger()->critical('Directory can`t be created', ['folder' => $folder]);\n throw new \\Exception('Directory can`t be created', 1398950058);\n }\n\n /** @var \\Symfony\\Component\\Process\\Process $process */\n list($process, $exception) = $this->extractArchive($message->filename, $targetFolder);\n if ($exception !== null || ($process !== null && $process->isSuccessful() === false)) {\n $context = $this->getContextOfCommand($process, $exception);\n $this->getLogger()->critical('Extract command failed', $context);\n throw new \\Exception('Extract command failed', 1398950082);\n }\n\n // Set the correct access rights. 0777 is a bit to much ;)\n chmod($targetFolder, 0744);\n\n // Store in the database, that a file is extracted ;)\n $this->setVersionAsExtractedInDatabase($message->versionId);\n\n // Adds new messages to queue: analyze phploc\n $this->addFurtherMessageToQueue($message->project, $record['id'], $targetFolder);\n }", "private function uploadZipFile()\n\t{\n\n\t\t $tsvfilename= $_FILES['zip_file']['name'];\n\t\t $legal_extentions = array(\"zip\"); \n\t\t $file = explode(\".\",$_FILES['zip_file']['name']);\t\n\t\t if(count($file) > 2 || $file[1] != 'zip')\n\t\t {\t\t\t\n \t\t\treturn '<div class=\"alert alert-error\">\n\t\t\t<button data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button> The file you are attempting to upload is not supported by this server</div>';\t\t\n\t\t }\t \t\n\t\t\t\n\t\t $file_ext = strtolower(end(explode(\".\",$_FILES['zip_file']['name'])));\t\n\t\t if (!in_array ($file_ext, $legal_extentions))\n\t\t {\n \t\t return '<div class=\"alert alert-error\">\n\t\t\t<button data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button> The file you are attempting to upload is not supported by this server</div>';\t\t\n \t }\t\t\n\n\n\t\tif(isset($_FILES['zip_file']['tmp_name']))\n\t\t{\n\t\t\t$spath=$_FILES['zip_file']['tmp_name'];\t\t\t\n\t\t\tif (isset($_POST['button']) && $_POST['skinname']!='')\n\t\t\t{\n\t\t\t\tif($_FILES['zip_file']['type']=='zip' || $_FILES['zip_file']['type']=='application/x-zip-compressed')\n\t\t\t\t{\n\t\t\t\t\t$dpath=ROOT_FOLDER.\"css/\".$_POST['skinname'].\".zip\";\n\t\t\t\t\t$file= new Lib_FileOperations();\n\t\t\t\t\t$file->uploadFile($spath,$dpath);\t\t\t\n\t\t\t\t\treturn $this->extractZip($dpath);\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\treturn '<div class=\"alert alert-error\">\n\t\t\t<button data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button> Please Upload Zip File</div>';\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private static function extractStubProject($filename)\n {\n //die(self::$stubDirectory . DIRECTORY_SEPARATOR . $filename);\n $stub_archive = new ZipArchive();\n if ($stub_archive->open(self::$stubDirectory . DIRECTORY_SEPARATOR . $filename)) {\n $stub_archive->extractTo(self::$stubDirectory);\n $stub_archive->close();\n } else {\n throw new \\RuntimeException(\"Unable to extract the stub project archive from {$filename}!\");\n }\n }", "function extract($extractTo)\n\t{\n\t\tglobal $fs;\n\n\t\tif (!$this->isOpen)\n\t\t\treturn false;\n\n\t\tif (!is_dir($extractTo))\n\t\t\tthrow new Exception('Directory '.$extractTo.' does not exist');\n\n\t\t$files = $this->listContent();\n\n\t\tif (!$files)\n\t\t\tthrow new Exception('ZIP archive is empty');\n\n\t\tforeach ($files as $curFile)\n\t\t{\n\t\t\t$fp = $this->zip->getStream($curFile);\n\n\t\t\tif (!$fp)\n\t\t\t\tthrow new Exception('Failed to read ZIP file');\n\n\t\t\t$contents = '';\n\t\t\twhile (!feof($fp))\n\t\t\t\t$contents .= fread($fp, 2);\n\t\t\tfclose($fp);\n\n\t\t\tif (in_array(substr($curFile, -1), array('/', '\\\\')))\n\t\t\t{\n\t\t\t\tif (!is_dir($extractTo.'/'.$curFile))\n\t\t\t\t\t$fs->mkdir($extractTo.'/'.$curFile);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$fs->put($extractTo.'/'.$curFile, $contents);\n\t\t}\n\t\treturn true; // TODO: error reporting\n\t}", "function zipData($source, $destination)\n{\n\n if (file_exists($source)) {\n $zip = new ZipArchive();\n if ($zip->open($destination, ZIPARCHIVE::CREATE)) {\n $source = realpath($source);\n if (is_dir($source)) {\n $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) ;\n foreach ($files as $file) {\n $file = realpath($file);\n if (is_dir($file)) {\n $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));\n } elseif (is_file($file)) {\n $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));\n }\n }\n } elseif (is_file($source)) {\n $zip->addFromString(basename($source), file_get_contents($source));\n }\n }\n return $zip->close();\n }\n\n return false;\n}", "function __construct()\n\t{\n\t\tif (!class_exists('ZipArchive'))\n\t\t\tthrow new Exception('Class ZipArchive not found. Make sure you have zip extension installed and enabled.');\n\t}", "function _getZipInfo(& $data) \n {\n // Initialize variables\n $entries = array ();\n\n // Find the last central directory header entry\n $fhLast = strpos($data, $this->_ctrlDirEnd);\n do {\n $last = $fhLast;\t\t\n } while(($fhLast = strpos($data, $this->_ctrlDirEnd, $fhLast+1)) !== false);\n\n // Find the central directory offset\n $offset = 0;\n if($last) {\n $endOfCentralDirectory = unpack('vNumberOfDisk/vNoOfDiskWithStartOfCentralDirectory/vNoOfCentralDirectoryEntriesOnDisk/vTotalCentralDirectoryEntries/VSizeOfCentralDirectory/VCentralDirectoryOffset/vCommentLength', substr($data, $last+4));\n $offset = $endOfCentralDirectory['CentralDirectoryOffset'];\n }\n\t\t\n // Get details from Central directory structure.\n $fhStart = strpos($data, $this->_ctrlDirHeader, $offset);\n do {\n if (strlen($data) < $fhStart +31) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength', substr($data, $fhStart +10, 20));\n $name = substr($data, $fhStart +46, $info['Length']);\n\n $entries[$name] = array('attr' => null, 'crc' => sprintf(\"%08s\", dechex($info['CRC32'] )), 'csize' => $info['Compressed'], 'date' => null, '_dataStart' => null, 'name' => $name, 'method' => $this->_methods[$info['Method']], '_method' => $info['Method'], 'size' => $info['Uncompressed'], 'type' => null);\n $entries[$name]['date'] = mktime((($info['Time'] >> 11) & 0x1f), (($info['Time'] >> 5) & 0x3f), (($info['Time'] << 1) & 0x3e), (($info['Time'] >> 21) & 0x07), (($info['Time'] >> 16) & 0x1f), ((($info['Time'] >> 25) & 0x7f) + 1980));\n\n if (strlen($data) < $fhStart +43) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vInternal/VExternal/VOffset', substr($data, $fhStart +36, 10));\n\n $entries[$name]['type'] = ($info['Internal'] & 0x01) ? 'text' : 'binary';\n $entries[$name]['attr'] = (($info['External'] & 0x10) ? 'D' : '-') .\n (($info['External'] & 0x20) ? 'A' : '-') .\n (($info['External'] & 0x03) ? 'S' : '-') .\n (($info['External'] & 0x02) ? 'H' : '-') .\n (($info['External'] & 0x01) ? 'R' : '-');\n \n $entries[$name]['offset'] = $info['Offset'];\n\n // Get details from local file header since we have the offset\n $lfhStart = strpos($data, $this->_fileHeader, $entries[$name]['offset']);\n if (strlen($data) < $lfhStart +34) {\n $this->set('error.message', 'Invalid ZIP data');\n return false;\n }\n $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength/vExtraLength', substr($data, $lfhStart +8, 25));\n $name = substr($data, $lfhStart +30, $info['Length']);\n $entries[$name]['_dataStart'] = $lfhStart +30 + $info['Length'] + $info['ExtraLength'];\n } while ((($fhStart = strpos($data, $this->_ctrlDirHeader, $fhStart +46)) !== false));\n \t\n $this->_metadata = array_values($entries);\n \n return true;\n }", "protected function pushArchive()\n {\n $branch = $this->getCurrenBranch();\n\n $source = $this->createArchive();\n\n // upload to s3\n $this->sync($source, $this->getConfig()->get('app.bucket'), $this->getRepoName().'/'.$branch.'/archives/'.basename($source));\n\n // remove local tmp copy\n $this->getFilesystem()->delete($source);\n\n return $this->getRepoName().'/archives/'.basename($source);\n }", "function zip_flatten ( $zipfile , $filter) \n\t{ \t\n\t\t@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );\n\t\t\n\t\t//if a temp dir already exists remove it and create a new one\n\t\tif(is_dir($this->paths['tempdir'])) $this->delete_folder($this->paths['tempdir']);\n\t\t\n\t\t//create a new\n\t\t$tempdir = avia_backend_create_folder($this->paths['tempdir'], false);\n\t\tif(!$tempdir) exit('Wasn\\'t able to create temp folder');\n\t\t\n\t $zip = new ZipArchive; \n\t \n\t if ( $zip->open( $zipfile ) ) \n\t { \n\t\t $zip_paths = pathinfo($zipfile);\n\t\t \n\t\t //check name scheme if user wants to rename the file \n\t\t if( isset( $zip_paths['filename'] ) && strpos( $zip_paths['filename'], 'iconset.' ) === 0)\n\t\t {\n\t\t\t $this->font_name = str_replace('iconset.', \"\", $zip_paths['filename']);\n\t\t }\n\t\t \n\t for ( $i=0; $i < $zip->numFiles; $i++ ) \n\t { \n\t \t$entry = $zip->getNameIndex($i); \n\t \n\t \tif(!empty($filter))\n\t\t\t\t{\n\t \t\t\t$delete \t= true;\n\t \t\t\t$matches \t= array();\n\t \t\t\t\n\t \t\t\tforeach($filter as $regex)\n\t \t\t\t{\n\t \t\t\t\tpreg_match(\"!\".$regex.\"$!\", $entry , $matches);\n\t \t\t\t\t\n\t \t\t\t\tif(!empty($matches))\n\t \t\t\t\t{\n\t\t \t\t\t\tif(strpos($entry, \".php\") === false)\n\t\t \t\t\t\t{\n\t \t\t\t\t\t\t$delete = false;\n\t\t \t\t\t\t\t\tbreak;\n\t\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t}\n\t\t\t\t}\n\t \n\t if ( substr( $entry, -1 ) == '/' || !empty($delete)) continue; // skip directories and non matching files\n\t \n\t $fp \t= $zip->getStream( $entry ); \n\t $ofp \t= fopen( $this->paths['tempdir'].'/'.basename($entry), 'w' ); \n\t \n\t if ( ! $fp ) \n\t exit('Unable to extract the file.'); \n\t \n\t while ( ! feof( $fp ) ) \n\t fwrite( $ofp, fread($fp, 8192) ); \n\t \n\t fclose($fp); \n\t fclose($ofp); \n\t } \n\t\n\t $zip->close(); \n\t }\n\t else\n\t {\n\t \texit('Wasn\\'t able to work with Zip Archive');\n\t }\n\t \n\t return true; \n\t}", "public function handle()\n {\n\t\t$this->info(\"Checking Zip libraries availability...\");\n\n\t\t$filePath = LogFile::getOrCreateFirstExistingLogFilePath();\n\t\t$zipPath = storage_path('logs/laravel.zip');\n\n\t\tZipper::createNativeZip($filePath, $zipPath);\n\n\t\tif (file_exists($zipPath)) {\n\t\t\tunlink($zipPath);\n\n\t\t\t$this->info(\"You're using PHP version \" . PHP_VERSION . \" so native Zip encryption is available! Your database dumps will be zipped and encrypted with AES-256.\");\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->info(\"Native Zip encryption is not available.\");\n\n\t\tZipper::create7zip($filePath, $zipPath);\n\n\t\tif (file_exists($zipPath)) {\n\t\t\tunlink($zipPath);\n\n\t\t\t$this->info(\"7-zip is available! Your database dumps will be zipped using 7-Zip and encrypted with AES-256.\");\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->info(\"7-zip is not available.\");\n\n\t\tZipper::createRegularZip($filePath, $zipPath);\n\n\t\tif (file_exists($zipPath)) {\n\t\t\tunlink($zipPath);\n\n\t\t\t$this->info(\"Zip is available! Your database dumps will be zipped using Zip library and protected using password from the Centinel API config file.\");\n\t\t\t$this->info(\"It is your responsibility to read up on Zip password protection and decide if this level of security is satisfactory.\");\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->info(\"Zip library is not available.\");\n\t\t$this->info(\"Your database dumps will be sent to Centinel without being zipped and password protected beforehand.\");\n }", "private function zip_files_main($originalfiles, $destination) {\n $pathparts = pathinfo(cleardoubleslashes($destination));\n $destpath = $pathparts[\"dirname\"]; // The path of the zip file.\n $destfilename = $pathparts[\"basename\"]; // The name of the zip file.\n $extension = $pathparts[\"extension\"]; // The extension of the file.\n\n // If no file, error.\n if (empty($destfilename)) {\n return false;\n }\n\n // If no extension, add it.\n if (empty($extension)) {\n $extension = 'zip';\n $destfilename = $destfilename.'.'.$extension;\n }\n\n // Check destination path exists.\n if (!is_dir($destpath)) {\n return false;\n }\n\n // Check destination path is writable. TODO!!\n\n // Clean destination filename.\n $destfilename = clean_filename($destfilename);\n\n // Now check and prepare every file.\n $files = array();\n $origpath = null;\n\n foreach ($originalfiles as $file) { // Iterate over each file.\n // Check for every file.\n $tempfile = cleardoubleslashes($file); // no doubleslashes!\n // Calculate the base path for all files if it isn't set.\n if ($origpath === null) {\n $origpath = rtrim(cleardoubleslashes(dirname($tempfile)), \"/\");\n }\n // See if the file is readable.\n if (!is_readable($tempfile)) { // Is readable.\n continue;\n }\n // See if the file/dir is in the same directory than the rest.\n if (rtrim(cleardoubleslashes(dirname($tempfile)), \"/\") != $origpath) {\n continue;\n }\n // Add the file to the array.\n $files[] = $tempfile;\n }\n\n $zipfiles = array();\n $start = strlen($origpath) + 1;\n foreach ($files as $file) {\n $zipfiles[substr($file, $start)] = $file;\n }\n\n $packer = get_file_packer('application/zip');\n\n return $packer->archive_to_pathname($zipfiles, $destpath . '/' . $destfilename);\n }", "public function __invoke( $args, $assoc_args ) {\n\t\t$this->source = realpath( $args[0] );\n\t\t$this->slug = Utils\\get_flag_value( $assoc_args, 'slug', Utils\\basename( $this->source ) );\n\n\t\tif ( ! $this->source || ! is_dir( $this->source ) ) {\n\t\t\tWP_CLI::error( 'Not a valid source directory!' );\n\t\t}\n\n\t\t$this->retrieve_main_file_data();\n\n\t\t// Determine destination.\n\t\tif ( isset( $args[1] ) ) {\n\t\t\t$this->destination = $args[1];\n\t\t} else {\n\t\t\t$file_data = $this->get_main_file_data();\n\n\t\t\t// Current directory.\n\t\t\t$this->destination = $this->slug . '.pot';\n\n\t\t\tif ( isset( $file_data['Domain Path'] ) ) {\n\t\t\t\t// Domain Path inside source folder.\n\t\t\t\t$this->destination = $this->source . DIRECTORY_SEPARATOR . $file_data['Domain Path'] . DIRECTORY_SEPARATOR . $this->slug . '.pot';\n\t\t\t}\n\t\t}\n\n\t\t// Two is_dir() checks in case of a race condition.\n\t\tif ( ! is_dir( dirname( $this->destination ) ) && ! mkdir( dirname( $this->destination ) ) && ! is_dir( dirname( $this->destination ) ) ) {\n\t\t\tWP_CLI::error( 'Could not create destination directory!' );\n\t\t}\n\n\t\tif ( ! $this->makepot( Utils\\get_flag_value( $assoc_args, 'domain', $this->slug ) ) ) {\n\t\t\tWP_CLI::error( 'Could not generate a POT file!' );\n\t\t}\n\n\t\tWP_CLI::success( 'POT file successfully generated!' );\n\t}", "private function zExtraction()\n {\n foreach ($this->absolute_path_to_mods as $absolute_path) {\n $this->z_file_list = [];\n $this->current_work = $absolute_path;\n $this->compileZFileList($absolute_path);\n $this->performExtraction();\n }\n }", "protected function handleUpload()\n {\n if (empty($_FILES['zip'])) {\n return $this->error(\"Expected file upload\", true);\n }\n if ($_FILES['zip']['error'] != UPLOAD_ERR_OK) {\n return $this->error(\n \"File upload error: {$this->upload_errors[$_FILES['zip']['error']]} ({$_FILES['zip']['error']})\",\n true\n );\n }\n if (!is_uploaded_file($_FILES['zip']['tmp_name'])) {\n return $this->error(\"Upload failed\", true);\n }\n $this->ensureDir($this->config['upload_dir'] . \"/upgrades\");\n $this->context['zip'] = $this->config['upload_dir'] . \"/upgrades/\" . basename($_FILES['zip']['name']);\n if (move_uploaded_file($_FILES['zip']['tmp_name'], $this->context['zip'])) {\n $this->state['zip'] = $this->context['zip'];\n $this->context['backup_dir'] = $this->config['upload_dir'] . \"/upgrades/backup/\" . pathinfo(\n $this->context['zip'],\n PATHINFO_FILENAME\n ) . \"-restore\";\n $this->saveState();\n return true;\n } else {\n return $this->error(\"Failed to move uploaded file to {$this->context['zip']}\", true);\n }\n\n }", "function __construct($p_zipname)\n {\n\n // ----- Tests the zlib\n if (!function_exists('gzopen'))\n {\n die('Abort '.basename(__FILE__).' : Missing zlib extensions');\n }\n\n // ----- Set the attributes\n $this->zipname = $p_zipname;\n $this->zip_fd = 0;\n $this->magic_quotes_status = -1;\n\n // ----- Return\n return;\n }", "public function wp_import_file() {\n\t \n\t $zip = new ZipArchive;\n\n\t $zip->open($this->_file_destination);\n\t $zip->extractTo('.');\n\t $zip->close();\n\n\t return TRUE;\n\t}", "public function openArchive() {\n\t\t// check whether archive exists and is a TAR archive\n\t\tif (!file_exists($this->archive)) {\n\t\t\tthrow new SystemException(\"unable to find package file '\".$this->archive.\"'\", 11002);\n\t\t}\n\n\t\t// open archive and read package information\n\t\t$this->tar = new Tar($this->archive);\n\t\t$this->readPackageInfo();\n\t}", "protected function archive() {\n\n // Instantiating Zip object\n $oZip = new ZipArchive;\n $directory = 'app/' . $this->sDirectory;\n $userId = explode('-', $this->sDirectory);\n $userId = $userId[0];\n\n // Retrieving downloaded files\n $files = File::allFiles(storage_path($directory));\n\n // Archiving logic\n $fileName = $this->sDirectory . '.zip';\n if ($oZip->open(public_path($fileName), ZipArchive::CREATE) == TRUE) {\n foreach ($files as $aFile) {\n $filePath = explode($this->sDirectory, base_path($aFile));\n $sFilePath = substr(str_replace('\\\\', '/', $filePath[1]), 1);\n $oZip->addFile($aFile, $sFilePath);\n }\n $oZip->close();\n\n // Updating download status to READY\n $user = User::find($userId);\n $user->download_status = 'READY';\n $user->save();\n }\n }", "function dir_to_zip($zip, $source_dir, $zip_dest_dir){\n $added_files = array();\n $files = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($source_dir),\n RecursiveIteratorIterator::LEAVES_ONLY\n );\n\n foreach ($files as $name => $file)\n {\n \n // Skip directories (they would be added automatically)\n if (!$file->isDir())\n {\n \n \n // Get real and relative path for current file\n $filePath = $file->getRealPath();\n $relativePath = substr($filePath, strlen($source_dir) + 1);\n\n $added_files[] = array(\n 'path' => $zip_dest_dir . '/' . basename($name),\n 'mime' => mime_content_type($filePath)\n );\n //echo print_r( compact('name', 'file', 'filePath', 'relativePath') );\n // Add current file to archive\n $file_name = $zip_dest_dir . '/' . basename($name);\n \n //add files only was used images in sheet\n if (in_array($file_name, $this->used_images)){\n $zip->addFile($filePath, $file_name);\n }\n \n }\n } \n // print_r(compact('added_files'));\n return $added_files;\n }", "protected function unzipDownloadedJp2Archive() {\n\t\t$zipFiles = preg_grep( '/^.*_jp2\\.zip$/', scandir( $this->jobDir() ) );\n\t\tif ( count( $zipFiles ) == 0 ) {\n\t\t\tthrow new Exception( \"JP2 zip file not found\" );\n\t\t}\n\t\t$zipFile = $this->jobDir() . '/' . array_shift( $zipFiles );\n\t\t$this->log->info( \"Unzipping $zipFile\" );\n\t\t$zip = new ZipArchive();\n\t\t$zip->open( $zipFile );\n\n\t\t$outDir = dirname( $zipFile ) . '/' . pathinfo( $zipFile, PATHINFO_FILENAME );\n\t\tif ( is_dir( $outDir ) ) {\n\t\t\t// Directory already exists; check contents.\n\t\t\t// Minus 2 for dot and dot-dot.\n\t\t\t$numInDir = count( scandir( $outDir ) ) - 2;\n\t\t\t// Minus 1 for the top-level directory.\n\t\t\t$numInZip = $zip->numFiles - 1;\n\t\t\tif ( $numInDir === $numInZip ) {\n\t\t\t\t// All done.\n\t\t\t\treturn $outDir;\n\t\t\t}\n\t\t}\n\n\t\t// Extract file.\n\t\t$zip->extractTo( $this->jobDir() );\n\t\t$this->log->debug( \"Zip file extracted to $outDir\" );\n\t\treturn $outDir;\n\t}", "function fm_unzip_cleanfilename ($p_event, &$p_header) {\r\n//to clean illegal characters for given platform and to prevent directory traversal.\r\n//Produces the same result as info-zip unzip.\r\n $p_header['filename'] = ereg_replace('[[:cntrl:]]', '', $p_header['filename']); //strip control chars first!\r\n $p_header['filename'] = ereg_replace('\\.\\.+', '', $p_header['filename']); //directory traversal protection\r\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n $p_header['filename'] = ereg_replace('[:*\"?<>|]', '_', $p_header['filename']); //replace illegal chars\r\n $p_header['filename'] = ereg_replace('^([a-zA-Z])_', '\\1:', $p_header['filename']); //repair drive letter\r\n } else {\r\n //Add filtering for other systems here\r\n // BSD: none (tested)\r\n // Linux: ??\r\n // MacosX: ??\r\n }\r\n $p_header['filename'] = cleardoubleslashes($p_header['filename']); //normalize the slashes/backslashes\r\n return 1;\r\n}", "public function _uncompress($moduleArchive) {\n if(substr($moduleArchive,-3) == \"zip\") {\n $res = $this->_extractZIPArchive($moduleArchive);\n } else if(substr($moduleArchive, -6)==\"tar.gz\") {\n $res = $this->_extractTarGZArchive($moduleArchive);\n }\n if($res == true) {\n $files = @scandir(INSTALL_WORKDIR);\n for($count = 0; $count < count($files); $count++) {\n if($files[$count]!=\".\" && $files[$count] != \"..\") {\n if(is_dir(INSTALL_WORKDIR.$files[$count])) {\n $installFromDir = $files[$count];\n }\n }\n }\n return $installFromDir;\n } else {\n die (\"couldnt extract Archive\");\n exit;\n }\n }", "public static function unpack($p_filename)\n\t{\n\t\t// Path to the archive\n\t\t$archivename = $p_filename;\n\n\t\t// Temporary folder to extract the archive into\n\t\t$tmpdir = uniqid('install_');\n\n\t\t// Clean the paths to use for archive extraction\n\t\t$extractdir = JPath::clean(dirname($p_filename) . '/' . $tmpdir);\n\t\t$archivename = JPath::clean($archivename);\n\n\t\t// Do the unpacking of the archive\n\t\t$result = JArchive::extract($archivename, $extractdir);\n\n\t\tif ($result === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n* Let's set the extraction directory and package file in the result array so we can\n* cleanup everything properly later on.\n*/\n\t\t$retval['extractdir'] = $extractdir;\n\t\t$retval['packagefile'] = $archivename;\n\n\t\t/*\n* Try to find the correct install directory. In case the package is inside a\n* subdirectory detect this and set the install directory to the correct path.\n*\n* List all the items in the installation directory. If there is only one, and\n* it is a folder, then we will set that folder to be the installation folder.\n*/\n\t\t$dirList = array_merge(Services::Filesystem()->folderFiles($extractdir, ''), Services::Folder()->folders($extractdir, ''));\n\n\t\tif (count($dirList) == 1) {\n\t\t\tif (Services::Filesystem()->folderExists($extractdir . '/' . $dirList[0])) {\n\t\t\t\t$extractdir = JPath::clean($extractdir . '/' . $dirList[0]);\n\t\t\t}\n\t\t}\n\n\t\t/*\n* We have found the install directory so lets set it and then move on\n* to detecting the extension type.\n*/\n\t\t$retval['dir'] = $extractdir;\n\n\t\t/*\n* Get the extension type and return the directory/type array on success or\n* false on fail.\n*/\n\t\tif ($retval['type'] = self::detectType($extractdir)) {\n\t\t\treturn $retval;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function ZipMaker($source,$destination) {\n $zipHandler = new \\ZipArchive();\n $zipHandler->open($destination, \\ZIPARCHIVE::CREATE);\n\n $source = str_replace('\\\\', '/', realpath($source)); // Fixing Windows paths\n\n $files = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($source),\\RecursiveIteratorIterator::SELF_FIRST);\n foreach ($files as $file) {\n $file = str_replace('\\\\', '/', $file); // Fixing Windows paths\n\n if (in_array(substr($file,strrpos($file, '/')+1), array('.', '..')))\n continue; // Skipping if it's a \".\" or \"..\" dir\n\n $file = realpath($file);\n\n if (is_dir($file) === true) { // If it's a directory\n $zipHandler->addEmptyDir(str_replace($source . '/', '', $file . '/'));\n } elseif (is_file($file) === true) { // If it's a file\n $zipHandler->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));\n }\n }\n\n return $zipHandler->close();\n }", "function echo_src_archive_2($title, $internal_name, $github_name, $engine_ver)\n {\n $version_const_name = 'VERSION_' . strtoupper($internal_name);\n $version = constant($version_const_name);\n\n echo '<dt>' . $title . ' source code:</dt><dd><p><b>Stable version</b>: ' .\n sf_download_link('Download sources of ' . $title,\n $internal_name . '-' . $version . '-src.tar.gz');\n\n if ($engine_ver == VERSION_CASTLE_GAME_ENGINE) {\n echo '. <br>The stable version is compatible with the latest ';\n download_engine_version($engine_ver);\n echo '.';\n } else\n if ($engine_ver == 'github') {\n echo '. <br>The stable version was tested with the latest <a href=\"https://github.com/castle-engine/castle-engine/\">(unstable) Castle Game Engine on GitHub</a>. (As soon as the next CGE will be released, this will be updated to depend on a stable engine version).';\n } else\n if ($engine_ver != '') {\n echo '. <br>The stable version is compatible with the ';\n download_engine_version($engine_ver);\n } else\n {\n throw new Exception('Invalid engine_ver');\n }\n\n ?>\n\n <p><b>Unstable (latest) version</b>: You can download it from the GitHub:\n <a href=\"https://github.com/castle-engine/<?php echo $github_name; ?>\">https://github.com/castle-engine/<?php echo $github_name; ?></a><br>\n It is compatible with the <a href=\"https://github.com/castle-engine/castle-engine/\">latest Castle Game Engine version from GitHub</a>.\n </dd>\n\n <?php\n }", "public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }" ]
[ "0.7211379", "0.666474", "0.6203012", "0.6113041", "0.6042506", "0.59558916", "0.59172755", "0.5895852", "0.58950645", "0.5858964", "0.58176655", "0.58010423", "0.57814515", "0.57630837", "0.573223", "0.5731901", "0.57263863", "0.57170963", "0.5701911", "0.5678042", "0.5618231", "0.5615761", "0.56116974", "0.5563146", "0.55421466", "0.55320036", "0.53798604", "0.53723085", "0.53665704", "0.53630346", "0.53560567", "0.53514105", "0.5341416", "0.5317539", "0.5313965", "0.529465", "0.5283974", "0.52549326", "0.5249992", "0.52440846", "0.52415216", "0.52155197", "0.5214287", "0.52109545", "0.5207697", "0.5205297", "0.52050817", "0.52018183", "0.51942074", "0.5179811", "0.5166895", "0.5163204", "0.51624787", "0.5149544", "0.5146639", "0.51461554", "0.5139858", "0.51334596", "0.51315355", "0.5131432", "0.5130925", "0.5122503", "0.510516", "0.509264", "0.50821596", "0.50820994", "0.5077685", "0.5058864", "0.50586164", "0.5044507", "0.50422275", "0.50381947", "0.50364506", "0.5032188", "0.5031462", "0.5028669", "0.50168526", "0.50157344", "0.4998747", "0.49979922", "0.49909064", "0.49798325", "0.49651763", "0.4961194", "0.49562353", "0.49545312", "0.49524182", "0.49445012", "0.49434012", "0.49290332", "0.49203652", "0.4910859", "0.49010652", "0.4900245", "0.48912326", "0.4863283", "0.4857009", "0.48526827", "0.4844076", "0.48343915" ]
0.7699186
0
Move some Revo folders to custom locations, if needed
protected function handleCustomFolders() { if (!empty($this->destinations)) { foreach ($this->destinations as $folder => $target) { $folder = $this->source .'/'. $folder; if (!file_exists($folder) || empty($target)) { // Invalid folder/target given continue; } if (!file_exists($target)) { mkdir($target); } // @TODO switch to PHP passthru("cp -rf {$folder}/* {$target}"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function narrative_move_files($current_narrative_dir, $new_narrative_dir)\n{\n $file_scan = scandir($current_narrative_dir);\n foreach ($file_scan as $filecheck)\n {\n if ($filecheck != '.' && $filecheck != '..' && !is_dir($current_narrative_dir . $filecheck))\n {\n rename($current_narrative_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "function moveFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "function FilesMoveToFolder()\r\n{\r\n global $PH;\r\n\r\n $file_ids= getPassedIds('file','files_*');\r\n\r\n if(!$file_ids) {\r\n $PH->abortWarning(__(\"Select some files to move\"));\r\n exit();\r\n }\r\n\r\n\r\n\r\n /**\r\n * by default render list of folders...\r\n */\r\n $target_id=-1;\r\n\r\n /**\r\n * ...but, if folder was given, directly move files...\r\n */\r\n $folder_ids= getPassedIds('folder','folders_*');\r\n if(count($folder_ids) == 1) {\r\n if($folder_task= Task::getVisibleById($folder_ids[0])) {\r\n $target_id= $folder_task->id;\r\n }\r\n }\r\n\r\n /**\r\n * if no folders was selected, move files to project root\r\n */\r\n else if(get('from_selection')) {\r\n $target_id= 0;\r\n }\r\n\r\n\r\n if($target_id != -1) {\r\n\r\n\r\n if($target_id != 0){\r\n if(!$target_task= Task::getEditableById($target_id)) {\r\n $PH->abortWarning(__(\"insufficient rights\"));\r\n\r\n }\r\n ### get path of target to check for cycles ###\r\n $parent_tasks= $target_task->getFolder();\r\n $parent_tasks[]= $target_task;\r\n }\r\n else {\r\n $parent_tasks=array();\r\n }\r\n\r\n\r\n $count=0;\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n\r\n $file->parent_item= $target_id;\r\n $file->update();\r\n }\r\n else {\r\n $PH->messages[]= sprintf(__(\"Can not edit file %s\"), $file->name);\r\n }\r\n }\r\n\r\n ### return to from-page? ###\r\n if(!$PH->showFromPage()) {\r\n $PH->show('home');\r\n }\r\n exit();\r\n }\r\n #else if($target_id != -1) {\r\n # $PH->abortWarning(__(\"insufficient rights to edit any of the selected items\"));\r\n #}\r\n\r\n\r\n\r\n\r\n /**\r\n * build page folder lists...\r\n */\r\n\r\n ### get project ####\r\n if(!$file= File::getVisibleById($file_ids[0])) {\r\n $PH->abortWarning(\"could not get file\", ERROR_BUG);\r\n }\r\n\r\n if(!$project= Project::getVisibleById($file->project)) {\r\n $PH->abortWarning(\"file without project?\", ERROR_BUG);\r\n }\r\n\r\n\r\n ### set up page and write header ####\r\n {\r\n $page= new Page(array('use_jscalendar'=>false, 'autofocus_field'=>'company_name'));\r\n $page->cur_tab='projects';\r\n $page->type= __(\"Edit files\");\r\n $page->title=\"$project->name\";\r\n $page->title_minor=__(\"Select folder to move files into\");\r\n\r\n $page->crumbs= build_project_crumbs($project);\r\n\r\n $page->options[]= new NaviOption(array(\r\n 'target_id' =>'filesMoveToFolder',\r\n ));\r\n\r\n echo(new PageHeader);\r\n }\r\n echo (new PageContentOpen);\r\n\r\n\r\n ### write form #####\r\n {\r\n ### write files as hidden entry ###\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n echo \"<input type=hidden name='files_{$id}_chk' value='1'>\";\r\n }\r\n }\r\n\r\n\r\n ### write list of folders ###\r\n {\r\n require_once(confGet('DIR_STREBER') . 'lists/list_tasks.inc.php');\r\n $list= new ListBlock_tasks();\r\n $list->reduced_header= true;\r\n $list->query_options['show_folders']= true;\r\n #$list->query_options['folders_only']= true;\r\n $list->query_options['project']= $project->id;\r\n $list->groupings= NULL;\r\n $list->block_functions= NULL;\r\n $list->id= 'folders';\r\n $list->no_items_html= __('No folders available');\r\n unset($list->columns['status']);\r\n unset($list->columns['date_start']);\r\n unset($list->columns['days_left']);\r\n unset($list->columns['created_by']);\r\n unset($list->columns['label']);\r\n unset($list->columns['project']);\r\n\r\n $list->functions= array();\r\n\r\n $list->active_block_function = 'tree';\r\n\r\n\r\n $list->print_automatic($project,NULL);\r\n }\r\n\r\n echo __(\"(or select nothing to move to project root)\"). \"<br> \";\r\n\r\n echo \"<input type=hidden name='from_selection' value='1'>\"; # keep flag to ungroup files\r\n echo \"<input type=hidden name='project' value='$project->id'>\";\r\n $button_name=__(\"Move items\");\r\n echo \"<input class=button2 type=submit value='$button_name'>\";\r\n\r\n $PH->go_submit='filesMoveToFolder';\r\n\r\n }\r\n echo (new PageContentClose);\r\n echo (new PageHtmlEnd());\r\n\r\n}", "private function moveAssets()\n {\n foreach ($this->reports as $report) {\n $old_file = config('import.import_assets_reports_path') . DIRECTORY_SEPARATOR . $report->file;\n $new_file = config('momentum.reports_path') . DIRECTORY_SEPARATOR . $report->file;\n\n $this->moveFile($old_file, $new_file);\n }\n\n foreach ($this->organizations as $organization) {\n // not every organization has a logo\n if (!$organization->logo) {\n continue;\n }\n\n $old_file = config('import.import_assets_logos_path') . DIRECTORY_SEPARATOR . $organization->logo;\n $new_file = config('momentum.logos_path') . DIRECTORY_SEPARATOR . $organization->logo;\n\n $this->moveFile($old_file, $new_file);\n }\n }", "function _pm_update_move_files($src_dir, $dest_dir, $skip_list, $remove_conflicts = TRUE) {\n $items_to_move = drush_scan_directory($src_dir, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'filename', 0, TRUE);\n foreach ($items_to_move as $filename => $info) {\n if ($remove_conflicts) {\n drush_delete_dir($dest_dir . '/' . basename($filename));\n }\n if (!file_exists($dest_dir . '/' . basename($filename))) {\n $move_result = drush_move_dir($filename, $dest_dir . '/' . basename($filename));\n }\n }\n return TRUE;\n}", "function movesiteimages()\n\t{\n\t\n\t\tglobal $option, $mainframe;\n\n\t\t//we'll need access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\n\t\t// define where the images are and where we want to put them\n\n\t\t$searchpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$destpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_cirriculum\". DS . \"tmp\" ;\n\n\t\t//read all the image files and put them in an array.\n\t\t$img_files = JFolder::files($searchpath, '.*');\n\n\t\t//Now we need some stuff from the JFile:: class to move all files into the new folder\n\t\tforeach ($img_files as $file) {\n\t\t\tJFile::move($searchpath. DS . $file, $destpath . DS. $file);\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'All images have moved into the site folder' );\n\t\n\t}", "function sf_relocate_smileys()\n{\n\t$success = 0;\n\t$newpath = WP_CONTENT_DIR . '/forum-smileys';\n\t$oldpath = SF_PLUGIN_DIR . '/styles/smileys';\n\n\t# check if new folder does not exist - which it shouldn't!\n\tif(!is_dir($newpath))\n\t{\n\t\tif(!is_writable(WP_CONTENT_DIR) || !($dir = mkdir($newpath, 0777)))\n\t\t{\n\t\t\t$success = 1;\n\t\t\treturn $success;\n\t\t}\n\t\tif (!is_writable($newpath))\n\t\t{\n\t\t\t$success = 2;\n\t\t\treturn $success;\n\t\t}\n\t\tif(is_dir($newpath))\n\t\t{\n\t\t\t$avlist = opendir($oldpath);\n\t\t\twhile (false !== ($file = readdir($avlist)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\")\n\t\t\t\t{\n\t\t\t\t\tif(!file_exists($newpath.'/'.$file))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(@rename($oldpath.'/'.$file, $newpath.'/'.$file) == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$success = 3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($avlist);\n\t\t\t@rmdir($oldpath);\n\t\t}\n\t}\n\treturn $success;\n}", "public function testMoveFolder()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new MoveFolderRequest();\n $request->setSrcPath( \"OutResult/Create\");\n $request->setDestPath( \"OutResult/Move\");\n $request->setSrcStorageName( \"\");\n $request->setDestStorageName( \"\");\n $this->instance->moveFolder($request);\n }", "public function renamingFolders_dataProvider() {}", "private function moveToRecycle($app)\n {\n\n\n global $boot;\n\n Az::debug($app, 'app to recycle:');\n $app_recycle_folder_name = date(\"Y_m_d_H_i\");\n\n $recycle_path = self::path['recyclePath'] . $app_recycle_folder_name;\n $boot->mkdir($recycle_path);\n\n foreach ($this->data as $n => $data) {\n\n Az::debug($data, 'data');\n $path = $this->rootDir;\n\n $destination = $recycle_path . $data->generate;\n $pathToMove = $recycle_path . $data->generatePath;\n\n if ($data->affectFileOnly) {\n\n $boot->mkdir($pathToMove);\n $path .= $data->generate;\n\n if (file_exists($path)) {\n copy($path, $destination);\n ZFileHelper::unlink($path);\n }\n } else {\n $path .= $data->generatePath;\n\n if (file_exists($path)) {\n ZFileHelper::copyDirectory($path, $pathToMove);\n ZFileHelper::removeDir($path);\n }\n\n }\n }\n }", "function moveFinalDirectories($aBooksDone, $aDirectories)\r\n{\r\n\t$readydir = $aDirectories['ready'];\r\n\t$sipdir = $aDirectories['sip'];\r\n\t$result = 0;\r\n\r\n\tforeach ($aBooksDone as $itemnumber) {\r\n\t\t$sourcedir = $readydir . '\\\\' . $itemnumber;\r\n\t\t$destinationdir = $sipdir . '\\\\' . $itemnumber;\r\n\r\n\t\tif (!(@opendir($destinationdir))) {\r\n\t\t\t$mk = mkdir($destinationdir);\r\n\t\t\t//if ($mk === FALSE) {\r\n\t\t\t//\t$result = 0;\r\n\t\t\t//\treturn $result;\r\n\t\t\t//}\r\n\t\t}\r\n\r\n\t\t$dh = opendir($sourcedir);\r\n if ($dh) {\r\n while (($file = @readdir($dh)) !== false) {\r\n if ($file != \".\" && $file != \"..\") {\r\n $source = $sourcedir . \"\\\\\" . $file;\r\n $destination = $destinationdir . \"\\\\\" . $file;\r\n //echo 'ik zou ' . $source . ' verplaatsen naar ' . $destination . '<br>';\r\n $result = @rename($source, $destination);\r\n }\r\n }\r\n \t\t}\r\n\r\n\t\t$result = rmdir($sourcedir);\r\n\t}\r\n\r\n\treturn $result;\r\n}", "protected function defineOriginalRootPath() {}", "private function insertCloneFolder()\n {\n global $boot;\n $coreIP = $boot->env('coreIP');\n\n if (file_exists($this->rootDir . \"/inserts/$this->oldName\")) ZFileHelper::copyDirectory($this->rootDir . \"/inserts/$this->oldName\", $this->rootDir . \"/inserts/$this->newName\");\n\n $sub_dirs = glob($this->rootDir . \"/inserts/$this->newName/*\");\n\n foreach ($sub_dirs as $dir) {\n if ($dir !== null && is_file($dir)) {\n $content = file_get_contents($dir);\n $replace = [\n $this->oldName => $this->newName\n ];\n $content = strtr($content, $replace);\n file_put_contents($dir, $content);\n }\n }\n\n $newdb = $this->dbname;\n $data = require $this->rootDir . '/configs/data/' . $this->oldName . '.php';\n $source = $data['components']['db']['dbName'];\n\n $file = $this->rootDir . '/configs/data/' . $this->newName . '.php';\n $file_content = file_get_contents($file);\n $replace = [\n $source => $newdb\n ];\n\n $content = strtr($file_content, $replace);\n file_put_contents($file, $content);\n\n }", "public function dir_rewinddir() {}", "function email_print_movefolder_button($options) {\n\n\tglobal $CFG, $USER;\n\n\t$courseid = NULL;\n\tif ( $options->id == SITEID and $options->course != SITEID) {\n\t\t$courseid = $options->course;\n\t} else {\n\t\t$courseid = $options->id;\n\t}\n\n\t/// TODO: Changed this function, now cases are had:\n\t//\t\t\t\t\t\t1.- Inbox folder: Only can move to subfolders inbox and trash folder.\n\t//\t\t\t\t\t\t2.- Sendbox and draft folder: Only can move on this subfolders.\n\t//\t\t\t\t\t\t3.- Trash folder: Can move any folder\n\tif ( isset($options->folderid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderid);\n\n\t} else if ( isset($options->folderoldid) ) {\n\t\t// Get folder\n\t\t$folderbe = email_get_folder($options->folderoldid);\n\t} else {\n\t\t// Inbox folder\n\t\t$folderbe = email_get_root_folder($USER->id, EMAIL_INBOX);\n\t}\n\n\tif ( email_isfolder_type($folderbe, EMAIL_SENDBOX ) ) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, false, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_DRAFT )) {\n\t\t// Get my sendbox folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, true );\n\t} else if ( email_isfolder_type($folderbe, EMAIL_TRASH ) ) {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, false, false, false );\n\t} else {\n\t\t// Get my folders\n\t\t$folders = email_get_my_folders( $USER->id, $courseid, false, true, true, false );\n\t}\n\n\tif ( $folders ) {\n\n\t\t$choose = '';\n\n\t\t// Get my courses\n\t\tforeach ($folders as $key => $foldername) {\n\n\t $choose .= '<option value=\"'.$key.'\">'.$foldername .'</option>';\n\t\t}\n\t}\n\n\techo '<select name=\"folderid\" onchange=\"addAction(this)\">\n\t\t\t\t\t<option value=\"\" selected=\"selected\">' . get_string('movetofolder', 'block_email_list') . ':</option>' .\n \t\t\t$choose . '\n \t\t</select>';\n\n\n\t// Add 2 space\n\techo '&#160;&#160;';\n\n\t// Change, now folderoldid is actual folderid\n\tif (! $options->folderid ) {\n\t\tif ( $inbox = email_get_root_folder($USER->id, EMAIL_INBOX) ) {\n\t\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$inbox->id.'\" />';\n\t\t}\n\t} else {\n\t\techo '<input type=\"hidden\" name=\"folderoldid\" value=\"'.$options->folderid.'\" />';\n\t}\n\n\t// Define action\n\t//echo '<input type=\"hidden\" name=\"action\" value=\"move2folder\" />';\n\t// Add javascript for insert person/s who I've send mail\n\n\t$javascript = '<script type=\"text/javascript\" language=\"JavaScript\">\n <!--\n \t\tfunction addAction(form) {\n\n \t\t\tvar d = document.createElement(\"div\");\n d.setAttribute(\"id\", \"action\");\n var act = document.createElement(\"input\");\n act.setAttribute(\"type\", \"hidden\");\n act.setAttribute(\"name\", \"action\");\n act.setAttribute(\"id\", \"action\");\n act.setAttribute(\"value\", \"move2folder\");\n d.appendChild(act);\n document.getElementById(\"move2folder\").appendChild(d);\n\n \t\t\tdocument.sendmail.submit();\n \t\t}\n \t-->\n </script>';\n\n\techo $javascript;\n\n\t// Print sent button\n\t//echo '<input type=\"submit\" value=\"' .get_string('move'). '\" onclick=\"javascript:addAction(this);\" />';\n\n\t//echo '</div>';\n}", "protected static function moveTemporaryDirs()\n {\n if (static::isCapsular()) {\n // Rename directories\n $original = static::getCacheDirs(false);\n foreach (static::getCacheDirs(true) as $i => $tmpDir) {\n \\Includes\\Utils\\FileManager::unlinkRecursive($tmpDir);\n $originalDir = $original[$i];\n rename($originalDir, $tmpDir);\n }\n\n // Rename files\n $original = static::getDecoratorDataFiles(false);\n foreach (static::getDecoratorDataFiles(true) as $i => $tmpPath) {\n $destPath = $original[$i];\n if (file_exists($tmpPath)) {\n rename($tmpPath, $destPath);\n }\n }\n }\n }", "private function updatePaths()\n\t{\n\t\t$hash = $this->e107->makeSiteHash($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\t$this->e107->site_path = $hash;\t\n\t\t\n\t\t$this->previous_steps['paths']['hash'] = $hash;\n\n\t\t$omit = array('FILES_DIRECTORY','WEB_IMAGES_DIRECTORY');\n\t\t\n\t\tforeach($this->e107->e107_dirs as $dir => $p)\n\t\t{\n\t\t\tif(in_array($dir, $omit)) { continue; }\t\n\t\t\t\n\t\t\t$this->e107->e107_dirs[$dir] = str_replace(\"[hash]\", $hash, $this->e107->e107_dirs[$dir]);\n\t\t\t\t\t\n\t\t\tif(!is_dir($this->e107->e107_dirs[$dir]))\n\t\t\t{\n\t\t\t\t@mkdir($this->e107->e107_dirs[$dir]);\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t}", "function narrative_move_xml($id, $new_narrative_dir)\n{\n $CI =& get_instance();\n $base_dir = $CI->config->item('site_data_dir') . '/' . $id . '/';\n $file_scan = scandir($base_dir);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n // Finding the XML file to be moved\n if ($file_extension == \"xml\" && $filecheck != 'AudioTimes.xml')\n {\n rename($base_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "function narrative_restore_tracks($tracks, $new_narrative_dir, $tracks_for_restoration = array())\n{\n foreach ($tracks as $i => $track)\n {\n if (in_array(basename($track), $tracks_for_restoration))\n {\n $track_dest = $new_narrative_dir . basename($track);\n }\n else\n {\n $track_dest = $new_narrative_dir . 'deleted/' . basename($track);\n }\n rename($track, $track_dest);\n }\n return TRUE;\n}", "function movefile($POSTfrom, $POSTto, $currentdir) {\n\tif(count($POSTto) == 1) { //if the user selected only one \"move to\" location\n\t\tforeach($POSTfrom as $fromItem => $n1) { //$fromItem returns selected file/folder name to be moved, $n is checkbox status\n\t\t\tforeach($POSTto as $toItem => $n2) {//$toItem returns selected folder to have the files put in\n\t\t\t\tif(!file_exists($currentdir . \"/\" . $toItem . \"/\" . $fromItem)) {\n\t\t\t\t\tif(rename($currentdir . \"/\" . $fromItem, $currentdir . \"/\" . $toItem . \"/\" . $fromItem)) { //if rename worked, do nothing. Else, echo an error. Since rename() can rename a folder, it is possible to rename a file/folder to its new directory and have linux move it accourdingly\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else if ($fromItem == $toItem) { //if user tries to move the same folder into its self\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. You cannot move a file into its self. Everything before it was moved.</p>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<p><b>Error</b>: Could not move file or folder <b>\" . $fromItem . \"</b>. Everything before it was moved.</p>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo \"<p><b>Error</b>: File already exists in the folder you want to move it to. Everything before <b>\" . $fromItem . \"</b> has been moved.</p>\";\n\t\t\t\t\techo \"<p>Rename file if you want to move it.</p>\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo \"<p><b>Error</b>: You selected more than one destination folder, or none at all. Or, you might have not selected anything to move.</p>\";\n\t\treturn false;\n\t}\n\t\n\treturn true; // If everything worked out, return true\n}", "public function test_move()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->move(SYSTEM);\n $this->assertTrue(is_dir(SYSTEM.DS.'test_dir'));\n $this->assertFalse(is_dir(ROOT.DS.'test_dir'));\n $this->assertEquals($object->get_path(), SYSTEM.DS.'test_dir');\n }", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "function move_file($name)\n{\n $old_file = __DIR__ . '/xml_schemas/' . $name . '.xml';\n $new_file = Path::get_repository_path() . 'lib/content_object/' . $name . '/install/' . $name . '.xml';\n Filesystem::copy_file($old_file, $new_file);\n return $new_file;\n}", "function rebuild($folderStart){\n\t\t\t\n\t\t\t\t// add to folder map!\n\t\t\t\t$f = substr($folderStart, strlen($_SERVER['DOCUMENT_ROOT'])+1);\n\t\t\t\t\n\t\t\t\t$this -> folderMap[$this -> hashFolder($f)] = $f;\n\t\t\t\t// now see if there are any folders inside this one.\n\t\t\t\t$results = scandir($folderStart);\n\t\t\t\t\n\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\tif ($result === '.' or $result === '..' or $result === 'converted') continue;\n\t\t\t\t\tif (is_dir($folderStart . '/' . $result)) {\n\t\t\t\t\t\t$this -> rebuild($folderStart . \"/\" . $result); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t}", "public function method_MOVE( $destination, $overwrite, $path )\n{\n $multistatus = new DAV_Multistatus();\n \n // This might generate an exception, but that's OK:\n $retval = ($destination[0] == '/')\n ? $this->method_COPY( $destination, $overwrite )\n : $this->method_COPY_external( $destination, $overwrite );\n \n foreach ( $this as $member ) {\n try {\n $deeppath = DAV::slashify($path) . $member;\n $deepdest = DAV::slashify($destination) . (\n $destination[0] == '/' ? $member : DAV::urlencode($member)\n );\n $resource = DAV_Server::inst()->resource($deeppath);\n if (!$resource)\n $multistatus->addStatus(\n $deeppath, new DAV_Status(\n REST::HTTP_INTERNAL_SERVER_ERROR,\n \"Resource not found: $deeppath\"\n )\n );\n elseif ( $resource instanceof DAV_Collection )\n $resource->method_MOVE( $deepdest, $overwrite, $deeppath );\n elseif ($destination[0] == '/')\n $resource->method_MOVE( $deepdest, $overwrite );\n else\n $resource->method_MOVE_external( $deepdest, $overwrite );\n }\n catch (DAV_Status $e) {\n $multistatus->addStatus($deeppath, $e);\n }\n catch (DAV_Multistatus $e) {\n $multistatus->mergeWith($e);\n }\n }\n if ( count( $multistatus->statuses() ) )\n throw $multistatus;\n \n try { $this->method_DELETE(); }\n catch (DAV_Status $e) {}\n \n return $retval;\n}", "public function test_move_directory_exists()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->move(ROOT, false);\n }", "public function moveFontelloFiles() {\n\n $this->_clearDirectory(array(\n 'assets/fontello',\n 'fontello'\n ));\n\n foreach (glob($this->_fontelloStorage . 'fontello-*/*', GLOB_NOSORT) as $file) {\n if (str_contains($file, 'config.json')) {\n if (\\File::exists(public_path('fontello/') . 'config.json')) {\n \\File::delete(public_path('fontello/') . 'config.json');\n }\n \\File::move($file, public_path('fontello/') . 'config.json');\n }\n if (is_dir($file)) {\n foreach (glob($file) as $index => $path) {\n $fileName = explode('/', $path);\n \\File::move($path, public_path('assets/fontello/') . end($fileName));\n }\n }\n }\n \\File::deleteDirectory($this->_fontelloStorage);\n }", "protected function syncSharedFolders()\n\t{\n\t\t$currentRelease = $this->releasesManager->getCurrentReleasePath();\n\t\tforeach ($this->rocketeer->getShared() as $file) {\n\t\t\t$this->share($currentRelease.'/'.$file);\n\t\t}\n\t}", "function sync_file_move($old, $new)\n{\n require_code('files2');\n _sync_file_move($old, $new);\n}", "private function moveMigration($arguments){\n\n $migrationPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/schemas/'.$arguments['schema'];\n $newPath=root.'/'.staticPathModel::$storeMigrationsPath.'/schemas/'.$arguments['schema'];\n\n\n $migrationPurePath=str_replace(root.'/','',$migrationPathWillBeMoved);\n $migrationNamespace=str_replace('/','\\\\',$migrationPurePath);\n $newMigrationNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newPath));\n\n\n if(rename($migrationPathWillBeMoved,$newPath)){\n\n foreach (glob($newPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationNamespace=>$newMigrationNamespace\n ]);\n }\n\n echo 'migration named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n echo PHP_EOL;\n }\n\n\n $migrationSeedPathWillBeMoved=staticPathModel::getProjectPath($arguments['move']).'/'.utils::getAppVersion($arguments['move']).'/migrations/seeds';\n $newSeedPath=root.'/'.staticPathModel::$storeMigrationsPath.'/seeds';\n\n\n $migrationSeedPurePath=str_replace(root.'/','',$migrationSeedPathWillBeMoved);\n $migrationSeedNamespace=str_replace('/','\\\\',$migrationSeedPurePath);\n $newMigrationSeedNamespace=str_replace('/','\\\\',str_replace(root.'/','',$newSeedPath));\n\n if(rename($migrationSeedPathWillBeMoved,$newSeedPath)){\n\n foreach (glob($newSeedPath.\"/*.php\") as $filename) {\n utils::changeClass($filename,[\n $migrationSeedNamespace=>$newMigrationSeedNamespace\n ]);\n }\n\n echo 'migration seeds named '.$arguments['schema'].' in '.$arguments['move'].' project has been successfully moved';\n\n }\n }", "function cp_r ($from, $to, $skip = array())\n{\n\t$fromFile = basename($from);\n\tif (in_array($fromFile,$skip))\n\t\treturn false;\n\t\n\tif (!is_dir($from))\n\t\tcopy($from, $to . '/' . $fromFile);\n\telse\n\t{\n\t\tmkdir($to . '/' . $fromFile);\n\t\t$dir = array_diff(getTreeStructure($from, GTS_ALL),$skip);\n\t\tsort($dir);\n\t\t\n\t\tfor($i=0; $i<count($dir); $i++)\n\t\t{\n\t\t\tif (!is_dir($from . '/' . $dir[$i]))\n\t\t\t\tcopy($from . '/' . $dir[$i], $to . $fromFile . '/' . $dir[$i]);\n\t\t\telse\n\t\t\t\tmkdir($to . $fromFile . '/' . $dir[$i]);\n\t\t}\n\t\treturn true;\n\t}\n}", "protected function onMove(){\n\t\tif (empty($this->post['directory']) || empty($this->post['file'])) return;\n\t\t\n\t\t$rename = empty($this->post['newDirectory']) && !empty($this->post['name']);\n\t\t$dir = $this->getDir($this->post['directory']);\n\t\t$file = realpath($dir . '/' . $this->post['file']);\n\t\t\n\t\t$is_dir = is_dir($file);\n\t\tif (!$this->checkFile($file) || (!$rename && $is_dir))\n\t\t\treturn;\n\t\t\n\t\tif ($rename || $is_dir){\n\t\t\tif (empty($this->post['name'])) return;\n\t\t\t$newname = $this->getName($this->post['name'], $dir);\n\t\t\t$fn = 'rename';\n\t\t}else{\n\t\t\t$newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory']));\n\t\t\t$fn = !empty($this->post['copy']) ? 'copy' : 'rename';\n\t\t}\n\t\t\n\t\tif (!$newname) return;\n\t\t\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\t\tif ($ext) $newname .= '.' . $ext;\n\t\t$fn($file, $newname);\n\t\t\n\t\techo json_encode(array(\n\t\t\t'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME),\n\t\t));\n\t}", "private function moveParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = 1; $i <= $this->index; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $source = sys_get_temp_dir().'/'.$indexed_filename;\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (!rename($source, $target)) {\n throw FileAccessException::failedOverwrite($source, $target);\n }\n }\n }", "public function moveAction()\n {\n $user = $this->getConnectedUser();\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $currentFolderId = $request->request->get('currentFolderId');\n $moveFolderId = $request->request->get('moveFolderId');\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n\n if (!is_null($moveFolderId)) {\n $parent = null;\n if (is_numeric($moveFolderId)) {\n $parent = $em->getRepository('TimeBoxMainBundle:Folder')->findOneById($moveFolderId);\n if (!$parent) {\n throw $this->createNotFoundException('Unable to find Folder entity.');\n }\n }\n\n $files = $em->getRepository('TimeBoxMainBundle:File')->findBy(array(\n 'user' => $user,\n 'id' => $filesId\n ));\n $folders = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'user' => $user,\n 'id' => $foldersId\n ));\n\n if (!is_null($files) && sizeof($files) > 0) {\n foreach ($files as $file) {\n is_null($parent) ? $file->setFolder() : $file->setFolder($parent);\n $file->setIsDeleted(false);\n }\n }\n if (!is_null($folders) && sizeof($folders) > 0) {\n foreach ($folders as $folder) {\n is_null($parent) ? $folder->setParent() : $folder->setParent($parent);\n $this->manageFolderContent($folder, false);\n }\n }\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file', array(\n 'folderId' => $moveFolderId\n )));\n }\n\n $filesId = json_encode($filesId);\n $foldersId = json_encode($foldersId);\n\n $folders = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(\n array(\n 'user' => $user,\n 'isDeleted' => false\n ),\n array(\n 'parent' => 'ASC',\n 'name' => 'ASC'\n )\n );\n\n return $this->render('TimeBoxMainBundle:File:move.html.twig', array(\n 'folders' => $folders,\n 'folderId' => $currentFolderId,\n 'filesId' => $filesId,\n 'foldersId' => $foldersId\n ));\n }\n return new Response('');\n }", "public function testMove()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // move\n $this->rlpMapper->move('/products/news/content1-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }", "function getSubfolders() ;", "private function renameDirectories(): void\n {\n //update directory names and update file created paths accordingly\n foreach ($this->dirsToRename as $dirPath) {\n $updateDirPath = $this->pathHelper->renamePathBasenameSingularOrPlural(\n $dirPath,\n $this->singularNamespacedName,\n $this->pluralNamespacedName\n );\n foreach ($this->filesCreated as $k => $filePath) {\n $this->filesCreated[$k] = str_replace($dirPath, $updateDirPath, $filePath);\n }\n }\n }", "public function move (MetaFolder $destination): MetaFolder\n {\n if ($destination->l >= $this->l && $destination->r <= $this->r) {\n throw new MetaFolderException('Metafolder cannot be moved into itself or a contained subfolder.');\n }\n if (!$this->level) {\n throw new MetaFolderException('Root metafolder cannot be moved.');\n }\n\n $newRelPath = $destination->getRelativePath() . array_slice (explode('/', trim($this->getRelativePath(), '/')), -1)[0] . '/';\n\n try {\n $existingFolder = self::getInstance($newRelPath);\n }\n catch (MetaFolderException $e) {\n }\n if (isset($existingFolder)) {\n throw new MetaFolderException('Cannot move folder. Folder with same path already exists.');\n }\n\n // metafile updates\n\n $db = Application::getInstance()->getVxPDO();\n\n // handle nesting, kudos to https://rogerkeays.com/how-to-move-a-node-in-nested-sets-with-sql\n\n $subtreeWidth = $this->r - $this->l + 1;\n $newPos = $destination->l + 1;\n $subtreeDist = $newPos - $this->l;\n $tmpPos = $this->l;\n $levelDiff = $destination->level - $this->level + 1;\n\n // observe backward movement\n\n if($subtreeDist < 0) {\n $subtreeDist -= $subtreeWidth;\n $tmpPos += $subtreeWidth;\n }\n\n $db->beginTransaction();\n\n // create space for subtree at new position\n\n $db->execute('UPDATE folders SET l = l + ? WHERE l >= ?', [$subtreeWidth, $newPos]);\n $db->execute('UPDATE folders SET r = r + ? WHERE r >= ?', [$subtreeWidth, $newPos]);\n\n // move subtree into new space\n\n $db->execute('UPDATE folders SET l = l + ?, r = r + ?, level = level + (?) WHERE l >= ? AND r < ?', [$subtreeDist, $subtreeDist, $levelDiff, $tmpPos, $tmpPos + $subtreeWidth]);\n\n // remove space previously occupied by subtree\n\n $db->execute('UPDATE folders SET l = l - ? WHERE l > ?', [$subtreeWidth, $this->r]);\n $db->execute('UPDATE folders SET r = r - ? WHERE r > ?', [$subtreeWidth, $this->r]);\n\n // update path\n\n $db->execute('UPDATE folders SET path = REGEXP_REPLACE(path, ?, ?) WHERE path LIKE ?', ['^' . $this->getRelativePath(), $newRelPath, $this->getRelativePath() . '%']);\n $db->commit();\n\n self::refreshNestings();\n\n // move filesystem folder\n\n $this->filesystemFolder->move($destination->getFilesystemFolder());\n\n // unset cached instances\n\n unset(self::$instancesById[$this->id], self::$instancesByPath[$this->filesystemFolder->getPath()]);\n return self::getInstance(null, $this->id);\n }", "public function mvCssFiles() {\n $this->taskCopyDir([\"css\" => \"css-0.1\"])->run();\n $this->taskDeleteDir(\"css\")->run();\n }", "function addLocations(){\n $l = $this->api->locate('addons', __NAMESPACE__, 'location');\n $addon = $this->api->locate('addons', __NAMESPACE__);\n $this->api->pathfinder->addLocation($addon, array(\n 'template' => 'templates',\n //'css' => 'templates/css',\n //'js' => 'js',\n ))->setParent($l);\n }", "public function testMoveDirectoryMovesEntireDirectoryAndOverwrites()\n {\n mkdir(self::$temp.DS.'tmp4', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp4'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp4'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp4'.DS.'nested'.DS.'baz.txt', '');\n\n mkdir(self::$temp.DS.'tmp5', 0777, true);\n file_put_contents(self::$temp.DS.'tmp5'.DS.'foo2.txt', '');\n file_put_contents(self::$temp.DS.'tmp5'.DS.'bar2.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp4', self::$temp.DS.'tmp5', true);\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp5'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp5'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'foo2.txt'));\n $this->assertFalse(is_file(self::$temp.DS.'tmp5'.DS.'bar2.txt'));\n $this->assertFalse(is_dir(self::$temp.DS.'tmp4'));\n }", "public function testMove(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n // move\n $this->document1->setResourceSegment('/products/asdf/content2-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/news/content1-news');\n $newNode = $this->defaultSession->getNode('/cmf/sulu_io/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n $this->assertEquals('sulu:path', $oldNodeMixins[0]->getName());\n\n $this->assertTrue($oldNode->getPropertyValue('sulu:history'));\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals(\n $this->documentInspector->getNode($this->document1),\n $newNode->getPropertyValue('sulu:content')\n );\n\n // get content from new path\n $result = $this->phpcrMapper->loadByResourceLocator('/products/asdf/content2-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n\n // get content from history should throw an exception\n $this->expectException(ResourceLocatorMovedException::class);\n $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n }", "public function test_move_not_exists_dir()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->move(ROOT.DS.'not_exist');\n }", "function email_move2folder($mailid, $foldermailid, $folderidnew) {\n\n\tif ( record_exists('email_folder', 'id', $folderidnew) ) {\n\n\t\t// Folder have exist in this new folder?\n\t\tif (! get_record('email_foldermail', 'mailid', $mailid, 'folderid', $folderidnew) ) {\n\n\t\t\t// Change folder reference to mail\n\t\t\tif (! set_field('email_foldermail', 'folderid', $folderidnew, 'id', $foldermailid, 'mailid', $mailid)) {\n\t\t\t \treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! delete_records('email_foldermail', 'id', $foldermailid) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function testOnMovedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, getcwd());\n\n $this->dir3->setParentBackedUp($this->dir3->getParent());\n $this->dir2->removeChildren($this->dir3);\n $this->dir1->addChildren($this->dir3);\n\n $obj->onMovedDocument($this->dir3);\n $this->assertFileExists($this->directory . \"/1/3\");\n }", "public function move_to_slideshow_dir()\n\t{\n\t\t\n\t\t$file_name = substr($this->file_handler[\"name\"], 0, strrpos($this->file_handler[\"name\"], \".\"));\n\t\t$file_name = $file_name . \"-\" . time();\n\t\t$file_name = $file_name . \".\" . pathinfo($this->file_handler['name'], PATHINFO_EXTENSION);\n\t\t$file_name = strtolower($file_name);\n\t\t\n\t\t$new_file_name = $this->base_path . $file_name;\n\n\t\t\n\t\tif(move_uploaded_file($this->file_handler[\"tmp_name\"], $new_file_name))\n\t\t\treturn $this->relative_path . $file_name;\n\t\telse\n\t\t\treturn false;\n\t}", "private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}", "static public function movePhysically($old_path, $new_path)\n {\n\n if(!is_dir($old_path))\n {\n return true;\n }\n \n if (!is_dir($new_path) || !is_writable($new_path))\n {\n $old = umask(0);\n mkdir($new_path, 0770);\n umask($old); \n }\n \n $files = sfFinder::type('file')->maxdepth(0)->in($old_path);\n $success = true;\n\n foreach ($files as $file)\n {\n $success = rename($file, $new_path . '/' . basename($file)) && $success;\n }\n if ($success)\n {\n $folders = sfFinder::type('dir')->maxdepth(0)->in($old_path);\n foreach($folders as $folder)\n {\n $new_name = substr($folder, strlen($old_path));\n $success = self::movePhysically($folder, $new_path . '/' . $new_name) && $success;\n }\n }\n \n $success = rmdir($old_path) && $success;\n\n return $success;\n }", "function create_folder($name)\n{\n $location = Path::get_repository_path() . 'lib/content_object/';\n Filesystem::create_dir($location . $name);\n}", "function expand()\r\n\t{\r\n\t\t$this->subfoldersCollection = new Collection ( );\r\n\r\n\t\tif( $handle = opendir( $this->path ) )\r\n\t\t{\r\n\r\n\t\t\twhile($file = readdir($handle))\r\n\t\t\t{\r\n\t\t\t\tif( !is_file( $this->path . \"/\" . $file ) && $file!='.' && $file!='..' )\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t$this->subfoldersCollection->add( new Folder( $this->path . '/' . $file ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error( \"houve algum erro na tentativa de abrir a pasta para manipulação\" );\r\n\t\t}\r\n\t}", "function copyFolder($old_dir,$new_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "protected function moveManagedFiles($manager)\n {\n foreach ($manager->listContents('from://', true) as $file) {\n $path = Str::after($file['path'], 'from://');\n\n if ($file['type'] === 'file' && (!$manager->fileExists('to://' . $path) || $this->option('force'))) {\n $manager->write('to://' . $path, $manager->read($file['path']));\n }\n }\n }", "function moveDIR($dir,$dest=\"\",$debug,$nMode=0755) {\n //$debug = 1;\n $result=true;\n\n //if($debug) { echo \"<h2>Moving directory</h2><p> From:<br> $dir <br>To: $dest</p>\";}\n\n $path = dirname(__FILE__);\n $files = scandir($dir);\n\n foreach($files as $file) {\n if (substr( $file ,0,1) != \".\") {\n $pathFile = $dir.'/'.$file;\n if (is_dir($pathFile)) {\n //if($debug) { echo \"<p><b>Directory:</b> $pathFile</p>\"; }\n\n $newDir = $dest.\"/\".$file;\n\n if (!moveDIR($pathFile,$newDir,$debug)) {\n $result = false;\n }\n\n } else {\n //echo ($debug) ? \"<p>$pathFile is a file</p>\" : \"\";\n\n // $currentFile = realpath($file); // current location\n $currentFile = $pathFile;\n\n $newFile = $dest.\"/\".$file;\n\n if (!file_exists($dest)) {\n makeDIR($dest,0,$nMode);\n }\n // if file already exists remove it\n if (file_exists($newFile)) {\n //if($debug) { echo \"<p>File $newFile already exists - Deleting</p>\"; }\n unlink($newFile);\n } else {\n //if($debug) { echo \"<p>File $newFile doesn't exist yet</p>\"; }\n }\n\n // Move via rename\n // rename(oldname, newname)\n if (rename($currentFile , $newFile)) {\n (CHMOD == 1) ? chmod($newFile, 0755) : '';\n //if($debug) { echo \"<p>Moved $currentFile to $newFile</p>\"; }\n } else {\n //if($debug) { echo \"<p>Failed to move $currentFile to $newFile</p>\"; }\n $result = false;\n } // END rename \n\n } // END if dir or file\n } // end if no dot\n } // END foreach\n return $result;\n }", "function loadFolders() {\n unset($this->folders);\n unset($this->folderTree);\n unset($this->alternativeFolderNames);\n $this->folders = $this->getFolders($this->lngSelect->currentLanguageId);\n $this->countSubFolders($this->folders);\n foreach ($this->folders as $folderId => $folder) {\n $this->folderTree[$folder['parent_id']][$folderId] = $folderId;\n if (!isset($folder['folder_name'])) {\n $foldersWithoutName[] = $folderId;\n }\n }\n if (PAPAYA_CONTENT_LANGUAGE != $this->lngSelect->currentLanguageId &&\n isset($foldersWithoutName) && is_array($foldersWithoutName) &&\n count($foldersWithoutName) > 0) {\n $this->alternativeFolderNames = $this->getFolders(\n PAPAYA_CONTENT_LANGUAGE, $foldersWithoutName\n );\n }\n }", "function renameFolder($oldName,$newName){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\r\n\r\n\t\t\t}", "function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}", "private function ensureFolderStructure()\n {\n $localeDir = Strata::getLocalePath();\n if (!is_dir($localeDir)) {\n mkdir($localeDir);\n }\n }", "abstract public function copyLocalDir($from, $to);", "public function testMoveDirectoryMovesEntireDirectory()\n {\n mkdir(self::$temp.DS.'tmp2', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'foo.txt', '');\n file_put_contents(self::$temp.DS.'tmp2'.DS.'bar.txt', '');\n\n mkdir(self::$temp.DS.'tmp2'.DS.'nested', 0777, true);\n file_put_contents(self::$temp.DS.'tmp2'.DS.'nested'.DS.'baz.txt', '');\n\n Storage::mvdir(self::$temp.DS.'tmp2', self::$temp.DS.'tmp3');\n\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'foo.txt'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'bar.txt'));\n $this->assertTrue(is_dir(self::$temp.DS.'tmp3'.DS.'nested'));\n $this->assertTrue(is_file(self::$temp.DS.'tmp3'.DS.'nested'.DS.'baz.txt'));\n\n $this->assertFalse(is_dir(self::$temp.DS.'tmp2'));\n }", "public function testMoveNotExist()\n {\n $this->rlpMapper->save($this->content1, '/news/news-1', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorNotFoundException');\n $this->rlpMapper->move('/news', '/neuigkeiten', 'default', 'de');\n }", "abstract function changedir($path = '', $supress_debug = FALSE);", "protected function swapJetstreamLivewireTeamStack()\n {\n // Directories...\n (new Filesystem)->ensureDirectoryExists(resource_path('views/teams'));\n\n (new Filesystem)->copyDirectory(__DIR__.'/../../../../stubs/livewire/resources/views/teams', resource_path('views/teams'));\n }", "public function createBaseFilesAndFolders()\n {\n $this\n ->createRootFolder()\n ->createRelsFolderAndFile()\n ->createDocPropsFolderAndFiles()\n ->createXlFolderAndSubFolders();\n }", "public static function moveConfigDistResources(): void\n {\n $filesystem = new Filesystem();\n $rootDir = getcwd();\n\n $distSourceDir = sprintf('%s/vendor/backbee/core-php/res/dist', $rootDir);\n\n if (!is_dir($distSourceDir)) {\n return;\n }\n\n $destDir = sprintf('%s/res/dist', $rootDir);\n $filesystem->mkdir($destDir);\n $filesystem->mirror(\n $distSourceDir,\n $destDir,\n null,\n [\n 'override' => false,\n 'delete' => false\n ]\n );\n }", "protected function syncSharedFolders()\n\t{\n\t\t$shared = (array) $this->rocketeer->getOption('remote.shared');\n\t\tforeach ($shared as $file) {\n\t\t\t$this->share($file);\n\t\t}\n\t}", "function narrative_purge_files($old_narrative_dir, $new_narrative_dir)\n{\n $file_scan = scandir($old_narrative_dir);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($file_extension == 'jpg')\n {\n rename($old_narrative_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "private function updateNamespace(): void\n {\n //now path is totally sorted, update namespace based on path\n foreach ($this->filesCreated as $filePath) {\n $this->findAndReplaceHelper->setNamespaceFromPath(\n $filePath,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n }\n }", "abstract public function subfolder($manipulation_name = '');", "private function createAppRoutesFolder(){\n return Storage::disk('routes')->makeDirectory($this->appNamePath);\n }", "static function _determine_custom_dir( $path = __FILE__ ) {\n $path = dirname( $path );\n $path = str_replace( '\\\\', '/', $path );\n $explode_path = explode( '/', $path );\n\n $current_dir = $explode_path[count( $explode_path ) - 1];\n array_push( $this->dir, $current_dir );\n\n if( $current_dir == 'wp-content' ) {\n # Build new paths\n $path = '';\n $directories = array_reverse( $this->dir );\n\n foreach( $directories as $dir ) {\n $path = $path . '/' . $dir;\n }\n\n $this->dir = $path;\n } else {\n return $this->_determine_custom_dir( $path );\n }\n }", "function moveFilesToDocs($src){\n // Get array of all source files\n $files = scandir($src);\n // Identify directories\n $source = $src . \"/\";\n $files = glob($source . \"*.html\");\n //echo $source;\n $dest = \"../docs/\";\n // Cycle through all source files\n foreach ($files as $fname) {\n if($fname != '.' && $fname != '..') {\n rename($fname, $dest.$fname);\n echo \"moving $dest.$fname \\n\";\n }\n }\n}", "public function set_special_folders($specials) {\n // should be overriden by storage class if backend supports special folders (SPECIAL-USE)\n // unset($this->icache['special-folders']);\n }", "protected function traverseFolders($destination, $replace, $with, $catalog_type_id)\n\t{\n\t\t/** retrieve all folder names for destination **/\n\t\t$folders = Services::Filesystem()->folderFolders($destination, $filter = '',\n\t\t\t$recurse = true, $fullpath = true, $exclude = array('.git'));\n\n\t\t$folders[] = $destination;\n\n\t\t/** process files in each folder **/\n\t\tforeach ($folders as $folder) {\n\n\t\t\t/** retrieve all file names in folder **/\n\t\t\t$files = Services::Filesystem()->folderFiles($folder);\n\n\t\t\t/** process each file **/\n\t\t\tforeach ($files as $file) {\n\n\t\t\t\t/** retrieve current file extension **/\n\t\t\t\t$file_extension = Services::Filesystem()->fileExtension($file);\n\n\t\t\t\t/** rename files, if needed **/\n\t\t\t\tif (strtolower($file) == $replace . '.' . $file_extension) {\n\n\t\t\t\t\t$this->renameFile(\n\t\t\t\t\t\t$existingName = $replace . '.' . $file_extension,\n\t\t\t\t\t\t$newName = $with . '.' . $file_extension,\n\t\t\t\t\t\t$folder);\n\n\t\t\t\t\t$this->changeWords($folder, $newName, $replace, $with, $catalog_type_id);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$this->changeWords($folder, $file, $replace, $with, $catalog_type_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** process each folder for renames last **/\n\t\tforeach ($folders as $folder) {\n\n\t\t\t/** rename folders, as needed **/\n\t\t\tif (basename($folder) == $replace) {\n\t\t\t\t/** see if the parent folders have been renamed **/\n\t\t\t\t$parentPath = dirname($folder);\n\t\t\t\tif (Services::Filesystem()->folderExists(dirname($parentPath))) {\n\t\t\t\t} else {\n\t\t\t\t\t$parentPath = str_replace($replace, strtolower($with), $parentPath);\n\t\t\t\t}\n\t\t\t\t/** rename folder **/\n\t\t\t\t$this->renameFolder(\n\t\t\t\t\t$existingName = $replace,\n\t\t\t\t\t$newName = $with,\n\t\t\t\t\t$parentPath);\n\t\t\t}\n\t\t}\n\t}", "function custom_upload_directory( $args ) {\n\t$id = $_REQUEST['post_id'];\n\t$parent = get_post( $id )->post_parent;\n\tif( \"music\" == get_post_type( $id ) || \"music\" == get_post_type( $parent ) ) {\n\t\t$args['path'] = plugin_dir_path(__FILE__) . \"uploads\";\n\t\t$args['url'] = plugin_dir_url(__FILE__) . \"uploads\";\n\t\t$args['basedir'] = plugin_dir_path(__FILE__) . \"uploads\";\n\t\t$args['baseurl'] = plugin_dir_url(__FILE__) . \"uploads\";\n\t}\n\treturn $args;\n}", "function rename_folder()\n\t{\n\t\t$new_name = trailingslashit($this->paths['fontdir']).$this->font_name;\n\t\t\n\t\t//delete folder and contents if they already exist\n\t\t$this->delete_folder($new_name);\n\t\n\t\trename($this->paths['tempdir'], $new_name);\n\t}", "abstract protected function getFilesDestination();", "public static function moveDistResources(): void\n {\n $filesystem = new Filesystem();\n $rootDir = getcwd();\n\n $distSourceDir = sprintf('%s/vendor/backbee/toolbar-dist/dist', $rootDir);\n\n if (!is_dir($distSourceDir)) {\n return;\n }\n\n $destDir = sprintf('%s/web/static/back', $rootDir);\n $filesystem->mkdir($destDir);\n $filesystem->mirror(\n $distSourceDir,\n $destDir,\n null, [\n 'override' => true,\n 'delete' => true\n ]\n );\n }", "public function testMoveRecursive() {\n $sourceDirName = self::TEST_DIR . '/testMoveRecursiveSource/hierachy1';\n $targetDirName = self::TEST_DIR . '/testMoveRecursiveTarget/hierachy1';\n\n mkdir(self::TEST_DIR . '/testMoveRecursiveSource/hierachy1', 0777, true);\n\n $directoryHandle = new Directory(self::TEST_DIR . '/testMoveRecursiveSource');\n\n $directoryHandle->move(new Directory(self::TEST_DIR . '/testMoveRecursiveTarget'));\n\n $this->assertDirectoryExists($targetDirName);\n $this->assertDirectoryNotExists(self::TEST_DIR . '/testMoveRecursiveSource');\n }", "public\n function copyAssets() {\n $this->info('Clearing webroot and copying assets...');\n// if ($this->_clear($this->_assetDir, '^(?!cover)(?!dashboard)(?!signin)(?!baked-with-cakephp.svg).*$')) {\n// $this->success('All files cleared...');\n// }\n\n $files = [];\n $folders = [];\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-duration-picker/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-markdown-editor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-toggle');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'checkboxes.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'datepair.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'flatpickr/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-awesome-cursor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-mask-plugin/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'markitup/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'popper.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'select2/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'vue/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'signature_pad/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'sticky-sidebar/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'timepicker/dist');\n\n foreach ($folders as $folder) {\n foreach ($folder->findRecursive() as $file) {\n $files[] = new File($file);\n }\n }\n try {\n $this->_copy($files);\n } catch (\\Exception $exception) {\n $this->info('Some did not copy. Exception: ' . $exception->getMessage(), 1, ConsoleIo::VERBOSE);\n }\n\n }", "function scribbles_move_elements() {\n\n\tremove_action( 'primer_header', 'primer_add_hero' );\n\tremove_action( 'primer_after_header', 'primer_add_page_title' );\n\n\tadd_action( 'primer_after_header', 'primer_add_hero' );\n\n\tadd_action( 'primer_before_site_navigation', 'scribbles_nav_wrapper_open', 0 );\n\tadd_action( 'primer_after_site_navigation', 'scribbles_nav_wrapper_close', 400 );\n\n\tif ( ! is_front_page() || ! is_active_sidebar( 'hero' ) ) {\n\n\t\tadd_action( 'primer_hero', 'primer_add_page_title' );\n\n\t}\n\n\tadd_action( 'primer_before_site_navigation', 'primer_add_social_navigation', 12 );\n\n}", "public function testMoveTwice()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // first move\n $this->rlpMapper->move('/products/news/content1-news', '/products/news/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n // second move\n $this->rlpMapper->move('/products/news/content2-news', '/products/asdf/content2-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $oldNode = $this->session->getNode('/cmf/default/routes/de/products/news/content1-news');\n $newNode = $this->session->getNode('/cmf/default/routes/de/products/asdf/content2-news');\n\n $oldNodeMixins = $oldNode->getMixinNodeTypes();\n $newNodeMixins = $newNode->getMixinNodeTypes();\n\n $this->assertEquals('sulu:path', $newNodeMixins[0]->getName());\n // FIXME after change mixin works: $this->assertEquals('sulu:history', $oldNodeMixins[0]->getName());\n\n $this->assertEquals($newNode, $oldNode->getPropertyValue('sulu:content'));\n $this->assertEquals($this->content1, $newNode->getPropertyValue('sulu:content'));\n\n // get content from new path\n $result = $this->rlpMapper->loadByResourceLocator('/products/asdf/content2-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n\n // get content from history should throw an exception\n $this->setExpectedException('Sulu\\Component\\Content\\Exception\\ResourceLocatorMovedException');\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n }", "function mt_autoregister_views($view_base, $folder, $base_location_path, $viewtype) {\n \n if (!isset($i)) $i = 0;\n if ($handle = opendir($folder)) {\n while ($view = readdir($handle)) {\n if (!in_array($view,array('.','..','.svn','CVS')) && !is_dir($folder . \"/\" . $view)) {\n if ((substr_count($view,\".php\") > 0) || (substr_count($view,\".png\") > 0)) {\n if (!empty($view_base)) { $view_base_new = $view_base . \"/\"; } else { $view_base_new = \"\"; }\n mt_set_view_location($view_base_new . str_replace(\".php\",\"\",$view), $base_location_path, $viewtype);\n }\n } else if (!in_array($view,array('.','..','.svn','CVS')) && is_dir($folder . \"/\" . $view)) {\n if (!empty($view_base)) { $view_base_new = $view_base . \"/\"; } else { $view_base_new = \"\"; }\n mt_autoregister_views($view_base_new . $view, $folder . \"/\" . $view, $base_location_path, $viewtype);\n }\n }\n }\n}", "function make_move_build($build_path) {\n $tmp_path = make_tmp();\n $ret = TRUE;\n if ($build_path == '.') {\n $info = drush_scan_directory($tmp_path . DIRECTORY_SEPARATOR . '__build__', '/./', array('.', '..'), 0, FALSE, 'filename', 0, TRUE);\n foreach ($info as $file) {\n $destination = $build_path . DIRECTORY_SEPARATOR . $file->basename;\n if (file_exists($destination)) {\n // To prevent the removal of top-level directories such as 'modules' or\n // 'themes', descend in a level if the file exists.\n // TODO: This only protects one level of directories from being removed.\n $files = drush_scan_directory($file->filename, '/./', array('.', '..'), 0, FALSE);\n foreach ($files as $file) {\n $ret = $ret && drush_copy_dir($file->filename, $destination . DIRECTORY_SEPARATOR . $file->basename, FILE_EXISTS_MERGE);\n }\n }\n else {\n $ret = $ret && drush_copy_dir($file->filename, $destination);\n }\n }\n }\n else {\n drush_mkdir(dirname($build_path));\n $ret = drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . '__build__', $tmp_path . DIRECTORY_SEPARATOR . basename($build_path), TRUE);\n $ret = $ret && drush_copy_dir($tmp_path . DIRECTORY_SEPARATOR . basename($build_path), $build_path);\n }\n\n // Copying to final destination resets write permissions. Re-apply.\n if (drush_get_option('prepare-install')) {\n $default = $build_path . '/sites/default';\n chmod($default . '/settings.php', 0666);\n chmod($default . '/files', 0777);\n }\n\n if (!$ret) {\n drush_set_error('MAKE_CANNOT_MOVE_BUILD', dt(\"Cannot move build into place.\"));\n }\n return $ret;\n}", "protected function fixFiles()\n {\n\n \tforeach (glob(base_path($this->passport_path) . '*.php') as $filename)\n \t{\n \t $file = file_get_contents($filename);\n \t file_put_contents($filename, str_replace($this->laravel_model, $this->mongo_model, $file));\n \t //$this->info($filename . \" has been Checked/Modified\");\n \t}\n\n }", "function narrative_restore_pictures($pictures, $new_narrative_dir, $pictures_for_restoration = array())\n{\n foreach ($pictures as $i => $picture)\n {\n if (in_array(basename($picture), $pictures_for_restoration))\n {\n $picture_dest = $new_narrative_dir . basename($picture);\n }\n else\n {\n $picture_dest = $new_narrative_dir . 'deleted/' . basename($picture);\n }\n rename($picture, $picture_dest);\n }\n}", "public function transferTo($destFolder);", "public function copyOtherFiles(): void;", "protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }", "public function renameMediaMetaFiles($old_base_name, $new_base_name) {\n $newPath = WikiGlobalConfig::getConf('mediametadir').\"/$new_base_name\";\n $old_base_name = str_replace(\"/\", \"_\", $old_base_name);\n $new_base_name = str_replace(\"/\", \"_\", $new_base_name);\n $ret = TRUE;\n if (($scan = @scandir($newPath))){\n foreach ($scan as $file) {\n if (is_file(\"$newPath/$file\")) {\n $search = \"/^{$old_base_name}(.*)/\";\n if (preg_match($search, $file)) {\n $newfile = preg_replace($search, \"{$new_base_name}$1\", $file);\n $ret = rename(\"$newPath/$file\", \"$newPath/$newfile\");\n if (!$ret) {\n $ret = \"$newPath/$file\";\n break;\n }\n }\n }\n }\n }\n if (is_string($ret)) {\n throw new Exception(\"renameProjectOrDirectory: Error mentre canviava el nom de l'arxiu $ret.\");\n }\n }", "function carr_move_media_menu() {\n\tglobal $menu;\n\n\t$menu[24] = $menu[10];\n\tunset( $menu[10] );\n}", "function restoreFolder($store, $folderentryid, $entryidlist, $action){\t\n\t\t\t$binEntryIdList = Array();\n\t\t\t$displayNameList = Array();\n\t\t\t//here the entryids and displaynames are stored in seprate arrays so \n\t\t\t//that folders display name can be checked for conflicting names which restoring folders. \n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t\t$displayNameList[] = u2w($entryidlist[$key][\"display_name\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\t\t\tfor($entryindex = 0;$entryindex < count($binEntryIdList); $entryindex++){\n\t\t\t\tmapi_folder_copyfolder($sfolder, $binEntryIdList[$entryindex], $sfolder, $displayNameList[$entryindex], FOLDER_MOVE);\n\t\t\t\t//here we check mapi errors for conflicting of names when folder/s is restored. \n\t\t\t\tif(mapi_last_hresult()==MAPI_E_COLLISION){\n\t\t\t\t\t$foldername = $GLOBALS[\"operations\"]->checkFolderNameConflict($store, $sfolder, $displayNameList[$entryindex]);\n\t\t\t\t\tmapi_folder_copyfolder($sfolder, $binEntryIdList[$entryindex], $sfolder, $foldername, FOLDER_MOVE);\n\t\t\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\t\t\t\t\tif(!$result){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// as after moving the folder's the entryid gets changed, so need to notify about the folder\n\t\t\t// so that we can update the folder on parent page.\n\t\t\t$folderProps = mapi_getprops($sfolder, array(PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID));\n\t\t\t$GLOBALS[\"bus\"]->notify(bin2hex($folderentryid), TABLE_SAVE, $folderProps);\n\n\t\t\treturn $result;\n\t\t}", "public function onAfterInstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'BetterRedactor'),\n array('type' => 'RichText')\n );\n\n $publicDirectory = craft()->path->appPath . '../../public/redactor_plugins';\n\n if (!IOHelper::folderExists($publicDirectory)) {\n $initialDirectory = craft()->path->getPluginsPath()\n . '/betterredactor/redactor_plugins';\n\n $files = array_filter(\n scandir($initialDirectory),\n function($file) use ($initialDirectory) {\n return is_file(\"$initialDirectory/$file\");\n }\n );\n\n foreach ($files as $file) {\n if (preg_match('((.js|.css)$)i', $file)) {\n IOHelper::copyFile(\n \"$initialDirectory/$file\",\n \"$publicDirectory/$file\"\n );\n }\n }\n }\n }", "function folder_recurse($src,$dst, $action = 'copy') {\n $dir = opendir($src);\n @mkdir($dst);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n if ( is_dir($src . '/' . $file) ) {\n folder_recurse($src . '/' . $file,$dst . '/' . $file, $action);\n }\n else {\n\n $action($src . '/' . $file,$dst . '/' . $file);\n }\n }\n }\n closedir($dir);\n }", "function moveFiles($src, $dest)\n{\n if (!is_dir($src)) {\n return false;\n }\n\n // If the destination directory does not exist create it\n if (!is_dir($dest)) {\n if (!mkdir($dest)) {\n // If the destination directory could not be created stop processing\n return false;\n }\n }\n\n // Open the source directory to read in files\n $i = new DirectoryIterator($src);\n foreach ($i as $f) {\n if ($f->isFile()) {\n rename($f->getRealPath(), \"$dest/\" . $f->getFilename());\n } else {\n if (!$f->isDot() && $f->isDir()) {\n rmDirRecursive($f->getRealPath(), \"$dest/$f\");\n unlink($f->getRealPath());\n }\n }\n }\n unlink($src);\n}", "function MoveRep($drive,$space) { // deplace le repertoire de sauvegarde $drive vers $space\n\t$cmd=\"/usr/bin/sudo /usr/share/se3/scripts/move_rep_backuppc.sh \".$drive.\" \".$space;\n\texec($cmd);\n}", "public function move_arquivos($imagem, $dir)\r\n\t{\r\n\t\tApp::uses('File', 'Utility');\r\n\t\t$arquivo = new File($imagem['tmp_name']);\r\n\t\t$arquivo->copy($dir.$imagem['name']);\r\n\t\t$arquivo->close();\r\n\t}", "function moveDirs($source, $dest, $recursive = true, $message) {\n jimport('joomla.filesystem.folder');\n jimport('joomla.filesystem.file');\n \n $error = false;\n\t\n\tif (!is_dir($dest)) { \n mkdir($dest); \n \t} \n \n $handle = @opendir($source);\n \n if(!$handle) {\n $message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_COPY');\n return $message;\n }\n \n while ($file = @readdir ($handle)) {\n if (eregi(\"^\\.{1,2}$\",$file)) {\n continue;\n }\n \n if(!$recursive && $source != $source.$file.\"/\") {\n if(is_dir($source.$file))\n continue;\n }\n \n if(is_dir($source.$file)) {\n moveDirs($source.$file.\"/\", $dest.$file.\"/\", $recursive, $message);\n } else {\n if (!JFile::copy($source.$file, $dest.$file)) {\n\t\t\t\t$error = true;\n\t\t\t}\n }\n }\n @closedir($handle);\n \n // $source loeschen wenn KEIN error\n if (!$error) {\n\t\t$res = delete_dir_and_allfiles ($source);\t\n if ($res) {\n\t\t\t$message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_DEL_AFTER_COPY');\t\t\n\t\t}\n\t} else {\n\t\t$message = JText::_('COM_JDOWNLOADS_BACKEND_CATSEDIT_ERROR_CAT_COPY');\n\t}\n\treturn $message;\n}", "public function move($from, $to, $root = NULL) {\n\n if (is_null($root)) $root = $this->root;\n $response = $this->http_oauthed($this->api_url . 'fileops/move', array('from_path' => rawurldecode($from), 'to_path' => rawurldecode($to), 'root' => $root));\n\n return json_decode($response,true);\n\n }", "function copy_dirs($wf, $wto) {\n\tif (!file_exists($wto)) {\n\t\tmkdir($wto, 0777);\n\t}\n\t$arr=ls_a($wf);\n\tforeach ($arr as $fn) {\n\t\tif($fn) {\n\t\t\t$fl=$wf.\"/\".$fn;\n\t\t\t$flto=$wto.\"/\".$fn;\n\t\t\tif(is_dir($fl)) copy_dirs($fl, $flto);\n\t\t\telse // begin 2nd improvement\n\t\t\t{\n\t\t\t\t@copy($fl, $flto);\n\t\t\t\tchmod($flto, 0666);\n\t\t\t} // end 2nd improvement\n\t\t}\n\t}\n}", "private function getDirectories()\n {\n $this->load();\n\n $this->data['themeDirectory'] = 'catalog/view/theme/default/';\n $customizedFile = $this->data['themeDirectory'] . 'stylesheet/mundipagg/mundipagg_customized.css';\n\n if (file_exists($customizedFile)) {\n $this->data['customizedFile'] = $customizedFile;\n }\n }" ]
[ "0.6192061", "0.6138709", "0.6126001", "0.5878493", "0.58597845", "0.5845825", "0.57427096", "0.5680255", "0.5670988", "0.56697506", "0.5665553", "0.56159455", "0.5582235", "0.5567524", "0.5519631", "0.5507322", "0.5501698", "0.54823154", "0.54298943", "0.5417129", "0.54166764", "0.54134315", "0.5406092", "0.53815883", "0.5355814", "0.5339744", "0.532557", "0.53180546", "0.5314931", "0.53093994", "0.530203", "0.52975315", "0.5296008", "0.52795357", "0.5259122", "0.5255989", "0.52437955", "0.5241101", "0.5235743", "0.5224564", "0.52217555", "0.5215712", "0.5215211", "0.5210512", "0.52077943", "0.51947075", "0.5190605", "0.51771605", "0.51748645", "0.5171334", "0.5154252", "0.5153212", "0.5144606", "0.5144017", "0.5142435", "0.51307636", "0.51204956", "0.51175827", "0.5114802", "0.51102835", "0.51096064", "0.51076037", "0.5103704", "0.51022905", "0.50833404", "0.50630224", "0.5058271", "0.5056639", "0.50548595", "0.5054609", "0.50382054", "0.50341713", "0.502113", "0.50189495", "0.5016802", "0.50166255", "0.50118834", "0.50065434", "0.50002", "0.4994979", "0.49921602", "0.4991586", "0.49879736", "0.49872625", "0.49864805", "0.49807858", "0.49621364", "0.49585658", "0.49534193", "0.49519286", "0.4940976", "0.4939831", "0.49313468", "0.4925573", "0.49182394", "0.49107593", "0.49059024", "0.49024108", "0.489689", "0.48943934" ]
0.67734855
0
Build an XML configuration file install Revo
protected function buildConfigFile(array $config) { $dom = new \DOMDocument(); $xml = $dom->appendChild($dom->createElement('modx')); foreach ($config as $k => $v) { $xml->appendChild($dom->createElement($k, $v)); } $dom->formatOutput = true; $output = $dom->saveXML(); $file = getcwd() . '/config.xml'; file_put_contents($file, $output); return realpath($file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateConfig()\n {\n if ('' == $this->config->getName()) {\n throw new \\InvalidArgumentException('No module name given');\n }\n $target = sprintf(\n '%s/app/code/%s/%s/%s/etc/config.xml',\n $this->config->getPath(),\n $this->config->getCodePool(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'config.xml', $target, array(\n 'config' => $this->config,\n ));\n \n \n $target = sprintf(\n '%s/app/etc/modules/%s_%s.xml',\n $this->config->getPath(),\n $this->config->getNamespace(),\n $this->config->getName() \n );\n \n $this->renderFile($this->skeletonDir, 'Module.xml', $target, array(\n 'config' => $this->config,\n )); \n }", "public function toXML()\r\n\t{\r\n\t\t// pass any configuration options defined as type=pass to the xml\r\n\t\t\r\n\t\t$source = explode('/', $this->config_file);\r\n\t\t$source = array_pop($source);\r\n\r\n\t\t$objConfigXml = new \\DOMDocument( );\r\n\t\t$objConfigXml->loadXML( \"<config source=\\\"$source\\\" />\" );\r\n\t\t\t\r\n\t\tforeach ( $this->getPass() as $key => $value )\r\n\t\t{\r\n\t\t\tif ($value instanceof \\SimpleXMLElement) \r\n\t\t\t{\r\n\t\t\t\t// just spit it back out again as XML\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement($key);\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t\t\r\n\t\t\t\tforeach ($value->children() as $child) \r\n\t\t\t\t{\r\n\t\t\t\t\t// need to convert to DOMDocument.\r\n\t\t\t\t\t$domValue = dom_import_simplexml($child);\r\n\t\t\t\t\t$domValue = $objConfigXml->importNode($domValue, true);\r\n\t\t\t\t\t$objElement->appendChild($domValue);\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t// simple string value\r\n\t\t\t\t\r\n\t\t\t\t$objElement = $objConfigXml->createElement( $key, Parser::escapeXml($value) );\r\n\t\t\t\t$objConfigXml->documentElement->appendChild( $objElement );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $objConfigXml;\r\n\t}", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "abstract public function generateConfiguration();", "protected function processBuildXml($config)\n {\n if (isset($config['package-include'])) {\n foreach ($config['package-include'] as $include) {\n $this->addBuildXmlInclude($include);\n }\n }\n if (isset($config['package-exclude'])) {\n foreach ($config['package-exclude'] as $exclude) {\n $this->addBuildXmlExclude($exclude);\n }\n }\n $this->buildXml->write();\n }", "protected function configure() {\n\n $this->xmlconfig = array(\n \"name\" => array(\"xpath\" => \"mads:authority/mads:name\", \"class_name\" => \"mads_name\"),\n\n \"permanent\" => array(\"xpath\" => \"mads:affiliation[mads:position = 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"current\" => array(\"xpath\" => \"mads:affiliation[mads:position != 'permanent resident']\",\n \"class_name\" => \"mads_affiliation\"),\n \"netid\" => array(\"xpath\" => \"mads:identifier[@type='netid']\"),\n );\n }", "private function createConfiguration()\n {\n $this->createVrpayecommercePluginConfig();\n $this->Form();\n }", "function writeVxmlConf() {\n\t\n\tglobal $astman;\n\t\n\t$confFile = \"/etc/asterisk/vxml.conf\";\n\t$content = \"\n;--------------------------------------------------------------------------------;\n; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;\n; this file must be done via the web gui. There are alternative files to make ;\n; custom modifications. ;\n;--------------------------------------------------------------------------------;\n \n;*********************************************************************************\n; AUTO-GENERATED AND CUSTOM USER VOICEXML CONFIGURATION INCLUDED HERE *\n;*********************************************************************************\n \n;--------------------------------------------------------------------------------;\n; Customizations to this configuration should be made in vxml_custom.conf ;\n; ;\n#include vxml_custom.conf\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n;--------------------------------------------------------------------------------;\n\";\n\t\n\t$settings = getConfiguration('*');\n\t$settingsArrayKeys = array_keys($settings);\n\t$content = $content.\"\\n[general]\\n\";\n\t$content = $content.\"autoanswer=yes\\n\";\n\t$content = $content.\"videosilence=\\n\";\n\t$content = $content.\"audiosilence=\\n\";\n\t$content = $content.\"speechprovider=unimrcp\\n\";\n\t$content = $content.\"speechscore=50\\n\";\n\t$content = $content.\"monitor=\".(($settings[\"monitor\"]) ? \"yes\" : \"no\").\"\\n\";\n\t\n\tforeach ($settingsArrayKeys as $key) {\n\t\t$value = trim($settings[$key]);\n\t\tif (!empty($value)) {\n\t\t\tif ($key == \"id\") {\n\t\t\t\tcontinue;\n\t\t\t} elseif ($key == \"wavdefaulcodec\") {\n\t\t\t\t$content = $content.\"wavcodec=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t} elseif ($key == \"dialformataudio\") {\n\t\t\t\t$content = $content.\"dialformat=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t} elseif ($key == \"debug\") {\n\t\t\t\tif ($settings['debug'] == \"Enabled\") $debug = 1;\n\t\t\t\telse $debug = 0;\n\t\t\t\t$content = $content.\"debug=\". $debug .\"\\n\";\n\t\t\t} elseif ($key == \"monitor\") {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$content = $content.$key.\"=\".strtolower($settings[$key]).\"\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//TODO Change this part when the page Settings is finished.\n\t$content = $content.\"\n[control]\nforward=#\nreverse=*\nstop=123456789\npause=\nrestart=0\nskipms=5000\t\t\t\n\t\";\n\t\n\t$license = getLicense();\n\t$licenseArrayKeys = array_keys($license);\n\t$content = $content.\"\\n[license]\\n\";\n\tforeach ($licenseArrayKeys as $key) {\n\t\t$value = trim($license[$key]);\n\t\tif (!empty($value)) {\n\t\t\tif ($key == \"licensekey\") {\n\t\t\t\t$content = $content.\"key=\".strtolower($license[$key]).\"\\n\";\t\n\t\t\t} else {\n\t\t\t\t$content = $content.$key.\"=\".strtolower($license[$key]).\"\\n\";\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\t$vxmlList = getVxmlList(\"*\");\n\t$i = 0;\n\tforeach ($vxmlList as $vxml) {\n\t\t$content = $content.\"\\n[account$i]\\n\";\n\t\t$vxmlKeyList = array_keys($vxml);\n\t\tforeach ($vxmlKeyList as $key) {\n\t\t\tif (!empty($vxml[$key]) && $key != \"goto\" && $key != \"id\") $content = $content.$key.\"=\".$vxml[$key].\"\\n\";\t\n\t\t}\t\t\n\t\t$i++;\n\t}\n\t\n\tfile_put_contents($confFile,$content);\n\t\n\tif ($astman) {\n\t\t$out = $astman->send_request('Command',array('Command'=>\"vxml reload\"));\n\t}\n\t\n\treturn;\n}", "function vxml_get_config($engine) {\n\twriteVxmlConf();\t\n\t\n\t//Call to the function to change the TTS engine\n\tchangeTTSEngine();\n\t\n\t//Call to the function to change the ASR engine\n\tchangeMRCPEngine();\n\t\n\t//We write the dialplan\n\tglobal $ext;\n\t\n\tswitch($engine) {\n\t\tcase \"asterisk\": \n\t\t\t$vxmllist = getVxmlList(\"*\");\n\t\t\tforeach ($vxmllist as $vxml) {\n\t\t\t\t$ename = \"app-vxml-\".$vxml['id'];\n\t\t\t\t$ext->addSectionComment($ename, $vxml['name']);\n\t\t\t\t$ext->add($ename,'s','',new ext_vxml($vxml['name']));\n\t\t\t\t$ext->add($ename,'s','',new ext_goto($vxml['goto']));\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t}\n\treturn;\n\t\n}", "private function getExtensionConfigXml() \n\t{\n\n\t\t// path to the extensions config.xml\n\t\t$extension_config_xml_path = parent::$extension_base_dir . '/etc/config.xml';\n\n\t\tif (!file_exists($extension_config_xml_path)) {\n\t\t\t$this->displayError('Cant find path to extension config xml.');\n\t\t}\n\n\t\t$extension_config_xml = simplexml_load_file($extension_config_xml_path);\n\n\t\tparent::$extension_config_xml = $extension_config_xml;\n\n\t}", "function build_config($file = \"\", $filter = \"\", $email = \"\", $html = 1, $csv = 1) {\n\tglobal $config;\n\n\tif (empty($file)) {\n\t\t$file = \"example.xml\";\n\t}\n\n\t/* get start date of the month */\n\t$start_date = date(\"Y/m/d\", mktime(0,0,0, date(\"n\", time()), 1, date(\"Y\", time())));\n\n\t/* define email if needed */\n\tif (empty($email)) {\n\t\t$email = \"root@localhost\";\n\t}\n\n\t/* define XML encoding */\n\t$XMLEncoding = \"UTF-8\";\n\tif ($config[\"cacti_server_os\"] == \"WIN\") {\n\t\t$XMLEncoding = \"ISO-8859-1\";\n\t}\n\n\t/* open file */\n\tif (!$xml_FH = fopen($file, \"w\")) {\n\t\tprint \"ERROR: Unable to open file for writing: $file\\n\";\n\t\texit;\n\t}\n\n\t$where = \"\";\n\tif (! empty($filter)) {\n\t\t$where = \" i.local_graph_id in(\" . $filter . \") AND \";\n\t}\n\n\t/* Query database for items of interest */\n\t$graph_items = db_fetch_assoc(\"SELECT \n\t\t\ti.id AS item_id, \n\t\t\ti.local_graph_id, \n\t\t\ti.task_item_id, \n\t\t\ti.text_format, \n\t\t\tg.id AS graph_id, \n\t\t\tg.title_cache\n\t\tFROM \n\t\t\tgraph_templates_item AS i, \n\t\t\tgraph_templates_graph AS g\n\t\tWHERE \n\t\t\ti.local_graph_id = g.local_graph_id AND \n\t\t\ti.local_graph_id <> 0 AND \n\t\t\ti.graph_type_id = 1 AND \" . $where . \" \n\t\t\ttext_format LIKE '%|%:%:%|%'\n\t\tORDER BY\n\t\t\ti.local_graph_id;\");\n\n\t/* write header information */\n\tfwrite($xml_FH, \"<?xml version=\\\"1.0\\\" encoding=\\\"\" . $XMLEncoding . \"\\\" standalone=\\\"yes\\\"?\");\n\tfwrite($xml_FH, \">\\n\");\n\tfwrite($xml_FH, \"<cacti_biller>\\n\");\n\tfwrite($xml_FH, \" <global>\\n\");\n\tfwrite($xml_FH, \" <!-- Global Threshold tracking for reporting and notification of date/time of overage occurance -->\\n\");\n\tfwrite($xml_FH, \" <threshold>\\n\");\n\tfwrite($xml_FH, \" <enabled>no</enabled>\\n\");\n\tfwrite($xml_FH, \" <notification>no</notification>\\n\");\n\tfwrite($xml_FH, \" </threshold>\\n\");\n\tfwrite($xml_FH, \" <!-- Defaults are used when the same elements are not defined for a customer -->\\n\");\n\tfwrite($xml_FH, \" <defaults>\\n\");\n\tfwrite($xml_FH, \" <email html=\\\"\");\n\tif ($html == 1) {\n\t\tfwrite($xml_FH, \"yes\");\n\t}else{\n\t\tfwrite($xml_FH, \"no\");\n\t}\t\n\tfwrite($xml_FH, \"\\\" csv=\\\"\");\n\tif ($csv == 1) {\n\t\tfwrite($xml_FH, \"yes\");\n\t}else{\n\t\tfwrite($xml_FH, \"no\");\n\t}\t\n\tfwrite($xml_FH, \"\\\">\" . $email . \"</email>\\n\");\n\tfwrite($xml_FH, \" <rate unit=\\\"Mb\\\">0.00</rate><!-- Rate per Kb, Mb or Gb used for calculating billing amounts -->\\n\");\n\tfwrite($xml_FH, \" <billing_timeframe>\\n\");\n\tfwrite($xml_FH, \" <type>monthly</type><!-- Values: bi-monthly,monthly,weekly,daily -->\\n\");\n\tfwrite($xml_FH, \" <day>last</day><!-- Values: integer, dependant on type selected, last keyword selects last day of week(Saturday), month or year -->\\n\");\n\tfwrite($xml_FH, \" <every>1</every><!-- Values: integer, dependant on type selected, example: type=monthly, day=last, every=1\\n means billing will be processed every month on the last day. If every=2, then it would\\n be every 2 months on the last day. -->\\n\");\n\tfwrite($xml_FH, \" <start_date>\" . $start_date . \"</start_date><!-- Date to start billing on, format: YYYY-MM-DD -->\\n\");\n\tfwrite($xml_FH, \" </billing_timeframe>\\n\");\n\tfwrite($xml_FH, \" </defaults>\\n\");\n\tfwrite($xml_FH, \" </global>\\n\\n\");\n\n\t/* create customers */\n\tfwrite($xml_FH, \" <!-- This is the customer section. All graphs are considered seperate customers, if you care to \\n add multiple graphs to a single customer follow the examples-->\\n\");\n\tfwrite($xml_FH, \" <customers>\\n\");\n\tfwrite($xml_FH, \"<!-- Example customer syntax -->\\n\");\n\tfwrite($xml_FH, \"<!-- <customer> -->\\n\");\n\tfwrite($xml_FH, \"<!-- <description>Customer Description</description>--><!-- Customer Description, this will show on billing reports -->\\n\");\n\tfwrite($xml_FH, \"<!-- <rate unit=\\\"Mb\\\">0.01</rate>--><!-- Rate per Kb, Mb or Gb used for calculating billing amounts per customer -->\\n\");\n\tfwrite($xml_FH, \"<!-- <graphs> -->\\n\");\n\tfwrite($xml_FH, \"<!-- <graph> --><!-- Example of single graph item selection from a graph-->\\n\");\n\tfwrite($xml_FH, \"<!-- <id>1</id>--><!-- Graph Title: \\\"Customer Graph 1\\\" -->\\n\");\n\tfwrite($xml_FH, \"<!-- <rate unit=\\\"Mb\\\" type=\\\"committed\\\">0.01</rate>--><!-- Rate per Kb, Mb or Gb used for calculating billing amounts per customer\\n at committed rate -->\\n\");\n\tfwrite($xml_FH, \"<!-- <rate unit=\\\"Mb\\\" type=\\\"overage\\\" threshold=\\\"23947239\\\">0.02</rate>--><!-- Rate per Kb, Mb or Gb used for\\n calculating billing amounts per customer at overage rate, threshold parameter\\n determines what is considered overage. When overage is detected, overage rate is\\n calculated for amount above overage threshold-->\\n\");\n\tfwrite($xml_FH, \"<!-- <graph_item_id>3</graph_item_id>--><!-- Comment: \\\"95th Percentile: |95:bits:6:max:2| mbits\\\" -->\\n\");\n\tfwrite($xml_FH, \"<!-- </graph> -->\\n\");\n\tfwrite($xml_FH, \"<!-- <graph> --><!-- Example of all graph item selection from a graph-->\\n\");\n\tfwrite($xml_FH, \"<!-- <id>2</id>--><!-- Graph Title: \\\"Customer Graph 2\\\" -->\\n\");\n\tfwrite($xml_FH, \"<!-- </graph> -->\\n\");\n\tfwrite($xml_FH, \"<!-- </graphs> -->\\n\");\n\tfwrite($xml_FH, \"<!-- <email>root@localhost</email>-->\\n\");\n\tfwrite($xml_FH, \"<!-- <billing_timeframe>-->\\n\");\n\tfwrite($xml_FH, \"<!-- <type>monthly</type>--><!-- Values: bi-monthly,monthly,weekly,daily -->\\n\");\n\tfwrite($xml_FH, \"<!-- <day>last</day>--><!-- Values: integer, dependant on type selected, last keyword selects last day of week, month or year -->\\n\");\n\tfwrite($xml_FH, \"<!-- <every>1</every>--><!-- Values: integer, dependant on type selected, example: type=monthly, day=last, every=1\\n means billing will be processed every month on the last day. If every=2, then it would\\n be every 2 months on the last day. -->\\n\");\n\tfwrite($xml_FH, \"<!-- <start_date>2006-07-01</start_date>--><!-- Date to start billing on, format: YYYY-MM-DD -->\\n\");\n\tfwrite($xml_FH, \"<!-- </billing_timeframe>-->\\n\");\n\tfwrite($xml_FH, \"<!-- </customer>-->\\n\\n\");\n\n\n\t$local_graph_id_prev = 0;\n\t$item_type = \"N/A\";\n\t$match = array();\n\tif (sizeof($graph_items) > 0) {\n\n\t\tfwrite($xml_FH, \" <customer>\\n\");\n\t\tforeach ($graph_items as $graph_item) {\n\t\t\t\n\n\t\t\t$item_type = \"N/A\";\n\t\t\t$match = array();\n\t\t\tif (preg_match('/\\|sum\\:.*\\|/',$graph_item[\"text_format\"]) > 0) { \n\t\t\t\t$item_type = \"Bandwidth Summation\";\n\t\t\t} elseif (preg_match('/\\|([0-9]{1,2})\\:[\\:0-9a-z]+\\|/',$graph_item[\"text_format\"], $match) > 0) { \n\t\t\t\t$item_type = get_pretty_nth_value($match[1]);\n\t\t\t}\n\n\t\t\tif ($graph_item[\"local_graph_id\"] <> $local_graph_id_prev) {\t\n\t\t\t\tif ($local_graph_id_prev <> 0) {\n\t\t\t\t\tfwrite($xml_FH, \" </graph>\\n </graphs>\\n </customer>\\n\\n <customer>\\n\");\n\t\t\t\t}\n\t\t\t\tfwrite($xml_FH, \" <description>\" . xml_character_encode($graph_item[\"title_cache\"] . \" - \" . $graph_item[\"local_graph_id\"]) . \"</description><!-- Customer Description, this will show on billing reports -->\\n\");\n\t\t\t\tfwrite($xml_FH, \" <graphs>\\n\");\n\t\t\t\tfwrite($xml_FH, \" <graph>\\n\");\n\t\t\t\tfwrite($xml_FH, \" <id>\" . $graph_item[\"local_graph_id\"] . \"</id><!-- Graph Title: \\\"\" . $graph_item[\"title_cache\"] . \"\\\" -->\\n\");\n\n\t\t\t}\n\t\t\tfwrite($xml_FH, \" <graph_item_id>\" . $graph_item[\"item_id\"] . \"</graph_item_id><!-- Comment: \\\"\" . $graph_item[\"text_format\"] . \"\\\"-->\\n\"); \n\t\t\t$local_graph_id_prev = $graph_item[\"local_graph_id\"];\n\t\t}\n\t\tfwrite($xml_FH, \" </graph>\\n </graphs>\\n </customer>\\n\");\n\t}else{\n\t\tprint \"No billable graphs found\\n\";\n\t}\n\n\tfwrite($xml_FH, \" </customers>\\n\\n\");\n\n\t/* write footer information */\n\tfwrite($xml_FH, \"</cacti_biller>\\n\");\n\n\t/* close file */\n\tfclose($xml_FH);\n\n\tprint \"\\nConfiguration file written to: $file\\n\\n\";\n\n}", "protected function generateBrowserConfigXml()\n {\n $xml = '';\n $xml .= '<?xml version=\"1.0\" encoding=\"utf-8\"?>'.\"\\n\";\n $xml .= \"\".'<browserconfig>'.\"\\n\";\n $xml .= \"\\t\".'<msapplication>'.\"\\n\";\n $xml .= \"\\t\\t\".'<tile>'.\"\\n\";\n $xml .= \"\\t\\t\\t\".'<square70x70logo src=\"/favicon/mstile-70x70.png\" />'.\"\\n\";\n $xml .= \"\\t\\t\\t\".'<square144x144logo src=\"/favicon/mstile-144x144.png \"/>'.\"\\n\";\n $xml .= \"\\t\\t\\t\".'<square150x150logo src=\"/favicon/mstile-150x150.png\" />'.\"\\n\";\n $xml .= \"\\t\\t\\t\".'<square310x310logo src=\"/favicon/mstile-310x310.png\" />'.\"\\n\";\n $xml .= \"\\t\\t\\t\".'<wide310x150logo src=\"/favicon/mstile-310x150.png\" />'.\"\\n\";\n if ( $this->appThemeColor !== '' ){\n $xml .= \"\\t\\t\\t\".'<TileColor>'.$this->appThemeColor.'</TileColor>'.\"\\n\";\n }\n $xml .= \"\\t\\t\".'</tile>'.\"\\n\";\n $xml .= \"\\t\".'</msapplication>'.\"\\n\";\n $xml .= '</browserconfig>'.\"\\n\";\n \n $xmlFilePath = $this->cleanPath($this->destPath.'favicon/browserconfig.xml');\n \n $this->infoBuffer[] = $xmlFilePath;\n \n try {\n $this->writeFile($xmlFilePath, $xml);\n }\n catch(\\Exception $e){\n throw new GeneratorException('Failed writing browserconfig.xml ('.$e->getMessage().')');\n }\n }", "protected function setPackageConfigurationFile()\n {\n $config = __DIR__ . '/Config/recaptcha.php';\n $path = config_path('recaptcha.php');\n \n $this->publishes([$config => $path], 'config'); \n $this->mergeConfigFrom( $config, 'recaptcha');\n }", "public function makeConfigFile()\n\t{\n\t\t// Make sure we are called by an expected caller\n\t\tServerTechnology::checkCaller($this->allowedCallersForMake);\n\n\t\tJLoader::import('joomla.utilities.date');\n\t\t\n\t\t$date = new Date();\n\t\t$tz = new DateTimeZone($this->container->platform->getUser()->getParam('timezone', $this->container->platform->getConfig()->get('offset', 'UTC')));\n\t\t$date->setTimezone($tz);\n\t\t$d = $date->format('Y-m-d H:i:s T', true);\n\t\t$version = ADMINTOOLS_VERSION;\n\n\t\t$webConfig = <<< XML\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\tSecurity Enhanced & Highly Optimized .web.config File for Joomla!\n\tautomatically generated by Admin Tools $version on $d\n\n\tAdmin Tools is Free Software, distributed under the terms of the GNU\n\tGeneral Public License version 3 or, at your option, any later version\n\tpublished by the Free Software Foundation.\n\n\t!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t!! !!\n\t!! If you get an Internal Server Error 500 or a blank page when trying !!\n\t!! to access your site, remove this file and try tweaking its settings !!\n\t!! in the back-end of the Admin Tools component. !!\n\t!! !!\n\t!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n-->\n<configuration>\n\t<system.webServer>\n\nXML;\n\n\t\t$config = $this->loadConfiguration();\n\n\t\tif ($config->fileorder == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t<!-- File execution order -->\n\t\t<defaultDocument enabled=\"true\">\n\t\t\t<files>\n\t\t\t\t<clear />\n\t\t\t\t<add value=\"index.php\" />\n\t\t\t\t<add value=\"index.html\" />\n\t\t\t\t<add value=\"index.htm\" />\n\t\t\t</files>\n\t\t</defaultDocument>\n\nXML;\n\t\t}\n\n\t\tif ($config->nodirlists == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t<!-- No directory listings -->\n\t\t<directoryBrowse enabled=\"false\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->exptime == 1)\n\t\t{\n\t\t\t$setEtag = ($config->etagtype == 'none') ? 'setEtag=\"false\"' : '';\n\t\t\t$eTagInfo = ($config->etagtype == 'none') ? '// Send ETag: false (IIS only supports true/false for ETags)' : '';\n\n\t\t\t$webConfig .= <<< XML\n\t\t<!-- Optimal default expiration time $eTagInfo -->\n\t\t<staticContent>\n\t\t\t<clientCache cacheControlMode=\"UseMaxAge\" cacheControlMaxAge=\"01:00:00\" $setEtag />\n\t\t</staticContent>\n\nXML;\n\t\t}\n\n\t\tif ($config->autocompress == 1)\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t<urlCompression doStaticCompression=\"false\" doDynamicCompression=\"true\" />\n\t\t<httpCompression>\n\t\t\t<dynamicTypes>\n\t\t\t\t<clear />\n\t\t\t\t<add mimeType=\"text/*\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"message/*\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"application/xml\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"application/xhtml+xml\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"application/rss+xml\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"application/javascript\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"application/x-javascript\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"image/svg+xml\" enabled=\"true\" />\n\t\t\t\t<add mimeType=\"*/*\" enabled=\"false\" />\n\t\t\t</dynamicTypes>\n\t\t</httpCompression>\n\nXML;\n\t\t}\n\n\n\t\t$webConfig .= <<< XML\n\t\t<rewrite>\n\t\t\t<rules>\n\t\t\t\t<clear />\n\nXML;\n\n\t\tif (!empty($config->hoggeragents) && ($config->nohoggers == 1))\n\t\t{\n\t\t\t$conditions = '';\n\t\t\t$patternCache = array();\n\n\t\t\tforeach ($config->hoggeragents as $agent)\n\t\t\t{\n\t\t\t\t$patternCache[] = $agent;\n\n\t\t\t\tif (count($agent) < 10)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$newPattern = implode('|', $patternCache);\n\t\t\t\t$conditions .= <<< XML\n<add input=\"{HTTP_USER_AGENT}\" pattern=\"$newPattern\" />\n\nXML;\n\t\t\t\t$patternCache = array();\n\t\t\t}\n\n\t\t\tif (count($patternCache))\n\t\t\t{\n\t\t\t\t$newPattern = implode('|', $patternCache);\n\t\t\t\t$conditions .= <<< XML\n\t\t\t\t\t\t<add input=\"{HTTP_USER_AGENT}\" pattern=\"$newPattern\" />\n\nXML;\n\t\t\t}\n\n\t\t\t$webConfig .= <<< XML\n\t\t\t\t<rule name=\"Common hacking tools and bandwidth hoggers block\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\".*\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAny\" trackAllCaptures=\"false\">\n$conditions\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden: Access is denied.\" statusDescription=\"You do not have permission to view this directory or page using the credentials that you supplied.\" />\n\t\t\t\t</rule>\n\nXML;\n\t\t}\n\n\t\tif ($config->autoroot)\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t\t\t<rule name=\"Redirect index.php to /\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^index\\.php$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\">\n\t\t\t\t\t\t<add input=\"{THE_REQUEST}\" pattern=\"^POST\" ignoreCase=\"false\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{THE_REQUEST}\" pattern=\"^[A-Z]{3,9}\\ /index\\.php\\ HTTP/\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{HTTPS}>s\" pattern=\"^(1>(s)|0>s)$\" ignoreCase=\"false\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Redirect\" url=\"http{C:2}://{HTTP_HOST}:{SERVER_PORT }/\" redirectType=\"Permanent\" />\n\t\t\t\t</rule>\n\nXML;\n\t\t}\n\n\t\tswitch ($config->wwwredir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t// If I have a rewriteBase condition, I have to append it here\n\t\t\t\t$subfolder = trim($config->rewritebase, '/') ? trim($config->rewritebase, '/').'/' : '';\n\n\t\t\t\t// non-www to www\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Redirect non-www to www\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^(.*)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\">\n\t\t\t\t\t\t<add input=\"{HTTP_HOST}\" pattern=\"^www\\.\" negate=\"true\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Redirect\" url=\"http://www.{HTTP_HOST}/$subfolder{R:1}\" redirectType=\"Found\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t// www to non-www\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Redirect www to non-www\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^(.*)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\">\n\t\t\t\t\t\t<add input=\"{HTTP_HOST}\" pattern=\"^www\\.(.+)$\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Redirect\" url=\"http://{C:1}/{R:1}\" redirectType=\"Found\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($config->olddomain))\n\t\t{\n\t\t\t$domains = trim($config->olddomain);\n\t\t\t$domains = explode(',', $domains);\n\t\t\t$newdomain = $config->httphost;\n\n\t\t\tforeach ($domains as $olddomain)\n\t\t\t{\n\t\t\t\t$olddomain = trim($olddomain);\n\t\t\t\t$originalOldDomain = $olddomain;\n\n\t\t\t\tif (empty($olddomain))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$olddomain = $this->escape_string_for_regex($olddomain);\n\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Redirect old to new domain ($originalOldDomain)\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"(.*)\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\">\n\t\t\t\t\t\t<add input=\"{HTTP_HOST}\" pattern=\"^$olddomain\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Redirect\" url=\"http://$newdomain/{R:1}\" redirectType=\"Found\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->httpsurls))\n\t\t{\n\t\t\t$webConfig .= \"<!-- Force HTTPS for certain pages -->\\n\";\n\t\t\tforeach ($config->httpsurls as $url)\n\t\t\t{\n\t\t\t\t$urlesc = '^' . $this->escape_string_for_regex($url) . '$';\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Force HTTPS for $url\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^$urlesc$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAny\">\n\t\t\t\t\t\t<add input=\"{HTTPS}\" pattern=\"0\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Redirect\" url=\"https://{$config->httpshost}/$url\" redirectType=\"Found\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Block out some common exploits\">\n\t\t\t\t\t<match url=\".*\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAny\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"proc/self/environ\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"base64_(en|de)code\\(.*\\)\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"(&lt;|%3C).*script.*(>|%3E)\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\" ignoreCase=\"false\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" url=\"index.php\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\n\t\tif ($config->fileinj == 1)\n\t\t{\n\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"File injection protection\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\".*\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAny\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"[a-zA-Z0-9_]=http://\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"[a-zA-Z0-9_]=(\\.\\.//?)+\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"[a-zA-Z0-9_]=/([a-z0-9_.]//?)+\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t}\n\n\t\t$webConfig .= \" <!-- Advanced server protection rules exceptions -->\\n\";\n\n\t\tif (!empty($config->exceptionfiles))\n\t\t{\n\t\t\t$ruleCounter = 0;\n\n\t\t\tforeach ($config->exceptionfiles as $file)\n\t\t\t{\n\t\t\t\t$ruleCounter++;\n\t\t\t\t$file = '^' . $this->escape_string_for_regex($file) . '$';\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Advanced server protection rules exception #$ruleCounter\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"$file\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->exceptiondirs))\n\t\t{\n\t\t\t$ruleCounter = 0;\n\n\t\t\tforeach ($config->exceptiondirs as $dir)\n\t\t\t{\n\t\t\t\t$ruleCounter++;\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Allow access to folders except .php files #$ruleCounter\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^$dir/\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" pattern=\"(\\.php)$\" ignoreCase=\"false\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($config->fullaccessdirs))\n\t\t{\n\t\t\t$ruleCounter = 0;\n\n\t\t\tforeach ($config->fullaccessdirs as $dir)\n\t\t\t{\n\t\t\t\t$ruleCounter++;\n\t\t\t\t$dir = trim($dir, '/');\n\t\t\t\t$dir = $this->escape_string_for_regex($dir);\n\t\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Allow access to folders, including .php files #$ruleCounter\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^$dir/\" ignoreCase=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t\t}\n\t\t}\n\n\t\tif ($config->phpeaster == 1)\n\t\t{\n\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"PHP Easter Egg protection\">\n\t\t\t\t\t<match url=\".*\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"\\=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t}\n\n\t\tif ($config->backendprot == 1)\n\t\t{\n\t\t\t$bedirs = implode('|', $config->bepexdirs);\n\t\t\t$betypes = implode('|', $config->bepextypes);\n\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Back-end protection - allow administrator login\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^administrator/?$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Back-end protection - allow administrator login, alternate\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^administrator/index\\.(php|html?)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Back-end protection - allow access to static media files\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^administrator/($bedirs)/.*\\.($betypes)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Back-end protection - Catch all\">\n\t\t\t\t\t<match url=\"^administrator/\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t}\n\n\t\tif ($config->frontendprot == 1)\n\t\t{\n\t\t\t$fedirs = implode('|', $config->fepexdirs);\n\t\t\t$fetypes = implode('|', $config->fepextypes);\n\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Front-end protection - allow access to static media files\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^($fedirs)/.*\\.($fetypes)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Front-end protection - Do not block includes/js\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^includes/js/\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"None\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Front-end protection - Block access to certain folders\">\n\t\t\t\t\t<match url=\"^($fedirs)/\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Front-end protection - Block access to certain folders, part 2\">\n\t\t\t\t\t<match url=\"^(cache|includes|language|logs|log|tmp)/\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Front-end protection - Forbid access to leftover Joomla! files\">\n\t\t\t\t\t<match url=\"^(configuration\\.php|CONTRIBUTING\\.md|htaccess\\.txt|joomla\\.xml|LICENSE\\.txt|phpunit\\.xml|README\\.txt|web\\.config\\.txt)\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Front-end protection - Block access to all PHP files except index.php\">\n\t\t\t\t\t<match url=\"(.*\\.php)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" pattern=\"(\\.php)$\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" pattern=\"(/index?\\.php)$\" ignoreCase=\"false\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t}\n\n\t\tif ($config->leftovers == 1)\n\t\t{\n\t\t\t$webConfig .= <<<END\n\t\t\t\t<rule name=\"Front-end protection - Block access to common server configuration files\">\n\t\t\t\t\t<match url=\"^(htaccess\\.txt|configuration\\.php-dist|php\\.ini|.user\\.ini|web\\.config|web\\.config\\.txt)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\" />\n\t\t\t\t\t<action type=\"CustomResponse\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\nEND;\n\t\t}\n\n\t\t$webConfig .= <<< XML\n\t\t\t\t<rule name=\"Joomla! SEF Rule 1\" stopProcessing=\"true\">\n\t\t\t\t\t<match url=\"^(.*)$\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAny\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"base64_encode[^(]*\\([^)]*\\)\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"(>|%3C)([^s]*s)+cript.*(&lt;|%3E)\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})\" ignoreCase=\"false\" />\n\t\t\t\t\t\t<add input=\"{QUERY_STRING}\" pattern=\"_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})\" ignoreCase=\"false\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"CustomResponse\" url=\"index.php\" statusCode=\"403\" statusReason=\"Forbidden\" statusDescription=\"Forbidden\" />\n\t\t\t\t</rule>\n\t\t\t\t<rule name=\"Joomla! SEF Rule 2\">\n\t\t\t\t\t<match url=\"(.*)\" ignoreCase=\"false\" />\n\t\t\t\t\t<conditions logicalGrouping=\"MatchAll\" trackAllCaptures=\"false\">\n\t\t\t\t\t\t<add input=\"{URL}\" pattern=\"^/index.php\" ignoreCase=\"true\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" ignoreCase=\"false\" negate=\"true\" />\n\t\t\t\t\t\t<add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" ignoreCase=\"false\" negate=\"true\" />\n\t\t\t\t\t</conditions>\n\t\t\t\t\t<action type=\"Rewrite\" url=\"index.php\" />\n\t\t\t\t</rule>\n\n\t\t\t</rules>\n\nXML;\n\n\t\tif ($config->noserversignature == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t<!-- Remove IIS version signature -->\n\t\t<outboundRules>\n\t\t <rule name=\"Remove RESPONSE_Server\">\n\t\t\t<match serverVariable=\"RESPONSE_Server\" pattern=\".+\" />\n\t\t\t<action type=\"Rewrite\" value=\"MYOB\" />\n\t\t </rule>\n\t\t</outboundRules>\n\nXML;\n\t\t}\n\n\t\t$webConfig .= <<< XML\n\t\t</rewrite>\n\t\t<httpProtocol>\n\t\t\t<customHeaders>\n\nXML;\n\n\t\tif ($config->clickjacking == 1)\n\t\t{\n\t\t\t$webConfig .= <<< ENDCONF\n\t\t\t\t<!-- Protect against clickjacking / Forbid displaying in FRAME -->\n\t\t\t\t<add name=\"X-Frame-Options\" value=\"SAMEORIGIN\" />\n\nENDCONF;\n\t\t}\n\n\t\tif ($config->reducemimetyperisks == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t\t\t<!-- Reduce MIME type security risks -->\n\t\t\t\t<add name=\"X-Content-Type-Options\" value=\"nosniff\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->reflectedxss == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t\t\t<!-- Reflected XSS prevention -->\n\t\t\t\t<add name=\"X-XSS-Protection\" value=\"1; mode=block\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->noserversignature == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t\t\t<!-- Remove IIS and PHP version signature -->\n\t\t\t\t<remove name=\"X-Powered-By\" />\n\t\t\t\t<add name=\"X-Powered-By\" value=\"MYOB\" />\n\nXML;\n\n\t\t}\n\n\t\tif ($config->notransform == 1)\n\t\t{\n\t\t\t$webConfig .= <<< XML\n\t\t\t\t<!-- Prevent content transformation -->\n\t\t\t\t<add name=\"Cache-Control\" value=\"no-transform\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->hstsheader == 1)\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t\t\t<!-- HSTS Header - See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security -->\n\t\t\t\t<add name=\"Strict-Transport-Security\" value=\"max-age=31536000\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->cors == 1)\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t\t\t<!-- Cross-Origin Resource Sharing (CORS) - See http://enable-cors.org/ -->\n\t\t\t\t<add name=\"Access-Control-Allow-Origin\" value=\"*\" />\n\t\t\t\t<add name=\"Timing-Allow-Origin\" value=\"*\" />\n\nXML;\n\t\t}\n\n\t\tif ($config->referrerpolicy !== '-1')\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t\t\t<!-- Referrer-policy -->\n\t\t\t\t<add name=\"Referrer-Policy\" value=\"{$config->referrerpolicy}\" />\n\nXML;\n\t\t}\n\n\t\t$webConfig .= <<< XML\n\t\t\t</customHeaders>\n\t\t</httpProtocol>\n\nXML;\n\n\t\tif ($config->notracetrack == 1)\n\t\t{\n\t\t\t$webConfig .= <<<XML\n\t\t<!-- Disable HTTP methods TRACE and TRACK (protect against XST) -->\n\t\t<security>\n\t\t\t<requestFiltering>\n\t\t\t\t<verbs>\n\t\t\t\t\t<add verb=\"TRACE\" allowed=\"false\" />\n\t\t\t\t\t<add verb=\"TRACK\" allowed=\"false\" />\n\t\t\t\t</verbs>\n\t\t\t</requestFiltering>\n\t\t</security>\n\nXML;\n\t\t}\n\n\t\t$webConfig .= <<< XML\n\t</system.webServer>\n</configuration>\n\nXML;\n\n\t\treturn $webConfig;\n\t}", "private function getConfig() {\r\n\t\techo '<reply action=\"ok\">';\r\n\t\techo $this->data->asXML();\r\n\t\techo '</reply>';\r\n\t}", "public function generate()\n {\n $this->document = new \\DOMDocument('1.0', 'utf-8');\n $this->document->formatOutput = true;\n\n $rootEl = $this->document->createElementNS($this->nsUrl, 'gupdate');\n $rootEl->setAttribute('protocol', '2.0');\n $this->document->appendChild($rootEl);\n\n $appId = $this->idGenerator->getAppId();\n $appEl = $this->document->createElementNS($this->nsUrl, 'app');\n $appEl->setAttribute('appid', $appId);\n $rootEl->appendChild($appEl);\n\n $updateCheckEl = $this->document->createElementNS($this->nsUrl, 'updatecheck');\n $updateCheckEl->setAttribute('codebase', $this->packageUrl);\n $updateCheckEl->setAttribute('version', $this->package->getPackageVersion());\n $appEl->appendChild($updateCheckEl);\n }", "function writeInstall() \n {\n $file = new CodeGen_Tools_Outbuf($this->dirpath.\"/INSTALL\");\n\n $title = $this->archivePrefix.\"-\".$this->name.\" \".$this->release->getVersion();\n\n echo \"$title\\n\";\n echo str_repeat(\"=\", strlen($title)).\"\\n\";\n\n echo \"\\n== Configuration ==\\n\\n\";\n\n if ($this->needSource) {\n?>\nThis user defined function module relies on information only \navailable in the MySQL source code, it can't be compiled if\nyou've only installed MySQL binary packages.\n\nTo compile this package you need to first tell configure \nwhere to find the MySQL source directory you want to compile\nagainst using the --with-mysql-src configure option, e.g:\n\n configure --with-mysql-src=/home/username/src/mysql-5.0.37\n\n<?php\n } else {\n?>\nYou can configure this package as usual, in the simplest case\nyou just need to invoke \n\n configure \n\nwithout options. This requires that the \"mysql_config\" binary \nof the server installation you want to compile this UDF module\nfor is in your environments $PATH\n\nYou may specify an explicit mysql installation to compile \nagainst by using the\n\n --with-mysql=...\n\noption, this option expects either the path of this installations\n\"mysql_config\" binary or the installations base dir (assuming\nthat \"mysql_config\" is in the \"$prefix/bin\" directory) as argument.\n\nSo any of the following may be used to configure the package\nagainst a server installed in a \"/usr/local/mysql\" prefix \n(the default if you compiled mysql yourself or used one of the\ntar.gz distribution packages provided by mysql.com):\n\n configure --with-mysql=/usr/local/mysql\n\n configure --with-mysql=/usr/local/mysql/bin/mysql_config\n\n<?php\n }\n?>\n\nFor a full list of configure options see \n\n configure --help\n\nBy default the UDF library created by this package will install\ninto /usr/local/lib. The mysql server may not be able to load\nit from there though as this directory may not be in its\nlibrary search path. \n\nYou may solve this by:\n\n - adding /usr/local/lib to the LD_LIBRARY_PATH before\n invoking the mysql server\n\n - changing the UDF install prefix by using either the\n --prefix or --libdir configure option so that the\n UDF library gets installed into a directory that is\n in the servers load path\n\n - or both of the above\n\n== Compilation ==\n\nOnce you have successfully configured the package \nyou should be able to compile it by simply typing\n\n make\n \n== Testing ==\n\nThis package includes test cases that can be invoked using\n \n mysql test\n\nThis relies on the following mysql binaries being available\nin your environments search $PATH to function as the tests\nrely on the mysql server test framework:\n\n * mysql - the mysql command line client\n * mysqld - the mysql server\n * mysqladmin - the mysql administration command line tool\n * mysql_install_db - the database server initialisation tool\n * mysqltest - the actual test framework tool\n\n== Installing the library ==\n\nTo install the generated UDF library you simply need to invoke\n\n make install\n\nDepending on the target directories user permissions you might\nneed to do this as superuser though, eg. by using \"sudo\":\n\n sudo make install\n\nRemember that the mysql server will only be able to load the\nlibrary if it is installed in a directory in its library load\npath, you may modify this search path by invoking the server\nwith the $LD_LIBRARY_PATH environment variable set appropriately\nbefore starting.\n\n== Installing the actual functions ==\n\nTo actually enable the functions provided by this UDF module\nyou need to make them known to the MySQL server using \n\"CREATE FUNCTION\" SQL commands:\n\n<?php\n echo \"Register the functions provided by this UDF module using\\n\";\n foreach ($this->functions as $function) {\n echo $function->createStatement($this).\"\\n\";\n }\n echo \"\\n\"; \n echo \"Unregister the functions provided by this UDF module using\\n\"; \n foreach ($this->functions as $function) {\n echo $function->dropStatement($this).\"\\n\";\n }\n?>\n\n== Changing the source ==\n\nChanges applied to any of the files in this project may be \noverwritten by further invocations of the udf-gen tool so\nyou should always try to apply all necessary changes to the\nXML specification file the project was generated from instead\nand then regenerate the project from the spec file instead.\n\nThe udf-gen tool will only overwrite files that actually \nchanged, so preserving file system time stamps of unmodified\nfiles, to play nice with \"make\" and to avoid unnecessary\nrecompilation of source files.\n\n<?php\n\n $file->write();\n }", "public function regenerateConfig($newversion=Null,$newupdaterVersion=Null,$newbuildDate=Null) {\n\t\tif(!file_exists('protected/config/X2Config.php')) {\n\t\t\t// App is using old config file. New one will be generated.\n\t\t\tinclude('protected/config/emailConfig.php');\n\t\t\tinclude('protected/config/dbConfig.php');\n\t\t} else {\n\t\t\tinclude('protected/config/X2Config.php');\n\t\t}\n\t\t\n\t\tif (!isset($appName)) {\n\t\t\tif(!empty(Yii::app()->name))\n\t\t\t\t$appName = Yii::app()->name;\n\t\t\telse\n\t\t\t\t$appName = \"X2EngineCRM\";\n\t\t}\n\t\tif (!isset($email)) {\n\t\t\tif(!empty(Yii::app()->params->admin->emailFromAddr))\n\t\t\t\t$email = Yii::app()->params->admin->emailFromAddr;\n\t\t\telse\n\t\t\t\t$email = 'contact@'.$_SERVER['SERVER_NAME'];\n\t\t}\n\t\tif (!isset($language)) {\n\t\t\tif(!empty(Yii::app()->language))\n\t\t\t\t$language = Yii::app()->language;\n\t\t\telse\n\t\t\t\t$language = 'en';\n\t\t}\n\t\t\n\t\t$config = \"<?php\\n\";\n\t\tif (!isset($buildDate))\n\t\t\t$buildDate = time();\n\t\tif (!isset($updaterVersion))\n\t\t\t$updaterVersion = '';\n\n\t\tforeach(array('version','updaterVersion','buildDate') as $var)\n\t\t\tif(!empty(${'new'.$var}))\n\t\t\t\t${$var} = ${'new'.$var};\n\t\t\n\t\tforeach (array('appName', 'email', 'language', 'host', 'user', 'pass', 'dbname', 'version', 'updaterVersion') as $var)\n\t\t\t$config .= \"\\$$var='\" . ${$var} . \"';\\n\";\n\t\t$config .= \"\\$buildDate = $buildDate;\\n\";\n\t\tfile_put_contents('protected/config/X2Config.php', $config);\n\t}", "function create_temp_xml($file_path, $protection_options){\n $path_info = pathinfo($file_path);\n $dir_name = realpath($path_info[\"dirname\"]);\n\n $xml = new SimpleXMLElement(\"<project></project>\");\n\n $xml->addAttribute(\"outputDir\", $dir_name . \"\\obfuscated\");\n $xml->addAttribute(\"baseDir\", $dir_name);\n $xml->addAttribute(\"xmlns\", \"http://confuser.codeplex.com\"); // <- i dont think thats needed\n\n $rules = $xml->addChild(\"rule\");\n $rules->addAttribute(\"pattern\", \"true\");\n $rules->addAttribute(\"inherit\", \"false\");\n\n foreach ($protection_options as &$opt) {\n $protections = $rules->addChild(\"protection\");\n $protections->addAttribute(\"id\", $opt);\n }\n\n $mdl = $xml->addChild(\"module\");\n $mdl->addAttribute(\"path\", $path_info[\"basename\"]);\n\n $xml_output_path = \"projects/\" . uniqid() . \".crproj\";\n\n $output = fopen($xml_output_path, \"w\");\n fwrite($output, explode(\"\\n\", $xml->asXML(), 2)[1]);\n fclose($output);\n\n return realpath($xml_output_path);\n}", "public static function createInstallToolEnableFile() {}", "function createBasepathXML() {\n\t\n $file_modified_time = date('Y-m-d',mktime());\n\t\n\t$xml = \"<url>\";\n $xml .= \" <loc>\".SITE_PATH.\"</loc>\";\n $xml .= \" <lastmod>$file_modified_time</lastmod>\";\n $xml .= \" <changefreq>monthly</changefreq>\";\n $xml .= \" <priority>1.0</priority>\";\n\t$xml .= \"</url>\";\n\t\n\treturn $xml;\n\t\n }", "public function createConfig()\n\t{\n\t}", "function generateConfig($nodes, $enable_rpc = true) {\n $output[] = \"<NodeConfig>\";\n $output[] = \" <BrunetNamespace>\".$this->pool->namespace.\"</BrunetNamespace>\";\n $output[] = \" <RemoteTAs>\";\n if($this->pool->tcpport) {\n foreach($nodes as $node) {\n $output[] = \" <Transport>brunet.tcp://\".$node.\":\".$this->pool->tcpport.\"</Transport>\";\n }\n }\n if($this->pool->udpport) {\n foreach($nodes as $node) {\n $output[] = \" <Transport>brunet.udp://\".$node.\":\".$this->pool->udpport.\"</Transport>\";\n }\n }\n $output[] = \" </RemoteTAs>\";\n $output[] = \" <EdgeListeners>\";\n if($this->pool->udpport) {\n $output[] = \" <EdgeListener type=\\\"udp\\\">\";\n $output[] = \" <port>\".$this->pool->udpport.\"</port>\";\n $output[] = \" </EdgeListener>\";\n }\n if($this->pool->tcpport) {\n $output[] = \" <EdgeListener type=\\\"tcp\\\">\";\n $output[] = \" <port>\".$this->pool->tcpport.\"</port>\";\n $output[] = \" </EdgeListener>\";\n }\n $output[] = \" </EdgeListeners>\";\n if($enable_rpc) {\n $output[] = \" <XmlRpcManager>\";\n $output[] = \" <Enabled>true</Enabled>\";\n $output[] = \" <Port>\".$this->pool->rpcport.\"</Port>\";\n $output[] = \" </XmlRpcManager>\";\n }\n\n $output[] = \" <NCService>\";\n $output[] = \" <Enabled>true</Enabled>\";\n $output[] = \" <OptimizeShortcuts>true</OptimizeShortcuts>\";\n $output[] = \" <Checkpointing>true</Checkpointing>\";\n $output[] = \" </NCService>\";\n\n $output[] = \"</NodeConfig>\";\n return implode(\"\\n\", $output);\n }", "function creat_conf_for_offline($project){\n $str = 'workingDir='.$project->outputPython.\"\\r\\n\";\n $str = $str.'git='.$project->userProjectRoot.\"\\\\\".$project->gitName.\"\\r\\n\";\n $str = $str.'issue_tracker_product_name='.$project->issue_tracker_product_name.\"\\r\\n\";\n $str = $str.'issue_tracker_url='.$project->issue_tracker_url.\"\\r\\n\";\n $str = $str.'issue_tracker='.$project->issue_tracker.\"\\r\\n\";\n $str = $str.\"vers=(\". $project->all_versions.\")\";\n file_put_contents($project->learnDir.\"\\\\antConf.txt\",$str); \n\t}", "public function build()\n {\n return $this->generateXml();\n }", "private function createAppXmlFile()\n {\n $appName = self::APP_NAME;\n $appXmlFileContents = <<<EOD\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\">\n <Application>$appName</Application>\n <TotalTime>0</TotalTime>\n</Properties>\nEOD;\n\n $this->createFileWithContents($this->docPropsFolder, self::APP_XML_FILE_NAME, $appXmlFileContents);\n\n return $this;\n }", "static function install_config($conn,$url,&$file_data)\n\t{\n\t\t$config = CmsConfig::get_instance();\n\t\t$config_data = $config->params;\n\t\t//Update the defaults with what we have. Start with database\n\t\t$drivers = CmsInstallOperations::get_loaded_database_modules();\n\t\t$config_data['dbms'] = $drivers[$conn['driver']];\n\t\t$config_data['db_username'] = $conn['username'];\n\t\t$config_data['db_hostname'] = $conn['hostname'];\n\t\t$config_data['db_password'] = $conn['password'];\n\t\t$config_data['db_name'] = $conn['dbname'];\n\t\t$config_data['db_prefix'] = $conn['table_prefix'];\n\t\t//Now location stuff\n\t\t$config_data['root_path'] = $url['rootpath'];\n\t\t$config_data['root_url'] = $url['rooturl'];\n\t\t$config_data[\"previews_path\"] = $config_data[\"root_path\"] . \"/tmp/cache\";\n\t\t$config_data[\"uploads_path\"] = $config_data[\"root_path\"] . \"/uploads\";\n\t\t$config_data[\"uploads_url\"] = $config_data[\"root_url\"] . \"/uploads\";\n\t\t$config[\"image_uploads_path\"] = $config_data[\"root_path\"] . \"/uploads/images\";\n\t\t$config[\"image_uploads_url\"] = $config_data[\"root_url\"] . \"/uploads/images\";\n\t\t//Generate the file\n\t\t$file_data = \"<?php\\n\";\n\t\t$file_data .= $config->config_text($config_data);\n\t\t$file_data .= \"\\n?>\";\n\t\t//Write the file\n\t\treturn @file_put_contents(CONFIG_FILE_LOCATION,$file_data) > 0;\n\t}", "protected function configure()\n {\n $this->addOption(\n 'v|version', '-s',\n 'The version of the template that is to be installed; optional if '\n .'project is installed with PEAR'\n );\n }", "public function install(){\n\n\t\t$model = Advertikon::getCurrentModel();\n\n\t\ttry {\n\t\t\t$this->_checkCompatibility();\n\t\t}\n\t\tcatch( Exception\\Transport $e ) {\n\t\t\t$this->errorPage( $e->getData() , 424 , 'Failed Dependency' );\n\t\t}\n\n\t\t$this->_install();\n\n\t\t$config = Advertikon::getXmlConfig();\n\t\t$settingsModel = Advertikon::getExtendedModel( 'setting_setting' );\n\t\t$settings = $model->stripPrefix( $settingsModel->getSetting() );\n\t\t$model->merge( $settings , $config->getValues( '/' ) );\n\t\t$settingsModel->editSetting( $settings );\n\n\t\t//mark the extension as installed\n\t\tAdvertikon::getExtendedModel( 'setting_setting' )->setSettingValue( 'installed' , 1 );\n\t}", "private function loadModuleXml() \n\t{\n\n\t\t// load in config.xml to simplexml parser\n\t\tparent::$base_xml = simplexml_load_file(parent::$app_etc_module_path);\n\n\t}", "private function readXML() {\n $xmlFile = __DIR__ .\"\\configuracion.xml\";\n if (file_exists($xmlFile)) {\n $xml = simplexml_load_file($xmlFile);\n } else {\n exit('Fallo al abrier el archivo configuraciones.xml');\n }\n $this->host = $xml->mysql[0]->host;\n $this->database = $xml->mysql[0]->database;\n $this->user = $xml->mysql[0]->user;\n $this->password = $xml->mysql[0]->password;\n }", "private function getXmlFile() {\n if (!$this->xmlFileCreated) {\n $this->createXmlDataFile();\n }\n return DOKU_INC . $this->command->getConf(\"processingXmlFile\");\n }", "function procMenuAdminMakeXmlFile()\n\t{\n\t\t// Check input value\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t// Get information of the menu\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menu_info = $oMenuAdminModel->getMenu($menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Re-generate the xml file\n\t\t$xml_file = $this->makeXmlFile($menu_srl);\n\t\t// Set return value\n\t\t$this->add('menu_title',$menu_title);\n\t\t$this->add('xml_file',$xml_file);\n\t}", "public function get_configuration_object() {\n $config = new \\suite6\\Tackler\\TacklerConfiguration();\n\n $xmlReader = new \\XMLReader();\n $xmlReader->XML($this->xml);\n \n //get xml version information\n// $xml_ver=null;\n// preg_match_all('/version=(\"|\\')(?P<version>.+?)(\"|\\')/', $this->xml, $xml_info);\n// if(isset($xml_info['version'])) $xml_ver = $xml_info['version'][0];\n \n while ($xmlReader->read()) {\n if ($xmlReader->nodeType == \\XMLREADER::ELEMENT) {\n switch ($xmlReader->name) {\n case 'meta':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $lib_ver=null;\n $schema_ver=null;\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT) {\n if ($xmlNodeReader->name == 'LibraryVersion') {\n $lib_ver = $xmlNodeReader->readString();\n }\n if ($xmlNodeReader->name == 'SchemaVersion') {\n $schema_ver = $xmlNodeReader->readString();\n }\n }\n }\n //if the Schema version is more recent than the \n //Library's default schema value\n if(version_compare($schema_ver, $config->get_schema_version())==1){\n throw new \\Exception('Tackler: Provided Schema version '. $schema_ver .' is newer than the library\\'s supported version '. $config->get_schema_version());\n }\n unset($xmlNodeReader);\n }\n break;\n case 'DefaultPolicy':\n $config->set_default_policy($xmlReader->readString());\n break;\n case 'DefaultDirectoryListingPolicy':\n $config->set_default_directory_listing_policy($xmlReader->readString());\n break;\n case 'SymbolicLink':\n $config->set_sym_link($xmlReader->readString());\n break;\n case 'DefaultDirectoryHandler':\n $config->set_default_directory_handler($xmlReader->readString());\n break;\n case 'Default404Handler':\n $config->set_default_404_handler($xmlReader->readString());\n break;\n case 'Default403Handler':\n $config->set_default_403_handler($xmlReader->readString());\n break;\n case 'TimeToExpiration':\n $config->set_time_to_expiration($xmlReader->readString());\n break;\n case 'CachePHPScript':\n if ($xmlReader->readString() !== '')\n $config->set_cache_php_script($xmlReader->readString());\n break;\n case 'BannedIps':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'IP') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_banned_ips($list);\n }\n break;\n case 'DeniedFile':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'File') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_denied_files($list);\n }\n break;\n case 'AllowedFile':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'File') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_allowed_files($list);\n }\n break;\n case 'DeniedDirectory':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'Directory') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_denied_directories($list);\n }\n break;\n case 'AllowedDirectory':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'Directory') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_allowed_directories($list);\n }\n break;\n case 'InternalRedirect':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Redirect') {\n $xmlRedirectNodeReader = new \\XMLReader();\n $xmlRedirectNodeReader->XML($xmlNodeReader->readOuterXml());\n $pattern = null;\n $action = null;\n $rule = null;\n while ($xmlRedirectNodeReader->read()) {\n if ($xmlRedirectNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlRedirectNodeReader->name != 'Redirect') {\n if ($xmlRedirectNodeReader->name == 'Pattern') {\n $pattern = $xmlRedirectNodeReader->readString();\n }\n if ($xmlRedirectNodeReader->name == 'Action') {\n $action = $xmlRedirectNodeReader->readString();\n }\n if ($xmlRedirectNodeReader->name == 'Conditions') {\n if (!$xmlRedirectNodeReader->isEmptyElement) {\n $xmlConditionNodeReader = new \\XMLReader();\n $xmlConditionNodeReader->XML($xmlRedirectNodeReader->readOuterXml());\n $condition_list = array();\n while ($xmlConditionNodeReader->read()) {\n if ($xmlConditionNodeReader->name == 'Expression') {\n $xmlExprNodeReader = new \\XMLReader();\n $xmlExprNodeReader->XML($xmlConditionNodeReader->readOuterXml());\n $condition_comparison = null;\n $condition_pattern = null;\n $condition_flags = null;\n while ($xmlExprNodeReader->read()) {\n if ($xmlExprNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlExprNodeReader->name != 'Expression') {\n if ($xmlExprNodeReader->name == 'Comparison') {\n $condition_flags = $xmlExprNodeReader->getAttribute('Flags');\n $condition_comparison = $xmlExprNodeReader->readString();\n }\n if ($xmlExprNodeReader->name == 'Value') {\n $condition_pattern = $xmlExprNodeReader->readString();\n }\n }\n }\n if ($condition_comparison !== null && $condition_pattern !== null) {\n $condition_list[] = new \\suite6\\Tackler\\TacklerCondition($condition_comparison, $condition_pattern, explode(',', $condition_flags));\n }\n }\n }\n }\n $rule = new \\suite6\\Tackler\\TacklerRule();\n $rule->set_match_pattern($pattern);\n $rule->set_action_pattern($action);\n $rule->set_rule_condition($condition_list);\n }\n }\n }\n if ($pattern !== null && $action !== null && $rule == null)\n $list[$pattern] = $action;\n elseif ($pattern !== null && $action !== null && $rule !== null)\n $list[] = $rule;\n }\n }\n unset($xmlRedirectNodeReader);\n unset($xmlNodeReader);\n $config->set_internal_redirects($list);\n }\n break;\n case 'TemporaryRedirect':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Redirect') {\n $xmlRedirectNodeReader = new \\XMLReader();\n $xmlRedirectNodeReader->XML($xmlNodeReader->readOuterXml());\n $pattern = null;\n $action = null;\n while ($xmlRedirectNodeReader->read()) {\n if ($xmlRedirectNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlRedirectNodeReader->name != 'Redirect') {\n if ($xmlRedirectNodeReader->name == 'Pattern') {\n $pattern = $xmlRedirectNodeReader->readString();\n }\n if ($xmlRedirectNodeReader->name == 'Action') {\n $action = $xmlRedirectNodeReader->readString();\n }\n }\n }\n if ($pattern !== null && $action !== null)\n $list[$pattern] = $action;\n }\n }\n unset($xmlRedirectNodeReader);\n unset($xmlNodeReader);\n $config->set_temporary_redirects($list);\n }\n break;\n case 'PermanentRedirect':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Redirect') {\n $xmlRedirectNodeReader = new \\XMLReader();\n $xmlRedirectNodeReader->XML($xmlNodeReader->readOuterXml());\n $pattern = null;\n $action = null;\n while ($xmlRedirectNodeReader->read()) {\n if ($xmlRedirectNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlRedirectNodeReader->name != 'Redirect') {\n if ($xmlRedirectNodeReader->name == 'Pattern') {\n $pattern = $xmlRedirectNodeReader->readString();\n }\n if ($xmlRedirectNodeReader->name == 'Action') {\n $action = $xmlRedirectNodeReader->readString();\n }\n }\n }\n if ($pattern !== null && $action !== null)\n $list[$pattern] = $action;\n }\n }\n unset($xmlRedirectNodeReader);\n unset($xmlNodeReader);\n $config->set_permanent_redirects($list);\n }\n break;\n case 'DomainRedirect':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Redirect') {\n $xmlRedirectNodeReader = new \\XMLReader();\n $xmlRedirectNodeReader->XML($xmlNodeReader->readOuterXml());\n $pattern = null;\n $action = null;\n while ($xmlRedirectNodeReader->read()) {\n if ($xmlRedirectNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlRedirectNodeReader->name != 'Redirect') {\n if ($xmlRedirectNodeReader->name == 'Pattern') {\n $pattern = $xmlRedirectNodeReader->readString();\n }\n if ($xmlRedirectNodeReader->name == 'Action') {\n $action = $xmlRedirectNodeReader->readString();\n }\n }\n }\n if ($pattern !== null && $action !== null)\n $list[$pattern] = $action;\n }\n }\n unset($xmlRedirectNodeReader);\n unset($xmlNodeReader);\n $config->set_domain_redirects($list);\n }\n break;\n case 'GzipCompression':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'File') {\n $xmlFileNodeReader = new \\XMLReader();\n $xmlFileNodeReader->XML($xmlNodeReader->readOuterXml());\n $ext = null;\n $ctype = null;\n while ($xmlFileNodeReader->read()) {\n if ($xmlFileNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlFileNodeReader->name != 'File') {\n if ($xmlFileNodeReader->name == 'Extension') {\n $ext = $xmlFileNodeReader->readString();\n }\n if ($xmlFileNodeReader->name == 'ContentType') {\n $ctype = $xmlFileNodeReader->readString();\n }\n }\n }\n if ($ext !== null && $ctype !== null)\n $list[$ext] = $ctype;\n }\n }\n unset($xmlFileNodeReader);\n unset($xmlNodeReader);\n $config->set_gzip_serve_extensions($list);\n }\n break;\n case 'GzipPerFile':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'File') {\n $xmlFileNodeReader = new \\XMLReader();\n $xmlFileNodeReader->XML($xmlNodeReader->readOuterXml());\n $ext = null;\n $ctype = null;\n while ($xmlFileNodeReader->read()) {\n if ($xmlFileNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlFileNodeReader->name != 'File') {\n if ($xmlFileNodeReader->name == 'Extension') {\n $ext = $xmlFileNodeReader->readString();\n }\n if ($xmlFileNodeReader->name == 'ContentType') {\n $ctype = $xmlFileNodeReader->readString();\n }\n }\n }\n if ($ext !== null && $ctype !== null)\n $list[$ext] = $ctype;\n }\n }\n unset($xmlFileNodeReader);\n unset($xmlNodeReader);\n $config->set_gzip_per_file($list);\n }\n break;\n case 'ListableDirectories':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'Directory') {\n $list[] = $xmlNodeReader->readString();\n }\n }\n unset($xmlNodeReader);\n $config->set_listable_directories($list);\n }\n break;\n case 'PHPConfig':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Configuration') {\n $xmlConfigNodeReader = new \\XMLReader();\n $xmlConfigNodeReader->XML($xmlNodeReader->readOuterXml());\n $ext = null;\n $ctype = null;\n while ($xmlConfigNodeReader->read()) {\n if ($xmlConfigNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlConfigNodeReader->name != 'File') {\n if ($xmlConfigNodeReader->name == 'Property') {\n $ext = $xmlConfigNodeReader->readString();\n }\n if ($xmlConfigNodeReader->name == 'Value') {\n $ctype = $xmlConfigNodeReader->readString();\n }\n }\n }\n if ($ext !== null && $ctype !== null)\n $list[$ext] = $ctype;\n }\n }\n unset($xmlConfigNodeReader);\n unset($xmlNodeReader);\n $config->set_php_configs($list);\n }\n break;\n case 'PHPFlag':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->name == 'Configuration') {\n $xmlConfigNodeReader = new \\XMLReader();\n $xmlConfigNodeReader->XML($xmlNodeReader->readOuterXml());\n $ext = null;\n $ctype = null;\n while ($xmlConfigNodeReader->read()) {\n if ($xmlConfigNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlConfigNodeReader->name != 'File') {\n if ($xmlConfigNodeReader->name == 'Flag') {\n $ext = $xmlConfigNodeReader->readString();\n }\n if ($xmlConfigNodeReader->name == 'Value') {\n $ctype = $xmlConfigNodeReader->readString();\n }\n }\n }\n if ($ext !== null && $ctype !== null)\n $list[$ext] = $ctype;\n }\n }\n unset($xmlConfigNodeReader);\n unset($xmlNodeReader);\n $config->set_php_flags($list);\n }\n break;\n case 'ETag':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'Stat') {\n $stat = $xmlNodeReader->readString();\n }\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'Flags') {\n $xmlFlagNodeReader = new \\XMLReader();\n $xmlFlagNodeReader->XML($xmlNodeReader->readOuterXml());\n while ($xmlFlagNodeReader->read()) {\n if ($xmlFlagNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlFlagNodeReader->name != 'Flags') {\n if ($xmlFlagNodeReader->name == 'Flag') {\n $list[] = $xmlFlagNodeReader->readString();\n }\n }\n }\n }\n }\n unset($xmlFlagNodeReader);\n unset($xmlNodeReader);\n $etag_settings = new \\suite6\\Tackler\\TacklerEtag($stat, $list);\n $config->set_etag($etag_settings);\n }\n break;\n case 'EtagFiles':\n if (!$xmlReader->isEmptyElement) {\n $xmlNodeReader = new \\XMLReader();\n $xmlNodeReader->XML($xmlReader->readOuterXml());\n $list = array();\n while ($xmlNodeReader->read()) {\n if ($xmlNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlNodeReader->name == 'File') {\n $filename = $xmlNodeReader->getAttribute('Name');\n if (!$xmlNodeReader->isEmptyElement) {\n $xmlFileReader = new \\XMLReader();\n $xmlFileReader->XML($xmlNodeReader->readOuterXml());\n $flag_list = array();\n while ($xmlFileReader->read()) {\n if ($xmlFileReader->nodeType == \\XMLREADER::ELEMENT && $xmlFileReader->name == 'Stat') {\n $stat = $xmlFileReader->readString();\n }\n if ($xmlFileReader->nodeType == \\XMLREADER::ELEMENT && $xmlFileReader->name == 'Flags') {\n $xmlFlagNodeReader = new \\XMLReader();\n $xmlFlagNodeReader->XML($xmlFileReader->readOuterXml());\n while ($xmlFlagNodeReader->read()) {\n if ($xmlFlagNodeReader->nodeType == \\XMLREADER::ELEMENT && $xmlFlagNodeReader->name != 'Flags') {\n if ($xmlFlagNodeReader->name == 'Flag') {\n $flag_list[] = $xmlFlagNodeReader->readString();\n }\n }\n }\n }\n }\n unset($xmlFlagNodeReader);\n unset($xmlFileReader);\n $list[$filename] = new \\suite6\\Tackler\\TacklerEtag($stat, $flag_list);\n } else {\n $list[$filename] = null;\n }\n }\n }\n unset($xmlNodeReader);\n $config->set_etag_files($list);\n }\n break;\n case 'LastModified':\n $config->set_last_modified($xmlReader->readString());\n break;\n case 'CacheControl':\n $config->set_cache_control($xmlReader->readString());\n break;\n default:\n break;\n }\n }\n }\n\n return $config;\n }", "protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }", "function _buildXML() {\r\n\r\n\t\t$db = &FabrikWorker::getDbo();\r\n\t\t$this->clearExportBuffer();\r\n\t\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\\n\";\r\n\t\t$strXML .= \"<install type=\\\"fabrik\\\" version=\\\"2.0\\\">\\n\";\r\n\r\n\t\t$strXML .= \"<creationDate>\" . JRequest::getVar('creationDate', '', 'post') . \"</creationDate>\\n\";\r\n\t \t$strXML .= \"<author>\" . JRequest::getVar('creationDate', '', 'author') . \"</author>\\n\";\r\n\t \t$strXML .= \"<copyright>\" . JRequest::getVar('creationDate', '', 'copyright') . \"</copyright>\\n\";\r\n\t \t$strXML .= \"<authorEmail>\" . JRequest::getVar('creationDate', '', 'authoremail') . \"</authorEmail>\\n\";\r\n\t \t$strXML .= \"<authorUrl>\" . JRequest::getVar('creationDate', '', 'authorurl') . \"</authorUrl>\\n\";\r\n\t \t$strXML .= \"<version>\" . JRequest::getVar('creationDate', '', 'version') . \"</version>\\n\";\r\n\t \t$strXML .= \"<liscence>\" . JRequest::getVar('creationDate', '', 'license') . \"</liscence>\\n\";\r\n\t \t$strXML .= \"<description>\" . JRequest::getVar('creationDate', '', 'description') . \"</description>\\n\";\r\n\r\n\t\t$aTableObjs = array();\r\n\r\n\t\t$tables = $this->packageModel->_tables;\r\n\t\t$forms = $this->packageModel->_forms;\r\n\t\tif ($this->fabrikData) {\r\n\r\n\t\t\t$strXML .= \"<tables>\\n\";\r\n\t\t\tif (is_array($this->tableIds)) {\r\n\r\n\t\t\t\tforeach ($tables as $table) {\r\n\t\t\t\t\t$vars = get_object_vars($table);\r\n\t\t\t\t\t$strXML .= \"\\t<table>\\n\";\r\n\t\t\t\t\tforeach( $vars as $key=>$val ) {\r\n\t\t\t\t\t\tif (substr($key, 0, 1) != '_' ) {\r\n\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</tables>\\n\\n\";\r\n\r\n\t\t\t$strXML .= \"<forms>\\n\";\r\n\r\n\t\t\tforeach ($forms as $form) {\r\n\t\t\t\t$vars = get_object_vars($form);\r\n\t\t\t\t$strXML .= \"\\t<form>\\n\";\r\n\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$strXML .= \"\\t</form>\\n\";\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</forms>\\n\\n\";\r\n\r\n\t\t\t$strElementXML \t\t= \"<elements>\\n\";\r\n\t\t\t$strXML \t\t\t.= \"<groups>\\n\";\r\n\t\t\t$strValidationXML \t= \"<validations>\\n\";\r\n\t\t\tforeach ($this->_aTables as $listModel) {\r\n\t\t\t\t$groups = $listModel->_oForm->getGroupsHiarachy();\r\n\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tforeach ($groups as $groupModel) {\r\n\t\t\t\t\t$group = $groupModel->getGroup();\r\n\t\t\t\t\t$vars = get_object_vars($group);\r\n\t\t\t\t\t$strXML .= \"\\t<group form_id=\\\"\".$listModel->getFormModel()->getId().\"\\\" ordering=\\\"\" . $i .\"\\\">\\n\";\r\n\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t//dont insert join_id as this isnt in the group table\r\n\t\t\t\t\t\tif ($key != \"join_id\") {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$strXML .= \"\\t</group>\\n\";\r\n\t\t\t\t\t$elementModels = $groupModel->getPublishedElements();\r\n\t\t\t\t\tforeach ($elementModels as $elementModel) {\r\n\t\t\t\t\t\t$element = $elementModel->getElement();\r\n\t\t\t\t\t\t$vars = get_object_vars($element);\r\n\t\t\t\t\t\t$strElementXML .= \"\\t<element>\\n\";\r\n\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strElementXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$strElementXML .= \"\\t</element>\\n\\n\";\r\n\r\n\t\t\t\t\t\tforeach ($elementModel->_aValidations as $oValidation) {\r\n\t\t\t\t\t\t\t$vars = get_object_vars($oValidation);\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t<validation>\\n\";\r\n\t\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t\t$strValidationXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t</validation>\\n\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML \t\t\t.= \"</groups>\\n\";\r\n\t\t\t$strElementXML \t\t.= \"</elements>\\n\\n\";\r\n\t\t\t$strValidationXML \t.= \"</validations>\\n\\n\";\r\n\t\t\t$strXML .= $strElementXML . $strValidationXML;\r\n\r\n\t\t}\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t\tif ($this->incTableStructure) {\r\n\t\t\t$strXML = $this->_createTablesXML($strXML);\r\n\t\t}\r\n\t\t$strXML .= $this->getTemplateFiles();\r\n\t\t$strXML .= \"</install>\";\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t}", "function install() {\n\t\techo \"\\nModule xlyre will be installed.\\n\";\n \t$this->loadConstructorSQL(\"xlyre.constructor.sql\");\n\t\t/*$name = \"xlyre\";\n $extension = \"xml\";\n $complexName = sprintf(\"%s.%s\", $name, $extension);\n $description = \"OpenData channel\";\n $renderMode = \"ximdex\";\n\n $nodeType = new NodeType();\n $nodeType->SetByName('Channel');\n\n\t\t$node = new Node();\n\t\t$idNode = $node->CreateNode($complexName, 9,$nodeType->GetID(), NULL);\n\n\t\t$ch=new Channel($idNode);\n\t\t$result=$ch->CreateNewChannel($name, $extension, NULL, $description, $idNode, NULL, $renderMode);\n if ($result > 0) {\n echo \"Channel has been succesfully created\\n\";\n }\n\t\telse{\n\t\t\techo \"There was a problem creating the xlyre channel\\n\";\n\t\t}*/\n\n parent::install();\n\t}", "function generate_layerconf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_layerconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_layerconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t\n\t\t// get all <layers> elements\n\t\t$all_layers = $dom->get_elements_by_tagname(\"layers\");\n\t\t$all_folders = $dom->get_elements_by_tagname(\"folders\");\n\t\t// currently there should only be one \n\t\t// of each of <layers> and <folders> elements\n\t\t$layers = $all_layers[0];\n\t\t$folders = $all_folders[0];\n\n\t\t// create <folder> to hold the new layers\n\t\t$visible_layers_folder = $this->create_dom_node($dom, $folders, \"folder\");\n\t\t// create <name> Visible Layers </name>\n\t\t$this->create_dom_node($dom, $visible_layers_folder, \"name\", \"Visible Layers\");\n\t\t// create <folder-layers>\n\t\t$folder_layers = $this->create_dom_node($dom, $visible_layers_folder, \"folder-layers\");\n\t\t\n\t\t// now that the folder has been created to hold the\n\t\t// new layer, loop through all viewable layers\n\t\t// and create a <layer> object for each, along with\n\t\t// a <folder-layer> for each layer that has its\n\t\t// display property set to true.\n\t\t$n_layers = count($this->viewable_layers);\n\t\tfor($i = 0; $i < $n_layers; $i++){\n\t\t\tif($this->viewable_layers[$i]->display == \"true\"){\n\t\t\t\t// create <layer>\n\t\t\t\t$new_layer = $this->create_dom_node($dom, $layers, \"layer\");\n\t\t\t\t// create <visible>true</visible>\n\t\t\t\t$this->create_dom_node($dom, $new_layer, \"visible\", \"true\");\n\t\t\t\t// create <name>tus_line</name>\n\t\t\t\t$this->create_dom_node($dom, $new_layer, \"name\", $this->viewable_layers[$i]->layer_name);\n\t\t\t\t// create \t<alias>tus line</alias>\n\t\t\t\t$this->create_dom_node($dom, $new_layer, \"alias\", $this->viewable_layers[$i]->layer_name);\n\t\t\t\t// create <max-scale>100000000</max-scale>\n\t\t\t\t$this->create_dom_node($dom, $new_layer, \"max-scale\", \"100000000\");\n\t\t\t\t// create <min-scale>1 </max-scale>\n\t\t\t\t$this->create_dom_node($dom, $new_layer, \"min-scale\", \"1\");\n\t\t\t\t// create <context>\n\t\t\t\t$context = $this->create_dom_node($dom, $new_layer, \"context\");\n\t\t\t\t// create <modes>\n\t\t\t\t$modes = $this->create_dom_node($dom, $context, \"modes\");\n\t\t\t\t// create <mode>\n\t\t\t\t$this->create_dom_node($dom, $modes, \"mode\", \"select\");\n\t\t\t\t// the <layer> element is now complete.\n\t\t\t\t// generate <folder-layer> elements\n\t\t\t\t$folder_layer = $this->create_dom_node($dom, $folder_layers, \"folder-layer\");\n\t\t\t\t// create <name>tus line</name> \t\n\t\t\t\t$this->create_dom_node($dom, $folder_layer, \"name\", $this->viewable_layers[$i]->layer_name);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_layerconf, false, false);\n\t\treturn $this->output_layerconf;\n\t}", "public function install();", "public function install();", "public function configurationToXML( DOMElement $element )\n {\n $element->setAttribute( 'variable', $this->configuration['name'] );\n $element->setAttribute( 'operand', $this->configuration['operand'] );\n }", "function rooney_build() {\n\t\n\treturn '/picard/prod/0.1.0/20131217/1'; // Edit this string to update theme across site.\n\t\n}", "function mediawikiinstall($o){\n\t\n\t\t//$o->extract(\"confirmaccount\", \"extensions/\");\n\t\t$o->sr(\"LocalSettings.php\", \"#Add\\s*more\\s*configuration\\s*options\\s*below.#\", \"End of automatically generated settings. \\n\\n \\$wgGroupPermissions['*']['edit'] = false; \\n\\n \\$wgGroupPermissions['*']['createpage'] = false; \\n\\n \\$wgEmailConfirmToEdit = true;\");\n\t}", "public function createXML() {}", "function create_minify_config_file()\n\t{\n\t\t$options = $this->options;\n\n\t\t// prepare config entry that can be changed\n\t\t$min_cachePath = empty($options['input_minpath'])\n\t\t\t&& empty($options['input_cache_dir'])\n\t\t\t? 'dirname(dirname(__FILE__)) . \\'/cache\\''\n\t\t\t: \"'\" . untrailingslashit($this->get_cache_dir()) . \"'\";\n\n\t\t$min_cacheFileLocking = 'yes' == $options['enable_cache_file_lock']\n\t\t\t? 'true' : 'false';\n\t\t$min_bubbleCssImports = 'yes' == $options['enable_css_bubble']\n\t\t\t? 'true' : 'false';\n\t\t$min_allowDebugFlag = 'yes' == $options['enable_debug']\n\t\t\t? 'true' : 'false';\n\t\t$min_errorLogger = 'yes' == $options['enable_debug']\n\t\t\t? 'true' : 'false';\n\t\t$min_maxAge = (int) $options['input_maxage'] * (int) $options['select_time_type'];\n\n\t\t$doc_root = $this->get_doc_root();\n\t\t$min_documentRoot = $_SERVER['DOCUMENT_ROOT'] != $doc_root\n\t\t\t? \"'\" . untrailingslashit($this->get_doc_root()) . \"'\"\n\t\t\t: \"''\";\n\n\t\t$configs = array(\n\t\t\t'min_enableBuilder' => 'false',\n\t\t\t'min_builderPassword' => \"'admin'\",\n\t\t\t'min_errorLogger' => $min_errorLogger,\n\t\t\t'min_allowDebugFlag' => $min_allowDebugFlag,\n\t\t\t'min_cachePath' => $min_cachePath,\n\t\t\t'min_documentRoot' => $min_documentRoot,\n\t\t\t'min_cacheFileLocking' => $min_cacheFileLocking,\n\t\t\t'min_serveOptions[\\'bubbleCssImports\\']' => $min_bubbleCssImports,\n\t\t\t'min_serveOptions[\\'maxAge\\']' => $min_maxAge,\n\t\t\t'min_serveOptions[\\'minApp\\'][\\'groupsOnly\\']' => 'false',\n\t\t\t'min_symlinks' => 'array()',\n\t\t\t'min_uploaderHoursBehind' => '0',\n\t\t\t'min_libPath' => 'dirname(__FILE__) . \\'/lib\\'',\n\t\t\t'ini_set(\\'zlib.output_compression\\', \\'0\\')' => ''\n\t\t);\n\n\t\t$config_lines = array();\n\t\tforeach ($configs as $config_key => $config_value)\n\t\t{\n\t\t\tif (false === strpos($config_key, 'ini_set'))\n\t\t\t\t$config_lines[] = '$' . $config_key . ' = ' . $config_value . ';';\n\t\t\telse\n\t\t\t\t$config_lines[] = $config_key . ';';\n\t\t}\n\n\t\t$lines = implode(\"\\n\", $config_lines) . \"\\n\";\n\t\t$lines .= '// auto-generated on ' . current_time('mysql') . \"\\n\";\n\n\t\t$min_dir = $this->get_min_dir();\n\t\tif (false == $min_dir)\n\t\t\t// Minify directory can not be found, warn admin\n\t\t\treturn 'config';\n\n\t\t$config_file = $min_dir . 'config.php';\n\t\t$current_lines = @file($config_file);\n\n\t\tif (is_writable($config_file) && false !== $current_lines)\n\t\t{\n\t\t\t// write Minify config variable to `config.php` file, but try not\n\t\t\t// to overwrite current config variables (put at the end of the\n\t\t\t// file if needed)\n\t\t\t$last_line = '';\n\t\t\t$begin = $end = false;\n\t\t\tforeach ($current_lines as $line_number => $line)\n\t\t\t{\n\t\t\t\tif (false !== strpos($line, '$min_enableBuilder'))\n\t\t\t\t\t$begin = $line_number;\n\n\t\t\t\tif (false !== strpos($line, '// auto-generated on'))\n\t\t\t\t{\n\t\t\t\t\t$end = $line_number;\n\t\t\t\t\t$last_line = $line;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$current_lines = implode('', $current_lines);\n\t\t\tif (false === $begin || false === $end)\n\t\t\t{\n\t\t\t\t// if we could not find the begin OR end, add config variables to\n\t\t\t\t// the end of the config file\n\t\t\t\t$current_lines .= \"\\n\";\n\t\t\t\t$current_lines .= $lines;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$begin = strpos($current_lines, '$min_enableBuilder');\n\t\t\t\t$end = strpos($current_lines, '// auto-generated on');\n\t\t\t\t$length = $end > $begin ? $end - $begin + strlen($last_line) : 0;\n\n\t\t\t\t$current_lines = substr_replace($current_lines, $lines, $begin, $length);\n\t\t\t}\n\n\t\t\tif (false === @file_put_contents($config_file, $current_lines))\n\t\t\t\treturn 'put';\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// return the contents of the config file for manual update\n\t\t\treturn $lines;\n\t\t}\n\t}", "public function build()\n {\n $this->taskMirrorDir([\n 'src/modules' => 'docroot/modules/custom',\n 'src/themes' => 'docroot/themes/custom',\n ])->run();\n $this->_copy('src/settings.php', 'docroot/sites/default/settings.php');\n $this->_touch(\".built\");\n return $this;\n }", "function generate_config( $args, $assoc_args ) {\n $config = $this->generate_distribution_config( $args, $assoc_args );\n echo $config;\n }", "protected function generateBreezeConfig()\n {\n\n $genConfPath = $this->getGeneratorConfigPath();\n $this->infoMessage(\"Creating generator conf file in $genConfPath.\");\n\n $galaxy = $this->getContextVar(\"galaxy\");\n $planet = $this->getContextVar(\"planet\");\n $createFile = $this->getContextVar(\"createFile\");\n\n $prefixes = $this->getTablePrefixes();\n $mainPrefix = array_shift($prefixes);\n\n\n DeveloperWizardBreezeGeneratorHelper::spawnConfFile($genConfPath, [\n \"galaxyName\" => $galaxy,\n \"planetName\" => $planet,\n \"createFilePath\" => $createFile,\n \"prefix\" => $mainPrefix,\n \"otherPrefixes\" => $prefixes,\n ]);\n return null;\n }", "private function returnConfig(){\n\t\techo '<reply action=\"ok\">';\n\t\techo $this->data->asXML();\n\t\techo '</reply>';\n\t}", "function makeXML($template) {\n\t# ensure its a v2 template if the Config entries exist\n\tif ( $template['Config'] && ! $template['@attributes'] )\n\t\t$template['@attributes'] = array(\"version\"=>2);\n\n\tfixAttributes($template,\"Network\");\n\tfixAttributes($template,\"Config\");\n\n\t$Array2XML = new Array2XML();\n\t$xml = $Array2XML->createXML(\"Container\",$template);\n\treturn $xml->saveXML();\n}", "protected function buildTypolinkConfiguration() {}", "function createPrintSettingsConfFile() {\r\n\t \t\r\n\t $fileContent = \"<?php \\n\";\r\n\t $fileContent .= \" /** \\n\";\r\n\t $fileContent .= \" * @name QR code for Virtuemart \\n\";\r\n\t $fileContent .= \" * @version\t1.0: crop.php 2011-06-06 \\n\";\r\n\t $fileContent .= \" * @since Joomla 1.5 \\n\";\r\n\t $fileContent .= \" * @subpackage\tcom_qrcode \\n\";\r\n\t $fileContent .= \" * @author contus support \\n\";\r\n\t $fileContent .= \" * @copyright Copyright (C) 2011 Contus Support \\n\";\r\n\t $fileContent .= \" * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html \\n\";\r\n\t $fileContent .= \" * @abstract Constants for print setting. \\n\";\r\n\t $fileContent .= \" **/ \\n\";\r\n\t $fileContent .= \"define('conf__QRCODE_PRINT_SIZE','\" . JRequest::getVar(\"size\") . \"');\\n \";\r\n\t $fileContent .= \"define('conf__QRCODE_PRINT_ORIENTATION','\" . JRequest::getVar(\"orientation\") . \"');\\n \";\r\n\t $fileContent .= \"?>\";\r\n\t $path = JPATH_COMPONENT_ADMINISTRATOR . DS . \"helpers\" . DS . \"printSettings.php\";\r\n\t $fp = fopen($path, \"w\");\r\n\t if ($fp) \r\n\t {\r\n\t fwrite($fp, $fileContent);\r\n\t fclose($fp);\r\n\t return true;\r\n\t }\r\n\t else\r\n\t return false;\r\n\t }", "public static function create_xrd() {\n $xrd = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\";\n $xrd .= '<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\">'.\"\\n\";\n $xrd .= ' <Subject>'.site_url(\"/\").'</Subject>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/vendor\">'.get_bloginfo('name').'</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/title\">'.get_bloginfo('description').'</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/name\">\"Press This\" bookmarklet</Property>'.\"\\n\";\n $xrd .= ' <Property type=\"http://www.oexchange.org/spec/0.8/prop/prompt\">Press This</Property>'.\"\\n\";\n $xrd .= ' <Link rel= \"icon\" href=\"'.OExchangePlugin::get_icon_url(16).'\" />'.\"\\n\";\n $xrd .= ' <Link rel= \"icon32\" href=\"'.OExchangePlugin::get_icon_url(32).'\" />'.\"\\n\";\n $xrd .= ' <Link rel= \"http://www.oexchange.org/spec/0.8/rel/offer\" href=\"'.admin_url('press-this.php').'\" type=\"text/html\"/>'.\"\\n\";\n $xrd .= '</XRD>';\n\n return $xrd;\n }", "private function config_OSF_WebServices()\n {\n // Get package info\n $installPath = \"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}\";\n $dataPath = \"{$this->data_folder}/osf-web-services/configs\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n $this->cp(\"{$installPath}/keys.ini\", \"{$dataPath}/keys.ini\");\n $this->cp(\"{$installPath}/osf.ini\", \"{$dataPath}/osf.ini\");\n $this->rm(\"{$installPath}/keys.ini\");\n $this->rm(\"{$installPath}/osf.ini\");\n // OSF Web Service scripts\n $this->sed(\"public static \\$osf_ini = \\\".*\\\";\", \"public static \\$osf_ini = \\\"{$dataPath}/\\\";\",\n \"{$installPath}/framework/WebService.php\");\n $this->sed(\"public static \\$keys_ini = \\\".*\\\";\", \"public static \\$keys_ini = \\\"{$dataPath}/\\\";\",\n \"{$installPath}/framework/WebService.php\");\n // OSF Web Service credentials\n if(stripos(file_get_contents(\"{$dataPath}/keys.ini\"), \"{$this->application_id} = \") === FALSE)\n {\n $this->append(\"\\n{$this->application_id} = \\\"{$this->api_key}\\\"\",\n \"{$dataPath}/keys.ini\");\n }\n else\n {\n $this->sed(\"{$this->application_id} = .*\", \"\", \"{$dataPath}/keys.ini\");\n $this->append(\"{$this->application_id} = \\\"{$this->api_key}\\\"\",\n \"{$dataPath}/keys.ini\");\n }\n // OSF Web Service paths\n $this->setIni(\"network\", \"wsf_base_url\", \"\\\"http://{$this->osf_web_services_domain}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"network\", \"wsf_base_path\", \"\\\"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}/\\\"\",\n \"{$dataPath}/osf.ini\");\n // OSF Tools paths\n $this->setIni(\"datasets\", \"wsf_graph\", \"\\\"http://{$this->osf_web_services_domain}/wsf/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"datasets\", \"dtd_base\", \"\\\"http://{$this->osf_web_services_domain}/ws/dtd/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"ontologies\", \"ontologies_files_folder\", \"\\\"{$this->data_folder}/ontologies/files/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"ontologies\", \"ontological_structure_folder\", \"\\\"{$this->data_folder}/ontologies/structure/\\\"\",\n \"{$dataPath}/osf.ini\");\n // SPARQL dependency\n $this->setIni(\"triplestore\", \"channel\", \"\\\"{$this->sparql_channel}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"dsn\", \"\\\"{$this->sparql_dsn}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"host\", \"\\\"{$this->sparql_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"port\", \"\\\"{$this->sparql_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"sparql\", \"\\\"{$this->sparql_url}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"sparql-graph\", \"\\\"{$this->sparql_graph_url}\\\"\",\n \"{$dataPath}/osf.ini\");\n if ($this->sparql_channel == 'http') {\n $this->setIni(\"triplestore\", \"sparql-insert\", \"\\\"insert\\\"\",\n \"{$dataPath}/osf.ini\");\n }\n $this->setIni(\"triplestore\", \"username\", \"\\\"{$this->sparql_username}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"password\", \"\\\"{$this->sparql_password}\\\"\",\n \"{$dataPath}/osf.ini\");\n // Keycache dependency\n $this->setIni(\"memcached\", \"memcached_enabled\", \"\\\"{$this->keycache_enabled}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"memcached\", \"memcached_host\", \"\\\"{$this->keycache_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"memcached\", \"memcached_port\", \"\\\"{$this->keycache_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n // Solr dependency\n $this->setIni(\"solr\", \"solr_host\", \"\\\"{$this->solr_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"solr_port\", \"\\\"{$this->solr_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"solr_core\", \"\\\"{$this->solr_core}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"fields_index_folder\", \"\\\"{$this->data_folder}/osf-web-services/tmp/\\\"\",\n \"{$dataPath}/osf.ini\");\n // OWL dependency\n $this->setIni(\"scones\", \"endpoint\", \"\\\"http://{$this->scones_host}:{$this->scones_port}/{$this->scones_url}/\\\"\",\n \"{$dataPath}/osf.ini\");\n // Other\n $this->setIni(\"geo\", \"geoenabled\", \"\\\"true\\\"\",\n \"{$dataPath}/osf.ini\");\n }", "public function install() {\r\n\t\tadd_option(ShoppWholesale::OPTION_NAME, $this->defaults);\r\n\t}", "function havp_convert_pfxml_xml() {\n\tglobal $config, $havp_config;\n\n\t$pfconf = $config['installedpackages'][HVFORM_HAVP]['config'][0];\n\n\t/* === GUI Fields === */\n\t$havp_config[F_ENABLE] = ($pfconf[F_ENABLE] === 'on' ? 'true' : 'false');\n\n\t/* ClamAV mode */\n\t$havp_config[F_USECLAMD] = $pfconf[F_USECLAMD];\n\n\t/* Proxy */\n\t$havp_config[F_PROXYMODE] = $pfconf[F_PROXYMODE] ?: 'standard';\n\t// TODO: Add check for Squid transparent\n\t$havp_config[F_PROXYINTERFACE] = $pfconf[F_PROXYINTERFACE];\n\t// TODO: Add check for Squid proxy port\n\t$havp_config[F_PROXYPORT] = $pfconf[F_PROXYPORT] ?: HVDEF_PROXYPORT;\n\n\t/* Parent proxy */\n\t// [F_PARENTPROXY] = \"proxy_ip:port\"\n\t$pfconf[F_PARENTPROXY] = trim($pfconf[F_PARENTPROXY]);\n\tif (!empty($pfconf[F_PARENTPROXY])) {\n\t\t$parent = explode(\":\", trim($pfconf[F_PARENTPROXY]));\n\t\t$havp_config[F_PARENTPROXY] = array('ip' => $parent[0], 'port' => $parent[1]);\n\t} else {\n\t\t$havp_config[F_PARENTPROXY] = '';\n\t}\n\n\t/* Language */\n\t$havp_config[F_LANGUAGE] = trim($pfconf[F_LANGUAGE]);\n\n\t/* HAVP proxy settings */\n\t$havp_config[F_ENABLEFORWARDEDIP] = ($pfconf[F_ENABLEFORWARDEDIP] === 'on' ? 'true' : 'false');\n\t$havp_config[F_ENABLEXFORWARDEDFOR] = ($pfconf[F_ENABLEXFORWARDEDFOR] === 'on' ? 'true' : 'false');\n\t$havp_config[F_MAXDOWNLOADSIZE]\t= (is_numeric($pfconf[F_MAXDOWNLOADSIZE]) ? $pfconf[F_MAXDOWNLOADSIZE] : 0);\n\t$havp_config[F_RANGE] = ($pfconf[F_RANGE] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_ENABLERAMDISK] = ($pfconf[F_ENABLERAMDISK] === 'on' ? 'true' : 'false');\n\t// Whitelist\n\t$havp_config[F_WHITELIST] = base64_decode($pfconf[F_WHITELIST]);\n\t$havp_config[F_WHITELIST] = str_replace(\";\", \"\\n\", $havp_config[F_WHITELIST]);\n\t$havp_config[F_WHITELIST] = str_replace(\";\", \" \", $havp_config[F_WHITELIST]);\n\t// Blacklist\n\t$havp_config[F_BLACKLIST] = base64_decode($pfconf[F_BLACKLIST]);\n\t$havp_config[F_BLACKLIST] = str_replace(\";\", \"\\n\", $havp_config[F_BLACKLIST]);\n\t$havp_config[F_BLACKLIST] = str_replace(\";\", \" \", $havp_config[F_BLACKLIST]);\n\n\t/*\n\t* ------------------------------------------------------------------------------\n\t* Temp RAMDisk\n\t* ------------------------------------------------------------------------------\n\t* Use RAMDisk only if capacity > calculated [MAXSCANSIZE * 50 connections]\n\t* Set up temp dir accordingly\n\t*/\n\t$havp_config[HV_SCANTEMPFILE] = HVDEF_HAVPTEMP_DIR . HVDEF_SCANTEMPFILE;\n\tif ($havp_config[F_ENABLERAMDISK] === 'true') {\n\t\t$sys_capacity = get_memory();\n\t\t$mem_capacity = intval($sys_capacity[0]) / 4; // [MB]\n\t\t$calculated = 50 * $havp_config[F_SCANMAXSIZE] / (1024 * 1024); // [MB]\n\t}\n\t/*\n\t* This restriction is required for balancing between pfSense and HAVP work speed\n\t* We cannot allocate memory at the expense of other services running on pfSense\n\t*/\n\tif ($mem_capacity > $calculated) {\n\t\t// Redefine temp file to RAM Disk\n\t\t$havp_config[HV_SCANTEMPFILE] = HVDEF_RAMTEMP_DIR . HVDEF_SCANTEMPFILE;\n\t} else {\n\t\tlog_error(\"HAVP: RAMDisk not used. Diagnostic: system {$sys_capacity[0]}MB, available {$mem_capacity}MB, calculated {$calculated}MB. Try reducing 'MAXSCANSIZE' value.\");\n\t}\n\n\t/* Scanner */\n\t$havp_config[F_FAILSCANERROR] = ( $pfconf[F_FAILSCANERROR] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_SCANMAXSIZE] = ( is_numeric($pfconf[F_SCANMAXSIZE]) ? $pfconf[F_SCANMAXSIZE] : HVDEF_MAXSCANSIZE ) * 1024; // KB -> Byte\n\t$havp_config[F_SCANIMG] = ( $pfconf[F_SCANIMG] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_SCANARC]\t= ( $pfconf[F_SCANARC] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_SCANSTREAM] = ( $pfconf[F_SCANSTREAM] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_SCANBROKENEXE] = ( $pfconf[F_SCANBROKENEXE] === 'on' ? 'true' : 'false' );\n\t$havp_config[F_SCANARCMAXSIZE] = ( is_numeric($pfconf[F_SCANARCMAXSIZE]) ? $pfconf[F_SCANARCMAXSIZE] : HVDEF_MAXARCSCANSIZE );\n\n\t/* Log */\n\t$havp_config[F_SYSLOG] = ($pfconf[F_SYSLOG] === 'on' ? 'true' : 'false');\n\t$havp_config[F_LOG] = ($pfconf[F_LOG] === 'on' ? 'true' : 'false');\n\n\t/*\n\t* ------------------------------------------------------------------------------\n\t* Internal variables\n\t* ------------------------------------------------------------------------------\n\t*/\n\t/* Proxy */\n\t$havp_config[F_PROXYBINDIFACE]\t= 'localhost';\n\t/* Language template files path */\n\t$lng = $havp_config[F_LANGUAGE]\t? $havp_config[F_LANGUAGE] : \"en\";\n\t$havp_config[F_TEMPLATEPATH]\t= (file_exists(HVDEF_TEMPLATES_EX . \"/$lng\") ? HVDEF_TEMPLATES_EX : HVDEF_TEMPLATES );\n\t$havp_config[F_TEMPLATEPATH]\t.= \"/$lng\";\n\t/* AV settings */\n\t$pf_avset_conf = $config['installedpackages'][HVFORM_AVSET]['config'][0];\n\t$havp_config[F_HAVPUPDATE] = $pf_avset_conf[F_HAVPUPDATE];\n\t$havp_config[F_DBREGION] = $pf_avset_conf[F_DBREGION];\n\t$havp_config[F_AVUPDATESERVER] = $pf_avset_conf[F_AVUPDATESERVER];\n\t/* AV log */\n\t$havp_config[F_AVSETSYSLOG] = $pf_avset_conf[F_AVSETSYSLOG] === 'on' ? 'true' : 'false';\n\t$havp_config[F_AVSETLOG] = $pf_avset_conf[F_AVSETLOG] === 'on' ? 'true' : 'false';\n\n\t/* Store HAVP config cache */\n\t$cfg_xml = dump_xml_config($havp_config, 'havp');\n\tfile_put_contents(HVDEF_HAVP_XMLCONF, $cfg_xml);\n\n\treturn $havp_config;\n}", "public function writewebconfig()\n {\n //<add fileExtension=\"supersake\" allowed=\"false\"/>\n }", "function install() {\n\t\t$config ['username'] = '';\n\t\t$config ['password'] = '';\n\t\t;\n\t\t$config ['signature'] = '';\n\t\t$config ['currency'] = 'EUR'; // default\n\t\t\n\n\t\t$config ['SANDBOX'] = true;\n\t\t\n\t\t$config ['enabled'] = \"0\";\n\t\t\n\t\t//not normally user configurable\n\t\t$config ['return_url'] = \"\";\n\t\t$config ['cancel_url'] = \"\";\n\t\t\n\t\t$this->CI->Settings_model->save_settings ( 'bnp_parisbas', $config );\n\t}", "protected function exportConfig()\n {\n if ($this->option('interactive')) {\n if (! $this->confirm('Install the package config file?')) {\n return;\n }\n }\n if (file_exists(config_path('laravel-mentor.php')) && ! $this->option('force')) {\n if (! $this->confirm('The Laravel Mentor configuration file already exists. Do you want to replace it?')) {\n return;\n }\n }\n copy(\n $this->packagePath('config/laravel-mentor.php'),\n config_path('laravel-mentor.php')\n );\n\n $this->comment('Configuration Files installed successfully.');\n }", "public function createNewConfig() { \n\n\t\t/** \n\t\t * Start by creating the top of the php file\n\t\t *\n\t\t */\n\t\t$this->newFileStr = \"<?php\\n\\n\";\n\n\t\t/** \n\t\t * We want to loop through the new config variables\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new variables.\n\t\t */\n\n\t\tforeach ($this->fileSettings as $name => $val) {\n\n\t\t/** \n\t\t * Output our config variables comment\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new config comment\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n\\n//\" . $val['1'] . \"\\n\";\n\t\t\n\n\t\t/** \n\t\t *\n\t\t * Using var_export() allows you to set complex values \n\t\t * such as arrays and also ensures types will be correct\n\t\t *\n\t\t * @var string stores new config setting\n\t\t */\n\t\t\n\t\t$this->newFileStr .= \"$\".$name.\" = \".var_export($val['0'], TRUE).\";\\n\";\n\n\n\t\t} // end of foreach\n\n\t\t/** \n\t\t *\n\t\t * End our php file\n\t\t *\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n?>\";\n\n\t\t/** \n\t\t *\n\t\t * Create out new config\n\t\t *\n\t\t */\n\t\tfile_put_contents($this->filePath, $this->newFileStr, LOCK_EX);\n\n\t}", "public function buildConfigText() {\n\t\t$this->setPrimaryDomain();\n\t\n\t\tob_start();\n\t\t$installation_path = $this->installation_path;\n\t\t$name = $this->sitename;\n\t\t$domains = array(\n\t\t\t$this->primary_domain\n\t\t);\n\t\t$redirrectdomains = array();\n\t\tinclude(SHARED_PATH . 'provisioning/httpd.tpl');\n\t\t$config_text = ob_get_clean ();\n\t\treturn $config_text;\n\t\t\n\t}", "function com_install() {\n\tglobal $mosConfig_absolute_path;\n\tmkdir($mosConfig_absolute_path . '/mambots/ajax');\n}", "public function get_install_config() {\n\t\treturn array(\n\t\t\t'get_parent' => __( 'Installing theme...', 'crocoblock-wizard' ),\n\t\t\t'prev' => array(\n\t\t\t\t'to' => 'cbw-install-theme',\n\t\t\t\t'type' => 'component',\n\t\t\t),\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'parent',\n\t\t\t\t\t'label' => __( 'Continue with parent theme', 'crocoblock-wizard' ),\n\t\t\t\t\t'description' => __( 'Install the Parent theme only, and skip the installation of the Child theme', 'crocoblock-wizard' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'child',\n\t\t\t\t\t'label' => __( 'Use child theme', 'crocoblock-wizard' ),\n\t\t\t\t\t'description' => __( 'Download and install the Child theme. We recommend doing this because it’s the safest way to make future modifications', 'crocoblock-wizard' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "public function configure()\n {\n // Image Packages\n require_once 'Image/Transform.php';\n // Text Packages\n require_once 'Text/Wiki.php';\n require_once 'Text/Wiki/Mediawiki.php';\n require_once \"Text/Password.php\";\n // HTML Packages\n require_once 'HTML/TagCloud.php';\n // HTTP Packages\n require_once 'HTTP/Request2.php';\n // Net Packages\n require_once 'Net/URL2.php';\n // Individual specific packages\n require_once 'Date.php';\n require_once \"Mail.php\"; \n // Service Packages\n require_once 'Services/TinyURL.php';\n require_once 'Services/Twitter.php';\n }", "function getXml() {\n\t\t// get the LTI configuration\n\t\t$configuration_name = $this->getConfigurationName();\n\t\t$configuration_properties = $this->getConfigurationProperties( $configuration_name );\n\n\t\t// declare XML document\n\t\t$doc = new \\DOMDocument( self::XML_VERSION, self::XML_ENCODING );\n\n /* +----------------------------------------+\n | ROOT NODE AND NAMESPACE DECLARATIONS |\n +----------------------------------------+ */\n\t\t// create root node and set namespace and its attributes\n\t\t$root_namespace = $this->getNamespace( 'xmlns' );\n\t\t$root = $doc->createElementNS( $root_namespace->xml, $configuration_properties['root'] );\n\t\t$doc->appendChild( $root );\n\t\t// set the default schema for the doc\n\t\t$doc->createAttributeNS( $root_namespace->xml, 'xmlns' );\n\t\t// gather all the xml/xsd pairs and set the xsi:schemaLocation\n\t\t$xsd_references = array();\n\t\tforEach( $configuration_properties['namespaces'] AS $namespace_hierarchy => $namespace_properties ){\n\t\t\tif( $namespace_hierarchy != 'xmlns' ){\n\t\t\t\t$root->setAttribute( $namespace_hierarchy, $namespace_properties['xml'] );\n\t\t\t}\n\t\t\tif( ! empty( $namespace_properties['xsd'] ) ){\n\t\t\t\t$xsd_references[] = $namespace_properties['xml'] . ' ' . $namespace_properties['xsd'];\n\t\t\t}\n\t\t}\n\t\t// set schema xsd locations for namespaces\n\t\t$root->setAttributeNS( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', implode( ' ', $xsd_references ) );\n\n /* +---------------------------+\n | NAMESPACE SECTION: BLTI |\n +---------------------------+ */\n\t\t// add basic lti properties\n\t\t$blti_namespace = $this->getNamespace( 'blti' );\n\t\tif( ! empty( $blti_namespace ) ){\n\t\t\t$blti_properties = $this->getBltiProperties();\n\t\t\tforEach( $blti_properties as $blti_key => $blti_value ){\n\t\t\t\t$root->appendChild( $doc->createElement( $blti_namespace->name . ':' . $blti_key, $blti_value ) );\n\t\t\t}\n\t\t}\n\n /* +----------------------------+\n | NAMESPACE SECTION: LTICM |\n +----------------------------+ */\n\t\t// add lti common messaging properties as blti:extensions\n\t\t$lticm_namespace = $this->getNamespace( 'lticm' );\n\t\tif( ! empty( $lticm_namespace ) && ! empty( $blti_namespace ) ){\n\t\t\t$lticm_properties = $this->getLticmProperties();\n\t\t\tforEach( $lticm_properties as $platform => $platform_attributes ){\n\t\t\t\t$platform_element = $doc->createElement( $blti_namespace->name . ':extensions' );\n\t\t\t\t$root->appendChild( $platform_element );\n\t\t\t\t$platform_element->setAttribute( 'platform', $platform );\n\t\t\t\tif( ! empty( $platform_attributes ) ){\n\t\t\t\t\tif( ! empty( $platform_attributes['properties'] ) ){\n\t\t\t\t\t\tforEach( $platform_attributes['properties'] as $property_set ){\n\t\t\t\t\t\t\t$property_element = $doc->createElement( $lticm_namespace->name . ':property' );\n\t\t\t\t\t\t\t$platform_element->appendChild( $property_element );\n\t\t\t\t\t\t\t$property_element->setAttribute( 'name', $property_set['name'] );\n\t\t\t\t\t\t\t$property_element->appendChild( $doc->createTextNode( $property_set['value'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif( ! empty( $platform_attributes['options'] ) ){\n\t\t\t\t\t\t$option_element = $doc->createElement( $lticm_namespace->name . ':options' );\n\t\t\t\t\t\t$platform_element->appendChild( $option_element );\n\t\t\t\t\t\tforEach( $platform_attributes['options'] as $options_key => $options_set ){\n\t\t\t\t\t\t\tif( $options_key == 'properties' && ! empty( $options_set ) ){\n\t\t\t\t\t\t\t\tforEach( $options_set as $property_index => $property_set ){\n\t\t\t\t\t\t\t\t\t$property_element = $doc->createElement( $lticm_namespace->name . ':property' );\n\t\t\t\t\t\t\t\t\t$option_element->appendChild( $property_element );\n\t\t\t\t\t\t\t\t\t$property_element->setAttribute( 'name', $property_set['name'] );\n\t\t\t\t\t\t\t\t\t$property_element->appendChild( $doc->createTextNode( $property_set['value'] ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif( $options_key == 'options' && ! empty( $options_set ) ){ // current hierarchy does not require us to go this many levels deep\n\t\t\t\t\t\t\t\t$option_subelement = $doc->createElement( $lticm_namespace->name . ':options' );\n\t\t\t\t\t\t\t\t$option_element->appendChild( $option_subelement );\n\t\t\t\t\t\t\t\tforEach( $options_set as $options_subkey => $options_subset ){\n\t\t\t\t\t\t\t\t\tif( $options_subkey == 'properties' && ! empty( $options_subset ) ){\n\t\t\t\t\t\t\t\t\t\tforEach( $options_subset as $property_subindex => $property_subset ){\n\t\t\t\t\t\t\t\t\t\t\t$property_subelement = $doc->createElement( $lticm_namespace->name . ':property' );\n\t\t\t\t\t\t\t\t\t\t\t$option_subelement->appendChild( $property_subelement );\n\t\t\t\t\t\t\t\t\t\t\t$property_subelement->setAttribute( 'name', $property_subset['name'] );\n\t\t\t\t\t\t\t\t\t\t\t$property_subelement->appendChild( $doc->createTextNode( $property_subset['value'] ) );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n /* +----------------------------+\n | NAMESPACE SECTION: LTICP |\n +----------------------------+ */\n\t\t// add lti common profile (vendor) properties\n\t\t$lticp_namespace = $this->getNamespace( 'lticp' );\n\t\tif( ! empty( $lticp_namespace ) ){\n\t\t\t$vendor = $doc->createElement( 'vendor' );\n\t\t\t$root->appendChild( $vendor );\n\t\t\t// add vendor properties using the common profile dtd\n\t\t\t$lticp_properties = $this->getLticpProperties();\n\t\t\tforEach( $lticp_properties as $lticp_key => $lticp_value ){\n\t\t\t\tif( is_array( $lticp_value ) ){ // assumes max of two levels\n\t\t\t\t\t$attribute = $doc->createElement( $lticp_namespace->name . ':' . $lticp_key );\n\t\t\t\t\t$vendor->appendChild( $attribute );\n\t\t\t\t\tforEach( $lticp_value AS $child_key => $child_value ){\n\t\t\t\t\t\t$child_attribute = $doc->createElement( $lticp_namespace->name . ':' . $child_key );\n\t\t\t\t\t\t$attribute->appendChild( $child_attribute );\n\t\t\t\t\t\t$child_attribute->appendChild( $doc->createTextNode( $child_value ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{ // only one level deep\n\t\t\t\t\t$attribute = $doc->createElement( $lticp_namespace->name . ':' . $lticp_key );\n\t\t\t\t\t$vendor->appendChild( $attribute );\n\t\t\t\t\t$attribute->appendChild( $doc->createTextNode( $lticp_value ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n /* +--------------------------------+\n | LTI OUTCOMES HEADER AND BODY |\n +--------------------------------+ */\n\t\t// add lti outcomes header and body for LTI Basic Outcomes messages\n\t\tif( $configuration_properties['root'] == 'imsx_POXEnvelopeRequest' ){\n\t\t\t// recursively append header nodes\n\t\t\t$header_hierarchy = $this->getImsxPoxHeaderProperties();\n\t\t\t$this->buildNode( $doc, $root, $header_hierarchy );\n\t\t\t// recursively append body nodes\n\t\t\t$body_hierarchy = $this->getImsxPoxBodyProperties( $this->_outcomes_action );\n\t\t\t$this->buildNode( $doc, $root, $body_hierarchy );\n\t\t}\n\n\t\t// output\n\t\t$doc->formatOutput = true;\n\t\t$result = $doc->saveXML();\n\t\treturn $result;\n\t}", "protected function generateConfiguration()\n {\n if (!in_array($this->format, array('yml', 'xml', 'php'))) {\n return;\n }\n\n $target = sprintf(\n '%s/Resources/config/routing/%s.%s',\n $this->bundle->getPath(),\n strtolower(str_replace('\\\\', '_', $this->entity)),\n $this->format\n );\n\n $this->renderFile('rest/config/routing.'.$this->format.'.twig', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n ));\n }", "public function install(){\r\n\t\t\r\n\t}", "function getXML() {\n $this->layout->addMenu(sprintf('<menu>%s</menu>'.LF, $this->menubar->getXML()));\n if (isset($this->params['cmd'])) {\n switch ($this->params['cmd']) {\n case 'edit_file':\n case 'file_tags':\n case 'file_versions':\n case 'file_derivations':\n case 'restore_version':\n case 'delete_version':\n case 'papaya_tag':\n $this->layout->addRight($this->getFilesToolbar());\n break;\n }\n }\n $this->addDialogXML();\n }", "public function actionGenerateModuleConfig()\n {\n $detectedModules = $this->actionDetectModules();\n\n $modules = Module::model()->findAll(new CDbCriteria(array(\n 'order' => 'name',\n 'condition' => 'enabled = true',\n )));\n $config = array();\n foreach ($modules as $module) {\n if (!isset($detectedModules[$module->name])) continue;\n $config[$module->name] = array(\n 'class' => $detectedModules[$module->name]\n );\n }\n $str = \"<?php\\nreturn \" . var_export($config, true) . \"\\n?>\";\n file_put_contents(Yii::getPathOfAlias('runtime.cache') . '/modules.php', $str);\n }", "protected function buildXML() {\n $xml = new \\DOMDocument('1.0', 'utf-8');\n $xml->formatOutput = true;\n\n $request = $xml->appendChild($xml->createElement('SMSBoxXMLRequest'));\n\n // add command, username and password params\n $username = $xml->createElement('username', $this->client->getConfig('username'));\n $password = $xml->createElement('password', $this->client->getConfig('password'));\n $command = $xml->createElement('command', strtoupper($this->getName()));\n\n $request->appendChild($username);\n $request->appendChild($password);\n $request->appendChild($command);\n\n $params = $request->appendChild($xml->createElement('parameters'));\n\n // add parameters\n foreach ($this->getApiCommand()->getParams() as $name => $arg) {\n if ($this->get($name) === true) {\n $params->appendChild($xml->createElement($name));\n } else if (!is_null($this->get($name)) && $this->get($name) !== false) {\n $params->appendChild($xml->createElement($name, $this->get($name)));\n }\n }\n\n return $xml;\n }", "public function install() {\n\n\n }", "function _write_config_file($values){\n $db_server = $values['db_server'] ?: \"\";\n $db_name = $values['db_name'] ?: \"\";\n $db_user = $values['db_user'] ?: \"\";\n $db_password = $values['db_password'] ?: \"\";\n $mynautique_enabled = (isset($values['mynautique_enabled']) && $values['mynautique_enabled'] == TRUE) ? \"TRUE\" : \"FALSE\";\n $mynautique_user = isset($values['mynautique_user']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_user'] : \"\";\n $mynautique_password = isset($values['mynautique_password']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_password'] : \"\";\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $config_string = '<?php'.\"\\n\";\n $config_string .= '// Database Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// database server'.\"\\n\";\n $config_string .= '$config[\\'db_server\\'] = \"'. $db_server .'\";'.\"\\n\";\n $config_string .= '// database'.\"\\n\";\n $config_string .= '$config[\\'db_name\\'] = \"'. $db_name .'\";'.\"\\n\";\n $config_string .= '// database user'.\"\\n\";\n $config_string .= '$config[\\'db_user\\'] = \"'. $db_user .'\";'.\"\\n\";\n $config_string .= '// database user password'.\"\\n\";\n $config_string .= '$config[\\'db_password\\'] = \"'. $db_password .'\";'.\"\\n\";\n $config_string .= \"\\n\";\n\n if ( isset($values['mynautique_enabled'])) {\n $config_string .= '// MyNautique Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// myNautique enabled'.\"\\n\";\n $config_string .= '$config[\\'mynautique_enabled\\'] = '.$mynautique_enabled .';'.\"\\n\";\n $config_string .= '// myNautique user'.\"\\n\";\n $config_string .= '$config[\\'mynautique_user\\'] = \"'. $mynautique_user .'\";'.\"\\n\";\n $config_string .= '// myNautique password'.\"\\n\";\n $config_string .= '$config[\\'mynautique_password\\'] = \"'. $mynautique_password .'\";'.\"\\n\";\n }\n\n $config_string .= '?>'.\"\\n\";\n\n $bytes_written = file_put_contents (\"../config/config.php\", $config_string);\n\n if($bytes_written == FALSE) {\n return $bytes_written;\n }\n return TRUE;\n }", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Nochex Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept Nochex payments?', '6', '44', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Nochex Email Address', 'MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS','\".STORE_OWNER_EMAIL_ADDRESS.\"', 'Registered email address for your Nochex account.<br />NOTE: This must match <strong>EXACTLY </strong>the registered email address on your Nochex account.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Nochex Account Type', 'MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE', 'Seller', 'Please select the type of Nochex account you are accepting payments with.', '6', '44', 'zen_cfg_select_option(array(\\'Seller\\',\\'Merchant\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_NOCHEX_MERCHANT_ID', '', 'For Nochex Merchant account holders, allows you to accept payments using a different merchant ID. Has no effect on Seller accounts.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '44', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_NOCHEX_PROCESSING_STATUS_ID', '\" . DEFAULT_ORDERS_STATUS_ID . \"', 'Set the status of orders made with this payment module that are not yet completed to this value<br />(\\'Pending\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br />(\\'Processing\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '44', now())\");\r\n\r\n // Nochex testing options go here\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_NOCHEX_APC_DEBUG', 'Off', 'Enable debug logging? <br />NOTE: This can REALLY clutter your email inbox!<br />Logging goes to the /includes/modules/payment/nochex_apc/logs folder<br />Email goes to the store-owner address.<strong>Leave OFF for normal operation.</strong>', '6', '44', 'zen_cfg_select_option(array(\\'Off\\',\\'Log File\\',\\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Status Live/Testing', 'MODULE_PAYMENT_NOCHEX_TESTING', 'Live', 'Set Nochex module to Live or Test. In Test mode no money is transferred.', '6', '44', 'zen_cfg_select_option(array(\\'Live\\', \\'Test\\'), ', now())\");\r\n\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_INSTALLED');\r\n }", "function install(){}", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function writePackageXmlDraft()\n {\n if (file_exists($this->getPackageXmlPath())) {\n throw new Horde_Pear_Exception(\n sprintf(\n 'File %s already exists and will not be overwritten!',\n $this->getPackageXmlPath()\n )\n );\n }\n $infoFile = $this->_root . '/info.php';\n if (!file_exists($infoFile)) {\n throw new Horde_Pear_Exception(\n sprintf('File %s missing', $infoFile)\n );\n }\n\n require $infoFile;\n\n file_put_contents(\n $this->getPackageXmlPath(),\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<package packagerversion=\"1.9.2\" version=\"2.0\" xmlns=\"http://pear.php.net/dtd/package-2.0\" xmlns:tasks=\"http://pear.php.net/dtd/tasks-1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd\">\n <name>' . $this->getName() . '</name>\n <channel>pear.horde.org</channel>\n <summary>' . $theme_name . ' Theme</summary>\n <description>' . $theme_name . ' Theme</description>\n <lead>\n <name>Jan Schneider</name>\n <user>jan</user>\n <email>[email protected]</email>\n <active>yes</active>\n </lead>\n <lead>\n <name>Michael J Rubinsky</name>\n <user>mrubinsk</user>\n <email>[email protected]</email>\n <active>yes</active>\n </lead>\n <date>' . date('Y-m-d') . '</date>\n <version>\n <release>1.0.0</release>\n <api>1.0.0</api>\n </version>\n <stability>\n <release>stable</release>\n <api>stable</api>\n </stability>\n <license uri=\"proprietary\">Proprietary</license>\n <notes>\n* Initial version.\n </notes>\n <dependencies>\n <required>\n <php>\n <min>5.3.0</min>\n </php>\n <pearinstaller>\n <min>1.7.0</min>\n </pearinstaller>\n </required>\n </dependencies>\n <changelog>\n <release>\n <version>\n <release>1.0.0</release>\n <api>1.0.0</api>\n </version>\n <stability>\n <release>stable</release>\n <api>stable</api>\n </stability>\n <license uri=\"proprietary\">Proprietary</license>\n <notes>\n* Initial version.\n </notes>\n </release>\n </changelog>\n</package>\n'\n );\n }", "public function configWizard() {\n $strReturn = \"\";\n\n if($this->checkDefaultValues())\n header(\"Location: \"._webpath_.\"/installer.php?step=loginData\");\n\n $bitCxCheck = true;\n\n if(isset($_POST[\"write\"]) && $_POST[\"write\"] == \"true\") {\n\n\n //try to validate the data passed\n $bitCxCheck = class_carrier::getInstance()->getObjDB()->validateDbCxData(\n $_POST[\"driver\"],\n $_POST[\"hostname\"],\n $_POST[\"username\"],\n $_POST[\"password\"],\n $_POST[\"dbname\"],\n $_POST[\"port\"]\n );\n\n\n if($bitCxCheck) {\n $strFileContent = \"<?php\\n\";\n $strFileContent .= \"/*\\n Kajona V4 config-file.\\n If you want to overwrite additional settings, copy them from /core/module_system/system/config/config.php into this file.\\n*/\";\n $strFileContent .= \"\\n\";\n $strFileContent .= \" \\$config['dbhost'] = '\".$_POST[\"hostname\"].\"'; //Server name \\n\";\n $strFileContent .= \" \\$config['dbusername'] = '\".$_POST[\"username\"].\"'; //Username \\n\";\n $strFileContent .= \" \\$config['dbpassword'] = '\".$_POST[\"password\"].\"'; //Password \\n\";\n $strFileContent .= \" \\$config['dbname'] = '\".$_POST[\"dbname\"].\"'; //Database name \\n\";\n $strFileContent .= \" \\$config['dbdriver'] = '\".$_POST[\"driver\"].\"'; //DB-Driver \\n\";\n $strFileContent .= \" \\$config['dbprefix'] = '\".$_POST[\"dbprefix\"].\"'; //Table-prefix \\n\";\n $strFileContent .= \" \\$config['dbport'] = '\".$_POST[\"port\"].\"'; //Database port \\n\";\n\n $strFileContent .= \"\\n\";\n //and save to file\n file_put_contents($this->STR_PROJECT_CONFIG_FILE, $strFileContent);\n // and reload\n header(\"Location: \"._webpath_.\"/installer.php?step=loginData\");\n $this->strOutput = $strReturn;\n return;\n }\n }\n\n\n //check for available modules\n $strMysqliInfo = \"\";\n $strSqlite3Info = \"\";\n $strPostgresInfo = \"\";\n $strOci8Info = \"\";\n if(!in_array(\"mysqli\", get_loaded_extensions())) {\n $strMysqliInfo = \"<div class=\\\"alert alert-error\\\">\".$this->getLang(\"installer_dbdriver_na\").\" mysqli</div>\";\n }\n if(!in_array(\"pgsql\", get_loaded_extensions())) {\n $strPostgresInfo = \"<div class=\\\"alert alert-error\\\">\".$this->getLang(\"installer_dbdriver_na\").\" postgres</div>\";\n }\n if(in_array(\"sqlite3\", get_loaded_extensions())) {\n $strSqlite3Info = \"<div class=\\\"alert alert-info\\\">\".$this->getLang(\"installer_dbdriver_sqlite3\").\"</div>\";\n }\n else {\n $strSqlite3Info = \"<div class=\\\"alert alert-error\\\">\".$this->getLang(\"installer_dbdriver_na\").\" sqlite3</div>\";\n }\n if(in_array(\"oci8\", get_loaded_extensions())) {\n $strOci8Info = \"<div class=\\\"alert alert-info\\\">\".$this->getLang(\"installer_dbdriver_oci8\").\"</div>\";\n }\n else {\n $strOci8Info = \"<div class=\\\"alert alert-error\\\">\".$this->getLang(\"installer_dbdriver_na\").\" oci8</div>\";\n }\n\n $strCxWarning = \"\";\n if(!$bitCxCheck) {\n $strCxWarning = \"<div class=\\\"alert alert-error\\\">\".$this->getLang(\"installer_dbcx_error\").\"</div>\";\n }\n\n //configwizard_form\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"configwizard_form\", true);\n $strReturn .= $this->objTemplates->fillTemplate(\n array(\n \"mysqliInfo\" => $strMysqliInfo,\n \"sqlite3Info\" => $strSqlite3Info,\n \"postgresInfo\" => $strPostgresInfo,\n \"oci8Info\" => $strOci8Info,\n \"cxWarning\" => $strCxWarning,\n \"postHostname\" => isset($_POST[\"hostname\"]) ? $_POST[\"hostname\"] : \"\",\n \"postUsername\" => isset($_POST[\"username\"]) ? $_POST[\"username\"] : \"\",\n \"postDbname\" => isset($_POST[\"dbname\"]) ? $_POST[\"dbname\"] : \"\",\n \"postDbport\" => isset($_POST[\"port\"]) ? $_POST[\"port\"] : \"\",\n \"postDbdriver\" => isset($_POST[\"driver\"]) ? $_POST[\"driver\"] : \"\",\n \"postPrefix\" => isset($_POST[\"dbprefix\"]) != \"\" ? $_POST[\"dbprefix\"] : \"kajona_\"\n ),\n $strTemplateID\n );\n $this->strBackwardLink = $this->getBackwardLink(_webpath_.\"/installer.php\");\n\n\n $this->strOutput = $strReturn;\n }", "function admin_generate(){\n\t\t$fp = fopen('files/sitemap.xml', 'w+');\n\n\t$start_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/</loc>\n \t\t<changefreq>daily</changefreq>\n \t\t<priority>1</priority>\n\t</url>';\n\n\t\tfwrite($fp, $start_string);\n\n\t\t// projdu vsechny produkty\n\t\tApp::import('Model', 'Product');\n\t\t$this->Sitemap->Product = new Product;\n\t\t\n\t\t$this->Sitemap->Product->recursive = -1;\n\t\t$products = $this->Sitemap->Product->find('all', array('fields' => array('Product.url', 'Product.modified')));\n\n\t\tforeach ( $products as $product ){\n\t\t\t// pripnout k sitemape\n\t\t\t$mod = explode(' ', $product['Product']['modified']);\n\t\t\t$mod = $mod[0];\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $product['Product']['url'] . '</loc>\n \t\t<lastmod>' . $mod . '</lastmod>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.9</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny kategorie\n\t\tApp::import('Model', 'Category');\n\t\t$this->Sitemap->Category = new Category;\n\t\t\n\t\t$this->Sitemap->Category->recursive = -1;\n\t\t$categories = $this->Sitemap->Category->find('all', array('fields' => array('Category.id', 'Category.url')));\n\n\t\t$skip = array(0 => '5', '25', '26', '53');\n\t\tforeach ( $categories as $category ){\n\t\t\tif ( in_array($category['Category']['id'], $skip) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = date('Y-m-d');\n\n\t\t\t// pripnout k sitemape\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $category['Category']['url'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t\t\n\t\t}\n\t\t\n\t\t// projdu vsechny vyrobce\n\t\tApp::import('Model', 'Manufacturer');\n\t\t$this->Sitemap->Manufacturer = new Manufacturer;\n\t\t\n\t\t$this->Sitemap->Manufacturer->recursive = -1;\n\t\t$manufacturers = $this->Sitemap->Manufacturer->find('all', array('fields' => array('Manufacturer.id', 'Manufacturer.name')));\n\t\t\n\t\tforeach ( $manufacturers as $manufacturer ){\n\t\t\t// pripnout k sitemape\n\t\t\t// vytvorim si url z name a id\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . strip_diacritic($manufacturer['Manufacturer']['name']) . '-v' . $manufacturer['Manufacturer']['id'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny obsahove stranky\n\t\tApp::import('Model', 'Content');\n\t\t$this->Sitemap->Content = new Content;\n\t\t\n\t\t$this->Sitemap->Content->recursive = -1;\n\t\t$contents = $this->Sitemap->Content->find('all', array('fields' => array('Content.path')));\n\t\t\n\t\tforeach ( $contents as $content ){\n\t\t\t// pripnout k sitemape\n\t\t\tif ( $content['Content']['path'] == 'index' ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $content['Content']['path'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.7</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t$end_string = '\n</urlset>';\n\t\tfwrite($fp, $end_string);\n\t\tfclose($fp);\n\t\t// uzavrit soubor\n\t\tdie('here');\n\t}", "public function build()\n {\n $this->taskMirrorDir([\n 'src/modules' => 'web/modules/custom',\n 'src/themes' => 'web/themes/custom',\n ])->run();\n $this->_copy('src/settings.php', 'web/sites/default/settings.php');\n if (getenv('PROD_DEST') == 'pantheon') {\n $this->_copy('src/settings.pantheon.php', 'web/sites/default/settings.pantheon.php');\n }\n $this->_touch(\".built\");\n return $this;\n }", "protected function configure() {\n // $this->addArguments(array(\n // new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),\n // ));\n\n $this->addOptions(array(\n new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'),\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),\n // add your own options here\n ));\n\n $this->namespace = 'u';\n $this->name = 'build-all';\n $this->briefDescription = '';\n $this->detailedDescription = <<<EOF\nThe [export-orders|INFO] task does things.\nCall it with:\n\n [php symfony u:build-all|INFO]\nEOF;\n }", "function printFormInstall()\n\t\t{\n\t\t$html = '\n\t\t\n\t\t<div>\n\t\t\n\t\t<form id=\"forminstall\">\n \n\t\t<legend><h1>Configuración del módulo</h1></legend>\n \n\t\t\t\t\t<p>&nbsp;</p>\n\t\t\t\t\t\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t <div>\n\t\t\t\t\t \t<p><label>Qué tipo de funcionalidad desea instalar?</label></p>\n\t\t\t\t\t </div>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <p>\n\t\t\t\t\t\t <select name=\"funcionality\" class=\"large\">\n\t\t\t\t\t\t\t <option value=\"sel\">Seleccione</option>\n\t\t\t\t\t\t\t <option value=\"1\">Título y artículo</option>\n\t\t\t\t\t\t\t <option value=\"2\">Título, artículo y una imagen</option>\n\t\t\t\t\t\t\t <option value=\"3\">Título, artículo y varias imagenes</option>\n\t\t\t\t\t\t </select>\n\t\t\t\t\t\t </p>\n\t\t\t\t\t </div>\t\t\t\t \n\t\t\t\t\t </fieldset>\n\t\t\t\t\t \n\t\t\t\t\t <p>&nbsp;</p>\n\t\t\t\t\t \n\t\t\t\t\t <!--<fieldset>\n\t\t\t\t\t <div>\n\t\t\t\t\t \t<p><label>Desea anadir la característica \"extracto\" del artículo?</label></p>\n\t\t\t\t\t </div>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t <input type=\"radio\" name=\"xtract\" value=\"1\" id=\"xtract_0\" />Si</label>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t <input type=\"radio\" name=\"xtract\" value=\"0\" id=\"xtract_1\" />No</label>\n\t\t\t\t\t\t </p>\n\t\t\t\t\t </div>\n\t\t\t\t\t\t</fieldset>-->\n\t\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t <div>\n\t\t\t\t\t \t<p><label>Instalar datos de ejemplo?</label></p>\n\t\t\t\t\t </div>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <p>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t <input type=\"radio\" name=\"dataExample\" value=\"1\" id=\"dataExample_0\" />Si</label>\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t <input type=\"radio\" name=\"dataExample\" value=\"0\" id=\"dataExample_1\" />No</label>\n\t\t\t\t\t\t </p>\n\t\t\t\t\t </div>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t<p>&nbsp;</p>\t \n\t\t\t\t <a class=\"uibutton\" onclick=\"xajax_install(xajax.getFormValues(\\'forminstall\\')); return false;\">Instalar módulo</a> \t\t\t\t \n\t\t</form>\t\t\t \n\t</div>\t\t\t\n</div>';\nreturn $html;\n\t\t}", "public function Bin_Build_Save()\n\t{\t\t\n\t\t$config = $this->readConfigFile();\t//invoking web.xml parsing\n\t\t$appsetup = $this->buildAppSetup($config); //creating app setup array\n\t\t$sysfiles = $this->buildSystemConfig($config); //creating system config array\n\t\t$libraries = $this->buildLibraryConfig($config); //creating library config array\n\t\t$controllers = $this->buildControllerConfig($config); //creating controller config array\t\t\t\n\n\t\t/**\n\t\t * All xml information will be converted in to an array\n\t\t * based on the root folder it will be stored as dll file\n\t\t * in the following we checking whether this configuration file\n\t\t * is related to this root folder.\n\t\t */\n\t\tif(!$controllers)\n\t\t\treturn false;\n\t\t\t\n\t\t$content = \"<?php \\n\\n\".' $system = '.var_export($sysfiles, true) . \";\\n\";\n\t\t$content .= \"\\n\\n\".' $appsetup = '.var_export($appsetup, true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $libraries = '.var_export($libraries, true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $domapping = '.var_export($controllers['domapping'], true) . \";\\n \";\n\t\t$content .= \"\\n\\n\".' $globalmapping = '.var_export($controllers['globalmapping'], true) . \";\\n ?>\";\n\n\t\t@mkdir(ROOT_FOLDER.'Built/'.CURRENT_FOLDER,0777);\n\t\t@chmod(ROOT_FOLDER.'Built/'.CURRENT_FOLDER,0777);\n\t\t\n\t\tif ($fp = @fopen(ROOT_FOLDER.'Built/'.CURRENT_FOLDER.\"/Dll.php\", 'wb'))\n\t\t{\n\t\t\t@flock($fp, LOCK_EX);\t\t\t\n\t\t\tfwrite($fp, $content);\n\t\t\t@flock($fp, LOCK_UN);\n\t\t\tfclose($fp);\n\t\t\t@chmod(ROOT_FOLDER.'Built/'.CURRENT_FOLDER.\"/Dll.php\", 0666);\n\t\t}\t\n\t}", "public static function install(){\n\t}", "public function toXML()\n {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . PHP_EOL;\n $output .= '<provisioning version=\"1.1\" productID=\"' . $this->getProductID() . '\">' . PHP_EOL;\n\n $output .= '<firmware>' . PHP_EOL;\n\n if ($this->getFirmware()) {\n $output .= '<file version=\"' . $this->getFirmware()->getVersion() . '\" url=\"' . $this->getFirmware()->getUrl() . '\"/>' . PHP_EOL;\n }\n\n $output .= '</firmware>' . PHP_EOL;\n\n if ($this->getDownloadWallpaper()) {\n $output .= '<custom>' . PHP_EOL;\n $output .= '<step type=\"DownloadWallpaper\" url=\"' . $this->getDownloadWallpaper() . '\"/>' . PHP_EOL;\n $output .= '</custom>' . PHP_EOL;\n }\n\n $output .= '<nvm>' . PHP_EOL;\n\n $iterator = new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($this->toArray()));\n foreach ($iterator as $leafValue) {\n $keys = [];\n foreach (range(0, $iterator->getDepth()) as $depth) {\n $keys[] = $iterator->getSubIterator($depth)->key();\n }\n\n // convert booleans to 0 or 1\n if (is_bool($leafValue)) {\n $leafValue = $leafValue ? '1' : '0';\n }\n\n $output .= '<param name=\"' . join('.', $keys) . '\" value=\"' . $leafValue . '\" />' . PHP_EOL;\n }\n $output .= '</nvm>' . PHP_EOL;\n\n $output .= '<custom></custom>' . PHP_EOL;\n $output .= '</provisioning>';\n\n return $output;\n }", "function install() {}", "function build_xml_actualites($file_path)\r\n\t{\r\n\t\tglobal $config;\r\n\r\n\t\t// On récupère les actualités\r\n\t\tmysql_query('SET lc_time_names = \"en_US\"');\r\n\t\t$db_items = Sql::get_objects_from_query(\"SELECT *, DATE_FORMAT(`date`, '%a, %d %b %Y') AS rfc_date FROM \" . TABLES__ACTUALITES . \" ORDER BY date DESC\", 'Actualite');\r\n\r\n\t\t// On créé le fichier XML\r\n\t\t$this->create_dir(ROOT_PATH . 'xml');\r\n\t\t$fp = fopen ($file_path, \"w+\");\r\n\t\tfputs($fp, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" . \"\\n\");\r\n\t\tfputs($fp, \"<rss version=\\\"2.0\\\" xmlns:atom=\\\"http://www.w3.org/2005/Atom\\\">\" . \"\\n\");\r\n\t\tfputs($fp, \"\\t\" . \"<channel>\" . \"\\n\");\r\n\t\tfputs($fp, \"\\t\\t\" . \"<title>\" . stripslashes($config->site_title) . \"</title>\" . \"\\n\");\r\n\t\tfputs($fp, \"\\t\\t\" . \"<link>\" . $config->site_url . \"</link>\" . \"\\n\");\r\n\t\tfputs($fp, \"\\t\\t\" . \"<description>\" . stripslashes($config->site_description) . \"</description>\" . \"\\n\");\r\n\t\tfputs($fp, \"\\t\\t\" . \"<atom:link rel=\\\"self\\\" type=\\\"application/rss+xml\\\" href=\\\"\" . $config->site_url . \"/xml/actualites.xml\\\" />\" . \"\\n\");\r\n\r\n\t\tforeach($db_items as $db_item)\r\n\t\t{\r\n\t\t\tfputs($fp, \"\\t\\t\" . '<item>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\\t\" . '<title>' . stripslashes($db_item->titre) . '</title>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\\t\" . '<link>' . $config->site_url . '/actualite.php?id=' . $db_item->id . '</link>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\\t\" . '<guid isPermaLink=\"false\">' . $config->site_url . '/actualite.php?id=' . $db_item->id . '</guid>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\\t\" . '<description>' .htmlentities('<img src=\"' . $config->site_url . '/uploads/medias/actualites/images/thumbs/' . $db_item->image() . '\" alt=\"\" height=\"80\" align=\"left\" />' . stripslashes($db_item->contenu)) . '</description>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\\t\" . '<pubDate>' . $db_item->rfc_date . ' 00:00:00 GMT</pubDate>' . \"\\n\");\r\n\t\t\tfputs($fp, \"\\t\\t\" . '</item>' . \"\\n\");\r\n\t\t}\r\n\r\n\t\tfputs($fp, \"\\t\" . \"</channel>\" . \"\\n\");\r\n\t\tfputs($fp, \"</rss>\" . \"\\n\");\r\n\t\tfclose($fp);\r\n\t}", "function installTreeToPackage() {\n\t\tif (!is_array($this->packageInfo)) { \n\t\t\tif ($this->debug) { echo \"ERROR - no package info found<BR>\\n\"; }\nexit();\n\t\t\treturn; \n\t\t}\n\t\t$info = $this->packageInfo['info'];\n\t\t$configs = $this->packageInfo['configs'];\n\t\t$mid = $info['name'];\n\t\tlcRegistry::delete($mid);\n\t\t$reg = lcRegistry::load($mid);\n\t\t$reg->mid = $mid;\n\t\t$reg->moduleName = $mid;\n\t\t$reg->displayName = $info['displayName'];\n\t\t$reg->version = $info['version'];\n\t\t$reg->author = $info['author'];\n\t\t$reg->copyright = $info['copyright'];\n\t\t$reg->lastModified = date(\"Y-m-d h:i:s\");\n\t\t$reg->save();\n\t\twhile(list($k,$v) = @each($configs['config'])) {\n\t\t\textract($v);\n\t\t\t$reg->config[$key] = $default;\n\t\t\t$reg->type[$key] = $type;\n\t\t\t$reg->extra[$key] = @implode(\"\\n\",$options);\n\t\t}\n\t\t$reg->saveConfig();\n\t\texec(\"cp \".$this->dir.\" \".SERVICE_PATH.\"/\".$this->moduleName.\"/ -R\");\n\t}", "protected function config_generate()\n\t{\n\t\t// Check if Database is supported by Sphinx\n\t\tif ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli')\n\t\t{\n\t\t\t$this->dbtype = 'mysql';\n\t\t}\n\t\telse if ($this->db->get_sql_layer() == 'postgres')\n\t\t{\n\t\t\t$this->dbtype = 'pgsql';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_WRONG_DATABASE');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if directory paths have been filled\n\t\tif (!$this->config['fulltext_sphinx_data_path'])\n\t\t{\n\t\t\t$this->config_file_data = $this->user->lang('FULLTEXT_SPHINX_NO_CONFIG_DATA');\n\t\t\treturn false;\n\t\t}\n\n\t\tinclude($this->phpbb_root_path . 'config.' . $this->php_ext);\n\n\t\t/* Now that we're sure everything was entered correctly,\n\t\tgenerate a config for the index. We use a config value\n\t\tfulltext_sphinx_id for this, as it should be unique. */\n\t\t$config_object = new \\phpbb\\search\\sphinx\\config($this->config_file_data);\n\t\t$config_data = array(\n\t\t\t'source source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('type',\t\t\t\t\t\t$this->dbtype . ' # mysql or pgsql'),\n\t\t\t\t// This config value sql_host needs to be changed incase sphinx and sql are on different servers\n\t\t\t\tarray('sql_host',\t\t\t\t\t$dbhost . ' # SQL server host sphinx connects to'),\n\t\t\t\tarray('sql_user',\t\t\t\t\t'[dbuser]'),\n\t\t\t\tarray('sql_pass',\t\t\t\t\t'[dbpassword]'),\n\t\t\t\tarray('sql_db',\t\t\t\t\t\t$dbname),\n\t\t\t\tarray('sql_port',\t\t\t\t\t$dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'SET NAMES \\'utf8\\''),\n\t\t\t\tarray('sql_query_pre',\t\t\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_range',\t\t\t'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t'5000'),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= $start AND p.post_id <= $end'),\n\t\t\t\tarray('sql_query_post',\t\t\t\t''),\n\t\t\t\tarray('sql_query_post_index',\t\t'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = $maxid WHERE counter_id = 1'),\n\t\t\t\tarray('sql_query_info',\t\t\t\t'SELECT * FROM ' . POSTS_TABLE . ' WHERE post_id = $id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'forum_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'topic_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'poster_id'),\n\t\t\t\tarray('sql_attr_uint',\t\t\t\t'post_visibility'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'topic_first_post'),\n\t\t\t\tarray('sql_attr_bool',\t\t\t\t'deleted'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'post_time'),\n\t\t\t\tarray('sql_attr_timestamp',\t\t\t'topic_last_post_time'),\n\t\t\t\tarray('sql_attr_string',\t\t\t'post_subject'),\n\t\t\t),\n\t\t\t'source source_phpbb_' . $this->id . '_delta : source_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('sql_query_pre',\t\t\t\t''),\n\t\t\t\tarray('sql_query_range',\t\t\t''),\n\t\t\t\tarray('sql_range_step',\t\t\t\t''),\n\t\t\t\tarray('sql_query',\t\t\t\t\t'SELECT\n\t\t\t\t\t\tp.post_id AS id,\n\t\t\t\t\t\tp.forum_id,\n\t\t\t\t\t\tp.topic_id,\n\t\t\t\t\t\tp.poster_id,\n\t\t\t\t\t\tp.post_visibility,\n\t\t\t\t\t\tCASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,\n\t\t\t\t\t\tp.post_time,\n\t\t\t\t\t\tp.post_subject,\n\t\t\t\t\t\tp.post_subject as title,\n\t\t\t\t\t\tp.post_text as data,\n\t\t\t\t\t\tt.topic_last_post_time,\n\t\t\t\t\t\t0 as deleted\n\t\t\t\t\tFROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.topic_id = t.topic_id\n\t\t\t\t\t\tAND p.post_id >= ( SELECT max_doc_id FROM ' . SPHINX_TABLE . ' WHERE counter_id=1 )'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_main'),\n\t\t\t\tarray('docinfo',\t\t\t\t\t'extern'),\n\t\t\t\tarray('morphology',\t\t\t\t\t'none'),\n\t\t\t\tarray('stopwords',\t\t\t\t\t''),\n\t\t\t\tarray('min_word_len',\t\t\t\t'2'),\n\t\t\t\tarray('charset_type',\t\t\t\t'utf-8'),\n\t\t\t\tarray('charset_table',\t\t\t\t'U+FF10..U+FF19->0..9, 0..9, U+FF41..U+FF5A->a..z, U+FF21..U+FF3A->a..z, A..Z->a..z, a..z, U+0149, U+017F, U+0138, U+00DF, U+00FF, U+00C0..U+00D6->U+00E0..U+00F6, U+00E0..U+00F6, U+00D8..U+00DE->U+00F8..U+00FE, U+00F8..U+00FE, U+0100->U+0101, U+0101, U+0102->U+0103, U+0103, U+0104->U+0105, U+0105, U+0106->U+0107, U+0107, U+0108->U+0109, U+0109, U+010A->U+010B, U+010B, U+010C->U+010D, U+010D, U+010E->U+010F, U+010F, U+0110->U+0111, U+0111, U+0112->U+0113, U+0113, U+0114->U+0115, U+0115, U+0116->U+0117, U+0117, U+0118->U+0119, U+0119, U+011A->U+011B, U+011B, U+011C->U+011D, U+011D, U+011E->U+011F, U+011F, U+0130->U+0131, U+0131, U+0132->U+0133, U+0133, U+0134->U+0135, U+0135, U+0136->U+0137, U+0137, U+0139->U+013A, U+013A, U+013B->U+013C, U+013C, U+013D->U+013E, U+013E, U+013F->U+0140, U+0140, U+0141->U+0142, U+0142, U+0143->U+0144, U+0144, U+0145->U+0146, U+0146, U+0147->U+0148, U+0148, U+014A->U+014B, U+014B, U+014C->U+014D, U+014D, U+014E->U+014F, U+014F, U+0150->U+0151, U+0151, U+0152->U+0153, U+0153, U+0154->U+0155, U+0155, U+0156->U+0157, U+0157, U+0158->U+0159, U+0159, U+015A->U+015B, U+015B, U+015C->U+015D, U+015D, U+015E->U+015F, U+015F, U+0160->U+0161, U+0161, U+0162->U+0163, U+0163, U+0164->U+0165, U+0165, U+0166->U+0167, U+0167, U+0168->U+0169, U+0169, U+016A->U+016B, U+016B, U+016C->U+016D, U+016D, U+016E->U+016F, U+016F, U+0170->U+0171, U+0171, U+0172->U+0173, U+0173, U+0174->U+0175, U+0175, U+0176->U+0177, U+0177, U+0178->U+00FF, U+00FF, U+0179->U+017A, U+017A, U+017B->U+017C, U+017C, U+017D->U+017E, U+017E, U+0410..U+042F->U+0430..U+044F, U+0430..U+044F, U+4E00..U+9FFF'),\n\t\t\t\tarray('min_prefix_len',\t\t\t\t'0'),\n\t\t\t\tarray('min_infix_len',\t\t\t\t'0'),\n\t\t\t),\n\t\t\t'index index_phpbb_' . $this->id . '_delta : index_phpbb_' . $this->id . '_main' => array(\n\t\t\t\tarray('path',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'index_phpbb_' . $this->id . '_delta'),\n\t\t\t\tarray('source',\t\t\t\t\t\t'source_phpbb_' . $this->id . '_delta'),\n\t\t\t),\n\t\t\t'indexer' => array(\n\t\t\t\tarray('mem_limit',\t\t\t\t\t$this->config['fulltext_sphinx_indexer_mem_limit'] . 'M'),\n\t\t\t),\n\t\t\t'searchd' => array(\n\t\t\t\tarray('compat_sphinxql_magics'\t,\t'0'),\n\t\t\t\tarray('listen'\t,\t\t\t\t\t($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost') . ':' . ($this->config['fulltext_sphinx_port'] ? $this->config['fulltext_sphinx_port'] : '9312')),\n\t\t\t\tarray('log',\t\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/searchd.log'),\n\t\t\t\tarray('query_log',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'log/sphinx-query.log'),\n\t\t\t\tarray('read_timeout',\t\t\t\t'5'),\n\t\t\t\tarray('max_children',\t\t\t\t'30'),\n\t\t\t\tarray('pid_file',\t\t\t\t\t$this->config['fulltext_sphinx_data_path'] . 'searchd.pid'),\n\t\t\t\tarray('max_matches',\t\t\t\t(string) SPHINX_MAX_MATCHES),\n\t\t\t\tarray('binlog_path',\t\t\t\t$this->config['fulltext_sphinx_data_path']),\n\t\t\t),\n\t\t);\n\n\t\t$non_unique = array('sql_query_pre' => true, 'sql_attr_uint' => true, 'sql_attr_timestamp' => true, 'sql_attr_str2ordinal' => true, 'sql_attr_bool' => true);\n\t\t$delete = array('sql_group_column' => true, 'sql_date_column' => true, 'sql_str2ordinal_column' => true);\n\t\tforeach ($config_data as $section_name => $section_data)\n\t\t{\n\t\t\t$section = $config_object->get_section_by_name($section_name);\n\t\t\tif (!$section)\n\t\t\t{\n\t\t\t\t$section = $config_object->add_section($section_name);\n\t\t\t}\n\n\t\t\tforeach ($delete as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($non_unique as $key => $void)\n\t\t\t{\n\t\t\t\t$section->delete_variables_by_name($key);\n\t\t\t}\n\n\t\t\tforeach ($section_data as $entry)\n\t\t\t{\n\t\t\t\t$key = $entry[0];\n\t\t\t\t$value = $entry[1];\n\n\t\t\t\tif (!isset($non_unique[$key]))\n\t\t\t\t{\n\t\t\t\t\t$variable = $section->get_variable_by_name($key);\n\t\t\t\t\tif (!$variable)\n\t\t\t\t\t{\n\t\t\t\t\t\t$variable = $section->create_variable($key, $value);\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$variable->set_value($value);\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$variable = $section->create_variable($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->config_file_data = $config_object->get_data();\n\n\t\treturn true;\n\t}", "function export_wxr_data($xml=null) {\r\n foreach($this->get_posts_xml($xml) as $item) {\r\n $atts = $item->attributes(); //get xml element attributes\r\n $hw = $item->children($this->namespaces['hw']);\r\n $wp = $item->children($this->namespaces['wp']);\r\n $title = (string)$wp->title;\r\n //get skins\r\n $skins = $this->fetch_skins($hw->skin, 'hash_skin', 'hwskin_config',0, false);\r\n\r\n //source path\r\n $source= (string) $hw->source;\r\n #if(!file_exists($source)) $source = get_stylesheet_directory().'/' .$source;\r\n\r\n $settings = $this->recursive_option_data($hw->settings->children())->option;\r\n if(isset($skins['theme'])) $settings['theme']= $skins['theme']->get_hash_skin_code();\r\n\r\n $this->run_cli('add_slider', array(\r\n 'title' => $title,\r\n 'source' => 'upload',\r\n 'num' => '3',\r\n 'from_path' => 'theme',\r\n 'source_path' => $source,\r\n 'settings' => HW_Encryptor::encode64($settings)\r\n ));\r\n }\r\n $this->add_export_widgets();\r\n $this->do_import();\r\n }", "function to_xml(){\n\t\tif ($this->skip) return \"\";\n\t\t\n\t\t$str=\"<item id='\".$this->get_id().\"' >\";\n\t\tfor ($i=0; $i<sizeof($this->config->text); $i++){\n\t\t\t$extra = $this->config->text[$i][\"name\"];\n\t\t\t$str.=\"<\".$extra.\"><![CDATA[\".$this->data[$extra].\"]]></\".$extra.\">\";\n\t\t}\n\t\treturn $str.\"</item>\";\n\t}", "public function getConfigTreeBuilder()\n {\n $treeBuilder = new TreeBuilder();\n\n $root = $treeBuilder->root('git_deploy_project');\n $root->children()\n ->booleanNode('npm')->defaultNull()->end()\n ->booleanNode('composer')->defaultNull()->end()\n ->arrayNode('scripts')\n ->fixXmlConfig('script')\n ->arrayPrototype()\n ->beforeNormalization()\n ->ifString()->then(function($v) {\n return [\n 'command' => $v,\n ];\n })\n ->end()\n ->children()\n ->arrayNode('command')\n ->isRequired()\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->variablePrototype()->end()\n ->end() // Command\n ->arrayNode('trigger')\n ->beforeNormalization()\n ->castToArray()\n ->end()\n ->arrayPrototype()\n ->beforeNormalization()\n ->castToArray()\n ->ifString()->then(function($v) {\n return [\n 'path' => $v,\n ];\n })\n ->end()\n ->children()\n ->variableNode('path')->isRequired()->end()\n ->variableNode('trigger')->end()\n ->booleanNode('exact')->defaultTrue()->end()\n ->end()\n ->end()\n ->end() // Trigger\n ->end()\n ->end() // Script Array Prototype\n ->end() // Scripts Array Node\n ->end();\n\n return $treeBuilder;\n }", "function install_settings()\n\t{\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\t\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Добавление настроек...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/settings.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\n\t\t//-----------------------------------------\n\t\t// Known settings\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr( $this->install->saved_data['install_url'], -1 ) == '/' )\n\t\t{\n\t\t\t$this->install->saved_data['install_url'] = substr( $this->install->saved_data['install_url'], 0, -1 );\n\t\t}\n\t\t\n\t\t$_urls = parse_url( $this->install->saved_data['install_url'] );\n\t\t\n\t\t$known = array( 'email_in' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'email_out' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'base_dir' => $this->install->saved_data['install_dir'],\n\t\t\t\t\t\t 'upload_dir' => $this->install->saved_data['install_dir'] . '/uploads',\n\t\t\t\t\t\t 'upload_url' => $this->install->saved_data['install_url'] . '/uploads',\n\t\t\t\t\t\t 'search_sql_method' => $this->install->ipsclass->DB->sql_can_fulltext() ? 'ftext' : 'man',\n\t\t\t\t\t\t //'cookie_domain' => $_urls['host'] != 'localhost' ? '.' . preg_replace( \"#^(?:.+?\\.)?([a-z0-9\\-]{3,})\\.(([a-z]{2,4})(\\.([a-z]{2}))?|museum)$#is\", \"\\\\1.\\\\2\", $_urls['host'] ) : '',\n\t\t\t\t\t );\n\t\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// Parse\n\t\t//-----------------------------------------\n\n\t\t$fields = array( 'conf_title' , 'conf_description', 'conf_group' , 'conf_type' , 'conf_key' , 'conf_default',\n\t\t\t\t\t\t 'conf_extra' , 'conf_evalphp' , 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',\n\t\t\t\t\t\t 'conf_help_key', 'conf_add_cache' , 'conf_title_keyword' );\n\n\t\t$setting_fields = array( 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_noshow', 'conf_title_module' );\n\n\t\t//-----------------------------------------\n\t\t// Fix up...\n\t\t//-----------------------------------------\n \n\t\tif ( ! is_array( $xml->xml_array['settingexport']['settinggroup']['setting'][0] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Ensure [0] is populated\n\t\t\t//-----------------------------------------\n\n\t\t\t$tmp = $xml->xml_array['settingexport']['settinggroup']['setting'];\n\n\t\t\tunset($xml->xml_array['settingexport']['settinggroup']['setting']);\n\n\t\t\t$xml->xml_array['settingexport']['settinggroup']['setting'][0] = $tmp;\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Loop through and sort out settings...\n\t\t//-----------------------------------------\n\n\t\tforeach( $xml->xml_array['settingexport']['settinggroup']['setting'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is setting?\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( ! $entry['conf_is_title']['VALUE'] )\n\t\t\t{\n\t\t\t\tforeach( $fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_settings[] = $newrow;\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is title?\n\t\t\t//-----------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach( $setting_fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_titles[] = $newrow;\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out titles...\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_titles ) and count( $new_titles ) )\n\t\t{\n\t\t\tforeach( $new_titles as $idx => $data )\n\t\t\t{\n\t\t\t\tif ( $data['conf_title_title'] AND $data['conf_title_keyword'] )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Get ID based on key\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$save = array( 'conf_title_title' => $data['conf_title_title'],\n\t\t\t\t\t\t\t\t 'conf_title_desc' => $data['conf_title_desc'],\n\t\t\t\t\t\t\t\t 'conf_title_keyword' => $data['conf_title_keyword'],\n\t\t\t\t\t\t\t\t 'conf_title_noshow' => $data['conf_title_noshow'],\n\t\t\t\t\t\t\t\t 'conf_title_module' => $data['conf_title_module'] );\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Insert first\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings_titles', $save );\n\n\t\t\t\t\t$conf_id = $this->install->ipsclass->DB->get_insert_id();\n\t\t\t\t\t$save['conf_title_id'] = $conf_id;\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Update settings cache\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$setting_groups_by_key[ $save['conf_title_keyword'] ] = $save;\n\t\t\t\t\t$setting_groups[ $save['conf_title_id'] ] = $save;\n\n\t\t\t\t\t$need_update[] = $conf_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out settings\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_settings ) and count( $new_settings ) )\n\t\t{\n\t\t\tforeach( $new_settings as $idx => $data )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Insert known\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tif ( in_array( $data['conf_key'], array_keys( $known ) ) )\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = $known[ $data['conf_key'] ];\n\t\t\t\t\t#$data['conf_default'] = $known[ $data['conf_key'] ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = '';\n\t\t\t\t}\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Now assign to the correct ID based on\n\t\t\t\t// our title keyword...\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id'];\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Remove from array\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tunset( $data['conf_title_keyword'] );\n\n\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings', $data );\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Update group counts...\n\t\t//-----------------------------------------\n\n\t\tif ( count( $need_update ) )\n\t\t{\n\t\t\tforeach( $need_update as $i => $idx )\n\t\t\t{\n\t\t\t\t$conf = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$idx ) );\n\n\t\t\t\t$count = intval($conf['count']);\n\n\t\t\t\t$this->install->ipsclass->DB->do_update( 'conf_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\n\t\t$this->install->template->next_action = '?p=install&sub=acpperms';\n\t\t$this->install->template->hide_next = 1;\n\t}", "public function createBookConfig()\n {\n $bookConfig = $this->twig->render('config.yml.twig', [\n 'title' => $this->config->title,\n 'author' => $this->config->author,\n 'entries' => $this->entries\n ]);\n file_put_contents($this->docPath.DIRECTORY_SEPARATOR.'config.yml', $bookConfig);\n }", "public function loadConfig(SimpleXMLElement $config, $metafile, $generate);", "public function sys_configAction()\n {\n // Check authonitcation\n $this->setAdminTab('developer');\n\n $this->page_title = 'System Configuration';\n $message = \"\";\n $file_path = CONFIG_PATH . DS . \"config.xml\";\n $definition = array();\n $dom = new DOMDocument();\n\n $dom->load($file_path);\n\n if (isset($this->post['Button']['button_save'])) {\n if (is_writeable($file_path)) {\n\n $this->data['sconfig'] = isset($this->data['sconfig'])\n ? $this->data['sconfig'] : array();\n\n $options = $dom->getElementsByTagName('option');\n\n foreach ($options as $option) {\n $name = $option->getAttribute('name');\n $option->getElementsByTagName('value')->item(0)->nodeValue = '';\n\n if (\n in_array($name,\n array_keys($this->data['sconfig'])\n )\n ) {\n $cdataNode = $dom->createCDATASection($this->data['sconfig'][$name]);\n $option->getElementsByTagName('flag')->item(0)->nodeValue = 0;\n }\n else {\n $cdataNode = $dom->createCDATASection(\n $option->getElementsByTagName('default')\n ->item(0)\n ->nodeValue\n );\n\n $option->getElementsByTagName('flag')->item(0)->nodeValue = 1;\n }\n\n $option->getElementsByTagName('value')->item(0)->appendChild($cdataNode);\n\n }\n\n App::Module('Notification')->Push($this->__(\"Configuration updated successfully.\"));\n\n /* Save Configuration */\n $dom->save($file_path);\n }\n else {\n App::Module('Notification')\n ->Push(\n $this->__(\"Your configuration file is not writeable($file_path).\"),\n 'Error'\n );\n }\n $this->redirect(\"/developer/sys-config\");\n exit;\n }\n $this->set('sysconf', $dom);\n }", "public function wp_install_config($opts){\n\n\t\t// We retrieve each line as an array\n\t\t$config_file = file( 'wp-config-sample.php' );\n\n\t\t// Managing the security keys\n\t\t$secret_keys = explode( \"\\n\", file_get_contents( 'https://api.wordpress.org/secret-key/1.1/salt/' ) );\n\n\t\tforeach ( $secret_keys as $k => $v ) {\n\t\t\t$secret_keys[$k] = substr( $v, 28, 64 );\n\t\t}\n\n\t\t// We change the data\n\t\t$key = 0;\n\t\tforeach ( $config_file as &$line ) {\n\n\t\t\tif ( '$table_prefix =' == substr( $line, 0, 16 ) ) {\n\t\t\t\t$line = '$table_prefix = \\'' . $this->sanit( $opts['prefix'] ) . \"';\\r\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! preg_match( '/^define\\(\\'([A-Z_]+)\\',([ ]+)/', $line, $match ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$constant = $match[1];\n\n\t\t\tswitch ( $constant ) {\n\t\t\t\tcase 'WP_DEBUG'\t :\n\n\t\t\t\t\t// Debug mod\n\t\t\t\t\tif ( (int) $opts['debug'] == 1 ) {\n\t\t\t\t\t\t$line = \"define('WP_DEBUG', 'true');\\r\\n\";\n\n\t\t\t\t\t\t// Display error\n\t\t\t\t\t\tif ( (int) $opts['debug_display'] == 1 ) {\n\t\t\t\t\t\t\t$line .= \"\\r\\n\\n \" . \"/** Affichage des erreurs à l'écran */\" . \"\\r\\n\";\n\t\t\t\t\t\t\t$line .= \"define('WP_DEBUG_DISPLAY', 'true');\\r\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// To write error in a log files\n\t\t\t\t\t\tif ( (int) $opts['debug_log'] == 1 ) {\n\t\t\t\t\t\t\t$line .= \"\\r\\n\\n \" . \"/** Ecriture des erreurs dans un fichier log */\" . \"\\r\\n\";\n\t\t\t\t\t\t\t$line .= \"define('WP_DEBUG_LOG', 'true');\\r\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$line .= \"\\r\\n\\n \" . \"/** On augmente la mémoire limite */\" . \"\\r\\n\";\n\t\t\t\t\t$line .= \"define('WP_MEMORY_LIMIT', '256M');\" . \"\\r\\n\";\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_NAME' :\n\t\t\t\t\t$line = \"define('DB_NAME', '\" . $this->sanit( $opts['dbname'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_USER' :\n\t\t\t\t\t$line = \"define('DB_USER', '\" . $this->sanit( $opts['uname'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_PASSWORD' :\n\t\t\t\t\t$line = \"define('DB_PASSWORD', '\" . $this->sanit( $opts['pwd'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DB_HOST' :\n\t\t\t\t\t$line = \"define('DB_HOST', '\" . $this->sanit( $opts['dbhost'] ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'AUTH_KEY' :\n\t\t\t\tcase 'SECURE_AUTH_KEY' :\n\t\t\t\tcase 'LOGGED_IN_KEY' :\n\t\t\t\tcase 'NONCE_KEY' :\n\t\t\t\tcase 'AUTH_SALT' :\n\t\t\t\tcase 'SECURE_AUTH_SALT' :\n\t\t\t\tcase 'LOGGED_IN_SALT' :\n\t\t\t\tcase 'NONCE_SALT' :\n\t\t\t\t\t$line = \"define('\" . $constant . \"', '\" . $secret_keys[$key++] . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WPLANG' :\n\t\t\t\t\t$line = \"define('WPLANG', '\" . $this->sanit( $this->_wp_lang ) . \"');\\r\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tunset( $line );\n\n\t\t$handle = fopen( 'wp-config.php', 'w' );\n\t\tforeach ( $config_file as $line ) {\n\t\t\tfwrite( $handle, $line );\n\t\t}\n\t\tfclose( $handle );\n\n\t\t// We set the good rights to the wp-config file\n\t\tchmod( 'wp-config.php', 0666 );\n\t\tunlink('wp-config-sample.php' );\n\n\t\treturn TRUE;\n\t}", "public function getXML(DOMDocument $xml){\n\t\t$user_setting = $xml->createElement('user-setting');\n\t\t/* Get XML method */\n\t\tif(!is_null($this->user)){\n\t\t\t$user_setting->setAttribute('user', $this->user->getID());\n\t\t}\n\t\tif(!is_null($this->ident)){\n\t\t\t$user_setting->setAttribute('ident', $this->getIdent());\n\t\t}\n\t\tif(!is_null($this->value)){\n\t\t\t$user_setting->setAttribute('value', $this->getValue());\n\t\t}\n\t\t/* Get XML method end */\n\t\treturn $user_setting;\n\t}", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "protected function configure()\n {\n $this->setName('appconfig')\n ->setDescription('Create appserver.io Config')\n ->addArgument('application-name', InputOption::VALUE_REQUIRED, 'config application name')\n ->addArgument('namespace', InputOption::VALUE_REQUIRED, 'namespace for the project')\n ->addArgument('directory', InputOption::VALUE_REQUIRED, 'webapps root directory')\n ->addOption('routlt-version', 'rl', InputOption::VALUE_OPTIONAL, 'the routlt version to use', '~2.0');\n }", "function configurationApply(){\n\t\t// this create a \"config/files/config-XXX.conf\" whith the maker found\n\t\t$makers = glob($_SERVER['DOCUMENT_ROOT'].'/config/makers/make-config-*.php', GLOB_BRACE);\n\t\t\n\t\t// get an unique ID for this apply action\n\t\t$actionId = uniqid();\n\n\t\t// run all makers in the directory\n\t\tforeach($makers as $maker) {\n\t\t\t$pat[0]= 'make-config-';\n\t\t\t$pat[1]= '.php';\n\t\t\t$remp[0]= '';\n\t\t\t$remp[1]= '';\n\t\t\t// get the single maker name\n\t\t\t$maker_name = basename($maker);\n\t\t\t$maker_name = str_replace($pat,$remp,$maker_name);\n\t\t\t// set the temp conf file for the maker\n\t\t\tglobal $config_done;\n\t\t\t$config_done = $_SERVER['DOCUMENT_ROOT'].'/config/files/config-'.$maker_name.'.conf';\n\t\t\tglobal $config_generated;\n\t\t\tglobal $config_user_do;\n\t\t\tglobal $config_syst;\n\t\t\t// run the maker\n\t\t\tinclude($maker);\n\t\t\t// create the config temp file\n\t\t\tif($file = @fopen($config_done, 'w')) {\n\t\t\t\tfwrite($file,$config_generated);\n\t\t\t\tfclose($file);\n\t\t\t\t// add the task to the \"podServerSystem\" queue (copy files to their system path to apply configuration)\n\t\t\t\t$this->podServerSystem->addTask($config_user_do,'cp ' . $config_done . ' ' . $config_syst,TASK_COPY_FILE_CONFIG,$actionId);\n\n\t\t\t\t/* NOTE : you can add all makers you want by adding a file \"config/makers/make-config-YOURMAKERNAME.php\" \n\t\t\t\t In your maker file, you have to correctly configure \n\t\t\t\t\t\"$config_syst\" : the conf file path in your system\n\t\t\t\t\t\"$config_user_do\" : the user that copy the configuration system file (for \"podServerSystem\" tasks queue)\n\t\t\t\t And feed correctly the configuration \n\t\t\t\t\t\"$config_generated\" : the content of the conf. file to write to the system\n\t\t\t\t This action will execute it automatically when \"apply\" action will be used\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t// copy uploaded files items of the global configuration to their system directory\n\t\tforeach ($this->itemsConfiguration as $item){\n\t\t\tif ($item->type == 'file') {\n\t\t\t\t$file_uploads = $_SERVER['DOCUMENT_ROOT'].'/uploads/' . $item->name;\n\t\t\t\t// if the directory does not exists, create it by adding a \"mkdir\" task for the system user\n\t\t\t\tif (!file_exists($item->values)) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'mkdir ' . $item->values,TASK_MKDIR_AUTO);\n\t\t\t\t}\n\t\t\t\t$file_system = $item->values . $item->name;\n\t\t\t\t// adding a \"cp\" task for the system user\t\t\t\n\t\t\t\tif ($item->values != '' && file_exists($file_uploads) ) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'cp ' . $file_uploads . ' ' . $file_system,TASK_COPY_FILE_ITEM,$actionId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.59866405", "0.59220266", "0.5830591", "0.56886625", "0.5678746", "0.56736124", "0.55745363", "0.5562491", "0.5556638", "0.5504562", "0.5439892", "0.53970945", "0.53956246", "0.5365915", "0.53373295", "0.5325211", "0.52837175", "0.5270281", "0.526991", "0.52666616", "0.52585495", "0.52486455", "0.52260935", "0.5213318", "0.52052134", "0.51869214", "0.51749724", "0.5158448", "0.5152163", "0.51461154", "0.5145338", "0.5117074", "0.5100513", "0.5083986", "0.50810295", "0.50697386", "0.5052434", "0.50466007", "0.50337404", "0.50337404", "0.5031868", "0.5027224", "0.5017567", "0.5004389", "0.49933255", "0.49914902", "0.4987938", "0.49841228", "0.49828753", "0.49824244", "0.49587947", "0.49487624", "0.49472925", "0.49440953", "0.49435362", "0.4940672", "0.49321845", "0.4917455", "0.4893669", "0.48839656", "0.4876222", "0.48730567", "0.4869569", "0.48663402", "0.48635972", "0.48606402", "0.4852417", "0.48493624", "0.48466867", "0.48457292", "0.48426744", "0.48346353", "0.4830599", "0.4828868", "0.4827299", "0.48195755", "0.4819202", "0.48172423", "0.48143142", "0.48059842", "0.48033458", "0.47974887", "0.4790549", "0.4785366", "0.47817236", "0.47790128", "0.47788802", "0.47758868", "0.47739956", "0.4765182", "0.47630855", "0.47605985", "0.4757425", "0.47490728", "0.47461003", "0.4744687", "0.47445202", "0.473902", "0.47237617", "0.4720929" ]
0.5504374
10
Try to instantiate a modX instance
protected function getInstance() { if ($this->modx) { return $this->modx; } $path = $this->getCorePath(); require_once "{$path}/model/modx/modx.class.php"; $this->modx = \modX::getInstance('setup'); $this->modx->initialize('mgr'); $this->modx->getService('error', 'error.modError'); return $this->modx; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initMODX()\n {\n require_once MODX_CORE_PATH . 'model/modx/modx.class.php';\n\n $this->modx = new modX();\n $this->modx->initialize('mgr');\n $this->modx->setLogLevel(modX::LOG_LEVEL_INFO);\n $this->modx->setLogTarget('ECHO');\n $this->modx->getService('error', 'error.modError');\n }", "public static function getInstance($modx)\n {\n \n if (null === self::$instance) {\n self::$instance = new self($modx);\n }\n return self::$instance;\n }", "public function _loadRealInstance() {}", "public static abstract function createInstance();", "abstract public function instance();", "public function newInstance(): object;", "public static function instantiateObject()\n {\n if (static::$bxObject) {\n return static::$bxObject;\n }\n\n if (class_exists(static::$objectClass)) {\n return static::$bxObject = new static::$objectClass();\n }\n\n throw new LogicException('Object initialization failed');\n }", "public function newInstance();", "public function newInstance();", "abstract protected function onCreateInstance();", "public function loadTheInstance();", "private function __construct($modx){\n\t\t$this->_modx = $modx;\n\t}", "public function instantiate($className);", "abstract public function get_instance();", "public static function instance();", "public function __construct()\n {\n if ($module = Registry::get('request')->getModules()) {\n $path = Micro::getInstance()->config['AppDir'] . $module . '/' . ucfirst(basename($module)) . 'Module.php';\n\n if (file_exists($path)) {\n $path = substr(basename($path), 0, -4);\n self::$module = new $path();\n }\n }\n }", "public function instance();", "function get_instance()\r\n{\r\n\t\r\n}", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getInstance(): object;", "public function instantiateClass()\n {\n $this->assertInstanceOf('\\Codeception\\Module\\DrupalUserRegistry', $this->module);\n }", "public static function get_instance ();", "function &_instanciateQuestion($question_id) \n\t{\n\t\tif ($question_id < 1) return FALSE;\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\tif (strlen($question_type) == 0) return FALSE;\n\t\tSurveyQuestion::_includeClass($question_type);\n\t\t$question = new $question_type();\n\t\t$question->loadFromDb($question_id);\n\t\treturn $question;\n }", "public static function inst();", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "public function be_instantiatable() {\n\t\t$this->assertInstanceOf( Cache::class, $this->make_instance() );\n\t}", "public function __construct() {\n\t\tif ( self::$_instance ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.0' );\n\t\t}\n\t}", "private function createInstance()\n\t{\n\t\tif( gdprcWpmlHelper::isActive() ) {\n\t\t\t$this->pluginClassName = 'gdprcMultilangWpml';\n\t\t\t\n\t\t\treturn $this->getInstance( $this->pluginClassName );\t\t\t\n\n\t\t} else {\t\t\t\t\n\t\t\treturn false;\n\t\t}\n\t}", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function init() {\n\t\treturn Factory::get_instance( self::class );\n\t}", "function &Factory(&$element, $moduleID, &$callerRef)\n{\n if(empty($callerRef)){\n trigger_error(\"The Index class requires a reference to the calling module object.\", E_USER_ERROR);\n }\n\n if(!is_a($callerRef, 'Module')){\n trigger_error(\"The Index class can only be used by a module object.\", E_USER_ERROR);\n }\n return new $element->type($element, $moduleID, $callerRef);\n}", "public static function init() {\n $class = __CLASS__;\n new $class;\n }", "public static function setUpBeforeClass()\n {\n self::$modx = new modX();\n self::$modx->initialize('mgr');\n }", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public function instantiateModule(\\DOMElement &$element, string $class_name): bool\n {\n // skip if placeholder already assigned\n if ($element->hasAttribute($this->modules::INDEX_ATTRIBUTE)) {\n return false;\n }\n\n // resolve class name\n $element_class_name = $class_name;\n\n if ($element->hasAttribute('name')) {\n $element_name = $element->getAttribute('name');\n $element_class_name = str_replace('{name}', $element_name, $class_name);\n }\n\n // if class does not exist add debug comment\n if (!class_exists($element_class_name)) {\n $this->replaceDomElement($element, '<!-- Handler \"' . $element_class_name . '\" Not Found -->');\n return false;\n }\n\n // get args from element and remove child arg\n $args = $this->getElementArgs($element);\n\n // instantiate element\n $element_object = new $element_class_name($args);\n\n // if object cannot be instantiated add debug comment\n if (!is_object($element_object)) {\n $this->replaceDomElement($element, '<!-- Handler \"' . $element_class_name . '\" Error -->');\n return false;\n }\n\n // set element object placeholder\n $element->setAttribute($this->modules::INDEX_ATTRIBUTE, $element_object->module_id);\n\n // add module to pool\n $this->modules->add($element_object);\n\n return true;\n }", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function getInstance();", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "public function getInstance(): mixed;", "public function testNewInstance()\n {\n $className = 'TechDivision\\ApplicationServer\\Api\\Mock\\MockService';\n $instance = $this->service->newInstance($className, array(\n $this->service->getInitialContext(),\n \\Mutex::create(false)\n ));\n $this->assertInstanceOf($className, $instance);\n }", "function new_instance($class)\n {\n }", "private static function precall_getInstance(){\n $in = func_get_args();\n $reflect = new \\ReflectionClass(__CLASS__);\n return $reflect->newInstanceArgs($in);\n }", "function block_instance($blockname, $instance = NULL) {\n if(!block_load_class($blockname)) {\n return false;\n }\n $classname = 'CourseBlock_'.$blockname;\n $retval = New $classname;\n if($instance !== NULL) {\n $retval->load_instance($instance);\n }\n return $retval;\n}", "function __construct(modX & $modx, array $config = array()) {\n $this->modx = &$modx;\n\n $packageName = 'migx';\n $packagepath = $this->findPackagePath($packageName); \n $modelpath = $packagepath . 'model/';\n $prefix = null;\n $this->modx->addPackage($packageName, $modelpath, $prefix);\n\n\n /* allows you to set paths in different environments\n * this allows for easier SVN management of files\n */\n $corePath = $this->modx->getOption('migx.core_path', null, $modx->getOption('core_path') . 'components/migx/');\n $assetsPath = $this->modx->getOption('migx.assets_path', null, $modx->getOption('assets_path') . 'components/migx/');\n $assetsUrl = $this->modx->getOption('migx.assets_url', null, $modx->getOption('assets_url') . 'components/migx/');\n\n $defaultconfig['debugUser'] = '';\n $defaultconfig['corePath'] = $corePath;\n $defaultconfig['modelPath'] = $corePath . 'model/';\n $defaultconfig['processorsPath'] = $corePath . 'processors/';\n $defaultconfig['templatesPath'] = $corePath . 'templates/';\n $defaultconfig['controllersPath'] = $corePath . 'controllers/';\n $defaultconfig['chunksPath'] = $corePath . 'elements/chunks/';\n $defaultconfig['snippetsPath'] = $corePath . 'elements/snippets/';\n $defaultconfig['auto_create_tables'] = true;\n $defaultconfig['baseUrl'] = $assetsUrl;\n $defaultconfig['cssUrl'] = $assetsUrl . 'css/';\n $defaultconfig['jsUrl'] = $assetsUrl . 'js/';\n $defaultconfig['jsPath'] = $assetsPath . 'js/';\n $defaultconfig['connectorUrl'] = $assetsUrl . 'connector.php';\n $defaultconfig['request'] = $_REQUEST;\n\n $this->config = array_merge($defaultconfig, $config);\n\n /* load debugging settings */\n if ($this->modx->getOption('debug', $this->config, false)) {\n error_reporting(E_ALL);\n ini_set('display_errors', true);\n $this->modx->setLogTarget('HTML');\n $this->modx->setLogLevel(modX::LOG_LEVEL_ERROR);\n\n $debugUser = $this->config['debugUser'] == '' ? $this->modx->user->get('username') : 'anonymous';\n $user = $this->modx->getObject('modUser', array('username' => $debugUser));\n if ($user == null) {\n $this->modx->user->set('id', $this->modx->getOption('debugUserId', $this->config, 1));\n $this->modx->user->set('username', $debugUser);\n } else {\n $this->modx->user = $user;\n }\n }\n }", "public static function autoInit()\n {\n if (self::$instance !== null)\n {\n return;\n }\n // since some servers may have either Memcached or Memcache extension installed, we need to check it\n if(class_exists('Memcache', false)) {\n $extension = 'Memcache';\n } elseif(class_exists('Memcached', false)) {\n $extension = 'Memcached';\n } else {\n throw new Exception('Neither Memcache nor Memcached extensions aren\\'t installed.');\n }\n \n self::$instance = new $extension();\n self::$instance->addServer('127.0.0.1', 11211);\n\n }", "function get_instance($class)\n {\n }", "public function instantiate() {\n\n\t\trequire_once $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php';\n\t\t$this->admin = new Genesis_Simple_Hooks_Admin();\n\t\t$this->admin->init();\n\n\t}", "public function instance() {\n\t\t\n\t}", "public static function init() \n {\n if (!isset(self::$o_instance)) \n\t\t{\n $c = __CLASS__;\n self::$o_instance = new $c;\n }\n\n return self::$o_instance;\n }", "public function create_instance($record = null, array $options = null) {\n global $DB;\n\n $record = (object)(array)$record;\n $options = (array)$options;\n\n if (empty($record->course)) {\n throw new coding_exception('module generator requires $record->course');\n }\n\n // module data\n $record->modulename = 'dragdrop';\n $record->module = $DB->get_field('modules', 'id', array('name' => 'dragdrop'));\n $record->section = 0;\n $record->visible = 1;\n\n // instance data\n if (!isset($record->startdate)) {\n $record->startdate = time();\n }\n if (!isset($record->header)) {\n $record->header = array(\n 'format' => FORMAT_HTML,\n 'text' => '<p>Header goes here</p>'\n );\n }\n if (!isset($record->footer)) {\n $record->footer = array(\n 'format' => FORMAT_HTML,\n 'text' =>'<p>Footer goes here</p>'\n );\n }\n if (!isset($record->instruction)) {\n $record->instruction = '<p>Instruction goes here</p>';\n }\n if (!isset($record->num_attempts)) {\n $record->num_attempts = 3;\n }\n if (!isset($record->feedback_correct)) {\n $record->feedback_correct = '<p>Feedback goes here</p>';\n }\n if (!isset($record->hint)) {\n $record->hint = '<p>Hint goes here</p>';\n }\n\n return parent::create_instance($record, $options);\n }", "protected function CreateDummyModule($moduleName) {\n\n\t\t$instanceId = IPS_CreateInstance(GUID_DUMMY);\n\t\tIPS_SetName($instanceId, $moduleName);\n\t\tIPS_SetParent($instanceId, $this->InstanceID);\n\n\t\treturn $instanceId;\n\t}", "protected function __construct()\n {\n $this->_module = new Reuse_Ack_Model_Module;\n }", "public function _init() {}", "public static function & GetInstance ();", "public static function get_instance() {\n\n\t\t\t$module = get_called_class();\n\n\t\t\tif ( ! isset( self::$instances[ $module ] ) ) {\n\t\t\t\tself::$instances[ $module ] = new $module();\n\t\t\t}\n\n\t\t\treturn self::$instances[ $module ];\n\t\t}", "public function init_module_instance($modulename, $cm,\n $timemodified=null, $timeexpires=null) {\n $this->plugin = 'mod_' . $modulename;\n $this->coursemoduleid = (int)$cm->id;\n $this->courseid = (int)$cm->course;\n if ($timemodified) {\n $this->timemodified = (int)$timemodified;\n } else {\n $this->timemodified = time();\n }\n if ($timeexpires) {\n $this->timeexpires = (int)$timeexpires;\n }\n }", "public function make() {}", "function atkinstance($fullclassname, $reset=false)\n{\n\treturn atkClassLoader::getSingletonInstance($fullclassname, $reset);\n}", "public function getInstance(): object\n {\n }", "static function &get_instance($context = FALSE)\n {\n if (is_null(self::$_instance)) {\n $klass = get_class();\n self::$_instance = new $klass($context);\n }\n return self::$_instance;\n }", "function __construct(modX &$modx,array $config = array()) {\n\t\t$this->modx =& $modx;\n\n\t\t$core = $this->modx->getOption('core_path').'components/xflickr/';\n\t\t$assets_url = $this->modx->getOption('assets_url').'components/xflickr/';\n\t\t$assets_path = $this->modx->getOption('assets_path').'components/xflickr/';\n\t\t$this->api_key = $this->modx->getOption('xflickr.api_key');\n\t\t$this->api_secret = $this->modx->getOption('xflickr.api_secret');\n\t\t$this->token = $this->modx->getOption('xflickr.token');\n\t\t$this->config = array_merge(array(\n 'core_path' => $core,\n 'model_path' => $core.'model/',\n 'processors_path' => $core.'processors/',\n 'controllers_path' => $core.'controllers/',\n 'chunks_path' => $core.'chunks/',\n 'base_url' => $assets_url,\n 'css_url' => $assets_url.'css/',\n 'js_url' => $assets_url.'js/',\n 'connector_url' => $assets_url.'connector.php',\n\n\t\t),$config);\n\n\t\t$this->modx->addPackage('xflickr',$this->config['model_path']);\n\t\tif ($this->modx->lexicon) {\n\t\t\t$this->modx->lexicon->load('xflickr:default');\n\t\t}\n\n\t\t/* load debugging settings */\n\t\tif ($this->modx->getOption('debug',$this->config,false)) {\n\t\t\terror_reporting(E_ALL); ini_set('display_errors',true);\n\t\t\t$this->modx->setLogTarget('HTML');\n\t\t\t$this->modx->setLogLevel(MODX_LOG_LEVEL_ERROR);\n\n\t\t\t$debugUser = $this->config['debugUser'] == '' ? $this->modx->user->get('username') : 'anonymous';\n\t\t\t$user = $this->modx->getObject('modUser',array('username' => $debugUser));\n\t\t\tif ($user == null) {\n\t\t\t\t$this->modx->user->set('id',$this->modx->getOption('debugUserId',$this->config,1));\n\t\t\t\t$this->modx->user->set('username',$debugUser);\n\t\t\t} else {\n\t\t\t\t$this->modx->user = $user;\n\t\t\t}\n\t\t}\n\t}", "function _construct(){ }", "public static function instance()\n {\n }", "public function _init(){}", "public abstract function createInstance($parameters);", "public static function me(): Instantiatable\n {\n return self::instantiate();\n }", "public function __construct(&$modx = null, array $options = array())\n {\n $this->options = $options;\n if ($modx instanceof \\modX) {\n $this->modx =& $modx;\n }\n $gitPath = $this->getOption(self::GIT_PATH, null, getcwd());\n $this->git = new Git($gitPath, $options);\n }", "public function testGetInstance() {\n $this->assertInstanceOf('\\Nimbles', \\Nimbles::getInstance());\n \\Nimbles::setInstance();\n $this->assertInstanceOf('\\Nimbles', \\Nimbles::getInstance());\n }", "static function get_instance($context = FALSE)\n {\n if (!isset(self::$_instances[$context])) {\n $klass = get_class();\n self::$_instances[$context] = new $klass($context);\n }\n return self::$_instances[$context];\n }", "public function Instancia()\r\n {\r\n $this->instance = null;\r\n $this->instance = new NomCampoestruc();\r\n }", "abstract public function init();", "protected function instantiateTemplate() {\n\t\t$baseTemplate = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\Base';\n\t\t$templateName = '\\\\'. \\Autoload::TEMPLATE_NAMESPACE .'\\\\'. $this->getDocument()->getTemplateName();\n\t\tif( $templateName != null && class_exists( $templateName ) )\n\t\t\treturn new $templateName( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telseif( class_exists( $baseTemplate ) )\n\t\t\treturn new $baseTemplate( $this, $this->getRequestHandler(), $this->getDocument() );\n\t\telse\n\t\t\tthrow new Exception( \"Template '\". $templateName .\"' could not be found.\" );\n\t\treturn null;\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();" ]
[ "0.68461514", "0.6451704", "0.6408626", "0.6257522", "0.61994493", "0.61747324", "0.61530584", "0.6142996", "0.6142996", "0.6118049", "0.6070053", "0.60338724", "0.6001725", "0.5997824", "0.59368646", "0.59211916", "0.5915931", "0.5893563", "0.588248", "0.5817001", "0.577507", "0.5750295", "0.57307214", "0.57288224", "0.5722039", "0.5715424", "0.57108796", "0.5705019", "0.56863135", "0.5682668", "0.5682668", "0.5682668", "0.5682668", "0.56820005", "0.56802523", "0.5678638", "0.5678076", "0.56715345", "0.5661747", "0.56574684", "0.56574684", "0.56574684", "0.56574684", "0.5656307", "0.5656307", "0.5656307", "0.5655973", "0.5655973", "0.5655973", "0.55980545", "0.55850524", "0.55850524", "0.55850524", "0.55850524", "0.55850524", "0.55850524", "0.55850524", "0.55850524", "0.5584435", "0.5580428", "0.55637425", "0.5552159", "0.55378854", "0.5537346", "0.5536997", "0.5524511", "0.55204546", "0.55140126", "0.5489499", "0.54872656", "0.5479094", "0.5476993", "0.5471657", "0.5468064", "0.54547375", "0.5449618", "0.54468614", "0.5433175", "0.54173905", "0.5408009", "0.54052544", "0.54005814", "0.5397341", "0.53895557", "0.5372743", "0.5349974", "0.5348736", "0.5347048", "0.53467816", "0.5334745", "0.5329556", "0.53254974", "0.5325472", "0.5317307", "0.53119576", "0.53119576", "0.53119576", "0.53083766", "0.53083766", "0.53083766" ]
0.63288254
3
Set ComicService before test
protected function setUp(): void { $this->comicService = new ComicService(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->service = new ComicService();\n }", "public function setUp()\n {\n $this->service = new MockService($this->getMockInitialContext());\n }", "public function setUp() : void {\n parent::setUp();\n\n $this->companyRepositoryInterface = Mockery::mock(CompanyRepositoryInterface::class);\n $this->app->instance(CompanyRepositoryInterface::class, $this->companyRepositoryInterface);\n\n $this->companyGetService = App::make(CompanyGetService::class);\n }", "protected function setUp()\n {\n parent::setUp();\n\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $this->resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow);\n }", "protected function setUp()\r\n {\r\n $this->session = new NashEarlySession(self::$config[\"authenticationPath\"], self::$config[\"servicePath\"]);\r\n $this->object = new ContaService($this->session);\r\n $this->session->login(self::$config);\r\n \r\n $empresaService = new EmpresaService($this->session);\r\n $empresa = $empresaService->getEmpresasSelecionaveis(1, 0)[0];\r\n $empresaService->selecionaEmpresa($empresa->getId());\r\n }", "public function testSetService() {\n\n $obj = new Employes();\n\n $obj->setService(\"service\");\n $this->assertEquals(\"service\", $obj->getService());\n }", "public function setUp()\n {\n $config = [\n 'host' => 'http://dev01.blogic.crcpress.local/',\n 'app_login' => 'www.crcpress.com',\n 'app_pass' => 'overlord',\n 'extra_config' => [\n 'user_agent' => 'CRC PHP Soap client 2.0',\n 'connection_timeout' => 6,\n 'cache_wsdl' => \\WSDL_CACHE_MEMORY,\n 'trace' => true,\n 'soap_version' => \\SOAP_1_1,\n 'encoding' => 'UTF-8'\n ],\n ];\n $ecommerceApi = new EcommerceAPI($config);\n $this->shopperService = $ecommerceApi->getService('Shopper');\n $this->invoiceService = $ecommerceApi->getService('InvoiceManager');\n }", "public static function setUpBeforeClass() : void\n {\n self::$dataService = new DataServices;\n }", "public function setUp()\n {\n $this->appService = new AppService($this->getMockInitialContext());\n }", "public function SetTestService($value)\n {\n $this->_TestService = $value;\n }", "public function setUp()\n {\n // $this->app->instance('Portfolio', $this->mock);\n }", "protected function setUp() {\n $this->object = new OnlineLookupApiService();\n }", "public function setUp()\n {\n parent::setUp();\n\n static::$sent = 0;\n $this->serviceManager = new ServiceManager();\n\n $this->serviceManager\n ->setService( 'Configuration', $this->dataConfig )\n ->setService( 'SiteInfo', new SiteInfo( $this->dataSiteInfo ) )\n ->setAlias( 'Zork\\Db\\SiteInfo', 'SiteInfo' )\n ->setFactory( 'Zork\\Mail\\Service', 'Zork\\Mail\\ServiceFactory' );\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->api = new PaymentSecupayCreditcardsApi();\n }", "protected function mustTestGetService()\n {\n return true;\n }", "private function addMockServicesToContainer() {\n $this->registerServiceWithContainerMock('current_user', $this->getNewUserMock());\n $this->registerServiceWithContainerMock('entity_type.manager', $this->getNewEntityTypeManagerMock());\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }", "public function setUp()\n {\n $this->client = static::createClient();\n $this->container = $this->client->getContainer();\n }", "public static function setUpBeforeClass()\n\t{\n\t\tif (is_null(static::$container))\n\t\t{\n\t\t\tstatic::$container = Container::getInstance('com_akeebasubs', [\n\t\t\t\t'platformClass' => 'Akeeba\\\\Subscriptions\\\\Tests\\\\Stubs\\\\CustomPlatform'\n\t\t\t]);\n\t\t}\n\n\t\t// Prime the component parameters\n\t\tstatic::$container->params->get('currency');\n\t}", "public function setDummyService( TestModel $service ) {\n $service->getData();\n }", "protected function setUp(): void\n\t{\n\t\t$this->httpClient = new \\GuzzleHttp\\Client(\\App\\Utils::merge(\\App\\RequestHttp::getOptions(), [\n\t\t\t'base_uri' => \\App\\Config::main('site_URL') . 'webservice/ManageConsents/',\n\t\t\t'Content-Type' => 'application/json',\n\t\t\t'Accept' => 'application/json',\n\t\t\t'timeout' => 60,\n\t\t\t'connect_timeout' => 60,\n\t\t\t'http_errors' => false,\n\t\t\t'headers' => [\n\t\t\t\t'x-raw-data' => 1,\n\t\t\t],\n\t\t]));\n\t}", "public function setService(){\n if($this->getRecord()->getRecordType() === \"yt\"){\n $this->service = new YoutubeService();\n }\n if($this->getRecord()->getRecordType() === \"gm\"){\n $this->service = new GoogleMapService();\n }\n }", "protected function setUp()\n {\n $this->factory = new OcrServiceFactory();\n }", "protected function setUp()\n {\n parent::setUp();\n\n $this->dateService = Mockery::mock(IDateService::class);\n }", "protected function setUp() {\n\t\tparent::setUp ();\n\t\t$sm = Bootstrap::getServiceManager();\n\t\t$em = $sm->get('doctrine.entitymanager.orm_default');\n\t\t$service = new Creacion($em);\n\t\t$this->_service = new Transaccional($em,$service);\n\t}", "public function setUp()\n {\n parent::setUp();\n $this->payoutService = $this->app->make(Payout::class);\n }", "public function testCreateService()\n {\n $dummyService = new OcrDummyService();\n $ocrConfig = array('blubb');\n $config = array('ocr' => array('service' => 'test', 'config' => $ocrConfig));\n $serviceLocator = new ServiceManager();\n $serviceLocator->setService('Configuration', $config);\n $serviceLocator->setService('test', $dummyService);\n $service = $this->factory->createService($serviceLocator);\n $this->assertSame($service, $dummyService);\n $this->assertEquals($service->getConfig(), $ocrConfig);\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }", "public function setUp()\n {\n // leading to an errant invalid class alias being reported.\n $this->container = $this->prophesize(ServiceManager::class);\n $this->container->willImplement(ContainerInterface::class);\n }", "public function setUp()\n {\n parent::setUp();\n $this->mock = $this->initMock(TodayService::class);\n $this->target = $this->app->make(TodayController::class);\n }", "protected function setUp()\r\n {\r\n $this->object = new AccessControlServiceFactory;\r\n }", "public function __construct()\n {\n $this->services = [];\n }", "protected function setUp()\n {\n $this->object = new Client;\n }", "public function setService($service) {\r\n\t\t$this->service = $service;\r\n\t}", "public function __construct()\n {\n $this->Service = new ContactsService();\n $this->GroupService = new GroupService();\n }", "public function beforeSetup()\n {\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->_startServices ( true );\n\t\t$this->startup = new Startup ();\n\t\tEventsManager::start ();\n\t\tTranslatorManager::start ( 'fr_FR', 'en' );\n\t\t$this->_initRequest ( 'RestApiController', 'GET' );\n\t}", "public function __construct()\n {\n $this->demoService = new DemoService();\n }", "public function testCreateService()\n {\n\n }", "public function setUp()\n {\n /*\n * Create a new credentials object for authorization\n */\n $credentials = new \\Google_Auth_AssertionCredentials(\n $this->serviceAccountName,\n $this->scopes,\n $this->key,\n 'notasecret'\n );\n\n /*\n * Create a new client object\n */\n $this->client = new \\Google_Client();\n\n /*\n * Set app name, client ID, and service credentials\n */\n $this->client->setApplicationName($this->applicationName);\n $this->client->setClientId($this->clientId);\n $this->client->setAssertionCredentials($credentials);\n\n /*\n * Create google calendar service and assign to class property\n */\n $this->service = new \\Google_Service_Calendar($this->client);\n }", "public static function setUpBeforeClass()\n {\n //start the symfony kernel\n $kernel = static::createKernel();\n $kernel->boot();\n\n //get the DI container\n self::$container = $kernel->getContainer();\n\n //now we can instantiate our service (if you want a fresh one for\n //each test method, do this in setUp() instead\n self::$paginator = self::$container->get('knp_paginator');\n self::$serializer = self::$container->get('serializer');\n }", "public function testSetCumHService() {\n\n $obj = new Employes();\n\n $obj->setCumHService(10.092018);\n $this->assertEquals(10.092018, $obj->getCumHService());\n }", "public function __construct(CrmAwarenesServiceInterface $awarness_service){\n $this->crm_helper = $awarness_service;\n\n }", "protected function setUp(): void\n {\n global $di;\n\n // Init service container $di to contain $app as a service\n $di = new DIMagic();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n\n // Use a different cache dir for unit test\n $di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n $app = $di;\n $this->app = $di;\n $di->set(\"app\", $app);\n\n // Create and initiate the controller\n $this->controller = new DiceController();\n $this->controller->setApp($app);\n }", "public function setUp()\n {\n if (APPLICATION_ENV == 'development_vagrant') {\n //@todo I think this is only needed on dev environments\n $guzzleClient = new \\GuzzleHttp\\Client(['curl' => [\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_SSL_VERIFYHOST => false\n ]]);\n $this->client()->setClient($guzzleClient);\n }\n\n parent::setUp();\n }", "private function checkServiceServiceSet () {\n if(is_null($this->serviceService)) {\n $this->exceptionWithResponseCode(500,\n \"Internal error: The service service has not been set. Please contact a GOCDB administrator and report this error.\"\n );\n }\n }", "public function testWillStoreTheServiceToSelf()\n {\n $this->controller = new Controller($this->service, $this->factory);\n\n static::assertSame(\n $this->service,\n \\PHPUnit_Framework_Assert::readAttribute($this->controller, \"service\")\n );\n }", "function __construct()\n\t{\n\t\t$this->customerService = new CustomerService;\n\t\tparent::__construct();\n\t}", "protected function setUp() : void\n {\n global $di;\n\n // Init service container $di to contain $app as a service\n $di = new DIFactoryConfig();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n //set a test-cache for tests\n //$di->get(\"cache\")->setPath(ANAX_INSTALL_PATH . \"/test/cache\");\n\n // Create and initiate the controller\n $this->controller = new WeatherControllerMock();\n\n $this->controller->setDi($di);\n }", "protected function setUp(): void\n {\n global $di;\n // Init service container $di to contain $app as a service\n $di = new DIMagic();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $app = $di;\n $this->app = $app;\n $di->set(\"app\", $app);\n\n // Create and initiate the controller\n $this->controller = new DiceGameController();\n $this->controller->setApp($app);\n $this->controller->initialize();\n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "protected function setUp() {\n\t\tinclude ('config.php');\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$this->apiConnector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->service = $this->apiConnector->getService('Invoice');\n\t\tif (!is_null(self::$invoiceId)) {\n\t\t\t$this->object = $this->service->getById(self::$invoiceId);\n\t\t}\n\t}", "public function setUp()\n {\n // Create a new Laravel container instance.\n $container = new Container;\n\n // Resolve the pricing calculator (and any type hinted dependencies)\n // and set to class attribute.\n $this->priceHolder = $container->make('PAMH\\\\PriceHolder');\n }", "public static function setUpBeforeClass(){\n printf(\"*********** TESTING CREATE SWAPP SERVICE **********\");\n }", "public function setService(BaseService $service)\n {\n $this->_service = $service;\n }", "public function testComAdobeGraniteCompatrouterImplCompatSwitchingServiceImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.compatrouter.impl.CompatSwitchingServiceImpl';\n\n $crawler = $client->request('POST', $path);\n }", "protected function initServiceClient()\n {\n if ($this->httpClient === null) {\n $this->initHttpClients();\n }\n\n $serviceDescription = new Description($this->config->getServiceDescriptionConfig());\n $serviceClient = new GuzzleClient($this->getHttpClient(), $serviceDescription);\n\n foreach ($this->config->getClientDefaultsConfig() as $option => $value) {\n $serviceClient->setConfig($option, $value);\n }\n\n $this->description = $serviceDescription;\n $this->serviceClient = $serviceClient;\n }", "public function __construct($service) {\n $this->service = $service;\n }", "public function before()\n\t{\n\t\tparent::before();\n\t\t$this->_rest = Model_RestAPI::factory('RestCustomer', $this->_user);\n\t}", "protected function setUp()\n {\n $cache = new VoidCache();\n $this->client = new MockClient($cache);\n }", "protected function setUp()\n {\n parent::setUp();\n \n // TODO Auto-generated ServiceLoaderTest::setUp()\n \n $this->serviceLoader = new ServiceLoader();\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "protected function setUp()\n {\n $this->object = new Currency();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "public function testListServices()\n {\n\n }", "public static function setUpBeforeClass() : void\n {\n $reflection = new \\ReflectionProperty(ISOCurrencyProvider::class, 'instance');\n $reflection->setAccessible(true);\n $reflection->setValue(null);\n }", "public function setUp()\n {\n $this->CI = &get_instance();\n $this->flight = new Flight();\n }", "public function setUp(){\n $this->client = static::createClient();\n }", "protected function setUp(): void\n {\n parent::setUp();\n config([\"services.{$this->provider}.client_id\" => $this->faker->uuid]);\n config([\"services.{$this->provider}.client_secret\" => $this->faker->uuid]);\n }", "protected function setUp() {\r\n $this->object = new Candidato('03592075101');\r\n }", "public function set_service($service_url)\n\t{\n\t\t$this->api_service = $service_url;\n\t}", "public function setConnectionService(string $connectionService): void;", "public static function setUpBeforeClass()\n {\n define('CONFIDE_TEST', true);\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\tStartup::setConfig ( $this->config );\n\t\t$this->_startCache ();\n\t\t$this->yumlModelsCreator = new YumlModelsCreator ();\n\t}", "public function setUp()\n {\n $this->controllerInfo = new ControllerInfo();\n }", "protected function setUp() {\n $this->object = new CallableActionProxy(function() {\n return 'test_proxy';\n });\n }", "protected function setUp(): void\n {\n $this->container = new Container();\n }", "protected function setUp()\n {\n $this->_instance = Tinebase_CustomField::getInstance();\n }", "protected function setUp()\n {\n $this->app = new Container();\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->rpc = $this->getMock( 'Zork\\Rpc\\CallableInterface' );\n $this->serviceManager = new ServiceManager;\n $this->serviceManager\n ->setService( 'SampleRpc', $this->rpc );\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public static function setUpBeforeClass()\n {\n self::$_client = static::createClient();\n }", "public function setUp(): void\n {\n parent::setUp();\n\n $this->client = new Client();\n }", "protected function setUp()\n {\n $this->client = new HttpClient($this->api_key, $this->api_signature, $this->hostname);\n }", "public function __construct() {\n\n parent::__construct();\n load_class('Service', 'core');\n $this->_ci_service_paths = array(APPPATH);\n }", "public function testOrgApacheFelixScrScrService()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.felix.scr.ScrService';\n\n $crawler = $client->request('POST', $path);\n }", "protected function setUp(): void\n {\n if (!isset($_SERVER['URL_ODATA_1C'])) {\n $this->markTestSkipped(\n 'You should define ODATA_URL_1C in phpunit.xml to pass this test'\n );\n }\n if (isset($_SERVER['LOGIN']) && isset($_SERVER['PASSWORD'])) {\n $auth = [\n $_SERVER['LOGIN'],\n $_SERVER['PASSWORD'],\n ];\n }\n\n $this->object = new Client($_SERVER['URL_ODATA_1C'], array_filter([\n 'auth' => $auth,\n 'timeout' => 300,\n ]));\n }", "public function setUp()\n {\n self::bootKernel();\n\n //fetch validator service\n $this->validator = static::$kernel->getContainer()->get('validator');\n\n }", "private static function setUpThirdPartyService(&$service) {\n $eventType = 'expiration';\n $filterService = ServiceFactory::createFilterService($eventType);\n $processingService = new ThirdPartyRecordProcessingService(\n App::make(\\App\\Repositories\\EmailRepo::class),\n App::make(\\App\\Repositories\\AttributionLevelRepo::class),\n App::make(\\App\\Repositories\\FeedDateEmailBreakdownRepo::class),\n App::make(\\App\\Repositories\\ThirdPartyEmailStatusRepo::class),\n App::make(\\App\\Repositories\\EmailAttributableFeedLatestDataRepo::class),\n $filterService,\n App::make(\\App\\Services\\EmailFeedAssignmentService::class),\n App::make(\\App\\Services\\AttributionRecordTruthService::class)\n );\n\n // Add suppression\n $processingService->registerSuppression(App::make(GlobalSuppressionService::class));\n $suppStrategy = App::make(\\App\\Services\\SuppressionProcessingStrategies\\ThirdPartySuppressionProcessingStrategy::class);\n $processingService->setSuppressionProcessingStrategy($suppStrategy);\n\n $service->registerProcessing($processingService);\n\n return $service;\n }", "public function init()\n {\n try {\n $id = $this->getIdOrName();\n $client = KongClient::getInstance();\n $res = $client->getService($id);\n dd($res);\n } catch (\\Exception $e) {\n dump($e->getMessage());\n }\n }", "public function setUp()\n {\n $this->app = new Container();\n }", "protected function setUp()\n {\n $app = new \\Slim\\Slim();\n ORM::configure('sqlite::memory:');\n $db = ORM::get_db();\n $this->model = new \\Model\\HolidayModel($app, $db);\n $this->model->setup();\n\n $this->ctrl = new \\MyLib\\HolidayCtrl($this->model);\n\n }", "public function setUp()\n {\n $delegate = new \\Rougin\\Slytherin\\Container\\Container;\n\n $this->container = new \\Rougin\\Slytherin\\Container\\ReflectionContainer($delegate);\n }", "protected function setUp() {\n\n $this->installer = new Core_Installer();\n $this->installer->installTest();\n $this->installer->loginAsSuperAdmin();\n\n $this->contentInstaller = new Content_Installer();\n $this->contentInstaller->installTest();\n \n $this->service = new Content_Model_CategorySet_Service();\n\n $this->bootstrap = new Zend_Application('testing', APPLICATION_PATH . '/configs/application.ini'); //\n $this->view = Zend_Registry::get('view');\n\n parent::setUp();\n\n $request = $this->getRequest();\n $request->setModuleName('Content');\n $request->setControllerName('CategorySet');\n }", "public function setService($service)\n\t{\n\t\t$this->service = ucfirst($service);\n\t}", "public function before() {}", "public function before() {}", "protected function setUp() {\n $this->object = new LicenseController;\n }", "public function testSetProcessor()\n {\n }" ]
[ "0.7094955", "0.6535453", "0.6474182", "0.64081854", "0.62524587", "0.62473917", "0.61706483", "0.61212534", "0.6090572", "0.60667485", "0.60234666", "0.59047717", "0.5893108", "0.58890736", "0.5886613", "0.5830131", "0.5813924", "0.5813218", "0.58113086", "0.5795344", "0.577564", "0.5768487", "0.5751929", "0.57439595", "0.573765", "0.57242155", "0.57136166", "0.5712607", "0.5701291", "0.5698951", "0.5692193", "0.56738204", "0.5651", "0.56346905", "0.5629665", "0.56154704", "0.5612147", "0.5610554", "0.5601577", "0.55898404", "0.5583307", "0.55732894", "0.55536526", "0.55514914", "0.55509067", "0.5538844", "0.55355096", "0.5532539", "0.551324", "0.55124235", "0.5508266", "0.5508266", "0.54979897", "0.54973733", "0.54881924", "0.54876506", "0.54827523", "0.5474735", "0.54709476", "0.54623413", "0.54551065", "0.54521143", "0.5449461", "0.54478616", "0.54474896", "0.54362345", "0.54221386", "0.5417928", "0.5409907", "0.5401113", "0.5391854", "0.537924", "0.5377863", "0.5376391", "0.5372764", "0.53723395", "0.5369417", "0.53690124", "0.53679526", "0.53623784", "0.5361593", "0.53607416", "0.53594655", "0.53589267", "0.53587234", "0.5353654", "0.53517395", "0.5351113", "0.5339057", "0.53354895", "0.5334922", "0.53336316", "0.53259575", "0.53232867", "0.5318201", "0.5317684", "0.5314755", "0.5314755", "0.53138256", "0.53105557" ]
0.7655772
0
Load only on ?page=samplepage
function load_transfer_plugin_scripts( $hook ) { // if( $hook != 'toplevel_page_get-user' ) { // return; // } // Load style & scripts. wp_enqueue_style( 'getUser-css-plugin' ); wp_enqueue_style( 'bootstrap-plugin' ); wp_enqueue_script( 'my-plugin' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadPage()\n {\n /*if(!isset(self::$user_id)) {\n self::$user_id = $_GET['user_id'];\n self::$id_wp_user = $_GET['id_wp_page'];\n self::$id_post = $_GET['id_post'];\n self::$nonce_img_upload = \"<input type='hidden' id='nonce_img_upload' name='nonce_img_upload' value='{$_GET['nonce_img_upload']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n self::$nonce_img_del = \"<input type='hidden' id='nonce_img_del' name='nonce_img_del' value='{$_GET['nonce_img_del']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n Profile_user::getUserListGods($_GET['id_wp_page']);\n self::$list = Profile_user::$page;\n self::$profile = Profile_user::getUserProfileObject($_GET['id_wp_page'])[0];\n }\n $page = $_GET['page']??0;\n $this->get_page($page = parent::$list[$page]);*/\n }", "public function ee_breakouts_page_load() {}", "public function pagesOnly() {}", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function get_page();", "protected function getPage() {}", "protected function getPage() {}", "public function getPage();", "function checkpage()\r\n\t{\r\n\tif(!isset($_GET['page']))\r\n\t{\r\n\t$GLOBALS['page']=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t$GLOBALS['page']=$_GET['page'];\r\n\t}\r\n\t}", "public function initPage() {}", "public function initPage() {}", "public function pageActual(){\n\n\t\tif(isset($_GET['p'])){\n\t\t\t$page = (int)$_GET['p'];\n\t\t\treturn $page;\n\t\t}else{\n\t\t\t$page = 1;\n\t\t\t$this->viewLoad('pages/initial');\n\t\t}\n\t\t\n\t\t\n\t}", "public function pageLoad($argument = false) {\n\t\t\n\t\t$check = $this->model->checkPage($argument);\n\t\t\n\t\tif($check[\"status\"])\n\t\t{\n\t\t\t\t$this->model->readCache($argument); // Кэш\n\t\t\t\t\n\t\t\t\t$this->view->menu =\t$this->model->menuList(); // Список меню\n\t\t\t\t\n\t\t\t\t$this->view->meta_contacts = $this->model->metaContacts($argument,$check['data']['id']); // Мета данные\n\t\t\t\t$this->view->script_static = $this->model->scriptStatic(); // Статические скрипты\n\t\t\t\t\n\t\t\t\t$this->view->breadCrumbs =\t$this->model->breadCrumbs($argument,$check); // Хлебные крошки\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$params = $this->view->get_params($check['type'],$check['data']); //Параметры из шаблона\n\t\t\t\t$params != NULL ? $this->view->query_post = $this->model->queryPost($params,NULL,$check['data']) : NULL; //Данные по параметрам\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->view->data =\t$this->model->{\"page\".$check['type']}($check['data']['id'],$argument); \n\t\t\t\t\n\t\t\t\t$this->view->render($check['type']);\n\t\t\t\t\n\t\t\t\t$this->model->writeCache($argument); // Кэш\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($check[\"subdomain\"])\n\t\t\t{\n\t\t\t\t$this->pageStop($argument);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->pageError($argument);\n\t\t\t}\n\t\t}\n\t}", "private function getPage() {\r\n $page = self::DEFAULT_PAGE;\r\n $this->module = self::DEFAULT_MODULE;\r\n //Check get for page to load, if page exists set page\r\n if (array_key_exists('page', $_GET)) {\r\n $page = $_GET['page'];\r\n }\r\n //Check get for module to load, if module exists set module\r\n if (array_key_exists('module', $_GET)) {\r\n $this->module = $_GET['module'];\r\n }\r\n return $this->checkPage($page);\r\n }", "function pageLoad () {\n\tglobal $pageBegin, $pageEnd, $tableRow;\n\t$page = page_load (\"search_results.html\");\n\n\t$tableRow = page_split ($page, \"[[\", \"]]\");\n\t$pageBegin = $tableRow[0];\n\t$pageEnd = $tableRow[2];\n\t$tableRow = $tableRow[1];\n}", "private function warmUp()\r\n\t{\r\n\t\t$this->loadPage( 1 );\r\n }", "abstract protected function getPage() ;", "public function Page($page){\r\n $fullpath=ucwords($page).EXT;\r\n $this->Load($fullpath);\r\n }", "public function is_page();", "public function getByPage($pageNo) {}", "public function loadContent($page_name)\n\t{\n\t\tinclude(\"resource/view/\".$page_name.\".php\");\n\t}", "public function prePageContent();", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public function getPage($pageNumber = 0);", "public function getPage() {}", "public function getPage() {}", "function get_page($page, $output = \\OBJECT, $filter = 'raw')\n {\n }", "public function onBeforeGet($url){}", "public function getExtraPageData();", "private function setPage(){\n\t if(!empty($_GET['page'])){\n\t if($_GET['page']>0){\n\t if($_GET['page'] > $this->pagenum){\n\t return $this->pagenum;\n\t }else{\n\t return $_GET['page'];\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }else{\n\t return 1;\n\t }\n\t }", "public function testPageFound()\n {\n $client = static::createClient();\n $client->request('GET', getenv(\"TEST_BASE_URL\"));\n $this->assertResponseIsSuccessful();\n }", "function identifyPage() {\n//\t\t$req_uri = $_SERVER['REQUEST_URI'];\n//\t\tprint \"init\";\n\t\t$query = new Query();\n\t\tif($query->sql(\"SELECT id, relation, name, url FROM \" . UT_MEN . \" WHERE url LIKE '%\".$this->url.\"%'\")) {\n\t\t\t$item->id = $query->getQueryResult(0, \"id\");\n\t\t\t$item->name = $this->translate($query->getQueryResult(0, \"name\"));\n\n\t\t\t$item->url = str_replace(FRAMEWORK_PATH.\"/admin\", \"\", $this->url);\n\t\t\t$item->url = str_replace(GLOBAL_PATH.\"/admin\", \"\", $item->url);\n\t\t\t$item->url = str_replace(REGIONAL_PATH.\"/admin\", \"\", $item->url);\n\n//\t\t\t$item->url = ereg_replace(FRAMEWORK_PATH.\"/admin|\".GLOBAL_PATH.\"/admin|\".REGIONAL_PATH.\"/admin\", \"\", $query->getQueryResult(0, \"url\"));\n\t\t\tarray_unshift($this->trail, $item);\n\t\t\t$relation = $query->getQueryResult(0, \"relation\");\n\t\t\tif($relation) {\n\t\t\t\t$this->pageTrail($relation);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function page_init() {\n }", "function gaming($page){\n $_GET[\"page\"] = $page;\n require_once(\"gaming/gamingIndex.php\");\n}", "public function loadPreviousPage()\n {\n $prevPage = $this->results->getPreviousPage();\n $this->search($prevPage);\n }", "protected function _Load_Pages() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/pages');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_pages_init',$this);\r\n }", "protected function _readPage($pageNumber) {}", "function load($page = 'author_login.php')\r\n{\r\n#build a URL string of protocol ,current domain and directory.\r\n$url = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['php_SELF']).'/online_bookstore';\r\n\r\n#remove any trailing slashes from url,append a forward slash and specific page argument.\r\n$url = rtrim($url, '/\\\\');\r\n$url .= '/' .$page;\r\n\r\n#load the specific page.\r\n header(\"Location: $url\");\r\nexit();\r\n}", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}", "public function getPageData();", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function __construct() {\r\n\t\t$this->page = isset($_GET['page']) ? $_GET['page'] : null;\r\n\t}", "public function set_page($page);", "public function fan_load_more()\n {\n if ($this->input->post('page')) {\n $page = $this->input->post('page');\n $data['list_100'] = $this->M_fan->list_100($page);\n $this->load->view('fan/top_100_list_more', $data);\n }\n }", "protected function _loadPageForOffset($offset) {\r\n\r\n $this->_calculatePageSize();\r\n\r\n $start = round($offset / $this->pageSize) * $this->pageSize;\r\n\r\n $params = $this->_getPageParams($start, $this->pageSize);\r\n\r\n\r\n\r\n // Loading page\r\n\r\n $data = $this->adapter->request('GET', $this->url, $params);\r\n\r\n $this->adapter->debug = false;\r\n\r\n\r\n\r\n $rekeyed = array();\r\n\r\n foreach ($data['entries'] as $key => $entry) {\r\n\r\n $rekeyed[$key+$data['start']] = $entry;\r\n\r\n }\r\n\r\n $this->data['entries'] = array_merge($this->data['entries'], $rekeyed);\r\n\r\n }", "public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }", "function page($page_num = 1, $change_order = null) {\r\n \r\n // Set layout\r\n $mode = get_cookie('layout_mode');\r\n if ($mode == null) {\r\n $mode = \"table\";\r\n $layout_cookie = array(\r\n 'name' => 'layout_mode',\r\n 'value' => \"$mode\",\r\n 'expire' => '86500',\r\n 'path' => '/',\r\n );\r\n set_cookie($layout_cookie);\r\n }\r\n if ($mode == \"table\") {\r\n $this->data['pagebody'] = 'TeamRosterTable';\r\n } else {\r\n $this->data['pagebody'] = 'TeamRosterGallery';\r\n }\r\n \r\n // Set ordering\r\n if ($change_order == null) {\r\n // Case 1: cookie previously set, not changing\r\n $order = get_cookie('roster_order');\r\n // Case 2: no cookie set, not changing; set to default\r\n if ($order == null) {\r\n $order = \"jersey\";\r\n $order_cookie = array(\r\n 'name' => 'roster_order',\r\n 'value' => \"$order\",\r\n 'expire' => '86500',\r\n 'path' => '/',\r\n );\r\n set_cookie($order_cookie);\r\n }\r\n } else {\r\n // Case 3: change cookie to new setting\r\n $order = $change_order;\r\n $order_cookie = array(\r\n 'name' => 'roster_order',\r\n 'value' => \"$order\",\r\n 'expire' => '86500',\r\n 'path' => '/',\r\n );\r\n set_cookie($order_cookie);\r\n }\r\n \r\n //Pagination settings\r\n $config = array();\r\n $config[\"base_url\"] = base_url() . \"Team/page\";\r\n $config[\"total_rows\"] = $this->Roster->record_count();\r\n $config['per_page'] = 12;\r\n $config['use_page_numbers'] = TRUE;\r\n $config['page_query_string'] = FALSE;\r\n \r\n //Bootstrap pagination controls\r\n $config['full_tag_open'] = \"<ul class='pagination'>\";\r\n $config['full_tag_close'] =\"</ul>\";\r\n $config['num_tag_open'] = '<li>';\r\n $config['num_tag_close'] = '</li>';\r\n $config['cur_tag_open'] = \"<li class='disabled'><li class='active'><a href='#'>\";\r\n $config['cur_tag_close'] = \"<span class='sr-only'></span></a></li>\";\r\n $config['next_tag_open'] = \"<li>\";\r\n $config['next_tagl_close'] = \"</li>\";\r\n $config['prev_tag_open'] = \"<li>\";\r\n $config['prev_tagl_close'] = \"</li>\";\r\n $config['first_tag_open'] = \"<li>\";\r\n $config['first_tagl_close'] = \"</li>\";\r\n $config['last_tag_open'] = \"<li>\";\r\n $config['last_tagl_close'] = \"</li>\"; \r\n $config['first_link'] = 'First';\r\n $config['last_link'] = 'Last';\r\n $config['next_link'] = 'Next';\r\n $config['prev_link'] = 'Previous';\r\n \r\n $this->pagination->initialize($config); \r\n \r\n //Fetch data from model\r\n $this->data['players'] = $this->Roster->get_data($page_num, $order);\r\n \r\n //Create page links\r\n $this->data[\"links\"] = $this->pagination->create_links();\r\n \r\n $this->render();\r\n }", "public function is_page($page = '')\n {\n }", "function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }", "public function loadPage($page = 0) {\n return $this->posts()\n ->with('tags')\n ->with('user')\n ->take(Post::ITEM_PER_PAGE)\n ->offset($page * Post::ITEM_PER_PAGE)\n ->get();\n }", "private function load_pagination($url, $total_rows, $show_rows, $offset, $cur_count, $sortby = null, $sortas = null){\r\n\t\t$full_url = $url.'?1=1';\r\n\t\tif($sortby) $full_url .= '&sortby='.$sortby;\r\n\t\tif($sortas) $full_url .= '&sortas='.$sortas;\r\n\t\t$page_data['links'] = self::get_pagination($full_url, $total_rows, $show_rows);\r\n\t\t$page_data['from_offset'] = $offset + 1;\r\n\t\t$page_data['to_offset'] = $offset + $cur_count;\r\n\t\t$page_data['total'] = $total_rows;\r\n\t\t$this->load->view('admin/pagination', $page_data);\r\n\t}", "private function getParamsFromRequest() {\n if (isset($_GET['page'])) {\n $this->currentpage = $_GET['page'];\n } else {\n //else set default page to render\n $this->currentpage = 1;\n }\n //If limit is defined in URL\n if (isset($_GET['limit'])) {\n $this->limit = $_GET['limit'];\n } else { //else set default limit to 20\n $this->limit = 10;\n }\n //If currentpage is set to null or is set to 0 or less\n //set it to default (1)\n if (($this->currentpage == null) || ($this->currentpage < 1)) {\n $this->currentpage = 1;\n }\n //if limit is set to null set it to default (10)\n if (($this->limit == null)) {\n $this->limit = 10;\n //if limit is any number less than 1 then set it to 0 for displaying\n //items without limit\n } else if ($this->limit < 1) {\n $this->limit = 0;\n }\n }", "function get_page() {\n\n $page = (isset($_GET['page']) && is_numeric($_GET['page']) ) ? $_GET['page'] : 1;\n return $page;\n\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 loadContent(){\n\n\t\t/* Initialize output var */\n\t\t$output = '';\n\n\t\t/* Set Initial Tags */\n\t\t$this->setTags();\n\n\t\tif(isset($_GET['photo_id']) && isset($_GET['secret'])){ // Single Photo Pages\n\n\t\t\t/* Single Photos */\n\t\t\t$photo_id = $_GET['photo_id'];\n\t\t\t$secret = $_GET['secret'];\n\t\t\t$output .= $this->printPhoto($photo_id,$secret);\n\n\t\t} elseif(isset($_GET['search'])){ // Search Page\n\n\t\t\t/* For Search & Tags */\n\t\t\t$search = $_GET['search'];\n\t\t\t$page = isset($_GET['page']) ? $_GET['page'] : 1;\n\t\t\t$tags = isset($_GET['tags']) ? $_GET['tags'] : false;\n\n\t\t\t/* Print Search */\n\t\t\t$output .= $this->printSearch($search, $page, 'search', $tags);\n\n\t\t} elseif(isset($_GET['recent'])){ // Recent Photos\n\n\t\t\t/* Basically the Same as the Search Function but without a Query */\n\t\t\t$page = isset($_GET['page']) ? $_GET['page'] : 1;\n\t\t\t$output .= $this->printSearch(false, $page, 'recent');\n\n\t\t} elseif( isset($_GET['set']) && isset($_GET['id'])) { // Load Set if Called\n\n\t\t\t/* For Sets */\n\t\t\t$set = $_GET['set'];\n\t\t\t$id = $_GET['id'];\n\n\t\t\t/* Print Set */\n\t\t\t$output .= $this->printSet($id);\n\n\t\t} elseif( isset($_GET['about']) ){ // About Page\n\n\t\t\t/* About Page */\n\t\t\t$output .= $this->printUserInfo();\n\n\t\t} elseif( isset($_GET['collections'])){\n\n\t\t\t/* Collections Page, Maybe Home Page Soon */\n\t\t\t$output .= $this->printCollections();\n\n\t\t} else { // Same as elseif( isset($_GET['home']\n\n\t\t\t/* Default to Home Page */\n\t\t\t$output .= $this->printSets();\n\t\t}\n\t\treturn $output;\n\t}", "function randomPageObject()\n\t{\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\n\t\t$page = ilWikiPage::getRandomPage($this->object->getId());\n\t\t$this->gotoPageObject($page);\n\t}", "public function getPageHandler();", "function load_page(string $page_name) {\n get_template_part( \"partials/$page_name\" );\n }", "protected function setupPage() {}", "public function getPage($id);", "public function pageAction()\n {\n $page = $this->getRequest()->getParam('page', 1);\n $count = $this->getRequest()->getParam('count', 20);\n $collectionJson = Mage::helper('neklo_productposition/product')->getCollectionJson($page, $count);\n $this->getResponse()->setBody($collectionJson);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n }", "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 getPageObject($observe = false) {}", "public function load_pages($body,$data)\n {\n $page_path = 'frontend/pages/'.$body ;\n\n $this->load->view('frontend/includes/header',$data);\n $this->load->view($page_path,$data);\n $this->load->view('frontend/includes/footer',$data);\n }", "private function page($page){\n return '&page=' . $page;\n }", "function getPage($params) {\r\n if (isset($params['named']['page'])) {\r\n return is_array($params['named']['page']) ? $params['named']['page'][0] : $params['named']['page']; //Ensure we only send one result\r\n }\r\n return 1;\r\n }", "public function allowPaginate()\n {\n $this->page = $this->dataProvider->getPaginationParams();\n }", "public function myPagesAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //CHECK CLAIM IS ENABLED OR NOT\n $claimEnabled = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1);\n if (empty($claimEnabled)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET LOGGED IN USER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $this->view->viewer_id = $viewer_id = $viewer->getIdentity();\n\n //CHECK THAT MEMBER HAS ALLOED FOR CLAIM OR NOT\n $canClaim = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitepage_page', 'claim');\n if (empty($canClaim)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitepage_main', array(), 'sitepage_main_manage');\n\n //MAKE PAGINATOR\n $this->view->paginator = $paginator = Engine_Api::_()->getDbtable('claims', 'sitepage')->getMyClaimPages($viewer_id);\n\n //GET PAGINATOR\n $items_count = (int) Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.page', 10);\n $paginator->setItemCountPerPage($items_count);\n $this->view->paginator = $paginator->setCurrentPageNumber(10);\n }", "function page($page_name=null, $content_type=\"text/html\")\n{\n\t$page_path = PAGES . \"/\" . $page_name . \".php\";\n\tif(!file_exists($page_path)) throw new FrameworkException(\"$page_path: page doesn't exist\");\n\n\theader(\"content-type: \".$content_type);\n\trequire_once $page_path;\n}", "public function loadNextPage()\n {\n $nextPage = $this->results->getNextPage();\n $this->search($nextPage);\n }", "public function testLoadLandingPage()\n {\n $this->visit('/')\n ->see('<div class=\"title\">Risk and Control</div>');\n }", "public function getPages() {}", "protected function _prepare_page($page)\n {\n }", "function on_page_init() {\n return true;\n }", "public function hasPages();", "public function hasPages();", "public function setStartPage($page);", "public function getList($page);", "public function getPages();", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "abstract function render_page();", "public function loadPage() {\n //We have to insert the following pages.\n /*\n * 1. Header\n\t\t *\t-> Admin Ajax / User Ajax\n * 2. Navigation Bar\n\t\t *\t-> Admin navBar / User navBar\n * 3. Main Body\n * 4. Footer\n */\n\t\t//First we decide whether the page is an admin page or not.\n\t\tglobal $session;\n\t\tif(stripos($this->pageName, 'admin') === false)\t{\n\t\t\t$navBarType = 'user';\n\t\t\t$this->setTemplateVar('isadmin', 0);\n\t\t\t//We Load the data for the top fixed infobar.\n\t\t\t$this->setTemplateVar('currentBalance', getCurrentBalance());\n\t\t\t$this->setTemplateVar('prodQueueCount', getProdQueueCount());\n\t\t\t$this->setTemplateVar('username', $session->getUserName());\n\t\t} else {\n\t\t\t$navBarType = 'admin';\n\t\t\t$this->setTemplateVar('isadmin', 1);\n\t\t}\n\t\t\n\t\t//Now we also have to note wheather the user is an admin user or not.\n\t\t$this->setTemplateVar('isAdminUser', ($session->isAdminUser() ? 1 : 0));\n\t\t\n\t\t//Now we load all the pages.\n\t\tinclude $this->rootPath.'templates/header.php';\n\t\tinclude $this->rootPath.'templates/'.$navBarType.'_navbar.php';\n\t\tinclude $this->rootPath.'templates/t_'.$this->pageName.'.php';\n\t\tinclude $this->rootPath.'templates/footer.html';\n }", "function page()\n {\n $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n # print_r($data);\n # exit();\n\n #Get the paginated list of the news items\n $data = add_msg_if_any($this, $data);\n\n //if user has permission\n if (check_user_access($this, 'view_procurement_plans')) \n {\n $search_str = '';\n if($this->session->userdata('isadmin') == 'N')\n {\n $userdata = $this->db->get_where('users', array('userid'=>$this->session->userdata('userid')))->result_array();\n $search_str = ' AND PP.pde_id=\"'. $userdata[0]['pde'] .'\"';\n }\n \n \n #Get the paginated list of plans\n $data['procurement'] = paginate_list($this, $data, 'procurement_plans', array('orderby'=>'PP.financial_year DESC', 'searchstring'=>$search_str));\n #exit($this->db->last_query());\n $data['page_title'] = 'Manage procurement plans';\n $data['current_menu'] = 'view_procurement_plans';\n $data['view_to_load'] = 'procurement/admin/all_procurement_plans_v';\n $data['view_data']['form_title'] = $data['page_title'];\n $this->load->view('dashboard_v', $data);\n \n } else {\n //load access denied page\n load_restriction_page();\n\n }\n\n\n }", "public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}", "private function load()\n\t{\n\t\tglobal $mediaWiki;\n\t\t\n\t\t$title = Title::newFromText( $this->title );\n\t\t \n\t\t// Can't load page if title is invalid.\n\t\tif ($title == null)\n\t\t\treturn;\n\t\t\n\t\t$article = $mediaWiki->articleFromTitle($title);\n\t\t\n\t\t// Also, if article can't be found, bail out.\n\t\tif ($article == null )\n\t\t\treturn;\n\t\t\n\t\t// Let's try fetching the page content.\n\t\t$article->loadContent();\n\t\t\n\t\t// V1.3 security feature.\n\t\t// At this point, the page's restriction\n\t\t// is loaded. Get 'edit' protection state.\n\t\t$state = $title->getRestrictions('edit');\n $this->protectState = false;\n $state = $title->getRestrictions('edit');\n foreach ($state as $index => $group )\n if ( $group == 'sysop' )\n $this->protectState = true;\n\t\t\n\t\tif (! $this->protectState)\n\t\t\treturn; \n\t\t\n\t\t# if no page or an empty one\n\t\tif (!$article->mDataLoaded)\n\t\t\treturn;\n\t\t \n\t\t$this->content = $article->mContent;\n\t\t$this->raw = $article->mContent;\n\t\t\n\t\t// Now, let's analyse the page\n\t\t// to determine things like page type.\n\t\t$this->analyse();\n\t}", "public function __construct(){\r\n $pageRequest ='homepage';\r\n //check if there are parameters\r\n if(isset($_REQUEST['page'])) {\r\n\r\n //load the type of page the request wants into page request\r\n \r\n $pageRequest = $_REQUEST['page'];\r\n }\r\n //instantiate the class that is being requested\r\n $page = new $pageRequest;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\r\n $page->get();\r\n } else {\r\n $page->post();\r\n }\r\n\r\n\r\n\r\n }", "function static_pages() {\r\n post_check();\r\n $this->form_validation->set_rules('sub_cat_id', 'Sub Category Id', 'required');\r\n $this->form_validation->run();\r\n $error = $this->form_validation->get_all_errors();\r\n if ($error) {\r\n return_data(false, array_values($error)[0], blank_json(), $error);\r\n } else {\r\n $res = $this->CategoriesModel->get_static_content($this->input->post('sub_cat_id'));\r\n $files = $this->CategoriesModel->get_sub_category_files($this->input->post('sub_cat_id'));\r\n\r\n if ($res) {\r\n $res = array(\r\n 'sub_cat_id' => $res['sub_category_id'],\r\n 'title' => $res['sub_category_name'],\r\n 'content' => $res['content'],\r\n 'created_date' => $res['created_date'],\r\n 'update_date' => $res['update_date'],\r\n 'files' => $files\r\n );\r\n return_data(true, 'Static Page available!', $res);\r\n } else {\r\n return_data(false, 'Static Page not found!', blank_json());\r\n }\r\n }\r\n }", "function _load($name, $_page=[]){\n if(strpos($name, '.php') === false)\n\t include_once(ROOT.\"/html/$name/.index.php\");\n else\n include_once(ROOT.\"/html/$name\");\n}", "public function get_data_berita_on_slider_page(){\r\r\n\t\tif( $this->input->is_ajax_request() ){\r\r\n\t\t\t$this->get_data_ajax_berita_on_slider_page();\r\r\n\t\t}else{\r\r\n\t\t\tredirect(base_url());\r\r\n\t\t}\r\r\n\t}", "static function load($initial)\n\t{\n\t\t$r = (object) $initial;\n\n\t\t$r->page_dir = $r->base_path.'pages/';\n\t\t$r->act = isset($_GET['act']) ? \n\t\t\t$_GET['act'] : $r->default_page;\n\n\t\t$r->func = isset($_GET['f']) ? trim($_GET['f']) : '';\n\t\t$r->id = isset($_GET['id']) ? trim($_GET['id']) : '';\n\t\t$r->page = isset($_GET['page']) ? intval($_GET['page']) : '';\n\n\t\tif ($r->page == 0) $r->page = 1; // default page\n\n\t\t// just make sure the act is something valid\n\t\tif (!preg_match('/^\\w+$/', $r->act))\n\t\t{\n\t\t\t$r->act = $s->default_page;\n\t\t}\n\n\t\treturn r::$r = $r; \n\t}", "function load_page($page){\r\n\t\treturn file_get_contents($page);\r\n\t}", "function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa,\n\t\t$r= getResponse();\t\t\n\t\tsetLocaleMode();\n\t\tif (!xvalidaAcceso($r,PAGE_PRIV)){\n\t\t\t$r->assign($capa,inner,'Acceso denegado');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t//$r->alert($args);\n\t\t$c = new connection();\n\t\t$c->open();\n\t\t\n\t\t\n\t\t$sa_paquetes = $c->sa_v_paquetes;\n\t\t$query = new query($c);\n\t\t$query->add($sa_paquetes);\n\t\t$paginador = new fastpaginator('xajax_load_page',$args,$query);\n\t\t$arrayFiltros=array(\n\t\t\t'Empresa'=>array(\n\t\t\t\t'change'=>'h_empresa',\n\t\t\t\t'addevent'=>\"obj('empresa').value='';\"\n\t\t\t),\n\t\t\t'busca'=>array(\n\t\t\t\t'title'=>'B&uacute;squeda',\n\t\t\t\t'event'=>'restablecer();'\n\t\t\t),\n\t\t\t'fecha'=>array(\n\t\t\t\t'title'=>'Fecha'\n\t\t\t)\n\t\t);\n\t\t$argumentos = $paginador->getArrayArgs();\n\t\t$aplica_iva=($argumentos['iva']==1);\n\t\t$id_empresa=$argumentos['h_empresa'];\n\t\t$query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa));\n\t\t\n\t\tif($id_empresa==null){\n\t\t\t$r->assign($paginador->layer,inner,'Seleccione una Empresa');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t$rec=$paginador->run();\n\t\tif($rec){\n\t\t\tforeach($rec as $v){\n\t\t\t\t//buscando las unidades basicas del paquete\n\t\t\t\t$unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica');\n\t\t\t\t$lista_unidades=implode(',',$unidades);\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"40%\" /><thead>';\n\t\t\t\t\n\t\t\t\t$html.='<tr><td>PAQUETE</td><td>Descripci&oacute;n</td><td>Unidades</td></tr></thead><tbody>';\n\t\t\t\t$html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"20%\" /><thead><tr><td>Codigo</td><td>Descripci&oacute;n</td><td>Unidad</td><td>Cantidad</td><td style=\"display:none;\">Precio</td><td style=\"display:none;\">Importe</td></tr></thead><tbody>';\n\t\t\t\t//cargando los detalles de tempario\n\t\t\t\t$sa_v_paq_tempario=$c->sa_paq_tempario;\n\t\t\t\t$sa_tempario= new table('sa_v_tempario','',$c);\n\t\t\t\t$join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $temp){\n\t\t\t\t\t\t$html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style=\"display:none;\">'.$temp->precio.'</td><td style=\"display:none;\">'.$temp->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sa_v_paq_repuestos=$c->sa_paquete_repuestos;\n\t\t\t\t$iv_articulos= new table('iv_articulos','',$c);\n\t\t\t\t$join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $rep){\n\t\t\t\t\t\t$html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style=\"display:none;\">'.$rep->precio.'</td><td style=\"display:none;\">'.$rep->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html.='</tbody></table><br />';\n\t\t\t}\n\t\t}\n\t\t$html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>';\n\t\t$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>');\n\t\t\n\t\t/*if($argumentos['busca']!=''){\n\t\t\t$query->where(\n\t\t\t\tnew criteria(sqlOR, array(\n\t\t\t\t\tnew criteria(' like ',$sa_paquetes->descripcion_paquete,\"'%\".$argumentos['busca'].\"%'\")//,\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->chasis,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->color,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$c->pg_empresa->nombre_empresa,\"'%\".$argumentos['busca'].\"%'\")\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\n\t\tif($argumentos['fecha']!=''){\n\t\t\t$query->where(new criteria(' = ',\"DATE_FORMAT(\".$sa_paquetes->fecha_rev.\",'%d-%m-%Y')\",\"'\".$argumentos['fecha'].\"'\"));\t\t\t\n\t\t}\n\t\tif($argumentos['h_empresa']!=''){\n\t\t\t$query->where(new criteria(sqlEQUAL,\"id_empresa\",\"'\".$argumentos['h_empresa'].\"'\"));\t\t\t\n\t\t}else{\n\t\t\t$arrayFiltros['Empresa']['hidden']=1;\n\t\t}*/\n\t\t//$r->alert($argumentos['h_empresa']);\n\t\t\n\t\t//$rec=$paginador->run();\n\t\t\n\t\t/*if($rec){\n\t\t\tif($rec->getNumRows()==0){\n\t\t\t\t$html.='<div class=\"order_empty\">No se han encontrado registros</div>';\n\t\t\t}else{\n\t\t\t\t$html.='<table class=\"order_table\"><thead><tr class=\"xajax_order_title\">\n\t\t\t\t\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->codigo_paquete,'C&oacute;digo').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripci&oacute;n').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td>\n\t\t\t\t</tr></thead><tbody>';\n\t\t\t\t$class='';\n\t\t\t\tforeach($rec as $v){\n\t\t\t\t\tif ($rec->parcial == '1')\n\t\t\t\t\t\t$parcial = 'Si';\n\t\t\t\t\telse\n\t\t\t\t\t\t$parcial = 'No';\n\t\t\t\t\t$html.='<tr class=\"'.$class.'\">\n\t\t\t\t\t\n\t\t\t\t\t<td align=\"center\">'.$rec->id_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->codigo_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->descripcion_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->nombre_empresa_sucursal.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->fecha_rev.'</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t\tif($class==''){\n\t\t\t\t\t\t$class='impar';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$class='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html.='</tbody></table>';\n\t\t\t}\n\t\t\t\n\t\t}*/\n\t\t\n\t\t$r->assign($paginador->layer,inner,$html);\n\t\t\n\t\t\n\t\t//$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class=\"ifilter\">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>');\n\n\t\t$r->assign('campoFecha','value',$fec);\n\t\t\n\t\t$r->script($paginador->fillJS('datos'));\n\t\n\t\t$c->close();\n\t\treturn $r;\n\t}", "function loadPage($template, $data = null)\n {\n $data['template_name'] = $template;\n $data['data'] = $data;\n // $data \t\t\t\t\t\t= \thtml_escape($this->security->xss_clean($data));\n $this->load->view('user/user_master-template', $data);\n }", "public function invoke()\r\n\t{\r\n\t\tif(isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$pageName = $_GET['page'];\r\n\t\t\t$this->loadPage($pageName);\r\n\t\t}\r\n\t\telseif(!isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$this->loadPage('home');\r\n\t\t}\r\n\t}", "public function loadByUrl($url);", "function pagination(){}", "function getPages($type=\"header\", $filter=\"\"){\n $this->subPages($type,0,0);\n return redirect()->back()->with(\"success\", \"Success Sync Pages\");\n }", "protected function loadPage()\n\t{\n\t\t$this->_dataProvider->getPagination()->setCurrentPage($this->_currentPage);\n\t\treturn $this->_items = $this->dataProvider->getData(true);\n\t}", "public function getStartPage();", "public static function isPage();", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }" ]
[ "0.6392238", "0.6209508", "0.61577487", "0.61181366", "0.5999596", "0.5904053", "0.5903599", "0.5820063", "0.57618004", "0.5745371", "0.5745371", "0.5742118", "0.571298", "0.5708434", "0.5699141", "0.5695992", "0.56959283", "0.5684688", "0.5680562", "0.5654368", "0.56199396", "0.5588225", "0.5582434", "0.55705416", "0.55405545", "0.55405545", "0.55369854", "0.5519172", "0.55088586", "0.54827094", "0.54762644", "0.54735535", "0.54709303", "0.54677695", "0.54548603", "0.544873", "0.544106", "0.5441007", "0.5436409", "0.54229736", "0.5422903", "0.54118747", "0.5392282", "0.5381224", "0.5379964", "0.53746474", "0.5371315", "0.53701663", "0.53693783", "0.5362995", "0.5336523", "0.5331507", "0.5324857", "0.5320349", "0.531436", "0.5311568", "0.5307798", "0.5303643", "0.52999187", "0.5288061", "0.527531", "0.52751935", "0.52725434", "0.5268896", "0.52667075", "0.5260772", "0.5258369", "0.5258331", "0.52581376", "0.5252861", "0.5251196", "0.5251117", "0.52508855", "0.5241426", "0.5235993", "0.5235993", "0.523367", "0.52313304", "0.5228624", "0.52237225", "0.5222798", "0.52200997", "0.5213208", "0.5208307", "0.52070576", "0.5205959", "0.5192763", "0.51891077", "0.5188914", "0.51884216", "0.5184664", "0.5173487", "0.5169422", "0.51692015", "0.51652914", "0.5160566", "0.51596355", "0.5158086", "0.5148791", "0.51420075", "0.5141055" ]
0.0
-1
Checks to see if a user exists, if so, it authorizes the user
private function attemptLogin($user){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n // TODO: Check if is authorized to create user\n return true;\n }", "public function auth() {\n\t\t\t// Check if user has not a session\n\t\t\tif (!$this->session->has('user')) return false;\n\n\t\t\t// Get the user from session\n\t\t\t$user = $this->session->get('user');\n\t\t\t$field = array_keys($user)[1] ?? null;\n\t\t\t$value = array_values($user)[1] ?? null;\n\n\t\t\t// If user does not exists\n\t\t\tif (!$this->user->exists($field, $value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\treturn true;\n\t\t}", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "function authorize()\n {\n try {\n $authRequest = $this->heimdall->validateAuth();\n $authRequest->setUser(new UserEntity());\n $this->heimdall->completeAuth($authRequest);\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorizeUserById($userId, $username);", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "public function hasUser();", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function authorize()\n {\n $user = $this->user();\n return $user->can('add-user');\n }", "function authorize() {\n if (!$this->auth_required()) {\n return TRUE; //we are authorized as authorization is not required\n }\n else {\n $microservice_users_file = $this->location . '/microservice_users.xml';\n $microservice_users_xml = simplexml_load_file($microservice_users_file);\n if (empty($microservice_users_xml)) {\n $this->log->lwrite(\"Could not load microservices user file\", 'SOAP_SERVER', NULL, NULL, 'INFO');\n return FALSE;\n }\n $users = $microservice_users_xml->xpath(\"//user\");\n if (empty($users)) {\n $this->log->lwrite(\"No Users found in microserices user file\", 'SOAP_SERVER', NULL, NULL, 'INFO');\n return FALSE;\n }\n foreach ($users as $user) {\n if (strcmp($_SERVER['PHP_AUTH_USER'], $user['username']) == 0 && strcmp($_SERVER['PHP_AUTH_PW'], $user['password']) == 0) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "private function authorizeUser()\n {\n $logout = new LogUserOutAction($this);\n $session = new Session();\n $idEncryption = new IDEncryption();\n\n $rights = $this->getRights();\n if ($rights < self::GUEST\n || $rights > self::DEVELOPER\n || (int) ($this->account->account_is_blocked ?? '0') === 1\n || !$idEncryption->validateHash(\n $this->account->account_login_token ?? '',\n $session->get('userID')\n )\n ) {\n $logout->execute();\n\n return new Redirect('/admin');\n }\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n $user = \n return false;\n }", "private function checkUser($_AdUser)\n {\n //get the user path from config\n $u = config('azureAdAuth.user_model');\n $theUser = $u::where('email', $_AdUser->userPrincipalName)->first();\n if($theUser == null){\n // create the user\n $usr = new $u();\n $usr->email = $_AdUser->userPrincipalName;\n $usr->name = $_AdUser->displayName;\n $usr->password = Hash::make($_AdUser->id);\n $usr->save();\n\n $theUser = $usr;\n }\n Auth::login($theUser);\n return Auth::check();\n }", "public function test_if_user_isnt_authorized_to_sign_in_if_doesnt_exists()\n {\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertUnauthorized();\n }", "public function isAuthorized(){\n\t\t// Check that username is not empty and exists\n\t\t;return ($username = $_SERVER['PHP_AUTH_USER']) && array_key_exists($username, $this->users_pwds)\n\t\t// Check passord validity\n\t\t&& $this->users_pwds[$username] === $_SERVER['PHP_AUTH_PW']\n\t\t;\n\t}", "private function authorizeUser($user){\n\n }", "public function userExists()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function authorize()\n {\n if (! auth()->user()) {\n return $this->deny($_SERVER['graphql.inviteUser.authorize'] ?? null);\n }\n\n return true;\n }", "public function authorize()\n {\t//para ver si el usuario tiene acceso a este metodo\n //return false;\n return true;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n\t{\n\t\t// La autorización siempre será true por que cualquier usuario podrá\n\t\t// crear álbumes y nosotros se los asociaremos al usuario\n\t\t// que tiene la sesión creada.\n\t\treturn true;\n\t}", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function userExists( $user_name ) { return true;}", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('user.create');\n }", "public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }", "public function authorize(): bool\n {\n return config('fenerum.webhook_auth_username') === $this->getUser() &&\n config('fenerum.webhook_auth_password') === $this->getPassword();\n }", "public static function checkUser()\n\t{\n\n\t\tif (!User::verifyLogin())\n\t\t{\n\n\t\t\theader(\"Location: /admin/login\");\n\t\t\texit;\n\n\t\t}\n\n\t}", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function validateUser(){\n\t\t$user = $this->auth->user();\n\t\tif(!$user) {\n\t\t\t$responseArray = [\n\t\t\t\t'message' => 'Not authorized. Please login again',\n\t\t\t\t'status' => false\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(403);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$responseArray = [\n\t\t\t'message' => 'User is authorized',\n\t\t\t'status' => true\n\t\t\t];\n\n\t\t\treturn response()->json($responseArray)->setStatusCode(200);\n\t\t}\n\t}", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "public static function checkAuth() {\n if(session(\"auth_token\", null) == null){ return false; }\n \n $apiresponse = ApiController::doRequest(\"GET\", \"/users/me\", [\"bearer\" => session(\"auth_token\")], []);\n if($apiresponse->getStatusCode() == 200) {\n $apibodystr = (string)$apiresponse->getBody();\n $apibody = \\GuzzleHttp\\json_decode($apibodystr);\n session([\"auth_user\" => new User($apibody)]);\n return true; \n }\n \n return false;\n }", "public function create(User $user)\n {\n if (Auth::check()==true ) {\n return true;\n }\n }", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function hasUser()\n {\n return $this->getUser() !== null;\n }", "protected function isUserAllowedToLogin() {}", "public function authorize() {\n\t\ttry {\n\t\t\t$authenticationStatus = $this->OAuth2Lib->checkUserCredentials(\n\t\t\t\t\t\t\t\t\t\t$this->data['client_id'], \n\t\t\t\t\t\t\t\t\t\t$this->data['username'], \n\t\t\t\t\t\t\t\t\t\t$this->data['password']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\n\t\t\t$this->OAuth2Lib->finishClientAuthorization(\n\t\t\t\t(boolean) $authenticationStatus,\n\t\t\t\tarray(\n\t\t\t\t\t'response_type' => $this->data['response_type'],\n\t\t\t\t\t'client_id' => $this->data['client_id'],\n\t\t\t\t\t'redirect_uri' => $this->data['redirect_uri'],\n\t\t\t\t\t'state' => $this->data['state'],\n\t\t\t\t\t'scope' => $this->data['scope'],\n\t\t\t\t\t'username' => $this->data['username']\n\t\t\t\t)\n\t\t\t);\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "public function isAuthValid() {\n if (is_null($this->getUserId())) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "protected function _checkAndRedirect() {\n $auth = $this->_checkAuthentication();\n if(true === $auth) { // authentication required, redirects to login page\n $user = $this->getCurrentUser();\n if(null === $user) { // user doesn't appear do be logged in\n $this->flashMessenger()->addErrorMessage(IControllerMessages::FATAL_ERROR_NOT_AUTHENTIFICATED);\n $this->redirect()->toRoute(IRouteStore::LOGIN); // break;\n return;\n }\n else {\n \treturn $user;\n }\n }\n else {\n \texit;\n \treturn false;\n }\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "public function authorize() {\n\t\t$this->db = new Database();\n\t\t$this->user = ( 'rjg70' );//$_SERVER['REMOTE_USER']);\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $this->user );\n\t\t$row = $this->db->single();\n\n\t\t//print_r($row);\n\t\tif ( $row ) {\n\t\t\tif ( $row[\"authorised\"] ) {\n\t\t\t\t$this->admin = $row[\"admin\"];\n\t\t\t\t$this->type = $row[\"type\"];\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n $token_sent = request()->bearerToken();\n\n if (empty(auth()->user()) && !empty($token_sent)) {\n $token = CompanyToken::whereToken($token_sent)->first();\n\n $user = $token->user;\n Auth::login($user);\n }\n\n return auth()->user()->can('create', Invoice::class);\n }", "private function _userAutehntication()\r\n {\r\n /* Check if the USERNAME and PASSWORD HTTP headers is set*/\r\n if(!(isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME']) and isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']))) {\r\n /* Error: Unauthorized User */\r\n $this->_sendResponse(401);\r\n }\r\n $username = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME'];\r\n $password = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']; \r\n \r\n /* Find the user */\r\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\r\n if($user===null) {\r\n /* Error: Unauthorized User, username doesn't exist */\r\n $this->_sendResponse(401, 'Error: Not a valid User');\r\n } else if(!$user->validatePassword($password)) {\r\n /* Error: Unauthorized User, Wrong Password */\r\n $this->_sendResponse(401, 'Error: Password is Wrong');\r\n }\r\n }", "public function authForUser( $user ){ return $user->authForDB( $this ); }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function test_if_user_can_sign_in()\n {\n $this->createFakerUser($this->credentials);\n\n $this->postJson('/api/v1/auth/login', $this->credentials)->assertOk();\n }", "private function _checkValidUser()\n\t{\n\t\t$user = $this->getUser();\n\t\tif(NULL == $user->getFirstname()) return $this->redirect('/logout');\n\t\tif(NULL <> $user->getEmployerId()) return $this->redirect('/admin');\n\t}", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authenticate() {\n $user = SysAdminUser::model()->find('LOWER(account)=?', array(strtolower($this->username)));\n if ($user === null){\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n }else if (!$user->validatePassword($this->password)){\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }else {\n $this->_uid = $user->id;\n $this->username = $user->name;\n $this->setUser($user);\n $roleArr = OBJTool::convertModelToArray($user->role);\n if ($roleArr) {\n $role = $roleArr[0]['id'];\n } else {\n $role = NULL;\n }\n $this->setState('__role', $role);\n $this->errorCode = self::ERROR_NONE;\n //Yii::app()->user->setState(\"isadmin\", true);\n }\n return $this->errorCode == self::ERROR_NONE;\n }", "public function validateUser()\n {\n if (!$this->session->has(\"user\") || $this->session->get(\"user\") === null) {\n return false;\n }\n\n if ($this->user === null) {\n $this->user = $this\n ->em\n ->getRepository(\"\\AppBundle\\Entity\\User\")\n ->findOneBy([\n \"name\" => $this->session->get(\"user\")\n ]);\n }\n\n if ($this->user === null\n || !hash_equals($this->user->getHash(), $this->session->get(\"user_token\"))\n ) {\n $this->logoutUser();\n return false;\n }\n\n return true;\n }", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "public function hasAccess() {\n // This is the TokenAuthUser.\n // The Publisher role is not assigned to the user,\n // it is only used to scope the consumer.\n /** @var \\Drupal\\Core\\Session\\AccountProxyInterface $user */\n $userAccount = $this->currentUser();\n // Verify permission against User entity.\n $userEntity = User::load($userAccount->id());\n if ($userEntity->hasPermission('access publisher')) {\n return new JsonResponse([\n 'access' => TRUE,\n ], 200);\n }\n else {\n return new JsonResponse([\n 'access' => FALSE,\n ], 403);\n }\n }", "private function login_or_register( $provider, $user, $user_meta ) {\n\t\t// Define how the social ID meta key looks like in the WP database\n\t\t$social_id_meta_key = '_' . $provider .'_id';\n\n\t\t// Check if this user already exists in the database based on the social_id (meta field)\n\t\t$existing_user = get_users( array( 'meta_key' => $social_id_meta_key, 'meta_value' => $user_meta[$social_id_meta_key] ) );\n\n\t\tif ( $existing_user ) {\n\t\t\t// User already exists, log him in\n\t\t\treturn $this->login( $user_obj->ID, $user_meta );\n\t\t} else {\n\t\t\t// Create a new user\n\t\t\treturn $this->register( $user, $user_meta );\n\t\t}\n\t}", "function user_AuthIsUser() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['user']) && ($AUTH['user'] !== 0);\n}", "public function authorize(): bool\n {\n return \\Auth::check();\n }", "function uservalidationbyadmin_check_auth_attempt($credentials) {\n\n\tif (!isset($credentials['username'])) {\n\t\treturn;\n\t}\n\n\t$username = $credentials['username'];\n\n\t// See if the user exists and isn't validated\n\t$access_status = access_get_show_hidden_status();\n\taccess_show_hidden_entities(TRUE);\n\n\t$user = get_user_by_username($username);\n\tif ($user && isset($user->validated) && !$user->validated) {\n\t\t// show an error and resend validation email\n\t\tuservalidationbyadmin_request_validation($user->guid);\n\t\taccess_show_hidden_entities($access_status);\n\t\tthrow new LoginException(elgg_echo('uservalidationbyadmin:login:fail'));\n\t}\n\n\taccess_show_hidden_entities($access_status);\n}", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n if(! Auth::check())\n return false;\n return true;\n\n }", "public function userExists()\n {\n $action = __NAMESPACE__ . '\\actions\\UserExists';\n\n $result = $this->actionController->executeAction($action);\n $content = ($result->getSuccess()) ?: 'That Username Does Not Exist';\n\n $result->setContent($content)\n ->Render();\n }", "public function authorize()\n { \n //Returnando sempre true porque não há auth.\n return true;\n }", "protected function Authorized(){\n // usuario\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return true;\n }\n \n // Autorizar la solicitud atendiendo a la activacion del usuario\n\t\t$uType = $this->getUserType();\n\t\t\n\t\tif ($uType >= USER_CLIENT){ // Ok user is active\n\t\t\t$res = DBHelper::Select('users', '*', \"email='{$this->user}'\");\n\t\t\t//if ((!$res[0]['name'] || !$res[0]['phone']) && $res[0]['expiration'] - time() >= 7 * 24 * 3600){\n\t\t\t//\t$this->url = Url::Parse(\n // \t\t\"http://\".HTTP_HOST.\"/__www/set-user-info.php?user={$this->user}&success_url=\" . urlencode((string)$this->data->url)\n \t//\t);\n\t\t\t//}\n\t\t}elseif(DBHelper::is_user_registered($this->user) > 0){ \n // La activacion del usuario ha expirado. Redirigir a\n // la pagina de recarga\n\t\t\t\n /** @var Url url */\n $url = $this->getUrlFromData();\n if (stripos($url->host, HTTP_HOST) === FALSE){\n\t\t\t $this->url = Url::Parse(ACCOUNT_EXPIRED_URL . \"&user={$this->user}&mobile={$this->data->mobile}&success_url=\". urlencode((string)$this->data->url));\n }\n\t\t}else {\n // Se permite acceso solamente al servidor de Aurora\n return FALSE;\n }\n \n return true;\n\t}", "public function authorize(): bool\n {\n return $this->user()->can('create', Role::class);\n }", "public function authorize()\n\t{\n\t\t//return User::where('id', Auth::user()->id)->where('active', 1)->exists();\n\t\treturn true;\n\t}", "public function authorize()\n {\n // return \\Auth::check();\n // Allows all users in\n return true;\n }", "public function authorize()\n {\n // return \\Auth::check();\n // Allows all users in\n return true;\n }", "public function authorize()\n {\n // return \\Auth::check();\n // Allows all users in\n return true;\n }", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "function execute() {\n\t\tif ($this->existingUser) {\n\t\t\t// Existing user in the system\n\t\t\t$userDao = &DAORegistry::getDAO('UserDAO');\n\t\t\t$user = &$userDao->getUserByUsername($this->getData('username'));\n\t\t\tif ($user == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$userId = $user->getUserId();\n\t\t\t\n\t\t} else {\n\t\t\t// New user\n\t\t\t$user = &new User();\n\t\t\t\n\t\t\t$user->setUsername($this->getData('username'));\n\t\t\t$user->setFirstName($this->getData('firstName'));\n\t\t\t$user->setMiddleName($this->getData('middleName'));\n\t\t\t$user->setInitials($this->getData('initials'));\n\t\t\t$user->setLastName($this->getData('lastName'));\n\t\t\t$user->setAffiliation($this->getData('affiliation'));\n\t\t\t$user->setEmail($this->getData('email'));\n\t\t\t$user->setUrl($this->getData('userUrl'));\n\t\t\t$user->setPhone($this->getData('phone'));\n\t\t\t$user->setFax($this->getData('fax'));\n\t\t\t$user->setMailingAddress($this->getData('mailingAddress'));\n\t\t\t$user->setBiography($this->getData('biography'));\n\t\t\t$user->setInterests($this->getData('interests'));\n\t\t\t$user->setDateRegistered(Core::getCurrentDate());\n\t\t\n\t\t\tif ($this->profileLocalesEnabled) {\n\t\t\t\t$site = &Request::getSite();\n\t\t\t\t$availableLocales = $site->getSupportedLocales();\n\t\t\t\t\n\t\t\t\t$locales = array();\n\t\t\t\tforeach ($this->getData('userLocales') as $locale) {\n\t\t\t\t\tif (Locale::isLocaleValid($locale) && in_array($locale, $availableLocales)) {\n\t\t\t\t\t\tarray_push($locales, $locale);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$user->setLocales($locales);\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($this->defaultAuth)) {\n\t\t\t\t$user->setPassword($this->getData('password'));\n\t\t\t\t// FIXME Check result and handle failures\n\t\t\t\t$this->defaultAuth->doCreateUser($user);\n\t\t\t\t$user->setAuthId($this->defaultAuth->authId);\n\t\t\t\t$user->setPassword(Validation::encryptCredentials($user->getUserId(), Validation::generatePassword())); // Used for PW reset hash only\n\t\t\t} else {\n\t\t\t\t$user->setPassword(Validation::encryptCredentials($this->getData('username'), $this->getData('password')));\n\t\t\t}\n\t\t\t\n\t\t\t$userDao = &DAORegistry::getDAO('UserDAO');\n\t\t\t$userDao->insertUser($user);\n\t\t\t$userId = $user->getUserId();\n\t\t\tif (!$userId) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$sessionManager = &SessionManager::getManager();\n\t\t\t$session = &$sessionManager->getUserSession();\n\t\t\t$session->setSessionVar('username', $user->getUsername());\n\t\t}\n\n\t\t$journal = &Request::getJournal();\n\t\t$roleDao = &DAORegistry::getDAO('RoleDAO');\n\t\t\n\t\t// Roles users are allowed to register themselves in\n\t\t$allowedRoles = array('reader' => 'registerAsReader', 'author' => 'registerAsAuthor', 'reviewer' => 'registerAsReviewer');\n\n\t\t$journalSettingsDao = &DAORegistry::getDAO('JournalSettingsDAO');\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegReader')) {\n\t\t\tunset($allowedRoles['reader']);\n\t\t}\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegAuthor')) {\n\t\t\tunset($allowedRoles['author']);\n\t\t}\n\t\tif (!$journalSettingsDao->getSetting($journal->getJournalId(), 'allowRegReviewer')) {\n\t\t\tunset($allowedRoles['reviewer']);\n\t\t}\n\t\t\n\t\tforeach ($allowedRoles as $k => $v) {\n\t\t\t$roleId = $roleDao->getRoleIdFromPath($k);\n\t\t\tif ($this->getData($v) && !$roleDao->roleExists($journal->getJournalId(), $userId, $roleId)) {\n\t\t\t\t$role = &new Role();\n\t\t\t\t$role->setJournalId($journal->getJournalId());\n\t\t\t\t$role->setUserId($userId);\n\t\t\t\t$role->setRoleId($roleId);\n\t\t\t\t$roleDao->insertRole($role);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$this->existingUser) {\n\t\t\t// Send welcome email to user\n\t\t\timport('mail.MailTemplate');\n\t\t\t$mail = &new MailTemplate('USER_REGISTER');\n\t\t\t$mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));\n\t\t\t$mail->assignParams(array('username' => $this->getData('username'), 'password' => $this->getData('password')));\n\t\t\t$mail->addRecipient($user->getEmail(), $user->getFullName());\n\t\t\t$mail->send();\n\t\t}\n\n\t\t// By default, self-registering readers will receive\n\t\t// journal updates. (The double set is here to prevent a\n\t\t// duplicate insert error msg if there was a notification entry\n\t\t// left over from a previous role.)\n\t\tif (isset($allowedRoles['reader']) && $this->getData($allowedRoles['reader'])) {\n\t\t\t$notificationStatusDao = &DAORegistry::getDAO('NotificationStatusDAO');\n\t\t\t$notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, false);\n\t\t\t$notificationStatusDao->setJournalNotifications($journal->getJournalId(), $userId, true);\n\t\t}\n\n\t\tif (isset($allowedRoles['reader']) && $this->getData('openAccessNotification')) {\n\t\t\t$userSettingsDao = &DAORegistry::getDAO('UserSettingsDAO');\n\t\t\t$userSettingsDao->updateSetting($userId, 'openAccessNotification', true, 'bool', $journal->getJournalId());\n\t\t}\n\t}", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n {\n // return auth()->user()->can('create user');\n return true;\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize(): bool\n {\n return !auth()->check();\n }" ]
[ "0.70663285", "0.6600494", "0.6573435", "0.6520676", "0.6442943", "0.63199544", "0.62971413", "0.62950075", "0.6275104", "0.62677544", "0.62669784", "0.6263903", "0.6246091", "0.62439114", "0.62429696", "0.62397814", "0.622074", "0.6196412", "0.61671954", "0.616646", "0.6158426", "0.61560166", "0.61510813", "0.61348706", "0.61344516", "0.61220014", "0.6119288", "0.60795575", "0.6073773", "0.6066023", "0.60634196", "0.60502243", "0.6044793", "0.6041923", "0.6041923", "0.6029303", "0.6018868", "0.60124296", "0.5996564", "0.59956056", "0.599334", "0.5986389", "0.5970325", "0.5961953", "0.5948677", "0.5939108", "0.5937464", "0.59325397", "0.5932464", "0.59235364", "0.59215397", "0.59152776", "0.5903775", "0.5901903", "0.59015065", "0.5900135", "0.58927405", "0.58686554", "0.58567315", "0.58518225", "0.5851523", "0.58462733", "0.5839861", "0.5832051", "0.5815698", "0.5813864", "0.58078825", "0.579751", "0.57964456", "0.5795765", "0.5793211", "0.57807755", "0.57801014", "0.57758194", "0.57670236", "0.57659614", "0.5762563", "0.5759928", "0.575888", "0.5758874", "0.5756751", "0.5756324", "0.5754477", "0.57513654", "0.5740878", "0.5737031", "0.5734215", "0.572981", "0.572981", "0.572981", "0.5723567", "0.5717976", "0.5717976", "0.57161504", "0.5715292", "0.5714309", "0.5710777", "0.57092094", "0.5708448", "0.57064974", "0.5704698" ]
0.0
-1
This unsets the authorization cookie
private function logoutUser($hash){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function unsetAccessTokenCookie()\n {\n setcookie('accessToken', '', time() - 3600, \"/\"); \n }", "public function deAuth(){\n $this->updateIP();\n $this->updateLoginDate();\n $this->authenticated = false;\n unset($_COOKIE['authenticated']);\n setcookie(\"authenticated\", \"\", time()-3600, \"/\");\n session_destroy();\n }", "public function clearAuthorization()\n {\n // So we just get rid of the token.\n $this->clearCrucibleSession();\n }", "public function logout() {\n $auth_cookie = Cookie::get(\"auth_cookie\");\n if ($auth_cookie != '') {\n $this->deleteCookie($auth_cookie);\n }\n }", "function wp_clear_auth_cookie()\n {\n }", "public function deAuthenticate()\n {\n $this->redis->del(\n request()->cookie('access_token')\n );\n }", "public function unauthorize () {\n\t\t$this->_plugin->setting(self::token_setting, NULL);\n\t}", "public function clear_cookie()\n {\n }", "function clear_auth_cookie() {\n\t\t\tif ( defined('LOGGED_IN_COOKIE') && !empty($_COOKIE[LOGGED_IN_COOKIE]) ) {\n\t\t\t\tif ( ($a = $this->parse_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in')) !== FALSE ) {\n\t\t\t\t\t$this->update_logged_out_db_value($a);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function logout(){\n $session = new Zend_Session_Namespace('Auth');\n unset($session->User);\n Zend_Session::namespaceUnset('Auth');\n\n App_Cookie::unsetCookie (\"ulogin\");\n App_Cookie::unsetCookie (\"uloginhash\");\n }", "public function logout(): void\n\t{\n\t\t$this->session->regenerateId();\n\n\t\t$this->session->regenerateToken();\n\n\t\t$this->session->remove($this->options['auth_key']);\n\n\t\t$this->response->getCookies()->delete($this->options['auth_key'], $this->options['cookie_options']);\n\n\t\t$this->user = null;\n\n\t\t$this->hasLoggedOut = true;\n\t}", "public function logout() {\n\t\t$this->clearCookies();\n\t}", "public function signOut() {\n\n $this->getAttributeHolder()->removeNamespace('sfGuardSecurityUser');\n $this->user = null;\n $this->clearCredentials();\n $this->setAuthenticated(false);\n $expiration_age = sfConfig::get('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);\n $remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');\n sfContext::getInstance()->getUser()->setAttribute('view', '');\n sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age);\n }", "public function signOut()\r\n {\r\n $this->getAttributeHolder()->removeNamespace('sfGuardSecurityUser');\r\n $this->user = null;\r\n $this->clearCredentials();\r\n $this->setAuthenticated(false);\r\n $expiration_age = sfConfig::get('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);\r\n $remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');\r\n sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age);\r\n }", "public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie();\n }", "public function iDestroyMyCookies() {\n $this->getSession()->reset();\n }", "public static function logout()\n\t{\n\t\t$_SESSION['loggedin'] = false;\n\t\t$_SESSION['showchallenge'] = null;\n\t\t$_SESSION['adminlastchosen'] = null;\n\t\t$_SESSION['login'] = '';\n\t\t$_SESSION['user_id'] = '';\n\t\t$_SESSION['email'] = '';\n\t\tsetcookie('logged_in', '');\n\t\tsetcookie('username', '');\n\t}", "public function signOut()\n {\n $this->getAttributeHolder()->removeNamespace('subscriber');\n $this->getAttributeHolder()->remove('recipe_history');\n $this->setAuthenticated(false);\n $this->clearCredentials();\n sfContext::getInstance()->getResponse()->setCookie('OpenEats', '', time() - 3600, '/');\n }", "public function remove()\n {\n if ($this->cookies->has('RMU')) {\n\t $this->cookies->get('RMU')->delete();\n }\n if ($this->cookies->has('RMT')) {\n\t $this->cookies->get('RMT')->delete();\n }\n\n $this->session->remove('auth-i');\n $this->session->destroy(true);\n }", "function auth_clear()\n{\n session_delete(auth_namespace());\n _app('auth', null);\n}", "function clearCookies(){\n\t\t$this->_HTTPCookies = array();\n\t}", "public function clearLogin() {\n\t\tsetcookie(\"login-email\", \"\", time(), \"/\");\n\t}", "public function logout()\n\t{\n\t\t$this->getAttributeHolder()->removeNamespace('client');\n\t\t$this->removeCredential();\n\t\t$this->setAuthenticated(false);\n\t}", "public function clear()\n\t{\n\t\t$this->connection()->delete('cookies');\n\t}", "public static function logout ()\r\n\t{\r\n\t\tif (self::isLogged())\r\n\t\t{\r\n\t\t\t$oAuth = Zend_Auth::getInstance();\r\n\t\t\t$oAuth->setStorage(self::_getStorage());\r\n\r\n\t\t\t$oAuth->getStorage()->clear();\r\n\t\t\t$oAuth->clearIdentity();\r\n\t\t}\r\n\t}", "public function logout() {\n\t\t$this->removeAccessToken();\n\t}", "function destroy_cookie() {\n\t\tsetcookie(\"id_user\", '', time()-3600);\n\t\tsetcookie(\"code_user\", '', time()-3600);\n\t}", "public function clearCookies()\n {\n $this->cookie_data = array();\n }", "public function endSession() {\n $this->state = 0;\n $_SESSION['authstate'] = 0;\n setcookie('access_token', '', 0);\n setcookie('access_token_secret', '', 0);\n }", "public function ClearCookie()\n {\n // set the time to negative to clear the cookies\n $iNegativeTime = time() - 3600;\n\n // clear all cookies\n setcookie( 'CUTOKENTNG', \"\", $iNegativeTime, \"/\", '.clemson.edu', false, true );\n setcookie( 'AUTHURL', $this->sSuccessUrl, $iNegativeTime, \"/\", '.clemson.edu', false, true);\n setcookie( 'AUTHREASON', '', $iNegativeTime, \"/\", '.clemson.edu', false, true);\n }", "function reset()\n {\n $this->_cookies = array();\n }", "public function logout()\r\n {\r\n delete_cookie('phb');\r\n $this->session->sess_destroy();\r\n redirect(base_url().'Auth');\r\n }", "public function clearCookies() {\n\t\t\t$this->_cookies = [];\n\t\t}", "public function destroy_cookie() {\n session_start();\n session_unset();\n session_destroy();\n setcookie('admin', '=479ae5ce40428338f078e302eb4b2df6', time() - 3600, '/');\n if (empty($_COOKIE['admin'])) {\n echo \"Admin cookie destroyed\";\n }\n }", "public function logout()\n {\n if (!is_null($this->token)) {\n $this->token->delete();\n }\n if (isset($_SESSION['uuid'])) {\n unset($_SESSION['uuid']);\n session_destroy();\n setcookie('token', '', time() - 3600, '/', getenv('DOMAIN'));\n }\n }", "public function logout()\n\t{\n\t\t$unset_array = array('set_id', 'access_pass', 'username');\n\t\t$this->session->unset_userdata($unset_array);\n\t}", "public function Logout() {\n\n $cookie = json_decode(\\FluitoPHP\\Request\\Request::GetInstance()->\n Cookie($this->\n config['id']), true);\n\n if (isset($cookie['salt_id'])) {\n\n $this->\n database->\n Conn($this->\n GetConn())->\n Helper()->\n Delete($this->\n GetPrefix() . 'usersalt', array(\n array(\n 'column' => 'salt_id',\n 'operator' => '=',\n 'rightvalue' => $cookie['salt_id']\n )\n ))->\n Query();\n\n \\FluitoPHP\\Response\\Response::GetInstance()->\n SetCookie($this->\n config['id'], '', 0, '', '', false, true);\n }\n\n $this->\n currentUser = null;\n }", "public function unlogin() {\n\t\t\tif ($user = $this->authorisator->getUser()) {\n\t\t\t\t/* @var $user ILoginUserDigest */\n\t\t\t\t$user->dao()->merge($user->setLoginKey(null));\n\t\t\t\t$this->authorisator->dropUser();\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->session->isStarted()) {\n\t\t\t\t$this->session->assign($this->getLoginKeyParamName(), null);\n\t\t\t}\n\t\t}", "function clearIsAbuse() {\n unset($_COOKIE['isInAbuse']);\n }", "public static function doLogout() {\n session()->forget('auth_token');\n session()->flush();\n }", "public function logout()\r\n\t{\r\n\t\tif(!$this->loggedIn()) return;\r\n\t\t$query = 'UPDATE users SET fingerprint=NULL WHERE id=' . $this->user->id . ' LIMIT 1';\r\n\t\tmysql_query($query);\r\n\t\tsetcookie('qw_login', '', time()-60*60*24, '/');\r\n\t\tsetcookie('tree_grid_cookie', '', time()-60*60*24, '/');\r\n\t\t$this->user = false;\r\n\t}", "public static function deleteCookie(){\n func::runSession();\n setcookie('username', '', time() - 1, '/');\n setcookie('userid', '', time() - 1, '/');\n setcookie('token', '', time() - 1, '/');\n setcookie('serial', '', time() - 1, '/');\n session_destroy();\n }", "public function logout(){\r\n unset($_SESSION['user_id']);\r\n unset($this->user_id);\r\n $this->signed_in = false;\r\n }", "public function logOut() {\n\t$this->isauthenticated = false;\n\tunset($_SESSION['clpauthid'], $_SESSION['clpareaname'], $_SESSION['clpauthcontainer']);\n\tsession_regenerate_id();\n}", "public function deauthenticate() {\n\t\t$response = $this->requester->request('DELETE', $this->url);\n\t\t$this->requester->token = null;\n\t\treturn $response;\n\t}", "public function logout()\n {\n\t // unsets all cookies and session data\n process_logout(); \n }", "public function logout()\n {\n $this->_delAuthId();\n }", "function slic_unset_cookie() {\n\t$year_ago = time() - YEAR_IN_SECONDS;\n\tsetcookie( 'wp_is_logged_in', ' ', $year_ago, COOKIEPATH, COOKIE_DOMAIN );\n\tsetcookie( 'wp_is_logged_in', ' ', $year_ago, SITECOOKIEPATH, COOKIE_DOMAIN );\n}", "public function logout(){\n echo 'logout';\n unset($_SESSION['email']);\n unset($this->email);\n\t\tunset($_SESSION['id']);\n unset($this->id);\n\t\tunset($_SESSION['role']);\n unset($this->role);\n $this->signed_in=false; \n }", "public function logout()\n {\n $this->removeRememberMeCookie();\n }", "public function logout() {\n\t\t\t// Unset the user ID from the cookie.\n\t\t\tunset($this->uid);\n\t\t\t\n\t\t\t// Set all cookies to expire immediately.\n\t setcookie('PHPSESSID', 0);\n\t\t\tsetcookie('fauth', 0);\n\t\t\t\n\t\t\t// Log the Session object out.\n\t\t\t$this->logged_in = false;\n\t\t\t\n\t\t\t// Unset all session variables.\n\t\t\t$_SESSION['uid'] = 0;\n\t\t\t$_SESSION['username'] = \"\";\n\t\t\t\n\t\t\t// Destroy the session.\n\t\t\tsession_destroy();\n\t\t}", "public function clearcookies() {\nif (isset($_COOKIE[\"islog_email\"]) && isset($_COOKIE[\"islog_pass\"]) && isset($_COOKIE[\"islog_id\"])) \n{\n//Destroy sessions\nunset($_SESSION['userSession']);\n //Destroy Cookies\nsetcookie(\"islog_email\", \"\", time()-86400 * 90);\nsetcookie(\"islog_pass\", \"\", time()-86400 * 90);\nsetcookie(\"islog_id\", \"\", time()-86400 * 90);\nheader(\"Location: logout.php\");\nexit;\nreturn;\n }\n}", "public function logout(){\n\t\tunset($_SESSION['auth']);\n\t\theader('Location: index.php?p=users.login');\n\t}", "protected function _deconnection() {\n\n\t\tif ($this->cookie->exists('user') && $this->cookie->exists('token') && isset($_GET['deconnection']) && $_GET['deconnection'] === \"1\") {\n\n\t\t\t$this->cookie->set('user', null, 0);\n\t\t\t$this->cookie->set('id', null, 0);\n\t\t\t$this->cookie->set('token', null, 0);\n\t\t}\n\t}", "private function _logout(){\r\n $auth = new AuthenticationService();\r\n\r\n if ($auth->hasIdentity()) {\r\n // Identity exists; get it\r\n $auth->clearIdentity();\r\n $this->user = false;\r\n\r\n header('Location: '.WEBROOT ) ;\r\n }\r\n }", "public function logout(){\n\t\tsetcookie(USER_COOKIE_ID,$this->id,1,\"/\");\n\t\tsession_destroy();\n\t\theader(\"Location: \".url);\n\t}", "function removeCookies() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE )\techo \"removeCookies() \\n\";\r\n\t\tunset( $this->requestHeaders[\"Cookie\"] );\r\n\t}", "public function logout()\n\t{\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\tunset($_SESSION['oauth_token']);\n\t\tunset($_SESSION['oauth_token_secret']);\n\t\theader('Location: index.php');\n\t}", "function\nauth_logout()\n{\n global $_SERVER, $LOGIN_EMAIL, $LOGIN_ID, $LOGIN_IS_ADMIN, $LOGIN_IS_EDITOR,\n $LOGIN_IS_MEMBER, $LOGIN_IS_OFFICER,\n $LOGIN_NAME, $LOGIN_ORGANIZATION, $LOGIN_PAGEMAX, $LOGIN_TIMEZONE;\n\n\n // Reset the user...\n $LOGIN_EMAIL = \"\";\n $LOGIN_ID = 0;\n $LOGIN_IS_ADMIN = 0;\n $LOGIN_IS_EDITOR = 0;\n $LOGIN_IS_MEMBER = 0;\n $LOGIN_IS_OFFICER = 0;\n $LOGIN_NAME = \"\";\n $LOGIN_ORGANIZATION = 0;\n $LOGIN_PAGEMAX = 10;\n $LOGIN_TIMEZONE = \"UTC\";\n\n setcookie(\"PWGSID\", \"\", 0, \"/\", $_SERVER[\"SERVER_NAME\"], TRUE, TRUE);\n}", "public function logout()\n\t{\n\t\t$this->client->revokeToken();\n\t \t$this->destroy();\n\t}", "function destory_2fa_sessions() {\n if(isset($_COOKIE['verified'])) {\n unset($_COOKIE['verified']);\n }\n}", "public function logout()\n {\n $this->getAuth()->clearIdentity();\n }", "function log_User_Out(){\n\t\tif (isset($_SESSION['status'])){\n\t\t\tunset($_SESSION['status']);\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['role']);\n\t\t\tunset($_COOKIE['startdate']);\n\t\t\tunset($_COOKIE['enddate']);\n\n\t\t\tif (isset($_COOKIE[session_name()])) setcookie(session_name(), '', time() - 1000);\n\t\t\tsession_destroy();\n\t\t}\n\t}", "function logout(){\n session_destroy();\n\tsetcookie('auth', '', time() + 365*24*3600, '/', null, false, true);\n header('Location: index.php');\n}", "public function logout() {\n\t\t$this->authProvider->logout();\n\t\t$this->authProvider = new Client\\Authentication\\NoAuth($this, array(), array());\n\t\t$this->changeDescription(NULL);\n\t}", "function wp_clearcookie()\n {\n }", "public function logout(){\n\t\tif(isset($_SESSION['authentication'])){\n\t\t\tunset($_SESSION['authentication']);\n\t\t}\n\t\tif(isset($_SESSION['user_folder'])){\n\t\t\tunset($_SESSION['user_folder']);\n\t\t}\n\t\t$this->session->unset_userdata('authentication');\n\t\tif(isset($_SESSION) && count($_SESSION)){\n\t\t\tforeach($_SESSION as $key => $val){\n\t\t\t\tif(in_array(substr($key, 0, 3), array('fb_'))){\n\t\t\t\t\t$_SESSION[$key] = '';\n\t\t\t\t\tunset($_SESSION[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(isset($_SESSION['access_token'])){\n\t\t\t$_SESSION['access_token'] = '';\n\t\t\tunset($_SESSION['access_token']);\n\t\t}\n\t\tredirect(site_url());\n\t}", "public function logout()\n {\n $this->user_provider->destroyAuthIdentifierSession();\n\n \\session()->flush();\n \n $this->user = null;\n\n $this->loggedOut = true;\n }", "public function logout()\n {\n $this->app['security']->setToken(null);\n }", "private function clearRequest(AuthorizationRequest $request)\n {\n /** @var Client $client */\n $client = $request->getClient();\n $clientId = $client->getClientKey();\n $this->session->remove(\"authn_request.$clientId\");\n }", "public function logout () {\n $this->clear();\n }", "function logout()\n { \n // corto la session\n session_destroy();\n // seteo la cookie con time en negativo para que tambien se borre\n setcookie(\"email\", \"\", time() -1);\n }", "static function logout() {\n unset($_SESSION['id']);\n unset($_SESSION['login']);\n unset($_SESSION['password']);\n }", "public function logout()\n {\n $this->deleteAllPersistentData();\n $this->accessToken = null;\n $this->user = null;\n $this->idToken = null;\n $this->refreshToken = null;\n }", "public function disconnect() : void\r\n {\r\n $this->authorization_uri = '';\r\n $this->access_token = '';\r\n $this->refresh_token = '';\r\n $this->expires = 0;\r\n }", "private function clear() {\n $_SESSION = array();\n\n // Destroy the session cookie and cookie header\n $sessionCookie = Cookie::loadCookie(session_name());\n $sessionCookie->unset();\n $sessionCookie->delete();\n\n // Clear out other possible values\n if (isset($_GET[session_name()]))\n unset($_GET[session_name()]);\n\n if (isset($_POST[session_name()]))\n unset($_POST[session_name()]);\n }", "public function clear_wider_cookie() {\n\t\tglobal $phpbbForum, $config;\n\t\t\n\t\tif($this->is_working()) {\n\t\t\t\n\t\t\t// Do this even for unintegrated users -- it must be cleared if set\n\t\t\t$fStateChanged = $phpbbForum->foreground();\n\t\t\t$domain = $config['cookie_domain'];\n\t\t\t$path = $config['cookie_path'];\n\t\t\t$phpbbForum->restore_state($fStateChanged);\n\t\t\n\t\t\tsetcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, $path, $domain);\n\t\t}\n\t\t\n\t}", "public function invalidate() {\n\t\tsetcookie(self::$csrf_cookie, '', 0, '/');\n\t\tunset($_COOKIE[self::$csrf_cookie]);\n\t}", "public function logout ()\n {\n unset ( $_SESSION['user_id'] );\n unset ( $_SESSION['email'] );\n unset ( $_SESSION['order_count'] );\n unset ( $_SESSION['like_count'] );\n //session_destroy () ;\n header( 'Location:' . \\f\\ifm::app()->siteUrl . 'login' );\n }", "public function logout()\n {\n foreach (array_keys($_COOKIE) as $name) {\n if (preg_match('/^WRAP.*/',$name)) {\n\n // set the expiration date to one hour ago\n setcookie($name, \"\", time() - 3600, \"/\", \"ncsu.edu\");\n }\n }\n\n wp_clearcookie();\n nocache_headers();\n\n header('Location:' . get_option('siteurl'));\n exit();\n }", "public function logout()\n\t{\n\t\t$this->user = null;\n\n\t\t$this->session->forget(static::$key);\n\t}", "function signout()\n {\n // Delete cookies\n if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid']))\n {\n setcookie(\"cookname\",\"\",time()-COOKIE_TIMEOUT,COOKIE_PATH);\n setcookie(\"cookid\",\"\",time()-COOKIE_TIMEOUT,COOKIE_PATH);\n }\n // Unset session variables\n $_SESSION = array();\n $_SESSION['signed_in'] = false;\n header(\"Location: /~mjholden/DMS/\");\n }", "public function declineCookies(){\n\t\tsetcookie('isUsingCookies', false, 0);\n\t\treturn redirect()->route('home');\n\t}", "public function logout(){\n if(isset($_SESSION[\"identity\"])){\n \n unset($_SESSION[\"identity\"]);\n }\n\n if(isset($_SESSION[\"admin\"])){\n \n unset($_SESSION[\"admin\"]);\n }\n\n /* redireccionar, cuando me elimine la sesion del logueo */\n header(\"Location:\".base_url);\n }", "private function logout()\n {\n try\n {\n global $userquery;\n\n \n if(!userid())\n {\n $logout_response['logged_out'] = 0;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'you are not logged in', \"data\" => $logout_response);\n $this->response($this->json($data)); \n }\n\n $userquery->logout();\n if(cb_get_functions('logout')) \n cb_call_functions('logout'); \n \n setcookie('is_logout','yes',time()+3600,'/');\n\n $logout_response['logged_out'] = 1;\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'logout successfully', \"data\" => $logout_response);\n $this->response($this->json($data));\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function remove()\n {\n if ($this->cookies->has('RMU')) {\n $this->cookies->get('RMU')->delete();\n }\n if ($this->cookies->has('RMT')) {\n $this->cookies->get('RMT')->delete();\n }\n\n $this->session->remove('auth-identity');\n $this->session->remove('subdomain-child');\n }", "protected function _clearAuthToken()\n {\n delete_transient($this->tokenOptionName);\n }", "public static function logout()\n\t{\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->resetSession();\n\t}", "function logout()\n {\n $user = $this->getAuthenticatedUser();\n if (!$user) return;\n\n unset($_SESSION['MFW_authenticated_user']);\n }", "public function logout() {\n\t\t\tunset( $_SESSION['user_id'] );\n\t\t\tunset( $this->user_id );\n\t\t\t$this->logged_in = false;\n\t\t}", "public static function logout() {\n session_unset();\n setcookie(\"rememberMe\", \"\", time() - 100);\n header(\"Location: index.php\");\n }", "public function delete()\n {\n if (isset($_COOKIE[$this->name])) {\n unset($_COOKIE[$this->name]);\n setcookie($this->name, '', time() - 3600);\n }\n }", "public function signOut()\n\t{\n\t\tunlink($this->cookies_path . session_id() .\"_cookie.txt\"); // delete the cookie\n\t\tunset($_SESSION['appConfig']); // kill the ACP session\n\t\t\n\t\t// \"click\" the logout button via request\n\t\t$this->request('http://www.amazon.com/gp/dmusic/mp3/forceSignOut?ie=UTF8&ref_=dm_cp_m_redirect');\n\t\techo \"Logged out\";\n\t}", "function User_logout()\n{\n setcookie('old_user', '', time() -3600);// deletes cookie \n unset($_SESSION['tyy_User'], $_SESSION['history']);// deletes session\n header(\"Location:http://$_SERVER[HTTP_HOST]\");// returns to login page\n}", "public function logout(){\n // setcookie(\"FacilityName\", \"\", time() - 3600);\n Auth::logout();\n return redirect('/'); \n }", "public function logOut(){\n\t\t\tsetcookie(\"usertoken\", $_SESSION['usertoken'], 1, \" \", '', false, false);\t\n\t\t \tsetcookie(\"sesstoken\", $_SESSION['sesstoken'], 1, \" \", '', false, false); \n\t\t \t\n\t\t \tsession_destroy();\n\t\t \theader(\"Refresh:0; url=index.php\"); \n\n\t }", "function wf_logout() {\n $cookieName = Configure::read('Wildflower.cookie.name');\n if ($this->Session->check($this->modelClass)) {\n // Generate an unique UUID\n $uuid = String::uuid();\n $user = $this->WildUser->findByCookie($uuid);\n while (!empty($user)) {\n $uuid = String::uuid();\n $user = $this->WildUser->findByCookie($uuid);\n }\n \n $user = $this->Session->read($this->modelClass);\n $this->WildUser->create($user);\n $this->WildUser->saveField('cookie', $uuid);\n $this->Session->del($this->modelClass);\n }\n\n\t\t// Destroy the keep-logged-in cookie\n $this->Cookie->destroy();\n \n $this->redirect('/login');\n }", "public function log_out() {\n $this->store_token(null);\n }", "private function logout() {\n $_SESSION['user'] = null;\n $_SESSION['valid'] = false;\n }", "static function logout() {\n self::forget(self::currentUser());\n unset($_SESSION['userId']);\n session_destroy();\n }", "public function eraseCredentials() {}" ]
[ "0.766261", "0.76082915", "0.74785566", "0.73259854", "0.7305", "0.72928023", "0.7201294", "0.72011477", "0.7067654", "0.70599306", "0.70085436", "0.6956858", "0.69274396", "0.69150287", "0.68915766", "0.6823587", "0.6822054", "0.67940176", "0.67811644", "0.6764661", "0.6763006", "0.6750587", "0.6731096", "0.67221296", "0.664751", "0.66451037", "0.664024", "0.6633865", "0.66303456", "0.66218156", "0.6619626", "0.66140294", "0.6589739", "0.6577816", "0.6556219", "0.6513274", "0.6507657", "0.6493109", "0.64928097", "0.64907455", "0.6465593", "0.6463916", "0.6460199", "0.64571404", "0.64348257", "0.643424", "0.64221174", "0.6404691", "0.64015895", "0.6389939", "0.6373729", "0.6373296", "0.63628286", "0.63492393", "0.63406926", "0.6337598", "0.6332217", "0.6331159", "0.63274264", "0.632011", "0.6314081", "0.6307747", "0.63065475", "0.6294123", "0.6290088", "0.6277379", "0.6266955", "0.62651056", "0.6264065", "0.6264048", "0.626329", "0.6261627", "0.6259374", "0.6245798", "0.62445706", "0.62306947", "0.62296957", "0.61882085", "0.6182857", "0.6182373", "0.61740917", "0.6172513", "0.61649674", "0.61646956", "0.61640674", "0.61578643", "0.6157817", "0.6153613", "0.61519957", "0.614845", "0.6147339", "0.6142422", "0.61385465", "0.613568", "0.61356646", "0.6134033", "0.6124931", "0.61216813", "0.6112038", "0.60947365", "0.6094455" ]
0.0
-1
Returns a user object for a specified hash key stored as cookie
private function userForAuth($hash){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHash($hash)\n {\n return $this->user->where('hash' , '=' , $hash)->first();\n }", "public function getUserByLoginHash($loginHash)\n {\n $sql = \"SELECT `id`,`login`,`loginHash`,`email`,`emailHash`,\".\n \"`pass`,`fio`,`phone`,`photo` \".\n \"FROM `\".DB::TBL_USERS.\"` \".\n \"WHERE `loginHash`=? LIMIT 1\";\n $st = $this->MySQL->getConn()->prepare($sql);\n $st->execute([$loginHash]);\n $r = $st->fetch();\n if (empty($r)) {\n return null;\n }\n $user = new User();\n foreach ([\n 'id', 'login', 'loginHash', 'email', 'emailHash',\n 'pass', 'fio', 'phone', 'photo'\n ] as $param) {\n $user->{$param} = $r[$param];\n }\n return $user;\n }", "public function loadUserCookies ()\n\t{\n\t\treturn $this->_getUserKey($this->_username, self::COOKIES);\n\t}", "protected function getFrontendUserByHash()\n {\n return $this->frontendUserByHash;\n //===\n }", "public function getUserByEmailHash($emailHash)\n {\n $sql = \"SELECT `id`,`login`,`loginHash`,`email`,`emailHash`,\".\n \"`pass`,`fio`,`phone`,`photo` \".\n \"FROM `\".DB::TBL_USERS.\"` \".\n \"WHERE `emailHash`=? LIMIT 1\";\n $st = $this->MySQL->getConn()->prepare($sql);\n $st->execute([$emailHash]);\n $r = $st->fetch();\n if (empty($r)) {\n return null;\n }\n $user = new User();\n foreach ([\n 'id', 'login', 'loginHash', 'email', 'emailHash',\n 'pass', 'fio', 'phone', 'photo'\n ] as $param) {\n $user->{$param} = $r[$param];\n }\n return $user;\n }", "private static function getUserFromKey() {\n\t\tstatic $user;\n\t\t\n\t\tif ($user === null) {\n\t\t\t$user = false;\n\t\t\tif ($key = Request::getGET('key')) {\n\t\t\t\t$l = User::getUsers();\n\t\t\t\t$l = $l->filter($l->exprEqual($l->exprMember('unconfirmedEmailKey'),\n\t\t\t\t\t$key));\n\t\t\t\tif ($l->getCount() == 1)\n\t\t\t\t\t$user = $l->get(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($user === false)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn $user;\n\t}", "private function getUserIDFromCookie($cookieHash) {\n $cookieHash = preg_replace(\"/[^A-Za-z0-9]/\", '', $cookieHash);\n $cookieFile = $this->_cookiePath. $cookieHash . \".txt\"; \n if (file_exists($cookieFile)) {\n $data = unserialize(file_get_contents($cookieFile));\n return intval($data[\"user_id\"]);\n } else {\n return false;\n }\n }", "function user($key = null)\n {\n $user = \\Auth::user();\n if (!is_null($key))\n return $user->$key;\n\n return $user;\n }", "public static function user($key=false){\n if(self::isLoggedIn()){\n return self::getUser($_SESSION['logged_user_id'], $key);\n } else {\n return false;\n }\n }", "public static function getUser()\n\t{\n\t\tif(isset($_SESSION['user_id'])){\n\t\t\t\n\t\t\treturn User::findByID($_SESSION['user_id']);\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\treturn static::loginFromRememberCookie();\n\t\t\n\t\t}\n\t}", "public static function getByHash($hash, \\user $user)\n\t{\n\t\t$f = new static();\n\t\t$f->setHash($hash);\n\t\t$f->setUser($user);\n\t\treturn $f->getFromDB($hash);\n\t}", "public static function loginFromRememberCookie()\n\t{\n\t\t\n\t\tif(isset($_COOKIE['remember_me'])){\n\t\t\t\n\t\t\t$cookie = $_COOKIE['remember_me'];\n\t\t\t\n\t\t\t$remembered_login = RememberedLogin::findByToken($cookie);\n\t\t\t\n\t\t\tif($remembered_login && ! $remembered_login->hasExpired()){\n\t\t\t\t\n\t\t\t\t$user = $remembered_login->getUser();\n\t\t\t\t\n\t\t\t\tstatic::login($user, false);\n\t\t\t\t\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function findRememberedUser() {\n\t\tif (session('user')) {\n\t\t\t//echo \"REMEMBERED SESSION!<br>\";die();\n\t\t\tif (session('reviewcycle')) {\n\t\t\t\t$this->loadUser(session('user'), null);\n\t\t\t}\n\t\t\t$this->loadUser(session('user'));\n\t\t} elseif (!$this->loggedin && cookie('rememberme')) {\n\t\t\t//echo \"REMEMBERED TOKEN!<br>\";\n\t\t\t$rememberme = cookie('rememberme');\n\t\t\t$id = substr($rememberme, strrpos($rememberme, ':') + 1);\n\t\t\t$token = $rememberme;\n\t\t\t$this->loadUser($id, $token);\n\t\t\tif ($this->loggedin) {\n\t\t\t\tsession('user', $id);\n\t\t\t}\n\t\t}\n\t}", "public function user($key = null) {\n return $this->getUser($key);\n }", "function getuser($aa_inst_id)\n {\n $session_key=generateSessionKey($aa_inst_id);\n $session=new Zend_Session_Namespace($session_key);\n\n if(!isset($session->facebook) || !isset($session->facebook['user']) )\n $user=false;\n else\n $user=$session->facebook['user'];\n\n return $user;\n }", "public static function get_user($user_id);", "public function authByHash(string $hash)\n {\n $entityManager = $this->getEntityManager();\n\n /** @var User $model */\n $model = $entityManager->getRepository('thewulf7\\friendloc\\models\\User')->findOneBy(['userhash' => $hash]);\n\n $model = $model ? $this->getUserService()->get($model->getId()) : null;\n\n return $model ?? false;\n }", "private function _getUserKey ($username, $key)\n\t{\n\t\t$realKey = $username . '_' . $key;\n\t\treturn $this->cache->get($realKey);\n\t}", "public static function getUserByKey($authKey) {\n $user = null;\n \n $dbResult = System::database()->query('select u.*\n from :table_users u \n where u.`auth_key` = :auth_key\n and u.`auth_expire` >= UNIX_TIMESTAMP()');\n \n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindValue(':auth_key', $authKey);\n $dbResult->execute();\n \n if($dbResult->numberOfRows() > 0) {\n $result = $dbResult->toArray();\n $user = new User();\n $user->userFill($result);\n }\n \n return $user;\n }", "public static function user()\n {\n if(static::$_auth_user) {\n return static::$_auth_user;\n }\n\n #Check for authenticated session\n $auth_id = Session::get(static::$_auth_name);\n $instance = static::getConfig('instance');\n\n if($auth_id) {\n static::$_auth_user = new $instance($auth_id);\n return static::$_auth_user;\n }\n\n #Check for user auto log cookie\n $cookie_token = Cookie::get(static::$_auth_name);\n\n if($cookie_token) {\n $user_id = static::validateAuthCookieToken($cookie_token);\n\n if(!$user_id) {\n static::logout();\n return false;\n }\n\n static::$_auth_user = new $instance($user_id);\n #update cookie\n static::setUserCookieToken($user_id);\n return static::$_auth_user;\n }\n\n return false;\n }", "static function currentUser() {\n $cookie = new CookieSigner(Config::app()['BASE_KEY']);\n\n if (isset($_SESSION['userId']) && $userId = $_SESSION['userId']) {\n $user = new User();\n return $user->findOne($userId);\n } else if ($userId = $cookie->get('userId')) {\n $user = new User();\n $user->findOne($userId);\n\n if ($user && $user->isAuthenticated('remember', $cookie->get('rememberToken'))) {\n self::logIn($user);\n return $user;\n }\n }\n return null;\n }", "function user($object = false)\n\t{\n\t\tglobal $user;\n\n\t\tif($object !== false)\n\t\t{\n\t\t\t$user = $object;\n\t\t\treturn $user;\n\t\t}\n\n\t\tif(isset($_COOKIE['user']) && !$user)\n\t\t{\n\t\t\t$user = dbGetSingle('its_users', 'id = ' . intval($_COOKIE['user']));\n\t\t}\n\n\t\treturn $user;\n\t}", "public function GetFbUserFromCookie()\n {\n $res = array();\n if ($this->mSession->GetCookie( 'fbsr_' . FACEBOOK_API_ID ))\n {\n //validate facebook cookie\n $signed_request = $this->mSession->GetCookie( 'fbsr_' . FACEBOOK_API_ID );\n list($encoded_sig, $payload) = explode('.', $signed_request, 2);\n $sig = base64_decode(strtr($encoded_sig, '-_', '+/'));\n $expected_sig = hash_hmac('sha256', $payload, FACEBOOK_API_SECRET, $raw = true);\n\n if ($sig == $expected_sig)\n {\n $data = json_decode(base64_decode($payload), true);\n if (array_key_exists('user_id', $data)) \n {\n $res['user_id'] = $data['user_id'];\n }\n if (array_key_exists('oauth_token', $data))\n {\n $res['access_token'] = $data['oauth_token'];\n }\n if (array_key_exists('code', $data))\n {\n $res['code'] = $data['code'];\n }\n if (array_key_exists('state', $data))\n {\n $res['state'] = $data['state'];\n }\n }\n }\n return $res;\n }", "public static function auth() : ?object\n {\n // Retrieve the \"full user\" just one time\n if (self::$fullUser) {\n return self::$fullUser;\n }\n\n if (! $token = $_COOKIE['NameYourGoat_User_Token'] ?? null) {\n return null;\n }\n\n if (! $user = Repository\\User::byToken($token)) {\n setcookie('NameYourGoat_User_Token', null, 0, '/');\n return null;\n }\n\n self::authCookie($token);\n\n return self::$fullUser = $user;\n }", "public function getUsernameCookie()\n {\n return $_COOKIE[$this->username];\n }", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "private function cookieInfo($hash) {\n $query = $this->db->select(\"SELECT uid, username, expiredate, ip FROM \".PREFIX.\"sessions WHERE hash=:hash\", array(':hash' => $hash));\n $count = count($query);\n if ($count == 0) {\n // Hash doesn't exist\n $auth_error[] = $this->lang['cookieinfo_invalid'];\n //setcookie(\"auth_cookie\", $hash, time() - 3600, '/');\n Cookie::destroy('auth_cookie', $hash); //check if destroys deletes only a specific hash\n // \\Helpers\\Cookie::set(\"auth_cookie\", $hash, time() - 3600, \"/\",$_SERVER[\"HTTP_HOST\"]);\n return false;\n } else {\n // Hash exists\n $cookie[\"uid\"] = $query[0]->uid;\n $cookie[\"username\"] = $query[0]->username;\n $cookie[\"expiredate\"] = $query[0]->expiredate;\n $cookie[\"ip\"] = $query[0]->ip;\n return $cookie;\n }\n }", "public function getUserFromCookie(Request $req) {\n if(isset($_COOKIE[\"xf_user\"]) && (\\Cookie::get('xf_user') == null)) {\n\t\t\t$xf_user = $_COOKIE[\"xf_user\"];\n\t\t\t$pos = strpos($xf_user, ',');\n\t\t\t$user = substr($xf_user,0,$pos);\n\t\t\t$req->session()->put('user', $user);\n\t\t}else{\n\t\t\tif (\\Cookie::get('xf_user') !== null) {\n\t\t\t\t$user = \\Cookie::get('xf_user');\n\t\t\t\t$req->session()->put('user', $user);\n\t\t\t} else {\n\t\t\t\t$user = null;\n\t\t\t}\n\t\t}\n\t\treturn $user;\n\t}", "public function get_sso_user($sso_id)\n\t{\n\t \t$this->db->where('sso_id', $sso_id);\n\t\t$user = $this->db->get('user')->row_array();\n\n\t\treturn $this->_cache_user($user);\n\t}", "public function get_user()\n {\n Session::_start();\n return (object) Session::_get(\"user\");\n\n }", "public function getUser($key = null) {\n $lookupKey = $this->getConfig('sessionKey');\n if ($key !== null) {\n $lookupKey .= '.' . $key;\n }\n return $this->getView()->getRequest()->getSession()->read($lookupKey);\n }", "function user_data($key){\n global $mysqli;\n @$token = addslashes($_SESSION['user']['token']);\n @$username = addslashes($_SESSION['user']['name']);\n\n if(!isset($token) && !isset($username)){\n return false;\n } else {\n\n $sql = \"SELECT * FROM user WHERE username = '\" . $username . \"' AND token = '\" . $token . \"'\";\n $result = $mysqli->query($sql);\n\n $result = $result->fetch_object();\n return @$result->$key;\n }\n }", "public function userFromKey($key){\r\n $query = $this->conn->prepare('SELECT `user_id` FROM `user` WHERE confirmationKey = :key'); // Création de la requête + utilisation order by pour ne pas utiliser sort\r\n $query->execute([':key' => $key ]); // Exécution de la requête\r\n return $query->fetch(\\PDO::FETCH_ASSOC);\r\n\r\n }", "public function getMyUser() {\n return new User($_SESSION['username']);\n }", "public function GetUser($iUserIdHashed)\r\n {\r\n $sQuery = $this->conPDO->prepare(\"SELECT sUsername,sUserPassword,iUserRole FROM users WHERE iUserIdHashed = ? LIMIT 1\");\r\n \r\n //Bind the values to the ? signs\r\n $sQuery->bindValue(1, $iUserIdHashed);\r\n //Execute the query\r\n try\r\n {\r\n $sQuery->execute();\r\n }\r\n catch(PDOException $e)\r\n {\r\n die($e->getMessage());\r\n } \r\n //Fetch the result as assoc array\r\n $aUser = $sQuery->fetch(PDO::FETCH_ASSOC);\r\n \r\n \r\n //Set the user from the user class\r\n $this->oUser->SetUser($aUser['sUsername'], $aUser['sUserPassword'], $aUser['iUserRole']);\r\n \r\n $oUser = $this->oUser->GetUser();\r\n \r\n //Return the user\r\n return $oUser;\r\n \r\n }", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}", "public function user()\n\t{\n\t\tif (is_null($this->user) and $this->session->has(static::$key))\n\t\t{\n\t\t\t$this->user = call_user_func(Config::get('auth.by_id'), $this->session->get(static::$key));\n\t\t}\n\n\t\treturn $this->user;\n\t}", "function get_user( $user_id ){\n\t$app = \\Jolt\\Jolt::getInstance();\n\treturn $app->store('db')->findOne('user', array( '_id'=>$user_id ));\n}", "private static function getFromSession()\n {\n if (empty($_SESSION['current_user'])) {\n // No user in session, create one.\n $entityClassName = static::ENTITIES_CLASS_NAME;\n $user = new $entityClassName(array(\n 'source' => 'cookie',\n ));\n self::setCurrent($user);\n } else {\n Logger::get()->debug('Found user in session.');\n // Regenerate session ID every SESSION_DURATION minutes.\n if (time() > ($_SESSION['timestamp'] + + self::SESSION_DURATION)) {\n Logger::get()->debug('Regenerated session ID.');\n session_regenerate_id();\n }\n }\n\n return $_SESSION['current_user'];\n }", "public function retrieve($key)\n {\n list($name, $userId) = explode('/user-', $key);\n\n $userMeta = $this->getModel()->search($name, $userId)->first();\n\n if (! is_null($userMeta)) {\n if (! $value = @unserialize($userMeta->value)) {\n $value = $userMeta->value;\n }\n\n $this->addKey($key, array(\n 'id' => $userMeta->id,\n 'value' => $value,\n ));\n\n return $value;\n }\n\n return null;\n }", "public static function getAuthentication()\r\n {\r\n $authentication = null;\r\n\r\n if (!empty($_COOKIE['authentication']))\r\n {\r\n $authentication = json_decode($_COOKIE['authentication'], true);\r\n $path = Zend_Registry::get('web_root') . '/';\r\n $memberProfile = new GenericProfilesObject();\r\n $foundUser = $memberProfile->findData(array(\r\n 'GP_Email' => $authentication['email'],\r\n 'GP_Hash' => $authentication['hash'],\r\n 'GP_Status' => $authentication['status']\r\n ));\r\n \r\n if (!$foundUser)\r\n {\r\n $authentication = null;\r\n setcookie('authentication', '', -1, $path);\r\n }\r\n }\r\n\r\n return $authentication;\r\n }", "public function getBasketUserFromAuth() {\n\n $auth = Zend_Auth::getInstance();\n $identity = $auth->getIdentity();\n $paramUser = array('username' => $identity);\n $basketUser = $this->getBasketUser($paramUser);\n\n return $basketUser;\n }", "public function get_user() {\n\t\treturn ($this->logged_in()) ? $this->session->get($this->config['session_key'], null) : null;\n\t}", "public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}", "public function getUser($id_user)\n\t{\n\t\t$user = $this->db->query(\"SELECT * FROM user WHERE id_user = \".$this->db->escape($id_user))->row();\n\n\t\tunset($user->password);\n\n\t\treturn $user;\n\t}", "public function user()\n {\n if ($this->loggedOut) {\n return;\n }\n\n // If we've already retrieved the user for the current request we can just\n // return it back immediately. We do not want to fetch the user data on\n // every call to this method because that would be tremendously slow.\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n $id = $this->session->get($this->getName());\n\n // First we will try to load the user using the identifier in the session if\n // one exists. Otherwise we will check for a \"remember me\" cookie in this\n // request, and if one exists, attempt to retrieve the user using that.\n if (! is_null($id)) {\n if ($this->user = $this->provider->retrieveById($id)) {\n $this->fireAuthenticatedEvent($this->user);\n }\n }\n\n // If the user is null, but we decrypt a \"recaller\" cookie we can attempt to\n // pull the user data on that cookie which serves as a remember cookie on\n // the application. Once we have a user we can return it to the caller.\n $recaller = $this->recaller();\n\n if (is_null($this->user) && ! is_null($recaller)) {\n $this->user = $this->userFromRecaller($recaller);\n\n if ($this->user) {\n $this->replaceRememberToken($this->user, $recaller->token());\n\n $this->updateSession($this->user->getAuthIdentifier());\n\n $this->fireLoginEvent($this->user, true);\n }\n }\n\n return $this->user;\n }", "public static function getUser() {\n\t\t\tif(isset($_SESSION['user']))\n\t\t\t\t$user = $_SESSION['user'];\n\t\t\telse\n\t\t\t\t$user = new User();\n\t\t\treturn $user;\n\t\t}", "function culturefeed_search_ui_get_user_location_cookie() {\n\n if (!empty($_COOKIE['Drupal_visitor_uitid_userLocation'])) {\n $user_location = json_decode($_COOKIE['Drupal_visitor_uitid_userLocation']);\n if ($user_location instanceof stdClass) {\n return $user_location;\n }\n }\n\n return new stdClass();\n\n}", "private function getUserInstance($a_usr_id)\n\t{\t\t\n\t\tstatic $userObjectCache = array();\n\t\t\n\t\tif(isset($userObjectCache[$a_usr_id])) return $userObjectCache[$a_usr_id];\n\t\t\n\t\t$oUser = ilObjectFactory::getInstanceByObjId($a_usr_id, false);\n\t\tif(!is_object($oUser) || $oUser->getType() != 'usr')\n\t\t{\n\t\t\t$userObjectCache[$a_usr_id] = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$userObjectCache[$a_usr_id] = $oUser;\n\t\t}\t\t \n\t\t\n\t\treturn $userObjectCache[$a_usr_id];\n\t}", "function getUser() {\n return user_load($this->uid);\n }", "public function user($username = NULL)\n {\n $username || $username = $this->CI->session->userdata('username');\n $user = $this->CI->Auth_Model->user($username);\n return (object)$user;\n }", "function getObjectCookie($CookieName, $obj) {\n\tif (isset($_SESSION[$CookieName])) {\n\t\t$objCookie = unserialize(Decode($_SESSION[$CookieName]));\n\t\tif (is_object($objCookie)) {\n\t\t\t$obj = $objCookie;\n\t\t}\n\t}\n\treturn $obj;\n}", "public static function getFromCookie(PMF_Configuration $config)\n {\n if (!isset($_COOKIE[PMF_Session::PMF_COOKIE_NAME_REMEMBERME])) {\n return;\n }\n\n // create a new CurrentUser object\n $user = new self($config);\n $user->getUserByCookie($_COOKIE[PMF_Session::PMF_COOKIE_NAME_REMEMBERME]);\n\n if (-1 === $user->getUserId()) {\n return;\n }\n\n // sessionId needs to be updated\n $user->updateSessionId(true);\n // user is now logged in\n $user->loggedIn = true;\n // save current user to session and return the instance\n $user->saveToSession();\n // add CSRF token to session\n $user->saveCrsfTokenToSession();\n\n return $user;\n }", "public function getCookiesUser(): ?array\n {\n $email = $_COOKIE[APP_USERS_COOKIES_EMAIL] ?? '';\n return (new UserController())->getUser($email);\n }", "function get_user($userName){\n return get_user_object($userName);\n}", "public static function getUser();", "protected function objectUserEnCours(){\n $fbUid = $this->getRequest()->getSession()->get('_fos_facebook_fb_482361481839052_user_id');\n $user = $this->getDoctrine()->getManager()->getRepository('MetinetFacebookBundle:User')->findOneByfbUid($fbUid);\n return $user ;\n }", "function getUserId(){\n if(empty($_COOKIE['heyo'])) return false;\n \n $userIdResult = $this->sql->prepare('SELECT userId FROM user_logins WHERE cookie = ? AND loggedIn = TRUE AND dateLogged > ? LIMIT 1')->bindString($_COOKIE['heyo'])->bindString($this->loginMaxAge)->execute()->getResult();\n \n if(!$userIdResult->num_rows) return false;\n \n return $userIdResult->fetch_assoc()['userId'];\n }", "public function decodeCookie()\n {\n return json_decode($_COOKIE[self::SITE_USER]);\n }", "public function get_member()\n {\n //get cookie information if available\n $cookie_raw_info = (array_key_exists(get_member_cookie(), $_COOKIE)) ? $_COOKIE[get_member_cookie()] : '';\n\n $cookie_info = array();\n $cookie_info = explode('_', $cookie_raw_info);\n $cookie_member = (array_key_exists(0, $cookie_info)) ? $cookie_info[0] : '';\n $cookie_loginkey = (array_key_exists(1, $cookie_info)) ? $cookie_info[1] : '';\n\n if ($cookie_member != '') {\n $row = $this->get_member_row(intval($cookie_member));\n //is the cookie info correct\n if ($cookie_loginkey == $row['loginkey']) {\n //if it is correct then return the cookie member\n return $cookie_member;\n } else {\n //return the default guest ID, because the login key is not correct\n return $this->get_guest_id();\n }\n } else {\n //return the default guest ID, because there is no member cookie information\n return $this->get_guest_id();\n }\n }", "public function find($key)\n\t{\n\t\t$user = model('user')->find_user($key);\n\n\t\treturn $user ? UserModel::newWithAttributes(Arr::toArray($user)) : null;\n\t}", "protected function getUser($token)\r\n {\r\n $userInfo = $this->getUserInfo($token);\r\n return $userInfo[static::CACHE_PART_USER_OBJECT];\r\n }", "public static function getById($user_id){\n\t\t$user = new User();\n\t\t$query = sprintf('SELECT USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE FROM %sUSER WHERE USER_ID = %d', DB_TBL_PREFIX, $user_id );\n\t\t$result = mysql_query($query, $GLOBALS['DB']);\n\t\tif(mysql_num_rows($result)){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$user->username =$row['USERNAME'];\n\t\t\t$user->password = $row['PASSWORD'];\n\t\t\t$user->emailAddr = $row['EMAIL_ADDR'];\n\t\t\t$user->isActive = $row['IS_ACTIVE'];\n\t\t\t$user->uid = $user_id;\n\t }\n\t\n\t mysql_free_result($result);\n\t return $user;\n\t}", "function fetch_user_by_nick($nick) {\n if(!cache_isset('taxi_!un_'.$nick)) {\n if(cache_isset('taxi_un_'.$nick)) {\n return fetch_user_by_id(cache_get('taxi_un_'.$nick));\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['nick'=>$nick]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$result['id'],$result);\n cache_set('taxi_un_'.$result['nick'],$result['id']);\n } else {\n cache_set('taxi_!un_'.$nick);\n }\n return $result;\n }\n }\n}", "function Session() {\n $sesskey = $_COOKIE['FortissimoSession'];\n if (! $sesskey) {\n # they don't have one, so let's ignore\n return;\n }\n\n # try to parse their cookie\n $ct = sscanf($sesskey, \"%d %s %d\", $sessid, $auth, $exptime);\n\n # return if bad cookie, or they say it's expired, or the auth length is wrong or bad sessid\n if ($ct != 3 || $exptime < time() || strlen($auth) != 64 || $sessid <= 0) {\n return;\n }\n\n # okay, so try loading it\n global $ft;\n $row = $ft->dbh->_select_row_as_object('SELECT * FROM tbl:sessions WHERE sessid = ? AND sesskey = ?',\n array($sessid, $auth));\n $userid = $row->userid;\n if (is_null($userid) || $userid <= 0 || $row->exptime < time()) {\n return;\n }\n\n # get the user this refers to\n $this->user = new User($userid);\n }", "public static function restore_from_cookie(){\n\t\tglobal $con;\n\t\t\n\t\tif(isset($_COOKIE['id'])){\n\t\t\t$prep = $con->prepare(\"\n\t\t\t\tSELECT user_name FROM `users`\n\t\t\t\tINNER JOIN `tokens`\n\t\t\t\t\tON token_user = user_id\n\t\t\t\tWHERE token_val = ?\n\t\t\t\t\tAND token_created_on < DATE_ADD(NOW(), INTERVAL 30 DAY)\n\t\t\t\");\n\t\t\t\n\t\t\t$prep->bind_param(\"s\", $_COOKIE['id']);\n\t\t\t\n\t\t\tif($prep->execute()) {\n\t\t\t\t$prep->bind_result($user_name);\n\t\t\t\t\n\t\t\t\tif($prep->fetch()) {\n\t\t\t\t\t\n\t\t\t\t\t$_SESSION['user-name'] = $user_name;\n\t\t\t\t\t$prep->close();\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$prep->close();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$prep->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function getUser($check = true)\n {\n if(($check && self::isLoggedIn()) || !$check)\n {\n if(($user = Cache::loadData(static::$sessionKey)) === null)\n {\n $class = static::$className;\n \n if(($user = $class::create(sanitize($_SESSION[static::$sessionKey]), \"*SHA1(MD5(CONCAT('\".Config::getSetting('salt').\"', id)))\")) !== false)\n Cache::saveData(static::$sessionKey, $user);\n else\n {\n unset($_SESSION[static::$sessionKey]);\n redirect();\n }\n }\n\n return $user;\n }\n else\n return false;\n }", "public function getUserLogged(){\n $session = new Zend_Session_Namespace('Auth');\n if(isset($session->User)){\n $UT = new App_Db_Users();\n //make te row RW (if not Read Only)\n try {\n $session->User->setTable($UT);\n } catch(Zend_Db_Table_Row_Exception $e) {\n $this->logout();\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n\t\t $redirector->gotoUrl(\"/\");\n }\n return $session->User;\n }\n\n $uLoginCookie = App_Cookie::getCookie (\"ulogin\");\n $uLoginHashCookie = App_Cookie::getCookie (\"uloginhash\");\n\n if(isset($uLoginCookie) && isset($uLoginHashCookie)) {\n $UT = new App_Db_Users();\n $User = $UT->fetchRow(\"id='\".$uLoginCookie.\"'\");\n if($User) {\n $loginhash = self::cryptme($User->id);\n if($loginhash == $uLoginHashCookie) { \n $UserTokens = App_Service_Twitter::getUserTokens($User->id);\n \n $session->user_id = $User->id;\n $session->user_name = $User->name;\n if($UserTokens) {\n $session->twitter_id = $UserTokens[\"twitter_id\"];\n }\n $session->User = $User;\n $session->loggedin_at = mktime();\n return $User;\n }\n } else {\n $this->logout();\n }\n }\n return false;\n }", "public function getUser($a_user_id)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$userObj = ilObjectFactory::getInstanceByObjId($a_user_id, false);\t\t\n\t\tif(!ilObject::_exists($a_user_id) || !$userObj)\n\t\t{\n\t\t\t$userObj = new ilObjUser();\n\t\t\t$userObj->setLogin($lng->txt(\"unknown\"));\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $userObj;\n\t}", "public function getUserById($userId)\n {\n $sql = \"SELECT `id`,`login`,`loginHash`,`email`,`emailHash`,\".\n \"`pass`,`fio`,`phone`,`photo` \".\n \"FROM `\".DB::TBL_USERS.\"` \".\n \"WHERE `id`=? LIMIT 1\";\n $st = $this->MySQL->getConn()->prepare($sql);\n $st->execute([$userId]);\n $r = $st->fetch();\n if (empty($r)) {\n return null;\n }\n $user = new User();\n foreach ([\n 'id', 'login', 'loginHash', 'email', 'emailHash',\n 'pass', 'fio', 'phone', 'photo'\n ] as $param) {\n $user->{$param} = $r[$param];\n }\n return $user;\n }", "function getLoggedInUser($token)\n\t{\n\t\tglobal $db;\n\t\t$userId = $this->GetUserIdByToken($token);\n\t\tif(isset($userId))\n\t\t{\n\t\t\t$user = $db->smartQuery(array(\n\t\t\t\t\t'sql' => \"SELECT userid, email, isAdmin FROM `user` WHERE `userid`=:userId;\",\n\t\t\t\t\t'par' => array('userId' => $userId),\n\t\t\t\t\t'ret' => 'fetch-assoc'\n\t\t\t));\n\t\t\treturn $user;\n\t\t}\n\t\treturn (object)array(\"error\" => \"user not found\");\n\t}", "public static function getFromSession(){\n\t\t$user = new User();\n\t\t\n\t\tif(isset($_SESSION[User::SESSION]) && (int)$_SESSION[User::SESSION]['id_user'] > 0)\n\t\t{\n\t\t\t$user->setData($_SESSION[User::SESSION]);\n\t\t}\n\t\treturn $user;\n\t}", "private function getUser()\r\n {\r\n $UserId = -1;\r\n isset($_POST['UserId']) && intval($_POST['UserId']) > 0 ? $UserId = intval($_POST['UserId']) : $UserId = -1;\r\n $User = new User ($UserId);\r\n return $User;\r\n }", "public function getUserWithUsername($username);", "public static function remember_from_cookies() {\n\t\tif (isset($_COOKIE['remember']) && !(self::logged_in())) {\n\t\t\t$user_id = explode(\"==\", $_COOKIE['remember'])[0];\n\t\t\t$user = User::find_where(\"users\", array(\"id\" => $user_id));\n\t\t\t$expected = $user_id.\"==\".$user[0][\"remember_token\"];\n\t\t\tif ($user_id && $user && $expected == $_COOKIE['remember']) {\n\t\t\t\tSession::write(\"user\", $user);\n\t\t\t\t$remember_token = $user[0][\"remember_token\"];\n\t\t\t\tsetcookie(\"remember\", $user[0][\"id\"]. \"==\". $remember_token, time()+60*60*24*7);\n\t\t\t} else {\n\t\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\t}\n\t\t}\n\t}", "public function getUser()\n\t{\n\t\tif(isset($this->user))\n\t\t{\n\t\t\treturn $this->user;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->user = ColoCrossing_Object_Factory::createObject($this, null, $content['user'], 'user');\n\t}", "public function loadUserByJWT($jwt): UserInterface;", "private function loginWithCookieData()\n {\n if (isset($_COOKIE['rememberme'])) {\n // extract data from the cookie\n list ($user_id, $token, $hash) = explode(':', $_COOKIE['rememberme']);\n // check cookie hash validity\n if ($hash == hash('sha256', $user_id . ':' . $token . COOKIE_SECRET_KEY) && !empty($token)) {\n // cookie looks good, try to select corresponding user\n if ($this->db->isConnected()) {\n // get real token from database (and all other data)\n $select = $this->db->row(\n \"SELECT user_id, user_name, user_email FROM users \n WHERE user_id = :user_id AND user_rememberme_token = :user_rememberme_token \n AND user_rememberme_token IS NOT NULL\",\n array(\n \"user_id\"=>$user_id,\n \"user_rememberme_token\"=>$token\n )\n );\n\n if (isset($select[\"user_id\"])) {\n // write user data into PHP SESSION [a file on your server]\n $_SESSION['user_id'] = $select[\"user_id\"];\n $_SESSION['user_name'] = $select[\"user_name\"];\n $_SESSION['user_email'] = $select[\"user_email\"];\n $_SESSION['user_logged_in'] = 1;\n\n // declare user id, set the login status to true\n $this->user_id = $select[\"user_id\"];\n $this->user_name = $select[\"user_name\"];\n $this->user_email = $select[\"user_email\"];\n $this->user_is_logged_in = true;\n\n // Cookie token usable only once\n $this->newRememberMeCookie();\n return true;\n }\n }\n }\n // A cookie has been used but is not valid... we delete it\n $this->deleteRememberMeCookie();\n $this->errors[] = MESSAGE_COOKIE_INVALID;\n }\n return false;\n }", "public function getUser ($authToken)\n {\n $bits = $this->parseToken($authToken);\n $sid = $bits[0];\n $uhash = $bits[1];\n $row = $this->getToken($sid);\n if (!isset($row))\n {\n error_log(\"invalid token sid\");\n $this->errors[] = 'invalid_token_sid';\n return;\n }\n if ($row->expired())\n {\n error_log(\"token expired\");\n $this->errors[] = 'expired_token';\n return;\n }\n $user = $row->getUser();\n if (!isset($user)) return; // invalid user.\n $ahash = $row->appHash($user);\n $chash = $this->authHash($sid, $ahash);\n if ($chash == $uhash)\n {\n return $user;\n }\n else\n {\n error_log(\"invalid hash\");\n error_log(\" > $uhash\");\n error_log(\" < $chash\");\n $this->errors[] = 'invalid_token_hash';\n return;\n }\n }", "public static function getUser($email_username_id=false, $key=false){\n self::init();\n\n if($email_username_id === false && isset($_SESSION['logged_user_id'])){\n $email_username_id = $_SESSION['logged_user_id'];\n }\n\n $user_data = self::$db->get(CONFIG['AUTH_USERS_TABLE'], '*', [ \n 'OR' => [\n self::$id_field => $email_username_id,\n self::$email_field => $email_username_id,\n self::$username_field => $email_username_id\n ]\n ]);\n\n return $key ? $user_data[$key] : $user_data;\n }", "function getUserName()\n{\n $logger = new Logger();\n\n // Default : method of login (Cookie)\n // Fallback method : IP based (To be done)\n if (!isCookiesEnabled()) \n {\n\t$logger->addLog(\"Error : Cookies not enabled\");\n\treturn false;\n }\n\n if(!isset($_COOKIE[\"login_key\"]) || !isset($_COOKIE[\"login_id\"])) \n {\n\t$logger->addLog(\"No login key found for this user\");\n\treturn false;\n }\n\n $logger->addLog(\"Login key found for this user\");\n $base_dir = $_SERVER['DOCUMENT_ROOT'];\n $file_path = \"$base_dir/Data/users/\".$_COOKIE['login_id'].\"/userInfo.dat\";\n\n if (!file_exists($file_path))\n {\n\t$logger->addLog(\"Error : User \".$_COOKIE['login_id'].\" does not exists.\");\n\treturn false;\n }\n\n $data = file_get_contents($file_path);\n $data = json_decode($data, true);\n\n if ($data['hash'] != $_COOKIE[\"login_key\"]) \n {\n\t$logger->addLog(\"Fatal Error : Password miss-match for user \".$_COOKIE['login_id'], 'e');\n\treturn false;\n }\n\n return $_COOKIE['login_id'];\n}", "public function getByCredentials(string $email, string $password): User;", "public static function &getCurrentUser() {\n\t\tstatic $instance;\n\t\tif( is_null($instance) ) {\n\t\t\tif ( !empty($_COOKIE['SESSION_NUMBER']) ) {\n\t\t\t\t$instance = self::getUser($_COOKIE['SESSION_NUMBER']);\n\t\t\t\tif ( !$instance || !$instance->checkCookies() ) {\n\t\t\t\t\t$instance = new user;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$instance = new user;\n\t\t\t}\n\t\t}\n\t\treturn $instance;\n\t}", "function _checkRemembered($cookie) {\n list ($username, $cookie) = @ unserialize($cookie);\n\n if (!$username or !$cookie)\n return;\n\n $sql = \"SELECT * FROM user WHERE \" .\n \"(userid = \\\"$username\\\") AND (cookie = \\\"$cookie\\\");\";\n $result = $this->db->mysql_query($sql);\n $result = mysql_fetch_object($result);\n\n // if remember-me user is found in the database, set session for the user\n if (is_object($result)) {\n $this->_setSession($result, false, true);\n } else {\n $this->_logout();\n }\n }", "public function getUser() {\n if ($this->_user === false) {\n $this->_user = CoLogin::findByUsername($this->username);\n }\n\n return $this->_user;\n }", "function retrieveUser()\n {\n $loginUserId = $_COOKIE[\"userid\"];\n $loginUserRole = $_COOKIE[\"userRole\"];\n if (isset($_GET['userId'])) {\n $userId = $_GET['userId'];\n } else {\n $userId = null;\n }\n // print($loginUserId);\n $company_name = $this->getCompanyIdFromUser($loginUserId);\n $retrieveUser_query = \"select * from users where is_deleted='0'\";\n // print($loginUserRole);\n /* if ($loginUserRole != '' && $loginUserRole != \"0\" && $company_name != '') {\n $retrieveUser_query .= \" and company_name= '$company_name'\";\n } */\n \n if ($userId != null && $userId != '') {\n $retrieveUser_query .= \" and id='$userId'\";\n }\n // print($retrieveUser_query);\n $r3 = $this->mysqli->query($retrieveUser_query);\n // print(\"number of rows\".$r3->num_rows);\n if ($r3->num_rows > 0) {\n $result = array();\n while ($row1 = $r3->fetch_assoc()) {\n $result[] = $row1;\n }\n }\n $this->response(json_encode($result), 200); // send user details\n $this->response('', 204);\n }", "public static function instance() {\n\t\tglobal $_SESSION;\n\t\t\n\t\tif (isset($_SESSION['puserauth'])) {\n\t\t\treturn unserialize($_SESSION['puserauth']);\n\t\t}\n\t\t$user = new PUserAuth();\n\t\t$user->store();\n\t\treturn $user;\n\t}", "public function getCertainUser($param) {\n return ModelLoader::getModel('UserData')->getUser($param['userId']);\n }", "abstract protected function getUser();", "public function getObjectForKey($key)\n {\n $key = $this->cookieScopePrefix . $key;\n if (isset($this->cookies[$key])) {\n return $this->cookies[$key];\n }\n\n return null;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = Client::findByUsername($this->username);\n\n /** added login by email**/\n if($this->_user === false ){\n $this->_user = Client::findByEmail($this->username);\n }\n }\n\n return $this->_user;\n }", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "public function getFirstByRegisterHash($hash)\n {\n if (!$user = $this->findFirstByRegisterHash($hash)) {\n throw new Exceptions\\EntityNotFoundException($hash, 'registerHash');\n }\n\n return $user;\n }", "public function getFirstByRegisterHash($hash)\n {\n if (!$user = $this->findFirstByRegisterHash($hash)) {\n throw new Exceptions\\EntityNotFoundException($hash, 'registerHash');\n }\n\n return $user;\n }", "public function user_info() {\n if ($this->rails_cookie_value() == NULL) {\n return null;\n }\n if (!self::$user_info && !self::$user_info_called) {\n $json_data = $this->api_request(\"user/\" . $this->rails_cookie_value());\n self::$user_info = $json_data->{'user'};\n self::$user_info_called = true;\n }\n return self::$user_info;\n }", "protected static function loadFromCookie($user_agent)\n\t{\n\t\tglobal $cookiename, $modSettings;\n\n\t\tif (empty(self::$id) && isset($_COOKIE[$cookiename]))\n\t\t{\n\t\t\tlist ($id, self::$session_password) = serializeToJson($_COOKIE[$cookiename], function ($array_from) use ($cookiename) {\n\t\t\t\tglobal $modSettings;\n\n\t\t\t\trequire_once(SUBSDIR . '/Auth.subs.php');\n\t\t\t\t$_COOKIE[$cookiename] = json_encode($array_from);\n\t\t\t\tsetLoginCookie(60 * $modSettings['cookieTime'], $array_from[0], $array_from[1]);\n\t\t\t});\n\n\t\t\tself::$id = !empty($id) && self::$session_password !== '' ? (int) $id : 0;\n\t\t}\n\t\telseif (empty(self::$id) && isset($_SESSION['login_' . $cookiename]) && (!empty($modSettings['disableCheckUA']) || (!empty($_SESSION['USER_AGENT']) && $_SESSION['USER_AGENT'] == $user_agent)))\n\t\t{\n\t\t\t// @todo Perhaps we can do some more checking on this, such as on the first octet of the IP?\n\t\t\tlist ($id, self::$session_password, $login_span) = serializeToJson($_SESSION['login_' . $cookiename], function ($array_from) use ($cookiename) {\n\t\t\t\t$_SESSION['login_' . $cookiename] = json_encode($array_from);\n\t\t\t});\n\n\t\t\tself::$id = !empty($id) && strlen(self::$session_password) === 64 && $login_span > time() ? (int) $id : 0;\n\t\t}\n\t}", "function get_user($user_id)\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->get_user($user_id);\n\t}", "function get_user($user_id)\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->get_user($user_id);\n\t}", "public function user()\n {\n\n $user_name = $this->session->get('user_name');\n $access_token = $this->session->get('access_token');\n $refresh_token = $this->session->get('refresh_token');\n\n Log::debug('session id: ' . $this->session->getId());\n Log::debug('user_name: ' . $user_name);\n Log::debug('access token: ' . $access_token);\n Log::debug('refresh token: ' . $refresh_token);\n\n Log::debug('cookies: ');\n foreach ($this->request->cookies->all() as $key => $value) {\n Log::debug(' key: ' . $key . ', val: ' . $value);\n }\n\n if ($access_token) {\n if (!CognitoService::getUser($access_token)) {\n try {\n $tokens = CognitoService::refreshToken($refresh_token);\n\n $this->setTokenToSession($tokens);\n } catch (RuntimeException $e) {\n Log::warning(\"リフレッシュトークンの取得に失敗しました。新規ユーザーを作成します。\");\n Log::warning($e->getMessage());\n $this->signUp();\n }\n }\n\n $this->setUser($this->provider->retrieveById($this->session->get('user_name')));\n } else {\n $this->signUp();\n }\n\n $this->fireAuthenticatedEvent($this->user);\n return $this->user;\n }" ]
[ "0.66925186", "0.6499301", "0.643256", "0.6387307", "0.636962", "0.63253236", "0.6313731", "0.6309718", "0.6299145", "0.6265376", "0.6249621", "0.6225055", "0.6172544", "0.6153799", "0.60795087", "0.60764647", "0.60629976", "0.6028445", "0.600177", "0.60000676", "0.5999475", "0.59920603", "0.59774375", "0.59474176", "0.5942656", "0.59402984", "0.59395885", "0.5918774", "0.5912653", "0.5881688", "0.5879982", "0.5867464", "0.5844895", "0.58384365", "0.58378226", "0.58368975", "0.5836035", "0.5824479", "0.5818368", "0.58032596", "0.58031934", "0.57969797", "0.5783243", "0.5777554", "0.5776456", "0.57742137", "0.57713723", "0.57684493", "0.5758019", "0.5748011", "0.57450163", "0.5744807", "0.57159907", "0.5715236", "0.57151437", "0.57120353", "0.5701915", "0.5694719", "0.5694432", "0.5693401", "0.5691098", "0.5689012", "0.5682939", "0.567749", "0.5668041", "0.5665834", "0.56642723", "0.5645885", "0.56428105", "0.564257", "0.5639852", "0.5635273", "0.562982", "0.56285447", "0.5628413", "0.56262875", "0.5624749", "0.56226313", "0.5619482", "0.5609673", "0.5609369", "0.56091994", "0.5608164", "0.5596021", "0.5595701", "0.5582351", "0.5580907", "0.5575989", "0.5571691", "0.55631727", "0.55623686", "0.5561145", "0.5553387", "0.5551497", "0.5551497", "0.55499107", "0.55493695", "0.55491483", "0.55491483", "0.554263" ]
0.63537455
5
Authorize user assigns a hash and stores it as a cookie and in the database's authentication system
private function authorizeUser($user){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createCookie()\n {\n $salt = openssl_random_pseudo_bytes(16);\n $hash = hash('sha256', $salt . $this->userId);\n\n $this->db->prepare('UPDATE `' . $this->config['authTable'] . '` SET `authSalt` = ? WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($salt, $this->userId), 'ss');\n\n setcookie('userid', $this->userId, time() + $this->config['cookieLifetime']);\n setcookie('auth', $hash, time() + $this->config['cookieLifetime']);\n }", "private function userForAuth($hash){\n\n }", "function confirmAuth()\n{\n $login = $this->session->get(USER_LOGIN_VAR);\n$password = $this->session->get(USER_PASSW_VAR);\n$hashKey = $this->session->get('login_hash');\nif (md5($this->hashKey . $login . $password) != $hashKey)\n{\n$this->logout(true);\n}\n}", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "function Auth(&$db, $redirect, $hashKey, $md5 = true)\n{\n$this->db = &$db;\n$this->redirect = $redirect;\n$this->hashKey = $hashKey;\n$this->md5 = $md5;\n$this->session = &new Session();\n$this->login();\n}", "public function activate(){\r\n\t\t$uid = $_GET[\"uid\"];\r\n\t\t$hash = $_GET[\"hash\"];\r\n\r\n\t\tif(User::activateUser($uid, $hash)){\r\n\t\t\techo \"active\";\r\n\t\t\tUser::loginSystem(User::fromUid($uid));\r\n\t\t}\r\n\t\tPage::redirect(\"/index\");\r\n\t}", "function login($user, $pass)\n{ $hash= null;\n if (isset($_POST['submit'])) {\n $user = escaped_str($_POST['user']);\n $pass = ($_POST['pass']);\n $query = \"SELECT hash FROM login WHERE user='$user' LIMIT 1\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n $status_text = Database::getInstance()->getConnection()->error;\n ?>\n <p id=\"status_baloon\" class=\"bg-danger alert h3\"><?= $status_text ?></p> <?php\n die();\n }\n while ($db_hash = $result->fetch_assoc()){\n $hash = $db_hash['hash'];\n }\n if (password_verify($pass, $hash)) {\n setcookie('user', $user, time() + (60 * 60));\n $_SESSION['user'] = ucfirst($user);\n $_SESSION['start'] = time();\n $_SESSION['expire'] = time() + (60 * 60);\n $_SESSION['status'] = \"success\";\n $_SESSION['message'] = \"Bine ai veni din nou in Program\";\n $_SESSION['icon'] = \"glyphicon-check\";\n header('Location: index.php');\n exit();\n } else {\n $_SESSION['status'] = \"danger\";\n $_SESSION['message'] = \"Userul sau Parola sunt gresite sau nu exista!\";\n $_SESSION['icon'] = \"glyphicon-exclamation-sign\";\n }\n }\n}", "private function verifyCookie()\n {\n if (isset($this->cookie['auth'])\n && isset($this->cookie['userid'])\n && !empty($this->cookie['auth'])\n && !empty($this->cookie['userid'])\n && ($this->cookie['userid'] > 0)\n ) {\n $this->db->prepare('SELECT `authSalt` FROM `' . $this->config['authTable'] . '` WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($this->cookie['userid']), 's');\n $result = $this->db->fetch();\n\n if (!$result) {\n return false;\n }\n\n $dbHash = hash('sha256', $result['authSalt'] . $this->cookie['userid']);\n\n if ($dbHash === $this->cookie['auth']) {\n return true;\n }\n }\n return false;\n }", "static protected function bakeUserCookie( $time, $user ) {\n return 'exp='.$time.'&id='.$user->id.'&digest='.md5($user->username.$user->password);\n }", "function checkUserMatch(){\n //check to see that password is set\n if (isset($_POST['password'])) {\n $username = sanitizeString($_POST['username']);\n $password = sanitizeString($_POST['password']);\n $user_row = getUserRowByUsernamePass($username, $password);\n if ($user_row) {\n //set cookie here\n $user_id = $user_row['id'];\n $_SESSION['user_id'] = $user_id;\n return TRUE;\n } else {\n return FALSE;\n }\n }\n}", "private function tasteTheCookie()\n {\n helper(\"auth\");\n\n if (isset($_COOKIE[\"token\"]))\n {\n $tokenCookie = $_COOKIE[\"token\"];\n $token = isValid($tokenCookie);\n \n if ($token != null)\n {\n if (isAuthenticated(\"Cinema\"))\n $this->userName = $token->name;\n else if (isAuthenticated(\"RUser\"))\n $this->userName = $token->firstName;\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n $this->userMail = $token->email;\n $this->userImage = ((new UserModel())->find($token->email))->image;\n }\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n }\n }", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "function storeAuth($login, $password)\n{\n$this->session->set(USER_LOGIN_VAR, $login);\n$this->session->set(USER_PASSW_VAR, $password);\n// Create a session variable to use to confirm sessions\n$hashKey = md5($this->hashKey . $login . $password);\n$this->session->set('login_hash', $hashKey);\n}", "private function authCredUser(){\n\t\t\n\t\t// UC 3 1: User wants to authenticate with saved credentials\n\t\t\t// - System authenticates the user and presents that the authentication succeeded and that it happened with saved credentials\n\t\t$inpName = $this->view->getInputName(true);\t\n\t\t$inpPass = $this->view->getInputPassword(true);\n\n\t\t$answer = $this->model->loginCredentialsUser($inpName, $inpPass, $this->view->getServerInfo());\n\t\t\n\t\tif($answer == null){\n\t\t\t$this->view->showLogin(false);\n\t\t\t\n\t\t} else if($answer == true){\t\t\n\t\t\t$this->view->storeMessage(\"Inloggning lyckades via cookies\");\n\t\t\treturn $this->view->showLogin(true);\n\t\t} else {\t\t\n\t\t\t// 2a. The user could not be authenticated (too old credentials > 30 days) (Wrong credentials) Manipulated credentials.\n\t\t\t\t// 1. System presents error message\n\t\t\t\t// Step 2 in UC 1\t\t\t\t\n\t\t\t$this->view->removeCredentials();\n\t\t\t$this->view->storeMessage(\"Felaktig eller föråldrad information i cookie\");\n\t\t\treturn $this->view->showLogin(false);\n\t\t}\n\t}", "public function authenticate()\n {\n if (!isset($_SERVER['PHP_AUTH_DIGEST']) || empty($_SERVER['PHP_AUTH_DIGEST'])) {\n\t\t\t//error_log(\"...\".$_SERVER['PHP_AUTH_DIGEST'].\"...\");\n\t\t\terror_log(\"Not Authorized\");\n\t\t\t$e = new Exception('Authentication required.', self::ERROR_DIGEST_MISSING, null);\n $this->handleError($e);\n }\n \n $data = $this->_parseDigest();\n\t\t\n\t\tif (!$data) {\n\t\t\t$e = new Exception('Invalid authorization digest.', self::ERROR_DIGEST_INVALID, null);\n $this->handleError($e); \n }\n\t\tif ($data['username']==\"anonymous\" || $data['username']==\"\") {\n\t\t\tZend_Registry::set('userID', -1);\n\t\t\treturn true;\n\t\t} else if (strpos($data['username'],\"uuid_\")===0) {\n\t\t\tZend_Registry::set('userID', $data['username']);\n\t\t\treturn true;\n\t\t}\n // Make sure the user exists.\n \n $knownUserData = mysql_query(\"SELECT * FROM `accounts` WHERE `username`='\".mysql_real_escape_string($data['username']).\"' OR `email`='\".mysql_real_escape_string($data['username']).\"'\") or die(mysql_error());\n //if (!isset($this->_users[$data['username']])) {\n if (mysql_num_rows($knownUserData)!==1) { \n\t\t\t$e = new Exception('Invalid credentials', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n\t\t\n\t\t$knownUserData = mysql_fetch_assoc($knownUserData);\n\t\t// Save the username so we can use it for access control checks\n // in other scripts.\n Zend_Registry::set('username', $data['username']);\n \n // Generate the server response.\n $password = $knownUserData['lastKnownPassword']; //$this->_users[$data['username']];\n\t\tZend_Registry::set('userID', $knownUserData['userID']);\n\t\tZend_Registry::set('userIDEncrypted', $knownUserData['userIDEncrypted']);\n\t\t//check password & username against thinklg.com data\n\t\t\n\t\t\n $HA1 = md5($data['username'] . ':' . self::AUTH_REALM . ':' . $password);\n\t\t$HA2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']);\n\t\t$valid_response = md5(\n $HA1 // hash 1\n . ':' // separator\n . $data['nonce'] // nonce\n . ':' // separator\n . $data['nc'] // nonce count \n . ':' // separator\n . $data['cnonce'] // client nonce\n . ':' // separator\n . $data['qop'] // quality of protection\n . ':' // separator\n . $HA2 // hash 2\n );\n // Compare the server response to the client response.\n if ( $data['response'] != $valid_response ) {\n // The username is ok, but the password is wrong.\n $e = new Exception('Invalid credentials.', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n }", "public function auth()\n {\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n \n $info = $this->userDetail->getDetail($email, $password);\n if (count($info) == 1) \n {\n $this->commonFunction->setSession($info->id, $info->user_name);\n return redirect('/dashboard'); \n } \n echo '<script language=\"javascript\">';\n echo 'alert(\"Username/Password does not match.\")';\n echo '</script>';\n return redirect('/login');\n }", "public function authenticate()\n {\n $confirm = $this->getServiceLocator()\n ->get( 'Grid\\User\\Model\\ConfirmHash' );\n\n if ( $confirm->has( $this->hash ) )\n {\n $user = $this->getModel()\n ->findByEmail( $confirm->find( $this->hash ) );\n\n if ( ! empty( $user ) )\n {\n $user->confirmed = true;\n\n if ( $user->save() )\n {\n $confirm->delete( $this->hash );\n return new Result( Result::SUCCESS, $user );\n }\n else\n {\n return new Result( Result::FAILURE_UNCATEGORIZED, null );\n }\n }\n }\n else\n {\n return new Result( Result::FAILURE_CREDENTIAL_INVALID, null );\n }\n\n return new Result( Result::FAILURE_IDENTITY_NOT_FOUND, null );\n }", "protected function _connection() {\n\n\t\tif ($this->cookie->exists('user') === false && $this->cookie->exists('token') === false) {\n\t\t\t\n\t\t\tif (count($_POST) && isset($_POST['email']) && isset($_POST['password'])) {\n\t\t\t\t\n\t\t\t\t$oUser = new User;\n\t\t\t\t$oUserEntity = $oUser->findOneByemail($_POST['email']);\n\n\t\t\t\tif (count($oUserEntity) > 0 && md5($_POST['password']) === $oUserEntity->get_password()) {\n\n\t\t\t\t\t$this->cookie->set('user', $_POST['email'], 86400);\n\t\t\t\t\t$this->cookie->set('id', $oUserEntity->get_id(), 86400);\n\t\t\t\t\t$this->cookie->set('token', md5($_POST['email'].self::PRIVATE_KEY_FOR_TOKEN), 86400);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->cookie->exists('user') && $this->cookie->exists('token')) {\n\t\t\t\n\t\t\tif (md5($this->cookie->get('user').self::PRIVATE_KEY_FOR_TOKEN) != $this->cookie->get('token')) {\n\t\t\t\t\n\t\t\t\t$this->cookie->set('user', null, 0);\n\t\t\t\t$this->cookie->set('id', null, 0);\n\t\t\t\t$this->cookie->set('token', null, 0);\n\t\t\t}\n\t\t}\n\t}", "public function auth()\n {\n\n if (Auth::attempt(['email' => $this->request->header('email'), 'password' => $this->request->header('password')])) {\n $this->user = Auth::user();\n\n } else {\n echo json_encode(['error' => 'Unauthorised']);\n die();\n }\n }", "private function setUserPass(){\n if($this->_request->get(login_user)){\n $this->_user = $this->_request->get(login_user);\n }else{\n $this->_user = $this->getCookie();\n }\n $this->_pass = $this->_request->get('login-password');\n }", "private function cookieIsValid($hash) {\n //if hash in db\n $sql = \"SELECT username, expiredate, ip FROM \".PREFIX.\"sessions WHERE hash=:hash\";\n $cookie = $this->db->select($sql, array(\":hash\" => $hash));\n $count = count($cookie);\n if ($count == 0) {\n //hash did not exists deleting cookie\n Cookie::destroy(\"auth_cookie\", $hash);\n //Cookie::destroy(\"auth_cookie\", $hash, '');\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity('UNKNOWN', \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - Hash ({$hash}) didn't exist\");\n return false;\n } else {\n $username = $cookie[0]->username;\n $db_expiredate = $cookie[0]->expiredate;\n $db_ip = $cookie[0]->ip;\n if ($_SERVER['REMOTE_ADDR'] != $db_ip) {\n //hash exists but ip is changed, delete cookie and hash\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n Cookie::destroy(\"auth_cookie\", $hash);\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity($username, \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - IP Different ( DB : {$db_ip} / Current : \" . $_SERVER['REMOTE_ADDR'] . \" )\");\n return false;\n } else {\n $expiredate = strtotime($db_expiredate);\n $currentdate = strtotime(date(\"Y-m-d H:i:s\"));\n if ($currentdate > $expiredate) {\n //cookie has expired delete cookie and cookies\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n Cookie::destroy(\"auth_cookie\", $hash);\n //setcookie(\"auth_cookie\", $hash, time() - 3600, \"/\");\n $this->logActivity($username, \"AUTH_CHECKCOOKIE\", \"User cookie cookie deleted - Cookie expired ( Expire date : {$db_expiredate} )\");\n } else {\n //all ok\n return true;\n }\n }\n }\n }", "public function authenticate() {\n $user = Zebu_User::createInstance($this->username);\n if($user && $this->passhash == $user->passhash){\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,$this->username);\n }\n return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,$this->username);\n }", "function is_authed()\n{\n \n //echo \"<br/>is_authed\";\n\n if (isset($_COOKIE['cookie_username']) && isset($_COOKIE['cookie_encrypted_username']))\n\t {\n $_SESSION['username'] = $_COOKIE['cookie_username'];\n $_SESSION['encrypted_name'] = $_COOKIE['cookie_encrypted_username'];\n $_SESSION['user_id'] = $_COOKIE['cookie_user_id'];\n \n //get first and last names from db\n $user_id = $_SESSION['user_id'];\n if($user_id){\n $user_obj = new user();\n $result = $user_obj -> get(\"user_id=$user_id\");\n $_SESSION['firstname'] = $result[0]['firstname'];\n $_SESSION['lastname'] = $result[0]['lastname'];\n }\n\t }\n \n // Check if the encrypted username is the same as the unencrypted one, if it is, it hasn't been changed\n if (isset($_SESSION['username']) && (md5($_SESSION['username']) == $_SESSION['encrypted_name'])){\n return true;\n } else {\n return false;\n }\n\n}", "function check_auth_cookie($appword,$cookexp=0,$cookiename=\"login\",$username=\"\"){\n//debug_string(\"check_auth_cookie()\");\n//debug_string(\"appword\",$appword);\n//debug_string(\"cookexp\",$cookexp);\n//debug_string(\"cookiename\",$cookiename);\n//debug_string(\"username\",$username);\n\n\t$c_data = get_cook_data($cookiename);// get the cookie data\n//debug_array(\"c_data\",$c_data);\n if (!isset($c_data)){// if no data return false\n return false;\n }\n//parse out the data in the cookie\n\t$c_username = $c_data['name'];// get the username\n//debug_string(\"c_username\",$c_username);\n//debug_string(\"mark1\");\n if (\"\"==$username){$username=$c_username;}//use cookie username if none given\n//debug_string(\"mark2\");\n\t$c_time = $c_data['time'];\n\t$c_hash = $c_data['hash'];\n\t$c_expire = $c_data ['expire'];\n//check expiration time; delete cookie and return false if expired\n//debug_string(\"c_time\",$c_time);\n//debug_string(\"c_hash\",$c_hash);\n//debug_string(\"c_expire\",$c_expire);\n//debug_string(\"mark3\");\n\tif (0!=$c_expire && $c_expire<time()){\n//debug_string(\"mark4\");\n\t\tdelete_cookie($cookiename);\n\t\treturn false;\n\t}\n//calc hash\n//debug_string(\"mark5\");\n $hash = md5($appword.$username.$c_time.$cookexp);// calculate hash \n//debug_string(\"hash\",$hash);\n//debug_string(\"c_hash\",$c_hash);\n//debug_string(\"c_username\",$c_username);\n//debug_string(\"username\",$username);\n// check hash\n//debug_string(\"mark6\");\n if(strcmp($c_username,$username)==0 && strcmp($hash,$c_hash)==0 ){\n//debug_string(\"mark7 true\");\n\n return true;\n }else{\n//debug_string(\"mark8 false\");\n return false;\n }\n//debug_string(\"mark9\");\n}", "static function confirm_account() {\n \n # hash GET param exists\n if ($hash = data('hash')) {\n \n $hash = confirm_account($hash);\n\n if ($hash === -3)\n flash('Algo ocorreu errado. Tente novamente mais tarde..', 'error');\n else if ($hash === true)\n flash('Conta Confirmada! Agora você já pode se conectar.');\n }\n\n go('/');\n }", "protected function _csrf_set_hash()\n\t{\n\t\tif ($this->_csrf_hash === NULL)\n\t\t{\n\t\t\t// If the cookie exists we will use its value.\n\t\t\t// We don't necessarily want to regenerate it with\n\t\t\t// each page load since a page could contain embedded\n\t\t\t// sub-pages causing this feature to fail\n\t\t\tif (isset($_COOKIE[$this->_csrf_cookie_name]) && is_string($_COOKIE[$this->_csrf_cookie_name])\n\t\t\t\t&& preg_match('#^[0-9a-f]{32}$#iS', $_COOKIE[$this->_csrf_cookie_name]) === 1)\n\t\t\t{\n\t\t\t\treturn $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name];\n\t\t\t}\n\n\t\t\t$rand = $this->get_random_bytes(16);\n\t\t\t$this->_csrf_hash = ($rand === FALSE)\n\t\t\t\t? md5(uniqid(mt_rand(), TRUE))\n\t\t\t\t: bin2hex($rand);\n\t\t}\n\n\t\treturn $this->_csrf_hash;\n\t}", "function VerifyUser(){\n $user = $_POST[\"input_user\"];\n $pass = $_POST[\"input_pass\"];\n\n if(isset($user)){\n $userFromDB = $this->model->GetUser($user);\n if(isset($userFromDB) && $userFromDB){ //PREGUNTAR SOBRE ESTE &&\n\n if (password_verify($pass, $userFromDB->pass)){ \n\n session_start(); //SE INICIA UNA SESION\n $_SESSION[\"user\"] = $userFromDB->nombre; //SE TRAE EL user DEL USUARIO DESDE LA DB\n $_SESSION[\"admin\"] = $userFromDB->admin; //SE TRAE EL ROL DEL USUARIO DESDE LA DB\n $_SESSION[\"email\"] = $userFromDB->email; //SE TRAE EL ROL DEL USUARIO DESDE LA DB\n $_SESSION[\"id_user\"] = $userFromDB->id;\n setcookie(\"id_user\", $userFromDB->id); //SE CREA UNA COOKIE \"id_user\"\n\n session_start();\n header(\"Location: \".BASE_URL.\"stock\");\n }\n else{ //SI LA CONTRASEÑA ES INCORRECTA\n $this->view->ShowLog(\"Contraseña incorrecta\");\n }\n\n }\n else{ //SI EL USUARIO NO EXISTE EN LA DB\n $this->view->ShowLog(\"El usuario no existe\"); \n }\n }\n }", "protected function calculateHash()\n {\n return md5((string)$this->toCookie());\n }", "abstract protected function auth();", "function authenticated() {\n return $_SESSION['auth'] == md5(config('security.password.hash') . $_SESSION['user']['id']);\n}", "public static function authenticateByCookie(): void\n {\n $request = RequestFactory::create();\n $token = $request->getCookieParam('jwToken');\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "function session_init($hash){\n if(isset($hash)){\n $session=mysqli_fetch_assoc(DB::select('sessions',['*'],'hash=\"'.$hash.'\"'));\n if(isset($session['closed'])){\n session_close($hash);\n $hash = md5(genHash());\n //dbg('Insert new HASH from session_init()');\n if (DB::insert('auth', array('iduser' => USER_ID, 'hash' => $hash))) {\n //session_init($hash);\n setcookie('HASH', $hash, 7000000000);\n }\n }\n //dbg('Insert new SESSION from session_init()');\n DB::insert('sessions',['hash'=>$hash,'iduser'=>USER_ID,'date'=>date('Y-m-d H:i:s'),'last_act'=>date('Y-m-d H:i:s'),'ip'=>$_SERVER['REMOTE_ADDR'],'provider'=>getIspByIp($_SERVER['REMOTE_ADDR']),'closed'=>0]);\n }\n}", "public function postLogin() {\n $input = array(\n 'email' => Input::get('email'),\n 'password' => Input::get('password'),\n 'remember' => Input::get('remember'),\n );\n\n $remember = null;\n\n if ($input['remember'] != null) {\n Cookie::queue('login_input', $input);\n } else {\n //Cookie::forget('login_input');\n }\n\n $model = User::whereRaw('email = ?', array($input['email']))->first();\n\n if ($model != null && Hash::check($input['password'], $model->password)) {\n Session::put('user_id', $model->id);\n\n return Redirect::to('admin/dashboard');\n } else {\n $alert_danger = 'Username/Password is incorrect.';\n\n return Redirect::back()->with('alert_danger', $alert_danger);\n }\n }", "public function checkAuth(){\n if( isset($_COOKIE['Auth']) ) {\n $result = $this->select(array(\"hash\"=>$_COOKIE['Auth']));\n if(!empty($result)){\n return $result[0];\n } else {\n return false;\n }\n \n } else {\n return false;\n }\n }", "function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth', $token = '')\n {\n }", "public function authSiteUser(){\n\n\t\t$token = Input::get('token');\n\t\t$tokenExists = TokenModel::where('token = ?', $token)\n\t\t\t\t\t\t\t\t\t->all();\n\t\t//invalid token used/no access token provided\n\t\tif (!$tokenExists->num_rows()) {\t\t \n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!1');\n\t\t}\n\t\t//check for expired token\n\t\telseif ($tokenExists->result_array()[0]['logout'] === true) {\n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!2');\n\t\t}\n\t\t//unathorized user access to admin controller\n\t\telseif ($tokenExists->result_array()[0]['user_role'] != 1 AND $tokenExists->result_array()[0]['user_role'] != 2) {\n\t\t\theader('HTTP/1.0 401 Unauthorized'); \n\t\t\tdie('Restricted access!');\n\t\t}\n\t\telse {\n\t\t\t//check for expired timestamp\n\t\t\t$token = $tokenExists->result_array()[0];\n\t\t\t$timestamp = strtotime($token['date_modified'] OR $token['date_created']);\n\n\t\t\tif (($timestamp + $token['duration']) > time()) {\n\t\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\t\tdie('Login required!3');\n\t\t\t}\n\n\t\t\t//extend token lifespan\n\t\t\tTokenModel::where('id = ?', $token['id'])\n\t\t\t\t\t\t->save(array(\n\t\t\t\t\t\t\t'duration' => 3600\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t}\n\n\t}", "protected function checkRememberMeCookie() {\n\n if (!isset($_SESSION[\"id_user\"])) {\n //echo \"check the cookie <br/>\";\n if (isset($_COOKIE['auth'])) {\n $auth = $_COOKIE['auth'];\n //echo \"cookie auth = \" . $auth . \"<br/>\";\n $authArray = explode('-', $auth);\n //print_r($authArray);\n $modelUser = new CoreUser();\n if (!$modelUser->isUserId($authArray[0])) {\n //echo \"user not found <br/>\";\n $this->redirect(\"coreconnection\");\n return 1;\n }\n\n $key = $modelUser->getRemeberKey($authArray[0]);\n //echo \"database key = \" . $key . \"<br/>\"; \n if ($key == $authArray[1]) {\n //echo \"cookie good<br/>\";\n // update the cookie\n $key = sha1($this->generateRandomKey());\n $cookieSet = setcookie(\"auth\", $authArray[0] . \"-\" . $key, time() + 3600 * 24 * 3);\n if (!$cookieSet) {\n throw new Exception('cannot set the cookie in coresecure <br>');\n }\n $modelUser->setRememberKey($authArray[0], $key);\n\n $this->initSession($modelUser->getUserLogin($authArray[0]));\n\n // redirect\n return 2;\n } else {\n\n setcookie('auth', '', time() - 3600);\n //echo \"cookie not good <br/>\";\n $this->redirectNoRemoveHeader(\"coreconnection\");\n return 0;\n }\n } else {\n //echo \"cookie not found\";\n return 0;\n }\n }\n return 0;\n //echo \"check cookie <br/>\";\n }", "function login_attempt() {\n $data = json_decode(file_get_contents(\"../dummyauth.json\"),true);\n if ($_POST['user'] === $data['login'] && password_verify($_POST[\"pass\"], $data['hash'])) {\n $_SESSION['authed'] = true;\n $_SESSION['actor'] = \"https://\". $_SERVER['HTTP_HOST'] . $data['actor'];\n $_SESSION['last_access'] = $_SERVER['REQUEST_TIME'];\n header('Location: index.php');\n exit();\n }\n}", "function set_my_cookie($username, $password){\n global $db;\n require_once(\"db.php\");\n $id = $db->insert_id;\n setcookie(\"id\", $id,0,\"/\");\n $security = md5($username.$password.\"two_plus_two\");\n setcookie(\"security\",$security,0,\"/\");\n $db->close();\n var_dump($_COOKIE);\n}", "public function auth_in_user() {\r\n $user_info = $this->db->where('user', $this->input->post('user'))->get('user')->result();\r\n if($user_info) {\r\n $pswd_hash = $user_info[0]->password;\r\n if(password_verify($this->input->post('pswd'), $pswd_hash)) {\r\n //set session\r\n $this->session->set_userdata(array(\r\n 'id' => $user_info[0]->id,\r\n 'front_name' => $this->details->front_name,\r\n 'isLoggedIn' => true\r\n ));\r\n return true;\r\n }\r\n //wrong psw\r\n return false;\r\n }\r\n //no user\r\n return false;\r\n }", "private function cookieInfo($hash) {\n $query = $this->db->select(\"SELECT uid, username, expiredate, ip FROM \".PREFIX.\"sessions WHERE hash=:hash\", array(':hash' => $hash));\n $count = count($query);\n if ($count == 0) {\n // Hash doesn't exist\n $auth_error[] = $this->lang['cookieinfo_invalid'];\n //setcookie(\"auth_cookie\", $hash, time() - 3600, '/');\n Cookie::destroy('auth_cookie', $hash); //check if destroys deletes only a specific hash\n // \\Helpers\\Cookie::set(\"auth_cookie\", $hash, time() - 3600, \"/\",$_SERVER[\"HTTP_HOST\"]);\n return false;\n } else {\n // Hash exists\n $cookie[\"uid\"] = $query[0]->uid;\n $cookie[\"username\"] = $query[0]->username;\n $cookie[\"expiredate\"] = $query[0]->expiredate;\n $cookie[\"ip\"] = $query[0]->ip;\n return $cookie;\n }\n }", "function _verify_cookie()\n\t{\n\t\tif((array_key_exists('login_attempts', $_COOKIE)) && ($_COOKIE['login_attempts'] >= 5))\n\t\t{\n\t\t\t$username = $this->CI->session->userdata('username');\n\t\t\t$userdata = $this->CI->db->query(\"SELECT * FROM `users` WHERE `username` = '$username'\");\n\t\t\t\n\t\t\t$result = $userdata->row();\n\n\t\t\t$identifier = $result->username . $result->token;\n\t\t\t$identifier = $this->_salt($identifier);\n\t\t\t\n\t\t\tif($identifier !== $_COOKIE['logged_in'])\n\t\t\t{\n\t\t\t\t$this->CI->session->sess_destroy();\n\t\t\t\t\n\t\t\t\tshow_error($this->CI->lang->line('logout_perms_error'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_generate();\n\t\t}\n\t}", "public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}", "function cookie_login($conn)\n {\n if (!isset($_SESSION['signed_in']))\n { \n if(isset($_COOKIE[\"new\"]) && isset($_COOKIE[\"pass\"]))\n {\n $email=test_input($_COOKIE[\"new\"]);\n\t $pass=$_COOKIE[\"pass\"];\n $sql= \"select email from users where email='$email' and password='$pass'\";\n $result = $conn->query($sql);\n if ($result->num_rows > 0) \n {\n\t $_SESSION['signed_in']=$email;\n }\n \n }\n\n }\n }", "public function login() {\r\n\t\t\r\n\t\t$back = $this->hybrid->get_back_url();\r\n\t\t$user_profile = $this->hybrid->auth();\r\n\t\t\r\n\t\t$email = $user_profile->emailVerified;\r\n\t\tif(!$email)\r\n\t\t\t$email = $user_profile->email;\r\n\t\t\r\n\t\tif(!$email)\r\n\t\t\t$this->hybrid->throw_error($this->ts(\"You don't have any email address associated with this account\"));\r\n\t\t\r\n\t\t/* check if user exists */\r\n\t\t$user = current($this->a_session->user->get(array(\"email\" => $email)));\r\n\t\tif(!$user) {\r\n\t\t\t/* create user */\r\n\t\t\t$uid = $this->hybrid->add_user($email, $user_profile);\r\n\t\t\t$user = current($this->a_session->user->get(array(\"id\" => $uid)));\r\n\t\t\t\r\n\t\t\tif(!$user)\r\n\t\t\t\t$this->wf->display_error(500, $this->ts(\"Error creating your account\"), true);\r\n\t\t}\r\n\t\t\r\n\t\t/* login user */\r\n\t\t$sessid = $this->hybrid->generate_session_id();\r\n\t\t$update = array(\r\n\t\t\t\"session_id\" => $sessid,\r\n\t\t\t\"session_time\" => time(),\r\n\t\t\t\"session_time_auth\" => time()\r\n\t\t);\r\n\t\t$this->a_session->user->modify($update, (int)$user[\"id\"]);\r\n\t\t$this->a_session->setcookie(\r\n\t\t\t$this->a_session->session_var,\r\n\t\t\t$sessid,\r\n\t\t\ttime() + $this->a_session->session_timeout\r\n\t\t);\r\n\t\t\r\n\t\t/* save hybridauth session */\r\n\t\t$this->a_session->check_session();\r\n\t\t$this->hybrid->save();\r\n\t\t\r\n\t\t/* redirect */\r\n\t\t$redirect_url = $this->wf->linker('/');\r\n\t\tif(isset($uid))\r\n\t\t\t$redirect_url = $this->wf->linker('/account/secure');\r\n\t\t$redirect_url = $back ? $back : $redirect_url;\r\n\t\t$this->wf->redirector($redirect_url);\r\n\t}", "public function authenticate()\n {\n $concat = $this->_password.self::getSalt();\n\n $sql = \"SELECT\n id\n FROM account\n WHERE\n email = '{$this->_email}'\n AND password = MD5(CONCAT(hash, '{$concat}'))\";\n\n $user = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne($sql);\n \n // check to make sure the email address and password match\n if (!$user) {\n $error = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;\n return new Zend_Auth_Result($error, 0);\n }\n\n $account = Js_Query::create()->from('account')->where('id = ?', $user['id'])->fetchOne();\n \n // return a valid login\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $account);\n }", "public function doAuthentication();", "function assignHQFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.hqusers';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('hq_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "private function get_auth_cookie() {\r\n $postfields = http_build_query([\r\n 'username' => $this->username,\r\n 'password' => $this->password,\r\n 'csrfmiddlewaretoken' => $this->csrf_token\r\n ]);\r\n curl_setopt_array($this->curl_handle, [\r\n CURLOPT_URL => $this->auth_url,\r\n CURLOPT_COOKIEJAR => self::COOKIE_FILE,\r\n CURLOPT_COOKIEFILE => self::COOKIE_FILE,\r\n CURLOPT_POST\t => false,\r\n CURLOPT_POSTFIELDS => $postfields,\r\n CURLOPT_FAILONERROR => true,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_REFERER => $this->auth_url,\r\n CURLOPT_AUTOREFERER => true,\r\n CURLOPT_HTTPHEADER => ['User-Agent: '.self::USER_AGENT],\r\n //CURLOPT_VERBOSE => true,\r\n CURLOPT_RETURNTRANSFER => true\r\n ]);\r\n\r\n curl_exec($this->curl_handle);\r\n }", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "function checkUserAuth()\n{\n\t$link = dbConnect();\n\n\tif (!isset($_COOKIE['csp1_jag13047_cookie3']))\n\t{\n\t\t$output = \"Access Denied. Please login.\";\n\t\tsetcookie(\"csp1_jag13047_cookie4\", $output, 0, \"/CSE4707/prj1jag13047/\", \"localhost\"); \n\t\theader('Location: ../html/error.html.php');\n\t}\n\telse\n\t{\n\t\t#$uname = $_COOKIE['csp1_jag13047_cookie1'];\n\t\t$uname = decryptUsername();\n\t\t$ip = $_COOKIE['csp1_jag13047_cookie2'];\n\t\t$seckey = $_COOKIE['csp1_jag13047_cookie3'];\n\t\t$query = \"SELECT * FROM cookie_information WHERE username = '{$uname}' and IP = '{$ip}'\";\n\t\t$result = mysqli_query($link, $query);\n\n\t\tif (!$result) \n\t\t{ \n\t\t $output = 'Error fetching rows: ' . mysqli_error($link); \n \t \t setcookie(\"csp1_jag13047_cookie4\", $output, 0, \"/CSE4707/prj1jag13047/\", \"localhost\"); \n \t \t header('Location: ../html/error.html.php');\n \t \t exit(); \n\t\t}\n\n\t\t$row = mysqli_fetch_array($result);\n\t\tif($row['security_key'] == $seckey)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output = 'Authentication Error';\n\t\t\tsetcookie(\"csp1_jag13047_cookie4\", $output, 0, \"/CSE4707/prj1jag13047/\", \"localhost\"); \n \t \t\theader('Location: ../html/error.html.php');\n \t \t\texit(); \n\t\t}\n\t}\n}", "function authenticate($POST) {\n // Check for email address\n if (!isset($POST->email)) {\n header('HTTP/1.1 400 Bad Request');\n return 'No email provided';\n }\n\n // Check for password\n if (!isset($POST->password)) {\n header('HTTP/1.1 400 Bad Request');\n return 'No password provided';\n }\n $email = $POST->email;\n $password = $POST->password;\n\n // Get account\n $query = sprintf(\"SELECT password FROM authentication WHERE email = '%s'\",\n mysql_real_escape_string($email));\n $result = mysql_query($query);\n\n // Alert failure\n if (!mysql_num_rows($result)) {\n header('HTTP/1.1 404 Not Found');\n return 'Could not find user.';\n }\n\n if ($password === mysql_result($result, 0, 'password')) {\n mysql_close();\n $token = getToken(15);\n\n // Check that the token worked\n if ($token === false) {\n header('HTTP/1.1 500 Internal Server Error');\n return 'Something went wrong when generating your token.';\n }\n\n // Set the cookie\n $test = setcookie('auth-token', $token, time() + (1000 * 60 * 60 * 24), \"/\");\n\n header('HTTP/1.1 200 OK');\n\n // Return the token\n $response = new stdClass;\n $response->token = $token;\n return json_encode($response);\n }\n}", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "public function confirm($hash , User $user)\n {\n\n try {\n $user = $user->where('hash' , '=' , $hash)->first();\n\n $user->active = 1;\n // $user->hash = null;\n $user->save();\n\n return response()->json(['msg' => 'Your email confirmed successfully.Now you can login to our application']);\n\n } catch (\\ErrorException $e) {\n return response()->json(['success' => FALSE , 'msg' => 'Confirmation error']);\n }\n\n }", "private function authorizeUser()\n {\n $logout = new LogUserOutAction($this);\n $session = new Session();\n $idEncryption = new IDEncryption();\n\n $rights = $this->getRights();\n if ($rights < self::GUEST\n || $rights > self::DEVELOPER\n || (int) ($this->account->account_is_blocked ?? '0') === 1\n || !$idEncryption->validateHash(\n $this->account->account_login_token ?? '',\n $session->get('userID')\n )\n ) {\n $logout->execute();\n\n return new Redirect('/admin');\n }\n }", "function authorization() {\n\t\t//~ screening user data\n\t\t$user_data=mysql::screening_array($_POST);\n\t\t//~ Find a user with the same name and taking his key\n\t\t$find_user=mysql::query(\"SELECT * FROM `users` WHERE `login_user`='\".$user_data['login'].\"';\", 'assoc');\n\t\tif (!$find_user) {\n\t\t\t//~ user not found\n\t\t\tself::$error='Пользователь не найден';\n\t\t\treturn false;\n\t\t} else {\n\t\t\t//~ user found\n\t\t\t$passwd=md5($find_user['key_user'].$user_data['passwd'].SECRET_KEY); //~ password hash with the private key and user key\n\t\t\tif ($passwd==$find_user['passwd_user']) {\n\t\t\t\t//~ passwords match\n\t\t\t\t$_SESSION['id_user']=$find_user['id_user'];\n\t\t\t\t$_SESSION['login_user']=$find_user['login_user'];\n\t\t\t\t//~ if user select \"remember me\"\n\t\t\t\tif (isset($user_data['remember']) and $user_data['remember']=='on') {\n\t\t\t\t\t$cook_code=$this->generateCode(15);\n\t\t\t\t\t$user_agent=mysql::screening($_SERVER['HTTP_USER_AGENT']);\n\t\t\t\t\tmysql::query(\"INSERT INTO `session` (`id_sess`, `id_user`, `code_sess`, `user_agent_sess`) VALUES (NULL, '\".$find_user['id_user'].\"', '\".$cook_code.\"', '\".$user_agent.\"');\");\n\t\t\t\t\tsetcookie(\"id_user\", $_SESSION['id_user'], time()+3600*24*30);\n\t\t\t\t\tsetcookie(\"code_user\", $cook_code, time()+3600*24*30);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//~ passwords not match\n\t\t\t\tself::$error='Пользователь не найден или пароль не совпадают';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function _cramMd5Login($challenge){\n $challenge=base64_decode($challenge);\n $hash=bin2hex($this->_hmac_md5($challenge,$this->AUTHPWD));\n $response=base64_encode($this->AUTHID. \" \" . $hash) . \"\\r\\n\";\n return $response;\n }", "function setUser ($user, $hash) {\r\n $_SESSION['user'] = [\r\n 'name' => $user,\r\n 'hash' => $hash\r\n ];\r\n}", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function casAction()\n {\n $auth = Zend_Auth::getInstance();\n $casAdapter = $this->_getCasAdapter();\n $casAdapter->setTicket($this->_getParam('ticket'));\n \n if ($this->_getParam('logoutRequest')) {\n $casAdapter->handleLogoutRequest($this->_getParam('logoutRequest'));\n }\n \n try {\n $result = $auth->authenticate(new Unl_Auth_Adapter_Cas($casAdapter));\n } catch (Exception $e) {\n //\n }\n \n if ($result && $result->isValid()) {\n $this->_setupUser(Zend_Auth::getInstance()->getIdentity());\n } else {\n Zend_Auth::getInstance()->clearIdentity();\n if (isset($_COOKIE['unl_sso'])) {\n setcookie('unl_sso', 'fake', time() - 60*60*24, '/', '.unl.edu');\n }\n }\n \n $session = new Zend_Session_Namespace(__CLASS__);\n $this->_redirect($session->referer);\n }", "function authenticateUser($user_email, $password, $isLogin) {\n // This could be supplied by a user, for example\n // Formulate Query\n // This is the best way to perform an SQL query\n // For more examples, see mysql_real_escape_string()\n $query = sprintf(\"SELECT * FROM scuola.utenti_scuola WHERE email='%s' AND password='%s'\", mysql_real_escape_string($user_email, $GLOBALS['link']), mysql_real_escape_string(base64_encode(base64_encode($password)), $GLOBALS['link']));\n\n // Perform Query\n $result = mysql_query($query);\n\n // Check result\n // This shows the actual query sent to MySQL, and the error. Useful for debugging.\n if (!$result) {\n $message = 'Invalid query: ' . mysql_error() . \"<br>\";\n $message .= 'Whole query: ' . $query . \"<br>\";\n echo($message);\n mysql_free_result($result);\n return FALSE;\n }\n $num_rows = mysql_num_rows($result);\n if ($num_rows == 1) {\n if ($isLogin) {//SE SIAMO AL LOGIN REGISTRA LE CREDENZIALI DELL'UTENTE NELL COOKYES\n $row = mysql_fetch_assoc($result);\n setcookie(\"cognome_user\", $row['cognome']);\n setcookie(\"nome_user\", $row['nome']);\n setcookie(\"email_user\", $row['email']);\n setcookie(\"id_utente\", $row['id_utente']);\n }\n } else {\n mysql_free_result($result);\n return FALSE;\n }\n mysql_free_result($result);\n return TRUE;\n }", "function wp_set_auth_cookie($user_id, $remember = \\false, $secure = '', $token = '')\n {\n }", "function AuthUsers($username) {\r\n //Can user login?\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $huser=hash(\"SHA256\",strip_tags($username));\r\n $result=$connection->query(\"select * from users where aduser='$huser'\") or die(mysqli_error($connection));\r\n if($result->num_rows>0) return 1; \r\n else return 0;\r\n}", "public function rememberLogin()\n\t{\n\t\t$token = new Token();\n\t\t$hashed_token = $token->getHash();\n\t\t// seting hashed token value to paramter for access from outside the class\n\t\t$this->remember_token = $token->getValue();\n\t\t$this->expiry_time = time() + 60*60*24*30;//30 days from now\n\t\t\n\t\t$sql = 'INSERT INTO remembered_logins (token_hash, user_id, expires_at) VALUES (:token_hash, :user_id, :expires_at)';\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t\n\t\t$stmt->bindValue(':token_hash', $hashed_token, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':user_id', $this->id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':expires_at', date('Y-m-d H-i-s', $this->expiry_time), PDO::PARAM_STR);\n\t\t\n\t\treturn $stmt->execute();\n\t}", "function login_challenge($username, $cleartext_password, $remember_session = false) {\n if (config\\MULTIPLE_IDENTITIES) {\n $user_identity = UserIdentityModel::select()->byKey(array(\"username\" => $username))->first();\n $user = ($user_identity !== null)? $user_identity->user: null;\n } else\n $user = UserModel::select()->byKey(array(\"username\" => $username))->first();\n if ($user !== null) {\n $hashed_password = $user->type(\"password\")->getStoredHashedValue();\n if (validate_password($hashed_password, $cleartext_password)) {\n if (!$user->loginChallengeFilter())\n return false;\n $user->last_login_time = time();\n $user->type(\"last_login_ip\")->setToRemoteAddr();\n if ($remember_session) {\n $user_remember_key = \\melt\\string\\random_hex_str(16);\n $user->user_remember_key = $user_remember_key;\n $user->user_remember_key_expires = $expires = time() + 60 * 60 * 24 * intval(config\\REMEMBER_ME_DAYS);\n // Remember user, allowing auto-login for time period configured.\n set_cookie(\"REMBR_USR_KEY\", $user_remember_key, $expires);\n } else if (isset($_COOKIE[\"REMBR_USR_KEY\"]))\n unset_cookie(\"REMBR_USR_KEY\");\n $user->store();\n // Remember username for two years.\n set_cookie(\"LAST_USER\", $username, time() + 60 * 60 * 24 * 365 * 2);\n // Stack any current shell on top of this shell.\n login($user);\n return true;\n }\n }\n return false;\n}", "function GetAuthenticated($username,$pass,$link,$magic_word,$cookiename=\"login\",$admin=false,$expiry=0,$title=\"Application\",$color='#F0F0F0',$mode=\"login\",$loginapp=\"index.php\", $reg=false){\n //check Cookie\n //debug_string(\"---- GetAuthenticated ----\");\n//debug_string(\"username\",$username);\n//debug_string(\"pass\",$pass);\n\n\t$c_data = get_cook_data($cookiename);\n//debug_array(\"cookie data\",$c_data);\n\t$message = \"\";\n//debug_string(\"----------------------------------------------\");\n//debug_string(\"type0\",$type);\n// check for a valid cookie\n\tif (check_auth_cookie($magic_word,calc_cookie_expiration($expiry,$c_data['time']),$cookiename)){\n\t\t$type = get_usertype($link,$cookiename);\n//debug_string(\"type1\",$type);\n\t\t$username = get_username($cookiename);\n\t\tif('inactive'==$type){//shouldn't have a cookie\n//debug_string(\"type2\",$type);\n\t\t\tdelete_cookie($cookiename);\n\t\t\tdisplaylogin($title,$color, $mode,$message=\"User in cookie is listed as inactive.\",$loginapp,$reg);\n\t\t\texit();\n\t\t} else if('admin'==$type){ // the user is the admin so it's good enough no matter what\n//debug_string(\"type3\",$type);\n\t\t\tcreate_auth_cookie($username,$expiry,$magic_word,$cookiename);//reset cookie so it doesn't expire// how can there be a valid $type at this point? \n\t} else if((!$admin && 'active'==$type)|| 'admin'==$type){//we don't need an admin so any good cookie is good enough\n//debug_string(\"type4\",$type);\n\t\t\tcreate_auth_cookie($username,$expiry,$magic_word,$cookiename);//reset cookie so it doesn't expire\n return true;\n// no valid cookie, no valid type, \n } else { //it will get here if we've dropped the username out of the cookie or anyother case where get_username fails\n//debug_string(\"type5\",$type);\n\t\t\tdelete_cookie($cookiename);\n\t\t\tdisplaylogin($title,$color, $mode,$message=\"User in cookie has unknown type (cookie removed).\",$loginapp,$reg);\n\t\t\texit();\n }\n//debug_string(\"type6\",$type);\n\t\treturn true;\n } else {\n//debug_string(\"type7\",$type);\n\t\t//debug_string(\"check_auth_cookie failed!\");\n\t\tdelete_cookie($cookiename);\n\t}\n //at this point there isn't a valid cookie\n//debug_string(\"type8\",$type);\n\t\t//debug_string(\"check_auth_cookie failed!\");\n\n // check username/password\n//debug_string(\"username\",$username);\n//debug_string(\"pass\",$pass);\n if(isset($username) && isset($pass)){//we have no cookie but we have a username and password\n//debug_string(\"type9\",$type);\n \t$users = MYSQLComplexSelect($link,array(\"*\"),array(\"user\"),array(\"username='\".$username.\"'\"),array(),0);\n\t\tif (count($users)==0){//no such user\n//debug_string(\"typeA\",$type);\n\t\t\tdisplaylogin($title,$color,$mode,$message=\"Bad user/password combination.\",$loginapp,$reg);\n\t\t\texit();\n\t\t}\n//debug_string(\"typeb\",$type);\n\t\t$user = $users[0];\n\t\t$id = $user['id']; \n\t\t$userpass = $user['userpass']; \n\t\t$email = $user['email']; \n\t\t$name = $user['name']; \n\t\t$temppw = $user['temppw']; \n\t\t$tpwexpiry = $user['tpwexpiry']; \n\t\t$type = $user['type']; \n\t\t$actword = $user['actword']; \n\t\t$ts = $user['ts']; \n\t\t$today = date(\"Y-m-d\");\n\t\tif (($pass==$userpass) or ($temppw==$userpass && $tpwexpiry>$today)) { // valid password \n//debug_string(\"typeC\",$type);\n\t\t\n\t\t/* \nTRUTH TABLE OF USER ACCESS CASES\n $admin\n$TYPE |True|False|\n--------------------\nadmin | T | T |\n--------------------\nactive | F | T |\n--------------------\ninactive| F | F |\n--------------------\n*/\n\t\t\tif ('inactive'==$type) {//user inactive\n//debug_string(\"typeE\",$type);\n\t\t\t\tdisplaylogin($title,$color,$mode,$message=\"User is inactive. Activate user or login as different user.\",$loginapp,$reg);\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse if ($admin && 'active'==$type){ // action requires admin privs\n//debug_string(\"typeF\",$type);\n\t\t\t\tdisplaylogin($title,$color,$mode,$message=\"Action requires user to be admin.\",$loginapp,$reg);\n\t\t\t\texit();\n\t\t\t} else {// good to go!\n//debug_string(\"typeG\",$type);\n\t\t\t\tcreate_auth_cookie($username,$expiry,$magic_word,$cookiename);//reset cookie so it doesn't expire\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{// bad password\n//debug_string(\"typeH\",$type);\n\t\t\tdisplaylogin($title,$color,$mode,$message=\"Bad user/password combination.\",$loginapp,$reg);\n\t\t\texit();\n\t\t}// password\n\t\t\t\n\n }//we have username and password\n //display password routine\n//debug_string(\"typeI\",$type);\n\tdisplaylogin($title,$color,$mode,$message=\"\",$loginapp,$reg);\n exit();\n}", "public function init_cookie(){\n\t\tglobal $con;\n\t\t\n\t\t// generate token value...\n\t\t$token = hash('sha512', (rand() . microtime()));\n\t\t\n\t\t// insert into table\n\t\tif($con->query(\"\n\t\t\t\tINSERT INTO `tokens`(token_user,token_val)\n\t\t\t\tVALUES ($this->user_id, '$token')\n\t\t\t\t\")) {\n\t\t\t\t\n\t\t\t// now set it\n\t\t\t$_COOKIE['id'] = $token;\n\t\t\tsetcookie('id', $token, time() + (60 * 60 * 24 * 30));\n\t\t\t\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "static function authorize($user, $remember)\r\n {\r\n $token = Token::getToken($user, crc32($_SERVER[\"REMOTE_ADDR\"]));\r\n \r\n $cookie_params = [\r\n $remember ? time()+60*60*24*30*12 : NULL,\r\n \"/\",\r\n NULL,\r\n false,\r\n true\r\n ];\r\n \r\n setcookie(\"uuid\", $user, ...$cookie_params);\r\n setcookie(\"tok\", $token, ...$cookie_params);\r\n }", "public function confirmAccount(string $hash): void;", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "public function actionActive() {\n if (!Yii::$app->request->get('hash') && !Yii::$app->request->get('hash') != \"\") {\n throw new NotFoundHttpException(Yii::t('site', 'not user'));\n }\n $id = Yii::$app->request->get('hash');\n $query = User::find()->where(['auth_key' => $id])->one();\n if (!$query) {\n throw new NotFoundHttpException(Yii::t('site', 'not user data'));\n }\n if ($query->status == User::STATUS_BLOCKED) {\n $query->status = User::STATUS_ACTIVE;\n }\n if ($query->active == User::STATUS_BLOCKED) {\n $query->active = User::STATUS_ACTIVE;\n }\n if ($query->save()) {\n Yii::$app->getSession()->setFlash('success', Yii::t('site', 'user activated'));\n return $this->goHome();\n } elseif($query->firstErrors) {\n $errors = $query->firstErrors;\n throw new UserException(reset($errors));\n }\n }", "function authorize($args)\n{\n global $_zp_authority;\n $args = decode64($args);\n //debugLog('after decode: '.var_export($args, true));\n logger('authorize', ($args['loglevel']));\n if (!preg_match('#^1.4#', ($version = getVersion()))) {\n return new ZEN_Error(-2, 'Zenphoto version '.$version.' but v1.4.x required!');\n }\n $_zp_authority = new Zenphoto_Authority();\n $hash = $_zp_authority->passwordHash($args['loginUsername'], $args['loginPassword']);\n debugLog('hashvalue: '.$hash);\n $userobj = getAnAdmin([\n '`user`=' => $args['loginUsername'],\n '`valid`=' => 1,\n ]);\n if ($userobj == '') {\n return new ZEN_Error(-1, 'Incorrect username or password '.$args['loginUsername'].' '.$args['loginPassword']);\n } //$userobj == ''\n else {\n $localhash = $userobj->getPass();\n debugLog('hash = '.$hash.' localhash = '.$localhash);\n if ($hash == $localhash) {\n return true;\n } //$userobj\n else {\n return new ZEN_Error(-1, 'Incorrect username or password '.$args['loginUsername'].' '.$args['loginPassword']);\n }\n }\n}", "public function authForUser( $user ){ return $user->authForDB( $this ); }", "public function signup()\n {\n $id = (int) Input::get(\"id\");\n $md5 = Input::get(\"secret\");\n if (!$id || !$md5) {\n Redirect::autolink(URLROOT, Lang::T(\"INVALID_ID\"));\n }\n $row = Users::getPasswordSecretStatus($id);\n if (!$row) {\n $mgs = sprintf(Lang::T(\"CONFIRM_EXPIRE\"), Config::TT()['SIGNUPTIMEOUT'] / 86400);\n Redirect::autolink(URLROOT, $mgs);\n }\n if ($row['status'] != \"pending\") {\n Redirect::autolink(URLROOT, Lang::T(\"ACCOUNT_ACTIVATED\"));\n die;\n }\n if ($md5 != $row['secret']) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_ACTIVATE_LINK\"));\n }\n $secret = Helper::mksecret();\n $upd = Users::updatesecret($secret, $id, $row['secret']);\n if ($upd == 0) {\n Redirect::autolink(URLROOT, Lang::T(\"SIGNUP_UNABLE\"));\n }\n Redirect::autolink(URLROOT . '/login', Lang::T(\"ACCOUNT_ACTIVATED\"));\n }", "function sorter_user($user, $pwd){\n global $db;\n require_once(\"db.php\");\n $sql = \" SELECT * FROM `user` WHERE `user_name`='{$user}' \";\n $result = $db->query($sql);\n if($result->num_rows == 0){\n return false;\n } else {\n $array = $result->fetch_array();\n if(md5($pwd) == $array['user_password']){\n set_this_cookie($array['user_id'], $array['user_password']);\n return 1;\n } else {\n return 2;\n }\n }\n}", "function checkuser($con) {\n if (isset($_COOKIE['email']) && isset($_COOKIE['password'])) {\n $check = mysqli_fetch_array(mysqli_query($con, \"select * from users where email='\" . $_COOKIE['email'] . \"' and status='Active'\"), MYSQLI_ASSOC);\n if (!empty($check)) {\n if ($check['password'] == $_COOKIE['password']) {\n $_SESSION['email'] = $_COOKIE['email'];\n $_SESSION['password'] = $_COOKIE['password'];\n } else\n header(\"location: login.php\");\n }\n }\n if (!isset($_SESSION['email']) && !isset($_SESSION['password']))\n header(\"location: login.php\");\n}", "public function authorize(){\n $token = $this->retrieveToken(); $this->setToken($token);\n }", "function setLoggedIn($username, $password, $remember){\r\n\tglobal $dbc;\r\n\t$encrypted = crypt(md5($password),md5($username));\r\n\t\r\n\t$query = 'SELECT username, password, firstname, type FROM user WHERE username = \\''. $username .'\\' AND password = \\''. $encrypted .'\\';';\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif($result->num_rows == 1){\r\n\t\t$userrow = mysqli_fetch_object($result);\r\n\t\t\r\n\t\t//encrypt cookie name\r\n\t\t$cookiename = md5(COOKIE_NAME);\r\n\t\t//generate an auth token for logged in state\r\n\t\t$auth_token = generate_auth_token($userrow->username);\r\n\t\t\r\n\t\tif(preg_match('/^Error/', $auth_token)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t//store session data\t\t\r\n\t\t$_SESSION['username'] = $userrow->username;\r\n\t\t$_SESSION['firstname'] = $userrow->firstname;\r\n\t\t\r\n\t\t//store cookie data\r\n\t\tif($remember){\r\n\t\t\tsetcookie($cookiename, $auth_token, time()+(7 * 24 * 60 * 60), '/', 'groupproject.localhost');\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetcookie($cookiename, $auth_token, false, '/', 'groupproject.localhost');\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "public function securePage(){\n\t\tif( !$this->currentUser && !$this->ci->user_model->autoLoginUser() ){\n\t\t\tsetcookie('redirect', $this->ci->uri->uri_string(), 0, '/' );\n\t\t\tredirect('main', 'refresh');\n\t\t}\n\t}", "function auth() {\r\n\t$code = \"\";\r\n\tfor ($i = 0; $i < 8; $i ++) {\r\n\t\t$code .= (rand(0, 1) ? chr(rand(65, 122)) : rand(0, 9));\r\n\t}\r\n\treturn sha1($code);\r\n}", "function page_protect() {\nsession_start();\n\nglobal $db; \n\n/* Secure against Session Hijacking by checking user agent */\nif (isset($_SESSION['HTTP_USER_AGENT']))\n{\n if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT']))\n {\n \n\t\tlogout();\n\t\t\n exit;\n }\n}\n\n// before we allow sessions, we need to check authentication key - ckey and ctime stored in database\n\n/* If session not set, check for cookies set by Remember me */\nif (!isset($_SESSION['user_id']) && !isset($_SESSION['user_name']) ) \n{\n\tif(isset($_COOKIE['user_id']) && isset($_COOKIE['user_key'])){\n\t/* we double check cookie expiry time against stored in database */\n\t\n\t$cookie_user_id = filter($_COOKIE['user_id']);\n\t$rs_ctime = $mysqli->query(\"select ckey, ctime from users where users_id='$cookie_user_id'\") or die($mysqli->error);\n\tlist($ckey,$ctime) = $rs_ctime->fetch_assoc($rs_ctime);\n\t// coookie expiry\n\tif( (time() - $ctime) > 60*60*24*COOKIE_TIME_OUT) {\n \n\t\tlogout();\n\t\t}\n/* Security check with untrusted cookies - dont trust value stored in cookie. \t\t\n/* We also do authentication check of the `ckey` stored in cookie matches that stored in database during login*/\n\n\t if( !empty($ckey) && is_numeric($_COOKIE['user_id']) && isUserID($_COOKIE['user_name']) && $_COOKIE['user_key'] == sha1($ckey) ) {\n\t \t session_regenerate_id(); //against session fixation attacks.\n\t\n\t\t $_SESSION['user_id'] = $_COOKIE['user_id'];\n\t\t $_SESSION['user_name'] = $_COOKIE['user_name'];\n\t\t/* query user level from database instead of storing in cookies */\t\n\t\t $userlevel = $mysqli->query(\"select user_level from users where users_id='$_SESSION[user_id]'\");\n\t\t list($user_level) = $userlevel->fetch_assoc();\n\n\t\t $_SESSION['user_level'] = $user_level;\n\t\t $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);\n\t\t \n\t\t \n\t\t \n\t } else {\n\t \n\t logout();\n\t }\n\n } else {\n\theader(\"Location: login.php?bye=nice_try_;)\");\n\texit();\n\t}\n}\n}", "function login_user($email,$password,$remember)\n{\n $sql=\"SELECT password, id FROM users WHERE email='\" . escape($email) . \"' AND active=1\";\n $result=query($sql);\n if(row_count($result)==1){\n $row=fetch_array($result);\n $db_password=$row['password'];\n if(md5($password)===$db_password){\n\n if($remember==\"on\"){\n setcookie('email',$email,time()+86400);\n }\n\n $_SESSION['email']=$email;\n return true;\n }else{\n return false;\n }\n return true;\n }else{\n return false;\n }\n}", "function authorize()\n {\n try {\n $authRequest = $this->heimdall->validateAuth();\n $authRequest->setUser(new UserEntity());\n $this->heimdall->completeAuth($authRequest);\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "protected function createHash()\n\t{\n\t\t// create new\n\t\t$this->setHash(uniqid());\n\t\tDB::get()->prepare(\"\n\t\t\tINSERT INTO forms\n\t\t\tSET forms_area = ?, forms_hash = ?, forms_u_id = ?, forms_created_time = ?\")\n\t\t\t->execute(array(\n\t\t\t\t$this->domain,\n\t\t\t\t$this->hash,\n\t\t\t\t$this->user->id,\n\t\t\t\ttime()));\n\t}", "function getActivationHash(){\n\t\tif(!isset($this->id)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn substr(Security::hash(Configure::read('Security.salt') . $this->field('signup_date') . date('Ymd')), 0, 8);\n\t\t}\n\t}", "public function afterValidationOnCreate()\n {\n $this->hash = $this->getDI()->getSecurity()->hash($this->hash);\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "function auth()\n {\n $this->load->library(\"jwt\");\n \n $email = $this->input->post_json(\"email\");\n $password = $this->input->post_json(\"password\");\n \n \n //check user login\n $salted_hash = $this->_hashsaltpass($password);\n //$salted_hash = $password;\n log_message('debug', \"email: \".$email.\" and password:\".$salted_hash);\n //JMR added id to the token contents\n if($this->UserModel->auth($email, $salted_hash))\n {\n //create an unique secret password for every user\n $token=array(\n \"email\" => $email,\n \"exp\" => (time()+(12*60*60)), // 12 hour \n );\n $jwt = $this->jwt->encode($token, $this->_secret());\n\n $arr[\"response_code\"] = \"200\";\n $arr[\"json\"] = array(\"token\"=>$jwt);\n }\n else {\n\t\tlog_message(\"error\", \"User->auth failed\");\n $arr[\"response_code\"] = \"401\";\n }\n \n \n\n $this->parser->parse(\"json\", $arr);\n\n }", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n if ($auth->hasIdentity()) {\n $this->_redirect($this->getUrl());\n }\n\n $request = $this->getRequest();\n\n $redirect = $request->getPost('redirect');\n if (strlen($redirect) == 0)\n $redirect = $request->getServer('REQUEST_URI');\n if (strlen($redirect) == 0)\n $redirect = $this->getUrl();\n\n $errors = array();\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n $username = $request->getPost('username');\n $password = $request->getPost('password');\n\n if (strlen($username) == 0 || strlen($password) == 0)\n $errors['username'] = 'Required field must not be blank';\n\n if (count($errors) == 0) {\n $adapter = new Champs_Auth_Doctrine($username, $password);\n\n $result = $auth->authenticate($adapter);\n\n if ($result->isValid()) {\n $this->_redirect($this->getUrl());\n }\n\n $errors['username'] = 'Your login details were invalid';\n }\n }\n }\n\n // setup hash\n $this->initHash();\n\n $this->view->errors = $errors;\n $this->view->redirect = $redirect;\n }", "public function hash_cookie_token($data) {\n if (empty($data))\n {\n return FALSE;\n }\n\n $browser = $this->auth->auth_security['static_salt'].$this->input->server('HTTP_USER_AGENT');\n\n return sha1($data.$browser);\n }", "private function generateCookieHash($userId) {\n $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $token = '';\n $max = mb_strlen($keyspace, '8bit') - 1;\n for ($i = 0; $i < 16; ++$i) {\n $token .= $keyspace[random_int(0, $max)];\n }\n return hash('sha256', $userId . $token);\n }", "static function controlHash($mixed){\n\t\t$data = json_encode($mixed);\n\t\tif(json_last_error()!=JSON_ERROR_NONE) $data = $mixed;\n\t\treturn sha1(md5($data).APP_CONTROL_SECRET);\n\t}", "public function auth_user() {\n\t\t$key = $this->getParams('key');\n\t\t\n\t\t$this->UserAuth = ClassRegistry::init('UserAuth');\n\t\t$options = array('conditions' => array('UserAuth.key' => $key), 'order' => array('id' => 'DESC'));\n\t\t$data = $this->UserAuth->find('first', $options);\n\t\t$data = isset($data['UserAuth']['params']) ? unserialize($data['UserAuth']['params']) : array();\n\t\t\t\n\t\t$response = array(\n\t\t\t\t'status' => 'success',\n\t\t\t\t'operation' => 'auth_user',\n\t\t\t\t'data' => $data,\n\t\t\t\t);\n\t\t$this->set(array(\n 'response' => parseParams($response),\n '_serialize' => array('response'),\n ));\n\t}", "protected function _secure()\n {\n // user already logged in?\n if($this->current_user && $this->current_user->user_id) \n {\n return;\n }\n \n $this->_current_user();\n \n if(!$this->current_user || !$this->current_user->user_id)\n {\n redirect('user');\n }\n // user is logged in \n //$this->current_user_role = $this->current_user->role ;\n \n \n }", "function authenticate() {}", "abstract public function authorize();", "abstract public function authorize();", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "public function authenticateSecondFactor() {\t \t \t\t \n\t \n\t $module = $this->getModule();\n\t \n\t\t$authParams = array(\n\t\t\t'module' => $module,\n\t\t);\n\t\t\n\t\tif ($module == RublonMagentoModule::CONNECT) {\n\t\t $callbackUrl = $this->getCallbackUrl($connect = true);\n\t\t} else {\n\t\t $callbackUrl = $this->getCallbackUrl();\n\t\t}\n\t\t\t\t\n\t\t$userId = $this->getAuthUserId();\n\t\t$email = $this->getAuthUserEmail(); \n\t\t\n\t\t$this->clearLoggedUser();\n \n try {\n \n $authUrl = $this->service->auth($callbackUrl, $userId, $email, $authParams); \n if (!empty($authUrl)) {\n \n // Retrive cached rublon features\n RublonFeature::getFeatures();\n \n $this->redirect($authUrl);\n } else {\n // do nothing\n }\n \n } catch (RublonException $e) {\n \n $notifierOptions = array(\n 'Method' => __METHOD__,\n 'Line' => __LINE__,\n 'Trace' => $e->getTraceAsString()\n );\n \n $this->addError($e, $notifierOptions);\n }\n\t}", "public function callbackAuthorization($f3){\n $getParams = (array)$f3->get('GET');\n\n // users can log in either from @login (new user) or @map (existing user) root alias\n // -> or from /admin page\n // -> in case login fails, users should be redirected differently\n $rootAlias = 'login';\n if( !empty($f3->get(self::SESSION_KEY_SSO_FROM)) ){\n $rootAlias = $f3->get(self::SESSION_KEY_SSO_FROM);\n }\n\n if($f3->exists(self::SESSION_KEY_SSO_STATE)){\n // check response and validate 'state'\n if(\n isset($getParams['code']) &&\n isset($getParams['state']) &&\n !empty($getParams['code']) &&\n !empty($getParams['state']) &&\n $f3->get(self::SESSION_KEY_SSO_STATE) === $getParams['state']\n ){\n // clear 'state' for new next login request\n $f3->clear(self::SESSION_KEY_SSO_STATE);\n $f3->clear(self::SESSION_KEY_SSO_FROM);\n\n $accessData = $this->getSsoAccessData($getParams['code']);\n\n if(\n isset($accessData->accessToken) &&\n isset($accessData->refreshToken)\n ){\n // login succeeded -> get basic character data for current login\n $verificationCharacterData = $this->verifyCharacterData($accessData->accessToken);\n\n if( !is_null($verificationCharacterData)){\n\n // check if login is restricted to a characterID\n\n // verification available data. Data is needed for \"ownerHash\" check\n\n // get character data from ESI\n $characterData = $this->getCharacterData((int)$verificationCharacterData->CharacterID);\n\n if( isset($characterData->character) ){\n // add \"ownerHash\" and SSO tokens\n $characterData->character['ownerHash'] = $verificationCharacterData->CharacterOwnerHash;\n $characterData->character['crestAccessToken'] = $accessData->accessToken;\n $characterData->character['crestRefreshToken'] = $accessData->refreshToken;\n $characterData->character['esiScopes'] = Lib\\Util::convertScopesString($verificationCharacterData->Scopes);\n\n // add/update static character data\n $characterModel = $this->updateCharacter($characterData);\n\n if( !is_null($characterModel) ){\n // check if character is authorized to log in\n if( ($authStatus = $characterModel->isAuthorized()) === 'OK'){\n // character is authorized to log in\n // -> update character log (current location,...)\n $characterModel = $characterModel->updateLog();\n\n // connect character with current user\n if( is_null($user = $this->getUser()) ){\n // connect character with existing user (no changes)\n if( is_null( $user = $characterModel->getUser()) ){\n // no user found (new character) -> create new user and connect to character\n /**\n * @var $user Model\\UserModel\n */\n $user = Model\\BasicModel::getNew('UserModel');\n $user->name = $characterModel->name;\n $user->save();\n }\n }\n\n /**\n * @var $userCharactersModel Model\\UserCharacterModel\n */\n if( is_null($userCharactersModel = $characterModel->userCharacter) ){\n $userCharactersModel = Model\\BasicModel::getNew('UserCharacterModel');\n $userCharactersModel->characterId = $characterModel;\n }\n\n // user might have changed\n $userCharactersModel->userId = $user;\n $userCharactersModel->save();\n\n // get updated character model\n $characterModel = $userCharactersModel->getCharacter();\n\n // login by character\n $loginCheck = $this->loginByCharacter($characterModel);\n\n if($loginCheck){\n // set \"login\" cookie\n $this->setLoginCookie($characterModel);\n\n // -> pass current character data to target page\n $f3->set(Api\\User::SESSION_KEY_TEMP_CHARACTER_DATA, $characterModel->_id);\n\n // route to \"map\"\n if($rootAlias == 'admin'){\n $f3->reroute([$rootAlias, ['*' => '']]);\n }else{\n $f3->reroute(['map', ['*' => '']]);\n }\n }else{\n $f3->set(self::SESSION_KEY_SSO_ERROR, sprintf(self::ERROR_LOGIN_FAILED, $characterModel->name));\n }\n }else{\n // character is not authorized to log in\n $f3->set(self::SESSION_KEY_SSO_ERROR,\n sprintf(self::ERROR_CHARACTER_FORBIDDEN, $characterModel->name, Model\\CharacterModel::AUTHORIZATION_STATUS[$authStatus])\n );\n }\n }\n }else{\n // failed to load characterData from API\n $f3->set(self::SESSION_KEY_SSO_ERROR, self::ERROR_CHARACTER_DATA);\n }\n }else{\n // failed to verify character by CCP SSO\n $f3->set(self::SESSION_KEY_SSO_ERROR, self::ERROR_CHARACTER_VERIFICATION);\n }\n }else{\n // SSO \"accessData\" missing (e.g. timeout)\n $f3->set(self::SESSION_KEY_SSO_ERROR, sprintf(self::ERROR_SERVICE_TIMEOUT, self::SSO_TIMEOUT));\n }\n }else{\n // invalid SSO response\n $f3->set(self::SESSION_KEY_SSO_ERROR, sprintf(self::ERROR_LOGIN_FAILED, 'Invalid response'));\n }\n }\n\n $f3->reroute([$rootAlias, ['*' => '']]);\n }" ]
[ "0.72424567", "0.6807739", "0.6586711", "0.6547643", "0.6097997", "0.6094497", "0.60780156", "0.60188186", "0.5942746", "0.59291637", "0.5924107", "0.58962953", "0.579546", "0.5756192", "0.5714744", "0.57141685", "0.5709384", "0.5694107", "0.5690988", "0.5643507", "0.56315607", "0.562868", "0.5627619", "0.56231827", "0.5618255", "0.5615377", "0.561517", "0.56067836", "0.5606035", "0.5593183", "0.5592026", "0.5589905", "0.55834347", "0.5578404", "0.5577401", "0.55486345", "0.5536456", "0.55295557", "0.5527407", "0.5526228", "0.55227095", "0.5492565", "0.54851836", "0.5481123", "0.5475826", "0.54715085", "0.5466565", "0.5466417", "0.54633605", "0.5461215", "0.54592454", "0.54553187", "0.5441382", "0.54368377", "0.5432418", "0.5428932", "0.54253125", "0.5417708", "0.54108214", "0.5410148", "0.53975666", "0.53952897", "0.5394475", "0.5388958", "0.5387889", "0.5372934", "0.5371895", "0.53677064", "0.53625375", "0.5362273", "0.5361476", "0.53612965", "0.5349279", "0.53477573", "0.5346515", "0.53403425", "0.53401846", "0.53347355", "0.53344953", "0.5332615", "0.5322581", "0.5318942", "0.53161675", "0.53156847", "0.53140724", "0.53133845", "0.5311195", "0.5307178", "0.5303717", "0.5299346", "0.5299183", "0.52923447", "0.5290987", "0.5289117", "0.5284685", "0.5280999", "0.5277051", "0.5277051", "0.5271768", "0.5268937", "0.52674615" ]
0.0
-1
Seed the application's database.
public function run() { DB::statement('SET FOREIGN_KEY_CHECKS = 0'); Date::truncate(); $cantidadDatos = 1625; factory(Date::class, $cantidadDatos)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801", "0.6789746", "0.6788733", "0.6788008", "0.6786291", "0.67765796", "0.67742485", "0.677106", "0.67651874", "0.6761959", "0.675823", "0.67337847", "0.6733437", "0.67295784", "0.67290515", "0.6724652", "0.67226326", "0.6722267", "0.6721339", "0.6715842", "0.67070943", "0.67060536", "0.67031103", "0.6702514", "0.6702361", "0.67017967", "0.6695973", "0.6693496", "0.66868156", "0.66837406", "0.6678434", "0.66755766", "0.66726524", "0.666599", "0.664943", "0.6640641", "0.663921", "0.66387916", "0.6636016", "0.6633116", "0.6629787", "0.6627134", "0.6625862", "0.661699", "0.66093796", "0.6602538", "0.65996546", "0.659914", "0.6596484", "0.6596383", "0.65922767", "0.65922284", "0.65913564", "0.65889347", "0.65812707", "0.65811145", "0.6579546", "0.6578819", "0.6575912", "0.65749073", "0.6574314", "0.657148", "0.65696406", "0.6568972", "0.65624833", "0.6560332", "0.6559092", "0.6557491", "0.65555155", "0.6554255", "0.65509576", "0.6548099", "0.65479296", "0.6545845", "0.65443295", "0.65434265", "0.65432936", "0.654295", "0.65426385", "0.6541781", "0.6539325" ]
0.0
-1
Validate the value is null Variable passed to this function will always be a scalar
public function validate($value) { return ($value === null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValueOrNull($value) {\n global $db;\n if(strlen($value) == 0) return \"NULL\";\n else return \"'\".$db->validate($value).\"'\";\n}", "public function it_can_identify_valid_values()\n {\n $this->assertTrue(Testee::isValid(self::TEST_NULL_VALUE));\n }", "function _sql_validate_value($var)\n\t{\n\t\tif (is_null($var))\n\t\t{\n\t\t\treturn 'NULL';\n\t\t}\n\t\telse if (is_string($var))\n\t\t{\n\t\t\treturn \"'\" . $this->sql_escape($var) . \"'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (is_bool($var)) ? intval($var) : $var;\n\t\t}\n\t}", "private function _isNull() {\n if (is_null($this->value)) {\r\n return true;\r\n }\n if (empty($this->value) && (in_array($this->type, array('multiple', 'ordered', 'string')))) {\n return true;\n }\n return false;\n }", "function not_null($value) {\n if (is_array($value)) {\n if (sizeof($value) > 0)\n return true;\n else\n return false;\n } else {\n if ((is_string($value) || is_int($value)) && ($value != '') && (strlen(trim($value)) > 0))\n return true;\n else\n return false;\n }\n}", "public function NullCheck($value){\r\n\t\t$validation=\"\";\r\n\t\tif($value==\"\"){\r\n\t\t\t$validation = 'null';\r\n\t\t}elseif($value!=\"\"){\r\n\t\t\t$validation = 'valid';\r\n\t\t}\r\n\t\treturn $validation;\r\n\t}", "public function isScalar()\n {\n return \\is_scalar($this->value);\n }", "abstract public function checkValueType($arg_value);", "public function testIsValidNoConstraints()\n {\n $this->assertTrue($this->uut->setValue(new ScalarValue('foo'))->isValid());\n }", "public function hasNullValue(){\n return $this->_has(1);\n }", "public function getInvalidValue();", "public function stdWrap_ifNullDeterminesNullValuesDataProvider() {}", "public function testValueIsNull(): void {\n $transform = $this->getTransform('count', [\n 'source' => 'source',\n 'field' => 'example_source_field',\n ]);\n $result = $transform->transform([\n 'example_source_field' => null\n ]);\n // Make sure it stays an array\n $this->assertEquals(null, $result);\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "function check_value($value) {\n\tif((@count($value)>0 and !@empty($value) and @isset($value)) || $value=='0') {\n\t\treturn true;\n\t}\n}", "public function isValue()\n {\n return\n $this->type === 'string' ||\n $this->type === 'number' ||\n $this->type === 'null' ||\n $this->type === 'boolTrue' ||\n $this->type === 'boolFalse';\n }", "public function getCleanValue()\n {\n return null;\n }", "function getValue($value) {\n\treturn (!empty($value)) ? sanitize($value) : false;\n}", "abstract protected function validateValue($value);", "public function checkValue()\r\n\t{\r\n\t\treturn $this->_v('checkValue', 'xsdfsdfdsfdsfsf');\r\n\t}", "abstract public function getIsValidValue($value);", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function isNotNull();", "public function getValidDefaultValue(): mixed;", "function est_vide($val){\r\n return empty($val);\r\n }", "function validate_type_code($object = null, $value)\n\t{\n\t\tif (isset($value) == false || empty($value) ) {\n\t\t\treturn Localized::ModelValidation(\n\t\t\t\t$this->tableName(),\n\t\t\t\tMedia::type_code,\n\t\t\t\t\"FIELD_EMPTY\"\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}", "public function validateValue($value)\n {\n }", "function tep_not_null ($value) {\n\treturn !empty ($value) && trim ($value);\n}", "function is_valid($value) {\n\t\tif (isset($value) && trim($value) != \"\" && trim(strtolower($value)) != \"null\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function empty2null($value)\n{\n return $value === '' ? null : $value;\n}", "abstract public function isNull();", "function validarNullInt($valor,&$error, $campo) {\n\n $CI = & get_instance();\n \n if(trim($valor) == \"\"):\n \n return true;\n \n else:\n \n if(filter_var($valor, FILTER_VALIDATE_INT) === FALSE):\n \n $error = mensajeCampo($campo);\n return false;\n\n else:\n \n return true;\n\n endif;\n\n endif;\n\n}", "public function testHasValue()\n {\n $this->assertFalse($this->uut->hasValue());\n $this->assertTrue($this->uut->setValue(new ScalarValue('foo'))->hasValue());\n }", "public function testGetValueNull()\n {\n $eavDocument = new EavDocument();\n $value = $eavDocument->getValue('non_existent');\n\n $this->assertNull($value);\n }", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "function testMinvalRunsOnlyIfNotEmpty(){\n\t\t#mdx:minval2\n\t\tParam::get('age')->filters()->minval(1, \"Age cannot be less than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>null])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}", "static function validate($val) {\n\t\t$res = false;\n\t\tif (isset($val) && ($val != \"\")){\n\t\t\t$res = true;\n\t\t}\n\t\treturn ($res);\n\t}", "public function testCastValueNullMissingValues()\n {\n $schema = new Schema((object) [\n 'fields' => [\n ['name' => 'name', 'type' => 'number'],\n ],\n 'missingValues' => ['null'],\n ]);\n $this->assertSame(['name' => null], $schema->castRow(['name' => 'null']));\n }", "public function isScalar()\n {\n return $this->type === self::SCALAR_TPYE;\n }", "function is_valid($var){\n return isset($var) && !is_null() && strlen(trim((''.$var))) > 0;\n}", "public function testNullValueIsEvaluatedAsFalse()\n {\n $this->assertFalse(EmailValidator::validate(null));\n }", "public function isNull();", "final protected function validateScalarOrArray($value): void\n {\n if (!(is_scalar($value) || is_array($value) || $value === null)) {\n throw new InvalidArgumentException('Value must be null, scalar or array');\n }\n }", "function pseudoTypeNull(null $var = null) {}", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "function validate_value($valid, $value, $field, $input)\n {\n }", "private function validateValue($value)\n {\n if (is_null($value)) {\n throw new \\InvalidArgumentException(\"Value cannot be null\");\n }\n }", "public function value(): ?string;", "abstract protected function isValidValue($value);", "public function testBindFloat64ParameterNull()\n {\n self::$database->runTransaction(function (Transaction $t) {\n $t->executeUpdate(\n 'INSERT INTO ' . self::TABLE_NAME . '(id, name, registered, rating, age) '\n . 'VALUES($1, $2, $3, $4, $5)',\n [\n 'parameters' => [\n 'p1' => 5,\n 'p2' => 'Vince',\n 'p3' => true,\n 'p4' => null,\n 'p5' => 26\n ],\n 'types' => [\n 'p4' => Database::TYPE_FLOAT64\n ]\n ]\n );\n $t->commit();\n });\n\n $res = self::$database->execute('SELECT * FROM ' . self::TABLE_NAME . ' WHERE rating IS NULL');\n\n $this->assertCount(1, iterator_to_array($res));\n }", "public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}", "private function nullable($value)\n {\n return is_null($value) || $value === '';\n }", "public function testValidateNull(): void\n {\n $this->assertTrue($this->validate(null));\n }", "abstract protected function checkValue( &$value );", "protected function nullFunc() {\n return true;\n }", "function testString($s)\n {\n return is_scalar($s) || is_null($s);\n }", "public function set_null($value = '', $force_null = FALSE) {\n if ($force_null == TRUE && ($value === 0 || $value === '0')) {\n return NULL;\n }\n\n return $value == '' || $value == '<br>' ? NULL : $value;\n //return $value == '' ? NULL : $value;\n }", "public function testUndefinedValuesQueryPart()\n {\n $method = $this->builder_reflection->getMethod('sql_values');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('values');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array(array()));\n\n $string = '';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function isNullable(): bool;", "function validate_empty($val) {\n\tif ($val === NULL || $val === '') {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function hasValue()\n {\n return $this->Value !== null ? true : false;\n }", "function isValid($value = null)\n {\n if(is_numeric($value)){\n return true;\n }\n\n $this->errorFound();\n\n return false;\n }", "public function getValue(): ?string;", "public function getValue(): mixed;", "public function getValue(): mixed;", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "public function getValue()\n\t{\n\t\treturn null;\n\t}", "public function orNull();", "public function testIsValidNoValue()\n {\n $this->assertTrue($this->uut->isValid());\n }", "function value($resource){\n if ($resource){\n if (is_object($resource) || is_array($resource) || is_resource($resource)){\n return $resource;\n } else {\n $cast = strval($resource);\n if ($cast != '' && $cast != 'null'){\n return $cast;\n }\n }\n }\n return false;\n}", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function getValue()\n {\n return null;\n }", "function check() {\n\t\t//{\n\t\t//return 'company id is null';\n\t\t//}\n\n\n\t\t//$this->company_id = intval($this->company_id);\n\n\n\t\treturn NULL;\n\t}", "public function isScalar(): bool\n {\n return $this->phpType === self::INTEGER\n || $this->phpType === self::FLOAT\n || $this->phpType === self::STRING\n || $this->phpType === self::BOOLEAN\n || $this->phpType === self::NULL;\n }", "public function evaluateIsValid()\n\t{\n\t\t$idPath=$this->getControlToValidate();\n\t\tif(strlen($idPath))\n\t\t{\n\t\t\t$control=$this->getTargetControl($idPath);\n\t\t\t$value=$control->getValidationPropertyValue();\n\t\t\tif(!strlen($value))\n\t\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\n\t\tswitch($this->getValueType())\n\t\t{\n\t\t\tcase 'Integer':\n\t\t\t\treturn $this->isValidInteger($value);\n\t\t\tcase 'Float':\n\t\t\tcase 'Double':\n\t\t\t\treturn $this->isValidDouble($value);\n\t\t\tcase 'Currency':\n\t\t\t\treturn $this->isValidCurrency($value);\n\t\t\tcase 'Date':\n\t\t\t\treturn $this->isValidDate($value);\n\t\t\tdefault:\n\t\t\t\treturn $this->isValidString($value);\n\t\t}\n\t}", "public static function CheckNull($value = null)\n\t{\n\t\treturn ($value == null) ? '' : $value;\n\t}", "public function cleanValue($value)\n {\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n if ($this->isLeveled()) {\n //special case...\n if ($value && !is_array($value)) {\n //fresh from user input... set it to array\n $value = geoLeveledField::getInstance()->getValueInfo($value);\n }\n if (!is_array($value) || !isset($value['id']) || !(int)$value['id']) {\n //invalid\n return false;\n }\n return $value;\n }\n if (is_array($value)) {\n return false;\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n if (!is_array($value) || (!isset($value['high']) || !isset($value['low']))) {\n return false;\n }\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n return $value;\n }", "function mixedTypeHintNullable(?Mixed $var1) {}", "public function is_null() { return is_null($this->obj); }", "public function getEmptyValue()\n {\n return new Value();\n }", "protected function checkValueParam(&$value)\n {\n if (isset($value)) {\n if (is_object($value)) {\n if (!method_exists($value, 'toRdfPhp')) {\n // Convert to a literal object\n $value = Literal::create($value);\n }\n $value = $value->toRdfPhp();\n } elseif (is_array($value)) {\n if (!isset($value['type'])) {\n throw new \\InvalidArgumentException(\n \"\\$value is missing a 'type' key\"\n );\n }\n\n if (!isset($value['value'])) {\n throw new \\InvalidArgumentException(\n \"\\$value is missing a 'value' key\"\n );\n }\n\n // Fix ordering and remove unknown keys\n $value = array(\n 'type' => strval($value['type']),\n 'value' => strval($value['value']),\n 'lang' => isset($value['lang']) ? strval($value['lang']) : null,\n 'datatype' => isset($value['datatype']) ? strval($value['datatype']) : null\n );\n } else {\n $value = array(\n 'type' => 'literal',\n 'value' => strval($value),\n 'datatype' => Literal::getDatatypeForValue($value)\n );\n }\n if (!in_array($value['type'], array('uri', 'bnode', 'literal'), true)) {\n throw new \\InvalidArgumentException(\n \"\\$value does not have a valid type (\".$value['type'].\")\"\n );\n }\n if (empty($value['datatype'])) {\n unset($value['datatype']);\n }\n if (empty($value['lang'])) {\n unset($value['lang']);\n }\n if (isset($value['lang']) and isset($value['datatype'])) {\n throw new \\InvalidArgumentException(\n \"\\$value cannot have both and language and a datatype\"\n );\n }\n }\n }", "function float_check($var) {\n\tif ( is_numeric($var) )\n\t\treturn $var;\n\treturn null;\n}", "public function value()\r\n\t{\r\n\t\tif ($this->isFetched() && $this->isValid())\r\n\t\t{\r\n\t\t\treturn $this->normalizedValue;\r\n\t\t}\t\r\n\t\treturn null;\r\n\t}", "function is_empty($value) {\n if (is_array($value)) {\n return empty($value);\n } elseif (is_string($value)) {\n return strlen($value) == 0;\n } else {\n return $value === null;\n }\n}", "public function testPhoneMayNotHaveValue()\n {\n $phone = new Phone(null);\n $this->assertFalse($phone->getHasValue());\n }", "private function validateAction(string $value) {\n\n\t\t\t$value = strtoupper($value); $range = ['CASCADE', 'RESTRICT', 'SET NULL'];\n\n\t\t\treturn (in_array($value, $range, true) ? $value : null);\n\t\t}", "private function ignore_value( $_INPUT ){\n\t\tif (!isset( $_INPUT['value'] ) ){\n\t\t\treturn true;\n\t\t}\n\t\tif (!is_numeric( $_INPUT['value'] ) ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {}", "public function checkScalar($value)\n {\n return new AssertionResult(\n is_scalar($value),\n '{name} must be a scalar'\n );\n }", "public static function isScalar($value)\n {\n if (null === $value) {\n return true;\n\n }\n\n if (is_array($value)) {\n foreach($value as $sub_value) {\n if (! self::isScalar($sub_value)) {\n return false;\n }\n }\n return true;\n\n }\n\n return is_scalar($value);\n }", "function is_blank($value) {\n if (is_object($value) && method_exists($value, 'is_blank')) return $value->is_blank();\n if (is_string($value)) $value = trim($value);\n return is_empty($value);\n}", "protected function checkValue() {\n if($this->required) {\n if($this->regularExpression) {\n if(preg_match($this->regularExpression, $this->value)) {\n $returnValue = TRUE;\n } else {\n $returnValue = FALSE;\n $this->error = TRUE;\n }\n } elseif($this->callBack) {\n if(call_user_func($this->callBack, $this->value)) {\n $returnValue = TRUE;\n } else {\n $returnValue = FALSE;\n $this->error = TRUE;\n }\n } elseif(!(bool)$this->value) {\n $returnValue = FALSE;\n } else {\n $returnValue = TRUE;\n }\n } else {\n $returnValue = TRUE;\n }\n\n return $returnValue;\n }", "function validateNull($string)\n\t\t{\n\t\t\tif(is_null($string)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "protected function checkValue($value)\n {\n return null !== $value && intval($value);\n }", "public function it_can_validate()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(self::TEST_NULL_VALUE, $object->validate(self::TEST_NULL_VALUE));\n }" ]
[ "0.6991197", "0.6640789", "0.6336527", "0.6323882", "0.63104427", "0.62625986", "0.6257696", "0.62542975", "0.6198979", "0.6155847", "0.6143664", "0.6116001", "0.60915047", "0.607213", "0.607213", "0.6022388", "0.6016797", "0.6005649", "0.5983497", "0.5978822", "0.5971588", "0.5961903", "0.5907019", "0.5886964", "0.58797485", "0.58432114", "0.58422625", "0.5839932", "0.58361167", "0.5831054", "0.58163965", "0.5815546", "0.5811804", "0.58084947", "0.5798359", "0.57587916", "0.57584286", "0.5744955", "0.5739448", "0.57283837", "0.5696418", "0.5695988", "0.5693926", "0.5686019", "0.5682614", "0.5678314", "0.567541", "0.567541", "0.567541", "0.567541", "0.5647876", "0.56474835", "0.56410027", "0.5628512", "0.56253535", "0.5618887", "0.5618227", "0.5613911", "0.5598774", "0.5591144", "0.5590029", "0.5577508", "0.5571314", "0.5570665", "0.55697167", "0.5556792", "0.55544", "0.5544957", "0.5544957", "0.5544721", "0.5544274", "0.55324703", "0.55320644", "0.5529227", "0.55276376", "0.55276376", "0.5524974", "0.5516835", "0.5516098", "0.54867834", "0.5481667", "0.54773575", "0.5473194", "0.5435372", "0.54329485", "0.5429026", "0.54246855", "0.5423324", "0.5419199", "0.5412469", "0.5407067", "0.53979665", "0.5393385", "0.5391833", "0.5390706", "0.5389524", "0.5388609", "0.5385878", "0.5377511", "0.53768927", "0.53704935" ]
0.0
-1
Sanitize the data, returns null Variable passed to this function will always be a scalar
public function sanitize($value) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sanitize(&$data)\n\t{\n\t\treturn $data;\n\t}", "protected function sanitize() {}", "abstract public function sanitize();", "public function getSanitizeData($data){\n\t $santiziedData = $this->sanitizeString($data);\n\t return $santiziedData;\n }", "function sanitize($data){\r\n\t\t\t$data=stripslashes($data); // Remove all slashses\r\n\t\t\t$data=strip_tags($data); //Remove all tags\r\n\t\t\treturn $data;\r\n\t\t}", "public function sanitize() {\n }", "function cleanInput($data){ //sanitize data \n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitizeData($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\n\t\treturn $data;\n\t}", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitize($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function sanitize($data)\n {\n $data=trim($data);\n $data=mysql_real_escape_string($data);\n return $data;\n }", "public function ex_sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities(trim($data)));\n\n\t}", "function sanitizeData_hard($var)\n\t{\n\t\t$var = trim($var); // gets rid of white space\n\t\t$var = stripslashes($var); // no slashes protecting stuff\n\t\t$var = htmlentities($var); // no html :-(\n\t\t$var = strip_tags($var); // no tags\n\t\treturn $var; //returns clean data\n\t}", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitise_input($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function sanitize($value);", "public static function sanitize($data){\n\t\t\t$db = new Database;\n\t\t\tif (gettype($data) === 'array') {\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\t$data = trim($data);\t\t\t\t\n\t\t\t\t$data = stripcslashes($data);\n\t\t\t\t$data = mysqli_real_escape_string($db->link, $data);\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}", "function sanitizeInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n return $data;\n}", "function cleanData($data){\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function sanitize($data) {\n $data = htmlentities(get_magic_quotes_gpc() ? stripslashes($data) : $data, ENT_QUOTES, 'UTF-8');\n return $data;\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}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "public function CleanData($data){\n\t\t\t$data = trim($data);\n\t\t\t$data=htmlentities($data,ENT_QUOTES, 'UTF-8');\n\t\t\t$data = filter_var($data,FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\treturn $data;\n\t\t\t}", "function sanitize($data) {\n return htmlentities(strip_tags(mysql_real_escape_string($data)));\n }", "function sanitize_input($data) { \r\n $data = trim($data); \r\n $data = stripslashes($data); \r\n $data = htmlspecialchars($data); \r\n return $data; \r\n }", "function filter_any_data($data){\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}", "function sanitizeData_lite($var)\n\t{\n\t\t$var = trim($var); // gets rid of white space\n\t\t$var = stripslashes($var); // no slashes protecting stuff\n\t\treturn $var; //returns clean data\n\t}", "public function sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities($data));\n\n\t}", "public function sanitize()\n {\n $purifier = $this->_purifier;\n $this->_sanitized_data = array_map(\n function ($field) use ($purifier) {\n return $purifier->purify($field);\n },\n $this->_data\n );\n }", "function sanitize($data) \n{\n\treturn htmlentities(strip_tags(mysql_real_escape_string($data)));\n}", "function cleanInput($data) {\r\n\t\t\t$data = trim($data);\r\n\t\t\t$data = stripslashes($data);\r\n\t\t\t$data = htmlspecialchars($data);\r\n\t\t\treturn $data;\r\n\t\t}", "private static function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function clean_input($data){\r\n\t\t\t\t\t$data = trim($data);\r\n\t\t\t\t\t$data = stripslashes($data);\r\n\t\t\t\t\t$data = htmlspecialchars($data);\r\n\t\t\t\t\treturn $data;\r\n\t\t\t\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}", "function sanitize($data){\n$data=trim($data);\n$data=htmlspecialchars($data);\n$data=mysql_real_escape_string($data);\nreturn $data;\n}", "function cleanInput($data) {\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function sanitize_string_xss(string $data): string\n{\n return filter_var($data, FILTER_SANITIZE_STRING);\n}", "function clean_input($data) {\n $data = trim($data); // strips whitespace from beginning/end\n $data = stripslashes($data); // remove backslashes\n $data = htmlspecialchars($data); // replace special characters with HTML entities\n return $data;\n}", "function cleanInput($data) { \r\n return htmlspecialchars(stripslashes(trim($data)));\r\n }", "public function sanitize($data){\n\t\treturn $new_data = $this->mysql_prep($data);\n\t\t}", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "public function sanitize_value(){\n if(is_string($this->value)){\n $json_value = json_decode($this->value, true);\n if(json_last_error() == JSON_ERROR_NONE)\n $this->value = $json_value;\n }\n }", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "function SafeConvert($data){\n\t$data=trim($data);\n\t//convert special characters to html entities\n\t//most hacking inputs in XSS are HTML in nature, so converting them to special characters so that they are not harmful\n\t$data=htmlspecialchars($data);\n\t//sanitize before using any MySQL database queries\n\t//this will escape quotes in the input.\n\t$data = mysql_real_escape_string($data);\n\treturn $data;\n}", "public function getSanitizedData()\n {\n return $this->_sanitized_data;\n }", "function cleanInput($data)\n\t{\n\t\t$data = trim($data);\n\t\t$data = stripslashes($data);\n\t\t$data = htmlspecialchars($data);\n\t\treturn $data;\n\t}", "function sanitize($data)\n{\n$data = trim($data);\n \n// apply stripslashes if magic_quotes_gpc is enabled\nif(get_magic_quotes_gpc())\n{\n$data = stripslashes($data);\n}\n \n// a mySQL connection is required before using this function\n$data = mysql_real_escape_string($data);\n \nreturn $data;\n}", "function sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function unsanitizeData($str=null) {\n if ($str == null) { return false; }\n if (function_exists(\"htmlspecialchars_decode\")) {\n $str = htmlspecialchars_decode($str, ENT_QUOTES);\n }\n else {\n $str = $this->uncleanString($str);\n }\n if (strlen($str) == 0) { return false; }\n return $str;\n }", "function filter_mydata($data)\n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public function sanitizeData($str = null) {\n if ($str == null) { return false; }\n $str = stripcslashes($str);\n if (function_exists(\"htmlspecialchars\")) {\n $str = htmlspecialchars($str, ENT_QUOTES);\n }\n elseif (function_exists(\"htmlentities\")) {\n $str = htmlentities($str, ENT_QUOTES);\n }\n else {\n $str = $this->cleanString($str);\n }\n if (strlen($str) == 0) { return false; }\n return $str;\n }", "function sanitize($dataArray)\n\t{\n\t\t$this->data[\"username\"] = filter_var($dataArray[\"username\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"password\"] = filter_var($dataArray[\"password\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"description\"] = filter_var($dataArray[\"description\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"quote\"] = filter_var($dataArray[\"quote\"], FILTER_SANITIZE_STRING);\n\t\t\n\t\t/* if(isset($this->data[\"user_level\"]))\n\t\t{\n\t\t\t$this->data[\"user_level\"] = filter_var($dataArray[\"user_level\"], FILTER_SANITIZE_STRING);\n\t\t} */\n\t\treturn $dataArray;\n\t}", "function clean($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\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 }", "function sanitize($val){\n return htmlentities(stripslashes(trim($val)), ENT_QUOTES);\n}", "function cleanData($data) {\n $data = stripslashes($data);\n $data = trim($data);\n return $data;\n}", "private function sanitize($x = null) {\n if (!isset($x)) {\n return null;\n } elseif(is_string($x)) {\n return htmlspecialchars($x, ENT_QUOTES);\n } elseif(is_array($x)) {\n foreach ($x as $key => $v) {\n $x[$key] = $this->sanitize($v);\n }\n return $x;\n } else {\n return $x;\n }\n }", "function cleanInput($data) {\n\t\n\treturn htmlspecialchars(stripslashes(trim($data)));\n}", "function scrubInput($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "protected function sanitizeData(): array {\n $sanitizedData = [];\n foreach ($this->rawData as $data) {\n $sanitizedData[] = htmlentities($data);\n }\n return $sanitizedData;\n }", "private function sanitize($form_data) {\n $sanitized_data = filter_var_array($form_data, FILTER_SANITIZE_STRING);\n \n // Return the sanitized datas\n return $sanitized_data;\n }", "public function sanitize($value)\n {\n }", "function clean_input($data) \n{\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function filter($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "public static function sanitizeData($data)\n {\n if (!is_string($data)) {\n $data = serialize($data);\n }\n return $data;\n }", "function cleanInput($data) { \n return htmlspecialchars(stripslashes(trim($data)));\n}", "function validateData($data) {\r\n $resultData = htmlspecialchars(stripslashes(trim($data)));\r\n return $resultData;\r\n }", "function sanitize_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n}", "public function sanitize() {\n\n\t\t// load the tool that we want to use in the xss filtering process\n\t\t$this->loadTool();\n\n\t\tif (is_array($_GET) AND count($_GET) > 0) {\n\n\t\t\t$_GET = $this->clean_input_data($_GET);\n\t\t}\n\t\tif (is_array($_POST) AND count($_POST) > 0) {\n\n\t\t\t$_POST = $this->clean_input_data($_POST);\n\t\t}\n\t\tif (is_array($_COOKIE) AND count($_COOKIE) > 0) {\n\n\t\t\t$_COOKIE = $this->clean_input_data($_COOKIE);\n\t\t}\n\t\tif (is_array($_FILES) AND count($_FILES) > 0) {\n\n\t\t\t//$_FILES = $this->clean_input_data($_FILES, true);\n\t\t}\n\n\t}", "function sanitize ($data) {\n\t\treturn htmlentities (mysqli_real_escape_string ($GLOBALS['con'], $data),ENT_NOQUOTES,\"utf-8\");\n\t}", "function sanitize_validate_input($data){\n\t\t \t \t$data = filter_var($data, FILTER_SANITIZE_STRING);\n\t\t \t \t//$data = filter_var($data, FILTER_VALIDATE_EMAIL);\n\t\t \t \t$data = stripcslashes($data);\n\t\t \t \t$data = trim($data);\n\t\t \t \t$data = htmlspecialchars($data);\n\t\t \t \t\n\t\t \t \treturn $data; }", "public function sanitize( $input ) {\n }", "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}", "public function sanitize($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_STRING);\n\t}", "function validate($data)\n{\n global $db;\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function clean_input($data){\r\n\t$data = trim($data);\r\n\t$data = stripslashes($data);\r\n\t$data = htmlspecialchars($data);\r\n\treturn $data;\t\r\n}", "function validation($data)\n{\n\t$data = htmlspecialchars($data);\n\t$data = trim($data);\n\t$data = stripcslashes($data);\n\treturn $data;\n}", "function validate($data)\n {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "function validate($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function validation($data){\n //trims any white space from data\n $data = trim($data); \n //removes backslashes\n $data = stripcslashes($data); \n //converts special characters to normal \n $data = htmlspecialchars($data); \n //return the formatted data\n return $data; \n }", "function validate($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function validate($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return !empty($data) ? $data : false;\n}", "function clean_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return !empty($data) ? $data : false;\n}", "public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }", "function cleanInput($data)\n{\n    $data = trim($data);\n\n // gunakan stripslashes untuk elakkan  double escape if magic_quotes_gpc is enabledif(get_magic_quotes_gpc()){\n $data = stripslashes($data);}", "function santitise_input($data) {\n $data = trim($data);\n //Removing backslashes.\n $data = stripslashes($data);\n //Removing HTML special/control characters.\n $data = htmlspecialchars($data);\n return $data; \n }", "function check_input($data){\n if(isset($data)){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = strip_tags($data);\n $data = htmlentities($data);\n return $data;\n }\n}", "function validate($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function clean_data($value, $handle) {\r\n\r\n if (get_magic_quotes_gpc()) {\r\n $value = stripslashes($value);\r\n }\r\n\r\n if (!is_numeric($value)) {\r\n $value = \"'\" . mysql_real_escape_string($value, $handle) . \"'\";\r\n }\r\n return $value;\r\n}", "function sanitize($data){\r\n $conn = db ();\r\n return mysqli_real_escape_string($conn, $data);\r\n}", "public function clean($data,$type='string'){\n return $this->purify($data,$type);\n }", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}", "function cleanInputs($data) {\n\t$data = trim($data);\n\t$data = stripslashes($data);\n\t$data = htmlspecialchars($data);\n\treturn $data;\n}" ]
[ "0.7764956", "0.7647218", "0.7634417", "0.74439245", "0.74326736", "0.7327387", "0.73249644", "0.72504514", "0.72093195", "0.720651", "0.7204841", "0.71716315", "0.7165721", "0.71600187", "0.71600187", "0.7151033", "0.7133801", "0.7120931", "0.7107685", "0.7102903", "0.7074844", "0.70568216", "0.70568216", "0.70568216", "0.70369625", "0.70323855", "0.7001151", "0.6995462", "0.6988442", "0.6981919", "0.69807565", "0.69796646", "0.69793975", "0.6977829", "0.6967499", "0.69635105", "0.6958014", "0.6951791", "0.6949373", "0.6948766", "0.69261587", "0.6919358", "0.6919358", "0.6908164", "0.69018847", "0.68963087", "0.6894742", "0.68927526", "0.68859917", "0.6882967", "0.6882919", "0.6880993", "0.687337", "0.68730944", "0.6845969", "0.68223083", "0.68217766", "0.68172735", "0.68148726", "0.6806688", "0.6803572", "0.67988026", "0.67839754", "0.6771602", "0.67681205", "0.6758184", "0.6756685", "0.674387", "0.67416185", "0.67415273", "0.6736597", "0.67353624", "0.67244476", "0.6715411", "0.6708316", "0.67051625", "0.66974735", "0.6686702", "0.6685316", "0.66641605", "0.6663461", "0.66584426", "0.66584426", "0.66554457", "0.66514075", "0.6637165", "0.6621947", "0.6621947", "0.66194", "0.66194", "0.66182196", "0.66071665", "0.65969115", "0.65890056", "0.65871304", "0.65757936", "0.6568779", "0.6563184", "0.65598476", "0.65598476" ]
0.71344846
16
Default Constructor. Determines whether or not the mcrypt extension should be used. $mode should only, at present, be CRYPT_AES_MODE_ECB or CRYPT_AES_MODE_CBC. If not explictly set, CRYPT_AES_MODE_CBC will be used.
function Crypt_AES($mode = CRYPT_AES_MODE_CBC) { if ( !defined('CRYPT_AES_MODE') ) { switch (true) { case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()): define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT); break; default: define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL); } } switch ( CRYPT_AES_MODE ) { case CRYPT_AES_MODE_MCRYPT: switch ($mode) { case CRYPT_AES_MODE_ECB: $this->paddable = true; $this->mode = MCRYPT_MODE_ECB; break; case CRYPT_AES_MODE_CTR: // ctr doesn't have a constant associated with it even though it appears to be fairly widely // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to // include a compatibility layer. the layer has been implemented but, for now, is commented out. $this->mode = 'ctr'; //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR; break; case CRYPT_AES_MODE_CFB: $this->mode = 'ncfb'; break; case CRYPT_AES_MODE_OFB: $this->mode = MCRYPT_MODE_NOFB; break; case CRYPT_AES_MODE_CBC: default: $this->paddable = true; $this->mode = MCRYPT_MODE_CBC; } break; default: switch ($mode) { case CRYPT_AES_MODE_ECB: $this->paddable = true; $this->mode = CRYPT_RIJNDAEL_MODE_ECB; break; case CRYPT_AES_MODE_CTR: $this->mode = CRYPT_RIJNDAEL_MODE_CTR; break; case CRYPT_AES_MODE_CFB: $this->mode = CRYPT_RIJNDAEL_MODE_CFB; break; case CRYPT_AES_MODE_OFB: $this->mode = CRYPT_RIJNDAEL_MODE_OFB; break; case CRYPT_AES_MODE_CBC: default: $this->paddable = true; $this->mode = CRYPT_RIJNDAEL_MODE_CBC; } } if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) { parent::Crypt_Rijndael($this->mode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct( $mode = CRYPT_RC2_MODE_CBC ) {\n\t\tparent::Crypt_Base( $mode );\n\t}", "function setMode($mode)\n {\n $this->_mcryptMode = $mode;\n }", "private function _getMode()\n {\n if ($this->_mcryptMode == '') {\n $this->_mcryptMode = MCRYPT_MODE_CBC;\n }\n return $this->_mcryptMode;\n }", "function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n }", "function _mcryptSetup()\n {\n if (!$this->changed) {\n return;\n }\n\n if (!$this->explicit_key_length) {\n // this just copied from Crypt_Rijndael::_setup()\n $length = strlen($this->key) >> 2;\n if ($length > 8) {\n $length = 8;\n } else if ($length < 4) {\n $length = 4;\n }\n $this->Nk = $length;\n $this->key_size = $length << 2;\n }\n\n switch ($this->Nk) {\n case 4: // 128\n $this->key_size = 16;\n break;\n case 5: // 160\n case 6: // 192\n $this->key_size = 24;\n break;\n case 7: // 224\n case 8: // 256\n $this->key_size = 32;\n }\n\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));\n\n if (!isset($this->enmcrypt)) {\n $mode = $this->mode;\n //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode;\n\n $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n\n if ($mode == 'ncfb') {\n $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');\n }\n\n } // else should mcrypt_generic_deinit be called?\n\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n $this->changed = false;\n }", "public function __construct($mode) {\n $this->mode = $mode;\n }", "public function __construct($mode = '')\n {\n $settings = variable_get('carsolize', array('mode' => 'test'));\n\n if ($settings) {\n $mode = empty($mode) ? $settings['mode'] : $mode;\n\n $config = isset($settings[$mode]) ? (object)$settings[$mode] : (object)array();\n\n if ($config) {\n if ($config->request_url && $config->login && $config->password) {\n $this->_request_url = $config->request_url;\n $this->_login = $config->login;\n $this->_password = $config->password;\n\n $this->_setEnable(TRUE);\n }\n }\n }\n }", "public function __construct()\n {\n $this->_mcryptExists = (!function_exists('mcrypt_encrypt')) ? false : true;\n\n if ($this->_mcryptExists === false) {\n throw new FlyException(Fly::t('fly', 'The Encrypt library requires the Mcrypt extension.'));\n }\n\n Fly::log('debug', \"Encrypt Class Initialized\");\n }", "public function __construct($key, $mode)\n\t{\n\t\t$this->key_setup($key);\n\t\t$this->mode = $mode;\n\t}", "private function __construct()\n\t{\t\t\n\t\t// Load the Cryptography class\n\t\trequire_once(__DIR__.'/../vendor/crypt/AES.php');\n\t\t\n\t\t// Create a new AES cryptography object\n\t\t$this->aes = new Crypt_AES(); \n\t\t\n\t\t// Set the encryption key\n\t\t$this->setKey($this->cryptKey);\n\t}", "public function setBcryptMode()\n {\n $this->setMode(self::MODE_BCRYPT);\n }", "public function __construct($mode)\n {\n $mode = substr($mode, 0, 3);\n $rest = substr($mode, 1);\n\n $this->base = substr($mode, 0, 1);\n $this->plus = (strpos($rest, '+') !== false);\n $this->flag = trim($rest, '+');\n\n if ($this->flag == '') {\n $this->flag = 'b';\n }\n }", "public function __construct($mode, $config_data)\n\t{\n\t\tif (is_null($mode))\n\t\t{\n\t\t\t$mode = MODE_DEFAULT;\n\t\t}\n\n\t\tparent::__construct($mode, $config_data);\n\t}", "public function __construct($mode = 'session') {\n $accepted_modes = array('session');\n\n if (in_array($mode, $accepted_modes)) {\n $this->mode = $mode;\n } else {\n $this->mode = 'session';\n } //else\n\n $this->valid = true;\n }", "public function __construct($params){\r\n if(!extension_loaded('mcrypt')){\r\n throw new Exception('mcrypt extension is required for this script');\r\n return false;\r\n }\r\n # make sure key is supplied\r\n if(!array_key_exists('key', $params) || !isset($params['key']) || (isset($params['key']) && !$params['key'])){\r\n $error = 'key is a required parameter. see Crypt::listOptions()';\r\n throw new Exception($error);\r\n return false;\r\n }\r\n # set params\r\n $this->raw_key = $params['key'];\r\n $this->algorithms = mcrypt_list_algorithms();\r\n $this->modes = mcrypt_list_modes();\r\n # check availables\r\n if(!count($this->algorithms)){\r\n throw new Exception('there are no available algorithms for mcrypt');\r\n return false;\r\n }\r\n if(!count($this->modes)){\r\n throw new Exception('there are no available modes for mcrypt');\r\n return false;\r\n }\r\n # algorithm\r\n $this->algorithm = $this->algorithms[0]; \r\n if(array_key_exists('algorithm', $params) && in_array($params['algorithm'], $this->algorithms)){\r\n $this->algorithm = $params['algorithm'];\r\n }\r\n # mode\r\n $this->mode = $this->modes[0];\r\n if(array_key_exists('mode', $params) && in_array($params['mode'], $this->modes)){\r\n $this->mode = $params['mode'];\r\n }\r\n # base 64 encoding\r\n $this->base64 = true;\r\n if(array_key_exists('base64', $params) && !$params['base64']){\r\n $this->base64 = false;\r\n }\r\n \r\n return $this->start();\r\n }", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "public function _setupMcrypt() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\tparent::_setupMcrypt();\n\t}", "function disableContinuousBuffer()\n {\n parent::disableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n }", "public function __construct(\n CipherEnum $cipher,\n ModeEnum $mode,\n PaddingInterface $padding,\n $key,\n $tagLength = self::DEFAULT_TAG_LENGTH\n );", "public function __construct(array $attr = array())\n {\n if (!function_exists('mcrypt_encrypt')) {\n throw new CreditCardFreezer_Exception(\n 'php-mcrypt library not installed. This library is required by '\n . 'the CreditCardFreezer class.'\n );\n }\n\n $this->_attr = $attr;\n }", "protected static function createEncryptionContext($encryptionMethod = null, $encryptionMode = null)\n {\n if (!$encryptionMethod) {\n $encryptionMethod = self::$encryptionMethod;\n }\n if (!$encryptionMode) {\n $encryptionMode = self::$encryptionMode;\n }\n\n $td = mcrypt_module_open($encryptionMethod, '', $encryptionMode, '');\n\n return $td;\n }", "public function __construct($mode, $config_data)\n\t{\n\t\t$this->mode = $mode;\n\t\t$this->config_data = $config_data;\n\t\t\n\t\t$this->preConfigure();\n\t}", "public function base64(string $mode = Config\\Base64::ENCODE) : self\n {\n Config\\Base64::validateOption($mode);\n\n return new static($mode($this->string));\n }", "private function _getCipher()\n {\n if ($this->_mcryptCipher == '') {\n $this->_mcryptCipher = MCRYPT_RIJNDAEL_256;\n }\n return $this->_mcryptCipher;\n }", "function __construct()\n {\n $this->configFile = dirname(__FILE__) . '/../openssl.cnf';\n\n if (!defined('CRYPT_RSA_MODE')) {\n switch (true) {\n // Math/BigInteger's openssl requirements are a little less stringent than Crypt/RSA's. in particular,\n // Math/BigInteger doesn't require an openssl.cfg file whereas Crypt/RSA does. so if Math/BigInteger\n // can't use OpenSSL it can be pretty trivially assumed, then, that Crypt/RSA can't either.\n case defined('MATH_BIGINTEGER_OPENSSL_DISABLE'):\n define('CRYPT_RSA_MODE', self::MODE_INTERNAL);\n break;\n case function_exists('phpinfo') && extension_loaded('openssl') && file_exists($this->configFile):\n // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work\n $versions = array();\n\n // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)\n if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {\n ob_start();\n @phpinfo();\n $content = ob_get_contents();\n ob_end_clean();\n\n preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);\n\n if (!empty($matches[1])) {\n for ($i = 0; $i < count($matches[1]); $i++) {\n $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));\n\n // Remove letter part in OpenSSL version\n if (!preg_match('/(\\d+\\.\\d+\\.\\d+)/i', $fullVersion, $m)) {\n $versions[$matches[1][$i]] = $fullVersion;\n } else {\n $versions[$matches[1][$i]] = $m[0];\n }\n }\n }\n }\n\n // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+\n switch (true) {\n case !isset($versions['Header']):\n case !isset($versions['Library']):\n case $versions['Header'] == $versions['Library']:\n case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0:\n define('CRYPT_RSA_MODE', self::MODE_OPENSSL);\n break;\n default:\n define('CRYPT_RSA_MODE', self::MODE_INTERNAL);\n define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);\n }\n break;\n default:\n define('CRYPT_RSA_MODE', self::MODE_INTERNAL);\n }\n }\n\n $this->zero = new BigInteger();\n $this->one = new BigInteger(1);\n\n $this->hash = new Hash('sha1');\n $this->hLen = $this->hash->getLength();\n $this->hashName = 'sha1';\n $this->mgfHash = new Hash('sha1');\n $this->mgfHLen = $this->mgfHash->getLength();\n }", "function setCipher($cipher)\n {\n $this->_mcryptCipher = $cipher;\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->hasOpenSSLSupport();\n\t\t$this->hasHashSupport();\n\t\t$this->hasMcryptSupport();\n\t}", "public function withSSL(int $mode = self::SSL_AUTO): self\n {\n $this->ssl = $mode;\n\n return $this;\n }", "public function mode($mode = null)\n {\n if (func_num_args() === 0) {\n return $this->_mode;\n }\n $this->_mode = $mode;\n return $this;\n }", "public static function mode($mode) {\n static::$mode = $mode;\n }", "public function mode($mode = NULL)\n\t{\n\t\tif (!is_null($mode))\n\t\t{\n\t\t\tunset(OLPBlackbox_Config::getInstance()->blackbox_mode);\n\t\t\tOLPBlackbox_Config::getInstance()->blackbox_mode = $mode;\n\t\t}\n\n\t\treturn OLPBlackbox_Config::getInstance()->blackbox_mode;\n\t}", "function enableContinuousBuffer()\n {\n parent::enableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n $this->enbuffer['enmcrypt_init'] = true;\n $this->debuffer['demcrypt_init'] = true;\n }\n }", "public function __construct(array $options = null) {\n if (isset($options[self::OPTION_MODE])) {\n $this->mode = $options[self::OPTION_MODE];\n\n if ($this->mode != self::MODE_NORMAL && $this->mode != self::MODE_FIRST && $this->mode != self::MODE_WORD) {\n throw new InvalidArgumentException('Invalid mode provided: try ' . self::MODE_NORMAL . ', ' . self::MODE_FIRST . ' or ' . self::MODE_WORD);\n }\n } else {\n $this->mode = self::MODE_NORMAL;\n }\n }", "public function __construct(?string $reservationNumber = null, ?string $mode = null)\n {\n $this\n ->setReservationNumber($reservationNumber)\n ->setMode($mode);\n }", "final public function setMode($mode) {\n\t\tif(($result = \\Glue\\Helper\\Validator::batch(array(\n\t\t\t'$mode' => array($mode, 'isString', array('matchesPattern', array('^serialize|raw$', 'i')))\n\t\t))) !== true) {\n\t\t\tthrow new \\InvalidArgumentException(\\Glue\\Helper\\General::replace(array('method' => __METHOD__, 'parameter' => $result), GLUE_EXCEPTION_PARAMETER));\n\t\t}\n\n\n\t\ttry {\n\t\t\t$this->mode = strtolower($mode);\n\n\t\t\tunset($mode, $result);\n\n\t\t\treturn $this;\n\t\t} catch(\\Exception $exception) {\n\t\t\tthrow new \\RuntimeException(\\Glue\\Helper\\General::replace(array('class' => __CLASS__), GLUE_EXCEPTION_CLASS_INITIALIZE), NULL, $exception);\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $this->authMfaMode = $oConfig->item('authTwoFactorMode');\n $aConfig = $oConfig->item('authTwoFactor');\n $this->authMfaConfig = $aConfig[$this->authMfaMode];\n }", "abstract public function mode($mode = NULL);", "protected function setUp()\n\t{\n\t\tif (!extension_loaded('mcrypt')) $this->markTestSkipped(\"mcrypt extension is not available\");\n\t\t\n\t\tparent::setUp();\n\t\t$this->Crypt_MCrypt = new Q\\Crypt_MCrypt(array('method'=>'blowfish', 'secret'=>'s3cret'));\n\t}", "public function __construct($key, $mode = self::MODE_CREATE_READ_WRITE,\n\t\t$memorySize = self::MEMORY_SIZE, $permissions = self::PERMISSIONS\n\t) {\n\t\tif (!function_exists('shmop_open')) {\n\t\t\tthrow new AzaException('You need php compiled with --enable-shmop option to work with shared memory', 1);\n\t\t}\n\t\tif (!is_numeric($key)) {\n\t\t\t$key = sprintf('%u', crc32($key));\n\t\t}\n\t\t$this->key = (int)$key;\n\t\t$this->mode = $mode;\n\t\t$this->memorySize = $memorySize;\n\t\t$this->permissions = $permissions;\n\t}", "function _exp_mode($mode=NULL){\n $mode = 'exp_' . nz($mode,$this->exp_mode_default);\n return method_exists($this,$mode)?$mode:FALSE;\n }", "public function __construct()\n {\n parent::__construct(); \n\n // $this->overrideTimeoutAndMemoryLimit(self::TIMEOUT_OVERRIDE, self::MEMORY_OVERRIDE);\n\n if (!extension_loaded('bcmath')) {\n // Placeholder for any extensions required for this problem's code\n // die('BCMath extension required. See http://www.php.net/manual/en/book.bc.php .');\n }\n }", "public function setMode(string $mode): self\n {\n //dd($mode);\n if ($this->isValidMode($mode)) {\n $this->mode = $mode;\n } else {\n throw new \\Exception('Can\\'t set \"' . $mode . '\" as current mode, due to \"' . $mode . '\" is not a ' . static::class . ' valid mode. You must implement \"'.Str::camel($mode).static::MODES_METHODS_NAME_SUFFIX.'()\" at ' . static::class .' in order to use that mode');\n }\n return $this;\n }", "public function __construct($options = array())\n\t{\n\t\tif (isset($options['minPassSize']))\n\t\t\t$this->minPassSize = $options['minPassSize'];\n\t\telse\n\t\t\t$this->minPassSize = 8;\n\t\t\t\n\t\t/* set maximum password size */\n\t\tif (isset($options['maxPassSize']))\n\t\t\t$this->maxPassSize = $options['maxPassSize'];\n\t\telse\n\t\t\t$this->maxPassSize = 15;\n\t\t\n\t\t/* set minimum char set required in password */\n\t\tif (isset($options['minCharSet']))\n\t\t\t$this->minCharSet = $options['minCharSet'];\n\t\telse\n\t\t\t$this->minCharSet = 2;\n\t\t\t\n\t\t/* set allowed symbols */\n\t\t$this->allowedSymbols = array ('!','@','#','$','%','_','&',',');\n\t\tif (isset($options['allowedSymbols']))\n\t\t{\n\t\t\tif (is_array($options['allowedSymbols']))\n\t\t\t\t$this->allowedSymbols = $options['allowedSymbols'];\n\t\t}\n\t\t\n\t\t/* set minPassSize = maxPassSize if min is > max */\n\t\tif ($this->minPassSize > $this->maxPassSize)\n\t\t\t$this->minPassSize = $this->maxPassSize;\n\t}", "public static function setMode($mode)\n\t{\n\t\tif($mode != self::MODE_DEVELOPMENT && $mode != self::MODE_PRODUCTION) {\n\t\t\tthrow new BakedCarrotException('Invalid setMode parameter');\n\t\t}\n\t\t\n\t\tself::$app_mode = $mode;\n\t}", "public function __construct(array $key_config, ?string $cipher = null)\n {\n if (!isset($key_config['key']))\n {\n throw new Exception('No encryption key is defined in the encryption configuration');\n }\n\n $this->_key = $key_config['key'];\n\n if (isset($key_config['cipher']))\n {\n $this->_cipher = $key_config['cipher'];\n }\n elseif ($cipher !== null)\n {\n $this->_cipher = $cipher;\n }\n }", "public static function isMcryptAvailable()\n {\n return extension_loaded('mcrypt');\n }", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "function setMode($mode) {\n\t\t$this->_mode = $mode;\n\t}", "protected function getAlgorithm(): int\n {\n return PASSWORD_BCRYPT;\n }", "public function preferredEncryption()\n\t{\n\t\t$aes = new Encrypt();\n\t\t$adapter = $aes->getAdapter();\n\n\t\tif (!$adapter->isSupported())\n\t\t{\n\t\t\treturn 'CTR128';\n\t\t}\n\n\t\treturn 'AES128';\n\t}", "public function getDefaultCrypt(): Encrypter|null;", "public function __construct($testMode = false) {\n\t\tif($testMode) {\n\t\t\tswitch($testMode) {\n\t\t\t\tcase self::TEST_THERMO_PRINTER:\n\t\t\t\t\t$this->setUser(self::DHL_BUSINESS_TEST_USER_THERMO);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::TEST_NORMAL:\n\t\t\t\tcase true:\n\t\t\t\tdefault:\n\t\t\t\t\t$this->setUser(self::DHL_BUSINESS_TEST_USER);\n\t\t\t}\n\n\t\t\t$this->setSignature(self::DHL_BUSINESS_TEST_USER_PASSWORD);\n\t\t\t$this->setEkp(self::DHL_BUSINESS_TEST_EKP);\n\t\t}\n\t}", "public function testNullPadding()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be installed to compare the output of the shim to the original mcrypt');\n }\n\n $key = str_repeat('z', 16);\n $iv = str_repeat('z', 16);\n\n // a plaintext / ciphertext of length 1 is of an insufficient length for cbc mode\n $plaintext = $ciphertext = 'a';\n\n $mcrypt = bin2hex(mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n\n $mcrypt = bin2hex(mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n }", "public function setMode($mode)\n {\n $this->options['mode'] = $mode ?? $this->options['mode'];\n return $this;\n }", "function setMode($mode) {\r\n\t\tif ( ($mode == FTP_ASCII) || ($mode == FTP_BINARY) ) {\r\n\t\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TRANSFER_MODE => $mode));\r\n\t\t\treturn $this;\r\n\t\t} else {\r\n\t\t\tthrow new ftpException('FTP-Mode has either to be FTP_ASCII or FTP_BINARY');\r\n\t\t}\r\n\t}", "public function __construct()\n {\n $this->method = 'des-ecb';\n\n // WinVNC uses a fixed key with reversed bits to encrypt/decrypt password in registry\n // Original Key: \\x17\\x52\\x6B\\x06\\x23\\x4E\\x58\\x07\n // Reversed Bits: \\xE8\\x4A\\xD6\\x60\\xC4\\x72\\x1A\\xE0\n $this->key = hex2bin('e84ad660c4721ae0');\n\n // We are sending raw data with zero padding to OpenSSL\n $this->options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING;\n\n // des-ecb seems to use 8 character block size\n $this->block_size = 8;\n }", "public function mode($encoding=null){\n $default = config('rsa.default.mode');\n if(empty($encoding) || !array_key_exists($encoding,self::MODES)){\n $encoding = $default;\n }\n $this->handler->setEncryptionMode(self::MODES[$encoding]);\n return $this;\n }", "public function getEncryptionAlgo() {\n\treturn $this->cipher;\n }", "public function setMode($mode = 'create')\n {\n $this->mode = $mode;\n }", "private function setAlgoBlockSize() {\n\t$this->algoBlockSize = mcrypt_module_get_algo_block_size($this->cipher);\n }", "public function setMode($mode) {\n $this->mode = $mode;\n }", "public function getAesAlgorithm()\n {\n return $this->aes_algorithm;\n }", "function init()\n {\n return $this->_crypt->init();\n }", "public function md5(bool $mode = Config\\Md5::DEFAULT): self\n {\n Config\\Md5::validateOption($mode);\n\n return new static(hash('md5', $this->string, $mode), $this->encoding);\n }", "static function setEncryptionAlgorithm($algo)\n {\n self::$defaultEncryptionAlgorithm = $algo;\n }", "public function use_encryption(): bool\n {\n return FALSE;\n }", "public function setCompression($mode) { \n switch($mode) {\n case \"gzip\":\n $this->compression = \"gz\";\n break;\n case \"bzip2\":\n $this->compression = \"bz2\";\n break;\n case \"none\":\n $this->compression = null;\n break;\n default:\n $this->log(\"Ignoring unknown compression mode: \".$mode, Project::MSG_WARN);\n $this->compression = null;\n }\n }", "function __construct()\n {\n parent::__construct();\n \n $this->load->helper('safety');\n $this->load->library('encrypt');\n }", "public function __construct() {\n Clanpress_Mode::init();\n }", "public function setMode($mode = null, $ignoreIfRenderModeNotAvailable = false)\n {\n $this->_mode = (null === $mode || '' === $mode ? null : $mode);\n $this->_ignoreIfRenderModeNotAvailable = $ignoreIfRenderModeNotAvailable;\n\n return $this;\n }", "public function __construct()\n {\n if (!isset(self::$_defaultCypher)) {\n //detect what cypher to use by default\n\n //TODO: Add more cypher types\n self::$_defaultCypher = self::CYPHER_BASIC;\n }\n\n if (!isset(self::$_siteKey)) {\n $db = DataAccess::getInstance();\n //NOTE: license_verify: Nothing to do with license or verify,\n //this is just to make it slightly harder for someone to\n //figure out the key, by naming it something that doesn't\n //sound like a key.\n $key = base64_decode($db->get_site_setting('license_verify'));\n if ($key === false || strlen($key) < 100) {\n //need to generate a random key, between 100 and 200 chars long\n $key = self::generateRandomKey(100, 180);\n $db->set_site_setting('license_verify', base64_encode($key));\n }\n self::$_siteKey = $key;\n }\n }", "public function __construct(\r\n \\CryptLib\\Cipher\\Block\\Cipher $cipher,\r\n $initv,\r\n array $options = array()\r\n ) {\r\n parent::__construct($cipher, $initv, $options);\r\n $this->bigMath = BigMath::createFromServerConfiguration();\r\n }", "public function setMode($mode)\n {\n $this->mode = $mode;\n }", "function __construct($o = null, $methodsOnlyMode = true) {\n\t\t$this->o = $o ?: new stdClass();\n\t\t$this->methodsOnlyMode = $methodsOnlyMode;\n\t}", "public static function mode($mode)\n {\n static::context()->mode($mode);\n }", "public function mode(string $mode = null)\n {\n if (is_string($mode)) {\n // only allow this if this is a new session, otherwise the change\n // might not be applied correctly to the current request\n if ($this->token() !== null) {\n throw new InvalidArgumentException([\n 'data' => ['method' => 'Session::mode', 'argument' => '$mode'],\n 'translate' => false\n ]);\n }\n\n $this->mode = $mode;\n }\n\n return $this->mode;\n }", "function __construct()\n {\n parent::__construct();\n // load encrypt\n $this->load->library('encrypt');\n $this->db = $this->load->database('default', true);\n }", "public function testAllCipherMethods()\n {\n if (!in_array($this->environmentVersion, $this->excludedEnvironments)) {\n $supportedCiphers = $this->weakCipher->getSupportedCiphers();\n foreach ($supportedCiphers as $supportedCipher) {\n $cipher = new Cipher($supportedCipher);\n $this->encryption->setCipher($cipher);\n $encrypted = $this->encryption->encrypt(self::PASSWORD, self::SALT, self::USERNAME);\n $decrypted = $this->encryption->decrypt($encrypted, self::SALT, self::USERNAME);\n $this->assertSame(self::PASSWORD, $decrypted);\n }\n }\n }", "protected function __construct() {\r\n\r\n\t\tself::$_bUseCache = (Kwgl_Config::get(array('mode', 'cache', 'acl')) == 1);\r\n\r\n\t\t$this->_initRoles();\r\n\t\t$this->_initResources();\r\n\t\t$this->_initPermissions();\r\n\t}", "function __construct($queryID,$mode=false)\n\t{\n\t\tif ($mode === false) {\n\t\t\tglobal $ADODB_FETCH_MODE;\n\t\t\t$mode = $ADODB_FETCH_MODE;\n\t\t}\n\t\tswitch ($mode)\n\t\t{\n\t\tcase ADODB_FETCH_NUM:\n\t\t\t$this->fetchMode = LDAP_NUM;\n\t\t\tbreak;\n\t\tcase ADODB_FETCH_ASSOC:\n\t\t\t$this->fetchMode = LDAP_ASSOC;\n\t\t\tbreak;\n\t\tcase ADODB_FETCH_DEFAULT:\n\t\tcase ADODB_FETCH_BOTH:\n\t\tdefault:\n\t\t\t$this->fetchMode = LDAP_BOTH;\n\t\t\tbreak;\n\t\t}\n\n\t\tparent::__construct($queryID);\n\t}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->defaultMode = func_get_arg(0);\n $this->items = func_get_arg(1);\n }\n }", "public function setMode($mode)\n {\n if (in_array($mode, $this->modeList)) {\n $this->mode = $mode;\n }\n\n return $this;\n }", "public function php_mode()\n\t{\n\t\t$this->phpMode = true;\n\t}", "private function setCrypto()\n {\n $this->cryptoType = STREAM_CRYPTO_METHOD_TLS_CLIENT;\n //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT\n //so add them back in manually if we can\n if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {\n $this->cryptoType |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;\n $this->cryptoType |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;\n }\n }", "public function setMode(string $mode)\n {\n $this->mode = $mode;\n return $this;\n }", "public function __construct($strictMode = true)\n {\n $this->__strictMode = $strictMode;\n }", "public function __construct($compress = true) {\n $this->encrypt = new encrypt($compress);\n }", "public function initAvailableModes(string $mode_methods_name_suffix): self\n {\n if (!isset($this->available_modes)) {\n $this->setAvailableModes($this->getModesByMethodsName($mode_methods_name_suffix));\n }\n return $this;\n }", "public function setMode($mode)\n {\n $this->mode = $mode;\n return $this;\n }", "private function setMode($mode)\n {\n $this->mode = $mode;\n }", "public function sha256(bool $mode = Config\\Sha256::DEFAULT): self\n {\n Config\\Sha256::validateOption($mode);\n\n return new static(hash('sha256', $this->string, $mode), $this->encoding);\n }", "public function __construct() {\n\n\t\tif (version_compare(PHP_VERSION, $this->php_required, '<' )) {\n\t\t\tadd_action('all_admin_notices', array($this, 'admin_notice_insufficient_php'));\n\t\t\t$abort = true;\n\t\t}\n\n\t\tif (!function_exists('mcrypt_get_iv_size') && !function_exists('openssl_cipher_iv_length')) {\n\t\t\tadd_action('all_admin_notices', array($this, 'admin_notice_missing_mcrypt_and_openssl'));\n\t\t\t$abort = true;\n\t\t}\n\n\t\tif (!empty($abort)) return;\n\n\t\tif (file_exists(SIMBA_TFA_PLUGIN_DIR.'/premium.php')) include_once(SIMBA_TFA_PLUGIN_DIR.'/premium.php');\n\n\t\tadd_action('wp_ajax_nopriv_simbatfa-init-otp', array($this, 'tfaInitLogin'));\n\t\tadd_action('wp_ajax_simbatfa-init-otp', array($this, 'tfaInitLogin'));\n\n\t\tadd_action('wp_ajax_simbatfa_shared_ajax', array($this, 'shared_ajax'));\n\n\t\tadd_action('woocommerce_before_customer_login_form', array($this, 'woocommerce_before_customer_login_form'));\n\t\t// The login form on the checkout doesn't call the woocommerce_before_customer_login_form action\n\t\tadd_action('woocommerce_before_checkout_form', array($this, 'woocommerce_before_customer_login_form'));\n\n\t\tadd_action('affwp_login_fields_before', array($this, 'affwp_login_fields_before'));\n\t\tif (!defined('TWO_FACTOR_DISABLE') || !TWO_FACTOR_DISABLE) {\n\t\t\tadd_action('affwp_process_login_form', array($this, 'affwp_process_login_form'));\n\t\t}\n\t\t\n\t\tadd_filter('tml_display', array($this, 'tml_display'));\n\t\t\n\t\tif (is_admin()) {\n\t\t\t//Save settings\n\t\t\tadd_action('admin_init', array($this, 'check_possible_reset'));\n\t\t\t\n\t\t\t//Add to Settings menu on sites\n\t\t\tadd_action('admin_menu', array($this, 'menu_entry_for_admin'));\n\n\t\t\t//Add settings link in plugin list\n\t\t\t$plugin = plugin_basename(__FILE__); \n\t\t\tadd_filter(\"plugin_action_links_\".$plugin, array($this, 'addPluginSettingsLink' ));\n\t\t\tadd_filter('network_admin_plugin_action_links_'.$plugin, array($this, 'addPluginSettingsLink' ));\n\n\t\t\t// Entry that everybody gets\n\t\t\tadd_action('network_admin_menu', array($this, 'admin_menu'));\n\t\t\tadd_action('admin_menu', array($this, 'admin_menu'));\n\n\t\t} else {\n\t\t\tadd_action('init', array($this, 'check_possible_reset'));\n\t\t}\n\n\t\tadd_action('plugins_loaded', array($this, 'plugins_loaded'));\n\t\tadd_action('init', array($this, 'init'));\n\n\t\t//Show off sync message for hotp\n\t\tadd_action('admin_notices', array($this, 'tfaShowHOTPOffSyncMessage'));\n\t\tadd_action('login_enqueue_scripts', array($this, 'login_enqueue_scripts'));\n\n\t\tif (!defined('TWO_FACTOR_DISABLE') || !TWO_FACTOR_DISABLE) {\n\t\t\tadd_filter('authenticate', array($this, 'tfaVerifyCodeAndUser'), 99999999999, 3);\n\t\t}\n\n\t\tif (file_exists(SIMBA_TFA_PLUGIN_DIR.'/updater.php')) include_once(SIMBA_TFA_PLUGIN_DIR.'/updater.php');\n\n\t\tif (defined('DOING_AJAX') && DOING_AJAX && defined('WP_ADMIN') && WP_ADMIN && !empty($_REQUEST['action']) && 'simbatfa-init-otp' == $_REQUEST['action']) {\n\t\t\t// Try to prevent PHP notices breaking the AJAX conversation\n\t\t\t$this->output_buffering = true;\n\t\t\t$this->logged = array();\n\t\t\tset_error_handler(array($this, 'get_php_errors'), E_ALL & ~E_STRICT);\n\t\t\tob_start();\n\t\t}\n\n\t}", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }", "private final function CheckMcrypt()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mcrypt_module_open\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mcrypt_module_open(). Mcrypt extension not installed?\", E_ERROR);\r\n\t\t}", "private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}", "public static function getCrypt($options = array())\n\t{\n\t\t$source = strtolower(JArrayHelper::getValue($options, 'source', 'jconfig', 'string'));\n\n\t\tif ($source === 'jconfig')\n\t\t{\n\t\t\t/*\n\t\t\t * If JConfig has been included then lets check whether the keys\n\t\t\t * have been imported and if not then use the secret value for now.\n\t\t\t */\n\t\t\tif (class_exists('JConfig'))\n\t\t\t{\n\t\t\t\t$config = new JConfig;\n\n\t\t\t\tif (!isset($options['key']))\n\t\t\t\t{\n\t\t\t\t\t$options['key'] = $config->secret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($source === 'file')\n\t\t{\n\t\t\t$file = JArrayHelper::getValue($options, 'file', '', 'string');\n\n\t\t\tif (file_exists($file))\n\t\t\t{\n\t\t\t\t$options['key'] = file_get_contents($file);\n\t\t\t}\n\t\t}\n\n\t\t$crypt = new JCrypt;\n\n\t\t// Create some default options\n\t\t$type = JArrayHelper::getValue($options, 'type', 'simple', 'string');\n\t\t$key = JArrayHelper::getValue($options, 'key', 'DEFAULTKEY', 'string');\n\n\t\t$crypt->setKey(\n\t\t\tnew JCryptKey(\n\t\t\t\t$type,\n\t\t\t\t$key,\n\t\t\t\t$key\n\t\t\t)\n\t\t);\n\n\t\treturn $crypt;\n\t}", "function __construct($key, $base64 = true) {\n\t\t\t\n\t\t\tglobal $cc_encryption_hash;\n\t\t\t\n\t\t\t// Toggle base64 usage on / off\n\t\t\t$this->base64 = $base64;\n\t\t\t\n\t\t\t// Instead of using the key directly we compress it using a hash function\n\t\t\t$this->hash_key = $this->_hash($key);\n\t\t\t\n\t\t\t// Remember length of hashvalues for later use\n\t\t\t$this->hash_length = strlen($this->hash_key);\n\t\t}", "function __construct()\n {\n define('FILE_READ_MODE', 0644);\n define('FILE_WRITE_MODE', 0666);\n define('DIR_READ_MODE', 0755);\n define('DIR_WRITE_MODE', 0777);\n }", "public function testEncrypt_des()\n\t{\n\t $this->Crypt_MCrypt->method = 'des';\n\t\t$this->assertEquals(mcrypt_encrypt('des', 's3cret', \"a test string\", MCRYPT_MODE_ECB), $this->Crypt_MCrypt->encrypt(\"a test string\"));\n\t}", "function _init()\n {\n $defaults = new Crypt_Blowfish_DefaultKey();\n $this->_P = $defaults->P;\n $this->_S = $defaults->S;\n }" ]
[ "0.70373356", "0.6823428", "0.63455945", "0.6301764", "0.61194754", "0.60630774", "0.6005595", "0.5989494", "0.59487134", "0.5876872", "0.578087", "0.56912386", "0.5678237", "0.56302", "0.56217587", "0.55871665", "0.55272985", "0.54762316", "0.5471484", "0.54683816", "0.54546857", "0.5393964", "0.52992", "0.5234611", "0.51512843", "0.51192814", "0.507303", "0.5053779", "0.5038712", "0.50102633", "0.50050235", "0.49858713", "0.49858436", "0.4984883", "0.49726593", "0.49622253", "0.4945095", "0.49251902", "0.49221674", "0.49135908", "0.48733237", "0.48692292", "0.48508677", "0.479171", "0.47901496", "0.4777132", "0.47607183", "0.47607183", "0.47348216", "0.4732498", "0.47268477", "0.47165683", "0.47156978", "0.4707897", "0.4702599", "0.47020534", "0.46981075", "0.4681819", "0.46795246", "0.46739876", "0.46615595", "0.46449775", "0.46320683", "0.46269858", "0.46242264", "0.46222165", "0.4610727", "0.46018872", "0.45997483", "0.45760846", "0.4575184", "0.45604986", "0.4560055", "0.4559638", "0.4556138", "0.45549676", "0.4552189", "0.4546348", "0.45441505", "0.45385456", "0.45379874", "0.453499", "0.45347285", "0.453426", "0.45332173", "0.45300865", "0.4528515", "0.45153564", "0.45117402", "0.44999737", "0.44794726", "0.4475455", "0.446298", "0.44607663", "0.4457946", "0.4457758", "0.4456811", "0.44561744", "0.44525617", "0.44499758" ]
0.7510137
0
Extended Crypt_Rijndael::_setup() Optimizing the key schedule arrays ($w, $dw) for _encryptBlock() and _decryptBlock() after Crypt_Rijndael::_setup()
function _setup() { if (!$this->changed) { return; } $this->w = $this->dw = array(); parent::_setup(); $this->dw = array_reverse($this->dw); $w = array_pop($this->w); $dw = array_pop($this->dw); foreach ($this->w as $r => $wr) { foreach ($wr as $c => $wc) { $w[] = $wc; $dw[] = $this->dw[$r][$c]; } } $this->w = $w; $this->dw = $dw; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _setup()\r\n {\r\n // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.\r\n // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse\r\n static $rcon = array(0,\r\n 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,\r\n 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,\r\n 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,\r\n 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,\r\n 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,\r\n 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000\r\n );\r\n\r\n if (!$this->changed) {\r\n return;\r\n }\r\n\r\n if (!$this->explicit_key_length) {\r\n // we do >> 2, here, and not >> 5, as we do above, since strlen($this->key) tells us the number of bytes - not bits\r\n $length = strlen($this->key) >> 2;\r\n if ($length > 8) {\r\n $length = 8;\r\n } else if ($length < 4) {\r\n $length = 4;\r\n }\r\n $this->Nk = $length;\r\n $this->key_size = $length << 2;\r\n }\r\n\r\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\r\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, chr(0));\r\n\r\n // see Rijndael-ammended.pdf#page=44\r\n $this->Nr = max($this->Nk, $this->Nb) + 6;\r\n\r\n // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,\r\n // \"Table 8: Shift offsets in Shiftrow for the alternative block lengths\"\r\n // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,\r\n // \"Table 2: Shift offsets for different block lengths\"\r\n switch ($this->Nb) {\r\n case 4:\r\n case 5:\r\n case 6:\r\n $this->c = array(0, 1, 2, 3);\r\n break;\r\n case 7:\r\n $this->c = array(0, 1, 2, 4);\r\n break;\r\n case 8:\r\n $this->c = array(0, 1, 3, 4);\r\n }\r\n\r\n $key = $this->key;\r\n\r\n $w = array_values(unpack('N*words', $key));\r\n\r\n $length = $this->Nb * ($this->Nr + 1);\r\n for ($i = $this->Nk; $i < $length; $i++) {\r\n $temp = $w[$i - 1];\r\n if ($i % $this->Nk == 0) {\r\n // according to <http://php.net/language.types.integer>, \"the size of an integer is platform-dependent\".\r\n // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,\r\n // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'\r\n // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.\r\n $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord\r\n $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];\r\n } else if ($this->Nk > 6 && $i % $this->Nk == 4) {\r\n $temp = $this->_subWord($temp);\r\n }\r\n $w[$i] = $w[$i - $this->Nk] ^ $temp;\r\n }\r\n\r\n // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns\r\n // and generate the inverse key schedule. more specifically,\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3), \r\n // \"The key expansion for the Inverse Cipher is defined as follows:\r\n // 1. Apply the Key Expansion.\r\n // 2. Apply InvMixColumn to all Round Keys except the first and the last one.\"\r\n // also, see fips-197.pdf#page=27, \"5.3.5 Equivalent Inverse Cipher\"\r\n $temp = array();\r\n for ($i = $row = $col = 0; $i < $length; $i++, $col++) {\r\n if ($col == $this->Nb) {\r\n if ($row == 0) {\r\n $this->dw[0] = $this->w[0];\r\n } else {\r\n // subWord + invMixColumn + invSubWord = invMixColumn\r\n $j = 0;\r\n while ($j < $this->Nb) {\r\n $dw = $this->_subWord($this->w[$row][$j]);\r\n $temp[$j] = $this->dt0[$dw & 0xFF000000] ^ \r\n $this->dt1[$dw & 0x00FF0000] ^ \r\n $this->dt2[$dw & 0x0000FF00] ^ \r\n $this->dt3[$dw & 0x000000FF];\r\n $j++;\r\n }\r\n $this->dw[$row] = $temp;\r\n }\r\n\r\n $col = 0;\r\n $row++;\r\n }\r\n $this->w[$row][$col] = $w[$i];\r\n }\r\n\r\n $this->dw[$row] = $this->w[$row];\r\n\r\n $this->changed = false;\r\n }", "function _mcryptSetup()\n {\n if (!$this->changed) {\n return;\n }\n\n if (!$this->explicit_key_length) {\n // this just copied from Crypt_Rijndael::_setup()\n $length = strlen($this->key) >> 2;\n if ($length > 8) {\n $length = 8;\n } else if ($length < 4) {\n $length = 4;\n }\n $this->Nk = $length;\n $this->key_size = $length << 2;\n }\n\n switch ($this->Nk) {\n case 4: // 128\n $this->key_size = 16;\n break;\n case 5: // 160\n case 6: // 192\n $this->key_size = 24;\n break;\n case 7: // 224\n case 8: // 256\n $this->key_size = 32;\n }\n\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));\n\n if (!isset($this->enmcrypt)) {\n $mode = $this->mode;\n //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode;\n\n $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n\n if ($mode == 'ncfb') {\n $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');\n }\n\n } // else should mcrypt_generic_deinit be called?\n\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n $this->changed = false;\n }", "public function _setupInlineCrypt() {\n\t\t$lambda_functions = &Crypt_RC2::_getLambdaFunctions();\n\n\t\t// The first 10 generated $lambda_functions will use the $keys hardcoded as integers\n\t\t// for the mixing rounds, for better inline crypt performance [~20% faster].\n\t\t// But for memory reason we have to limit those ultra-optimized $lambda_functions to an amount of 10.\n\t\t// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)\n\t\t$gen_hi_opt_code = (bool) ( count( $lambda_functions ) < 10 );\n\n\t\t// Generation of a uniqe hash for our generated code\n\t\t$code_hash = \"Crypt_RC2, {$this->mode}\";\n\t\tif ( $gen_hi_opt_code ) {\n\t\t\t$code_hash = str_pad( $code_hash, 32 ) . $this->_hashInlineCryptFunction( $this->key );\n\t\t}\n\n\t\t// Is there a re-usable $lambda_functions in there?\n\t\t// If not, we have to create it.\n\t\tif ( ! isset( $lambda_functions[ $code_hash ] ) ) {\n\t\t\t// Init code for both, encrypt and decrypt.\n\t\t\t$init_crypt = '$keys = $self->keys;';\n\n\t\t\tswitch ( true ) {\n\t\t\t\tcase $gen_hi_opt_code:\n\t\t\t\t\t$keys = $this->keys;\n\t\t\t\tdefault:\n\t\t\t\t\t$keys = [];\n\t\t\t\t\tforeach ( $this->keys as $k => $v ) {\n\t\t\t\t\t\t$keys[ $k ] = '$keys[' . $k . ']';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $in is the current 8 bytes block which has to be en/decrypt\n\t\t\t$encrypt_block = $decrypt_block = '\n $in = unpack(\"v4\", $in);\n $r0 = $in[1];\n $r1 = $in[2];\n $r2 = $in[3];\n $r3 = $in[4];\n ';\n\n\t\t\t// Create code for encryption.\n\t\t\t$limit = 20;\n\t\t\t$actions = [ $limit => 44, 44 => 64 ];\n\t\t\t$j = 0;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// Mixing round.\n\t\t\t\t$encrypt_block .= '\n $r0 = (($r0 + ' . $keys[ $j ++ ] . ' +\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF) << 1;\n $r0 |= $r0 >> 16;\n $r1 = (($r1 + ' . $keys[ $j ++ ] . ' +\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF) << 2;\n $r1 |= $r1 >> 16;\n $r2 = (($r2 + ' . $keys[ $j ++ ] . ' +\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF) << 3;\n $r2 |= $r2 >> 16;\n $r3 = (($r3 + ' . $keys[ $j ++ ] . ' +\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;\n $r3 |= $r3 >> 16;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 64 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Mashing round.\n\t\t\t\t\t$encrypt_block .= '\n $r0 += $keys[$r3 & 0x3F];\n $r1 += $keys[$r0 & 0x3F];\n $r2 += $keys[$r1 & 0x3F];\n $r3 += $keys[$r2 & 0x3F];';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$encrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Create code for decryption.\n\t\t\t$limit = 44;\n\t\t\t$actions = [ $limit => 20, 20 => 0 ];\n\t\t\t$j = 64;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// R-mixing round.\n\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 | ($r3 << 16)) >> 5;\n $r3 = ($r3 - ' . $keys[ -- $j ] . ' -\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF;\n $r2 = ($r2 | ($r2 << 16)) >> 3;\n $r2 = ($r2 - ' . $keys[ -- $j ] . ' -\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF;\n $r1 = ($r1 | ($r1 << 16)) >> 2;\n $r1 = ($r1 - ' . $keys[ -- $j ] . ' -\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF;\n $r0 = ($r0 | ($r0 << 16)) >> 1;\n $r0 = ($r0 - ' . $keys[ -- $j ] . ' -\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 0 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// R-mashing round.\n\t\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 - $keys[$r2 & 0x3F]) & 0xFFFF;\n $r2 = ($r2 - $keys[$r1 & 0x3F]) & 0xFFFF;\n $r1 = ($r1 - $keys[$r0 & 0x3F]) & 0xFFFF;\n $r0 = ($r0 - $keys[$r3 & 0x3F]) & 0xFFFF;';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$decrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Creates the inline-crypt function\n\t\t\t$lambda_functions[ $code_hash ] = $this->_createInlineCryptFunction(\n\t\t\t\t[\n\t\t\t\t\t'init_crypt' => $init_crypt,\n\t\t\t\t\t'encrypt_block' => $encrypt_block,\n\t\t\t\t\t'decrypt_block' => $decrypt_block\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Set the inline-crypt function as callback in: $this->inline_crypt\n\t\t$this->inline_crypt = $lambda_functions[ $code_hash ];\n\t}", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "protected function generateEncryptionKeyIfNeeded() {}", "public function _setupKey() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\t// Key has already been expanded in Crypt_RC2::setKey():\n\t\t// Only the first value must be altered.\n\t\t$l = unpack( 'Ca/Cb/v*', $this->key );\n\t\tarray_unshift( $l, $this->pitable[ $l['a'] ] | ( $l['b'] << 8 ) );\n\t\tunset( $l['a'] );\n\t\tunset( $l['b'] );\n\t\t$this->keys = $l;\n\t}", "function des_createKeys (key) {\r\n //declaring this locally speeds things up a bit\r\n pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);\r\n pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101);\r\n pc2bytes2 = new Array (0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808);\r\n pc2bytes3 = new Array (0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000);\r\n pc2bytes4 = new Array (0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010);\r\n pc2bytes5 = new Array (0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420);\r\n pc2bytes6 = new Array (0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002);\r\n pc2bytes7 = new Array (0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800);\r\n pc2bytes8 = new Array (0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002);\r\n pc2bytes9 = new Array (0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408);\r\n pc2bytes10 = new Array (0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020);\r\n pc2bytes11 = new Array (0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200);\r\n pc2bytes12 = new Array (0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010);\r\n pc2bytes13 = new Array (0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105);\r\n\r\n //how many iterations (1 for des, 3 for triple des)\r\n var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\r\n //stores the return keys\r\n var keys = new Array (32 * iterations);\r\n //now define the left shifts which need to be done\r\n var shifts = new Array (0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\r\n //other variables\r\n var lefttemp, righttemp, m=0, n=0, temp;\r\n\r\n for (var j=0; j<iterations; j++) { //either 1 or 3 iterations\r\n left = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n right = (key.charCodeAt(m++) << 24) | (key.charCodeAt(m++) << 16) | (key.charCodeAt(m++) << 8) | key.charCodeAt(m++);\r\n\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);\r\n temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n //the right side needs to be shifted and to get the last four bits of the left side\r\n temp = (left << 8) | ((right >>> 20) & 0x000000f0);\r\n //left needs to be put upside down\r\n left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);\r\n right = temp;\r\n\r\n //now go through and perform these shifts on the left and right keys\r\n for (var i=0; i < shifts.length; i++) {\r\n //shift the keys either one or two bits to the left\r\n if (shifts[i]) {left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26);}\r\n else {left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27);}\r\n left &= -0xf; right &= -0xf;\r\n\r\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\r\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\r\n //rather than 48 consecutive bits and the order of lines will be according to \r\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\r\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]\r\n | pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]\r\n | pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]\r\n | pc2bytes6[(left >>> 4) & 0xf];\r\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]\r\n | pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]\r\n | pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]\r\n | pc2bytes13[(right >>> 4) & 0xf];\r\n temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff; \r\n keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);\r\n }\r\n } //for each iterations\r\n //return the keys we've created\r\n return keys;\r\n}", "public static function initEncryptionKeys(array &$keys, $password)\n {\n /*\n 6.1.5 Initializing the encryption keys\n\n Key(0) <- 305419896\n Key(1) <- 591751049\n Key(2) <- 878082192\n\n loop for i <- 0 to length(password)-1\n update_keys(password(i))\n end loop\n */\n\n $keys = array(0x12345678, 0x23456789, 0x34567890);\n $len = strlen($password);\n\n for ($i = 0; $i < $len; ++$i) {\n self::updateEncryptionKeys($keys, ord($password{$i}));\n }\n }", "function _init()\n {\n $defaults = new Crypt_Blowfish_DefaultKey();\n $this->_P = $defaults->P;\n $this->_S = $defaults->S;\n }", "protected function _computeEncryptionKey(array $envelopes, $seed, $encryptMetadata = true) {}", "function Kravatte_WBC_AE($block_size, $key)\n \t{\n \t$this->WBC_AE_TAG_LEN = 16;\n\tself::Kravatte_WBC($block_size+$this->WBC_AE_TAG_LEN, '', $key);\n\t}", "public function recalcEncryptionKeys() {\n if (! $this->getLineIn() || ! $this->getLineOut()) return;\n\n // Derive secret key\n $curve = NISTcurve::generator_256();\n $alice = $this->getEccOurKeyPair();\n $bob = PublicKey::decode($curve, Utils::bin2hex($this->getEccTheirPubKey(), 130));\n\n $ecDH = new EcDH($curve);\n $ecDH->setPublicPoint($bob->getPoint());\n $ecdhe = $ecDH->getDerivedSharedSecret($alice->privkey->getSecretMultiplier());\n\n\n // Hash everything into an encode and decode key\n $ctx = hash_init('sha256');\n hash_update($ctx, Utils::hex2bin(GMP::gmp_dechex($ecdhe)));\n hash_update($ctx, Utils::hex2bin($this->getLineOut()));\n hash_update($ctx, Utils::hex2bin($this->getLineIn()));\n $key = hash_final($ctx, true);\n $this->setEncryptionKey($key);\n\n $ctx = hash_init('sha256');\n hash_update($ctx, Utils::hex2bin(GMP::gmp_dechex($ecdhe)));\n hash_update($ctx, Utils::hex2bin($this->getLineIn()));\n hash_update($ctx, Utils::hex2bin($this->getLineOut()));\n $key = hash_final($ctx, true);\n $this->setDecryptionKey($key);\n }", "function _encryptBlock($in)\n {\n $state = unpack('N*', $in);\n\n $sbox = $this->sbox;\n $w = $this->w;\n $t0 = $this->t0;\n $t1 = $this->t1;\n $t2 = $this->t2;\n $t3 = $this->t3;\n\n // addRoundKey\n $s0 = $state[1] ^ $w[4];\n $s1 = $state[2] ^ $w[5];\n $s2 = $state[3] ^ $w[6];\n $s3 = $state[4] ^ $w[7];\n\n // shiftRows + subWord + mixColumns + addRoundKey\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[8];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[9];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[10];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[11];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[12];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[13];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[14];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[15];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[16];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[17];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[18];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[19];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[20];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[21];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[22];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[23];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[24];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[25];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[26];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[27];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[28];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[29];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[30];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[31];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[32];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[33];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[34];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[35];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[36];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[37];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[38];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[39];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[40];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[41];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[42];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[43];\n\n switch ($this->Nr) {\n case 10:\n break;\n\n case 14:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[56];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[57];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[58];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[59];\n break;\n\n case 12:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n break;\n\n case 13:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54];\n $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n break;\n\n default: // 11\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n }\n\n // subWord\n $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24);\n $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24);\n $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24);\n $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24);\n\n // shiftRows + addRoundKey\n return pack('N*',\n ($e0 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $w[0],\n ($e1 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $w[1],\n ($e2 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $w[2],\n ($e3 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $w[3]\n );\n }", "public function _setupMcrypt() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\tparent::_setupMcrypt();\n\t}", "function enableContinuousBuffer()\n {\n parent::enableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n $this->enbuffer['enmcrypt_init'] = true;\n $this->debuffer['demcrypt_init'] = true;\n }\n }", "function Kravatte_WBC($block_size, $tweak='', $key)\n \t{\n \t$this->SPLIT_THRESHOLD = 398;\n\tself::k_key($key);\n\tself::reset_state();\n self::Kravatte_split($block_size);\n $this->tweak = $tweak;\n\t}", "public function testEncryptPadding(): void\n {\n $rc2 = new RC2('ecb');\n\n // unlike Crypt_AES / Crypt_Rijndael, when you tell Crypt_RC2 that the key length is 128-bits the key isn't null padded to that length.\n // instead, RC2 key expansion is used to extend it out to that length. this isn't done for AES / Rijndael since that doesn't define any\n // sort of key expansion algorithm.\n\n // admittedly, phpseclib is inconsistent in this regard. RC4 and Blowfish support arbitrary key lengths between a certain range, as well,\n // and they don't have any way to set the key length. but then again, neither do those algorithms have their own key expansion algorithm,\n // whereas RC2 does. and technically, AES / Rijndael (and even Twofish) don't support arbitrary key lengths - they support variable key\n // lengths. so in some ways, i suppose this inconsistency somewhat makes sense, although the fact that Crypt_Twofish doesn't have a\n // setKeyLength() function whereas Crypt_AES / Crypt_Rijndael do not is, itself, an inconsistency.\n\n // but that said, Crypt_RC2 is inconsistent in other ways: if you pass a 128-bit (16-byte) key to it via setKey() the key is not treated\n // as a 128-bit key but rather as a 1024-bit key and is expanded accordingly, not via null padding, but via RC2's key expansion algorithm.\n\n // this behavior is in contrast to mcrypt, which extends keys via null padding to 1024 bits. it is also in contrast to OpenSSL, which\n // extends keys, via null padding, to 128 bits. mcrypt's approach seems preferable as one can simulate 128 bit keys by using RC2's\n // key expansion algorithm to extend the key to 1024 bits and then changing the first byte of the new key with an inverse pitable mapping.\n // in contrast, to my knowledge, there is no technique for expanding a key less than 128 bits to 128 bits, via RC2 key expansion. the only\n // scenario in that regard is null padding.\n\n // simple truncation is insufficient, since, quoting RFC2268, \"the purpose of the key-expansion algorithm [in RC2] is to modify the key buffer\n // so that each bit of the expanded key depends in a complicated way on every bit of the supplied input key\".\n\n // now, to OpenSSL's credit, null padding is internally consistent with OpenSSL. OpenSSL only supports fixed length keys. For rc2, rc4 and\n // bf (blowfish), all keys are 128 bits (or are null padded / truncated accordingly). to use 40-bit or 64-bit keys with RC4 with OpenSSL you\n // don't use the rc4 algorithm - you use the rc4-40 or rc4-64 algorithm. and similarly, it's not aes-cbc that you use - it's either aes-128-cbc\n // or aes-192-cbc or aes-256-cbc. this is in contrast to mcrypt, which (with the exception of RC2) actually supports variable and arbitrary\n // length keys.\n\n // superficially, it seens like Rijndael would be another exception to mcrypt's key length handling, but it in fact is not. the reason being that,\n // with mcrypt, when you specify MCRYPT_RIJNDAEL_128 or MCRYPT_RIJNDAEL_192 or MCRYPT_RIJNDAEL_256 the numbers at the end aren't referring to the\n // key length, but rather, the block length. ie. Rijndael, unlike most block ciphers, doesn't just have a variable (but not arbitrary) key length -\n // it also has a variable block length. AES's block length, however, is not variable, so technically, only MCRYPT_RIJNDAEL_128 is AES.\n\n $rc2->setKey(str_repeat('d', 16), 128);\n\n $rc2->setPreferredEngine('PHP');\n $internal = $rc2->encrypt('d');\n\n $result = pack('H*', 'e3b36057f4821346');\n $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result');\n\n $rc2->setPreferredEngine('OpenSSL');\n if ($rc2->getEngine() == 'OpenSSL') {\n $openssl = $rc2->encrypt('d');\n $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result');\n } else {\n self::markTestSkipped('Unable to initialize OpenSSL engine');\n }\n }", "protected function _computeEncryptionKey($password = '') {}", "function createKey($bits = 1024, $timeout = false, $partial = array())\n {\n if (!defined('CRYPT_RSA_EXPONENT')) {\n // http://en.wikipedia.org/wiki/65537_%28number%29\n define('CRYPT_RSA_EXPONENT', '65537');\n }\n // per <http://cseweb.ucsd.edu/~hovav/dist/survey.pdf#page=5>, this number ought not result in primes smaller\n // than 256 bits. as a consequence if the key you're trying to create is 1024 bits and you've set CRYPT_RSA_SMALLEST_PRIME\n // to 384 bits then you're going to get a 384 bit prime and a 640 bit prime (384 + 1024 % 384). at least if\n // CRYPT_RSA_MODE is set to self::MODE_INTERNAL. if CRYPT_RSA_MODE is set to self::MODE_OPENSSL then\n // CRYPT_RSA_SMALLEST_PRIME is ignored (ie. multi-prime RSA support is more intended as a way to speed up RSA key\n // generation when there's a chance neither gmp nor OpenSSL are installed)\n if (!defined('CRYPT_RSA_SMALLEST_PRIME')) {\n define('CRYPT_RSA_SMALLEST_PRIME', 4096);\n }\n\n // OpenSSL uses 65537 as the exponent and requires RSA keys be 384 bits minimum\n if (CRYPT_RSA_MODE == self::MODE_OPENSSL && $bits >= 384 && CRYPT_RSA_EXPONENT == 65537) {\n $config = array();\n if (isset($this->configFile)) {\n $config['config'] = $this->configFile;\n }\n $rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);\n openssl_pkey_export($rsa, $privatekey, null, $config);\n $publickey = openssl_pkey_get_details($rsa);\n $publickey = $publickey['key'];\n\n $privatekey = call_user_func_array(array($this, '_convertPrivateKey'), array_values($this->_parseKey($privatekey, self::PRIVATE_FORMAT_PKCS1)));\n $publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, self::PUBLIC_FORMAT_PKCS1)));\n\n // clear the buffer of error strings stemming from a minimalistic openssl.cnf\n while (openssl_error_string() !== false) {\n }\n\n return array(\n 'privatekey' => $privatekey,\n 'publickey' => $publickey,\n 'partialkey' => false\n );\n }\n\n static $e;\n if (!isset($e)) {\n $e = new BigInteger(CRYPT_RSA_EXPONENT);\n }\n\n extract($this->_generateMinMax($bits));\n $absoluteMin = $min;\n $temp = $bits >> 1; // divide by two to see how many bits P and Q would be\n if ($temp > CRYPT_RSA_SMALLEST_PRIME) {\n $num_primes = floor($bits / CRYPT_RSA_SMALLEST_PRIME);\n $temp = CRYPT_RSA_SMALLEST_PRIME;\n } else {\n $num_primes = 2;\n }\n extract($this->_generateMinMax($temp + $bits % $temp));\n $finalMax = $max;\n extract($this->_generateMinMax($temp));\n\n $generator = new BigInteger();\n\n $n = $this->one->copy();\n if (!empty($partial)) {\n extract(unserialize($partial));\n } else {\n $exponents = $coefficients = $primes = array();\n $lcm = array(\n 'top' => $this->one->copy(),\n 'bottom' => false\n );\n }\n\n $start = time();\n $i0 = count($primes) + 1;\n\n do {\n for ($i = $i0; $i <= $num_primes; $i++) {\n if ($timeout !== false) {\n $timeout-= time() - $start;\n $start = time();\n if ($timeout <= 0) {\n return array(\n 'privatekey' => '',\n 'publickey' => '',\n 'partialkey' => serialize(array(\n 'primes' => $primes,\n 'coefficients' => $coefficients,\n 'lcm' => $lcm,\n 'exponents' => $exponents\n ))\n );\n }\n }\n\n if ($i == $num_primes) {\n list($min, $temp) = $absoluteMin->divide($n);\n if (!$temp->equals($this->zero)) {\n $min = $min->add($this->one); // ie. ceil()\n }\n $primes[$i] = $generator->randomPrime($min, $finalMax, $timeout);\n } else {\n $primes[$i] = $generator->randomPrime($min, $max, $timeout);\n }\n\n if ($primes[$i] === false) { // if we've reached the timeout\n if (count($primes) > 1) {\n $partialkey = '';\n } else {\n array_pop($primes);\n $partialkey = serialize(array(\n 'primes' => $primes,\n 'coefficients' => $coefficients,\n 'lcm' => $lcm,\n 'exponents' => $exponents\n ));\n }\n\n return array(\n 'privatekey' => '',\n 'publickey' => '',\n 'partialkey' => $partialkey\n );\n }\n\n // the first coefficient is calculated differently from the rest\n // ie. instead of being $primes[1]->modInverse($primes[2]), it's $primes[2]->modInverse($primes[1])\n if ($i > 2) {\n $coefficients[$i] = $n->modInverse($primes[$i]);\n }\n\n $n = $n->multiply($primes[$i]);\n\n $temp = $primes[$i]->subtract($this->one);\n\n // textbook RSA implementations use Euler's totient function instead of the least common multiple.\n // see http://en.wikipedia.org/wiki/Euler%27s_totient_function\n $lcm['top'] = $lcm['top']->multiply($temp);\n $lcm['bottom'] = $lcm['bottom'] === false ? $temp : $lcm['bottom']->gcd($temp);\n\n $exponents[$i] = $e->modInverse($temp);\n }\n\n list($temp) = $lcm['top']->divide($lcm['bottom']);\n $gcd = $temp->gcd($e);\n $i0 = 1;\n } while (!$gcd->equals($this->one));\n\n $d = $e->modInverse($temp);\n\n $coefficients[2] = $primes[2]->modInverse($primes[1]);\n\n // from <http://tools.ietf.org/html/rfc3447#appendix-A.1.2>:\n // RSAPrivateKey ::= SEQUENCE {\n // version Version,\n // modulus INTEGER, -- n\n // publicExponent INTEGER, -- e\n // privateExponent INTEGER, -- d\n // prime1 INTEGER, -- p\n // prime2 INTEGER, -- q\n // exponent1 INTEGER, -- d mod (p-1)\n // exponent2 INTEGER, -- d mod (q-1)\n // coefficient INTEGER, -- (inverse of q) mod p\n // otherPrimeInfos OtherPrimeInfos OPTIONAL\n // }\n\n return array(\n 'privatekey' => $this->_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients),\n 'publickey' => $this->_convertPublicKey($n, $e),\n 'partialkey' => false\n );\n }", "function init () {\r\n\t$this->A = 0x6745 << 16 | 0x2301;\r\n\t$this->B = 0xefcd << 16 | 0xab89;\r\n\t$this->C = 0x98ba << 16 | 0xdcfe;\r\n\t$this->D = 0x1032 << 16 | 0x5476;\r\n\t$this->E = 0xc3d2 << 16 | 0xe1f0;\r\n\t$this->ta = $this->A;\r\n\t$this->tb = $this->B;\r\n\t$this->tc = $this->C;\r\n\t$this->td = $this->D;\r\n\t$this->te = $this->E;\r\n\t$this->K0_19 = 0x5a82 << 16 | 0x7999;\r\n\t$this->K20_39 = 0x6ed9 << 16 | 0xeba1;\r\n\t$this->K40_59 = 0x8f1b << 16 | 0xbcdc;\r\n\t$this->K60_79 = 0xca62 << 16 | 0xc1d6;\r\n\r\n $this->buffer = array();\r\n $this->buffsize = 0;\r\n $this->totalsize = 0;\r\n }", "function key_setup($key) {\r\n\t\tif(is_array($key))\r\n \t$this->key = $key;\r\n\t\telse if(isset($key) && !empty($key))\r\n\t\t\t$this->key = $this->_str2long(str_pad($key, 16, $key));\r\n\t\telse\r\n\t\t\t$this->key = array(0,0,0,0);\r\n }", "function Code128($x, $y, $code, $w, $h) {\n $Aguid = \"\"; // Création des guides de choix ABC\n $Bguid = \"\";\n $Cguid = \"\";\n for ($i = 0; $i < strlen($code); $i++) {\n $needle = substr($code, $i, 1);\n $Aguid .= ((strpos($this->Aset, $needle) === false) ? \"N\" : \"O\");\n $Bguid .= ((strpos($this->Bset, $needle) === false) ? \"N\" : \"O\");\n $Cguid .= ((strpos($this->Cset, $needle) === false) ? \"N\" : \"O\");\n }\n\n $SminiC = \"OOOO\";\n $IminiC = 4;\n\n $crypt = \"\";\n while ($code > \"\") {\n // BOUCLE PRINCIPALE DE CODAGE\n $i = strpos($Cguid, $SminiC); // forçage du jeu C, si possible\n if ($i !== false) {\n $Aguid [$i] = \"N\";\n $Bguid [$i] = \"N\";\n }\n\n if (substr($Cguid, 0, $IminiC) == $SminiC) { // jeu C\n $crypt .= chr(($crypt > \"\") ? $this->JSwap[\"C\"] : $this->JStart[\"C\"]); // début Cstart, sinon Cswap\n $made = strpos($Cguid, \"N\"); // étendu du set C\n if ($made === false) {\n $made = strlen($Cguid);\n }\n if (fmod($made, 2) == 1) {\n $made--; // seulement un nombre pair\n }\n for ($i = 0; $i < $made; $i += 2) {\n $crypt .= chr(strval(substr($code, $i, 2))); // conversion 2 par 2\n }\n $jeu = \"C\";\n } else {\n $madeA = strpos($Aguid, \"N\"); // étendu du set A\n if ($madeA === false) {\n $madeA = strlen($Aguid);\n }\n $madeB = strpos($Bguid, \"N\"); // étendu du set B\n if ($madeB === false) {\n $madeB = strlen($Bguid);\n }\n $made = (($madeA < $madeB) ? $madeB : $madeA ); // étendu traitée\n $jeu = (($madeA < $madeB) ? \"B\" : \"A\" ); // Jeu en cours\n\n $crypt .= chr(($crypt > \"\") ? $this->JSwap[$jeu] : $this->JStart[$jeu]); // début start, sinon swap\n\n $crypt .= strtr(substr($code, 0, $made), $this->SetFrom[$jeu], $this->SetTo[$jeu]); // conversion selon jeu\n }\n $code = substr($code, $made); // raccourcir légende et guides de la zone traitée\n $Aguid = substr($Aguid, $made);\n $Bguid = substr($Bguid, $made);\n $Cguid = substr($Cguid, $made);\n } // FIN BOUCLE PRINCIPALE\n\n $check = ord($crypt[0]); // calcul de la somme de contrôle\n for ($i = 0; $i < strlen($crypt); $i++) {\n $check += (ord($crypt[$i]) * $i);\n }\n $check %= 103;\n\n $crypt .= chr($check) . chr(106) . chr(107); // Chaine cryptée complète\n\n $i = (strlen($crypt) * 11) - 8; // calcul de la largeur du module\n $modul = $w / $i;\n\n for ($i = 0; $i < strlen($crypt); $i++) { // BOUCLE D'IMPRESSION\n $c = $this->T128[ord($crypt[$i])];\n for ($j = 0; $j < count($c); $j++) {\n $this->Rect($x, $y, $c[$j] * $modul, $h, \"F\");\n $x += ($c[$j++] + $c[$j]) * $modul;\n }\n }\n }", "function init()\n {\n return $this->_crypt->init();\n }", "function disableContinuousBuffer()\n {\n parent::disableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n }", "function km200_Encrypt( $encryptData ) \n{ \n $blocksize = 16;\n $encrypt_padchar = $blocksize - ( strlen( $encryptData ) % $blocksize ); \n $encryptData .= str_repeat( chr( $encrypt_padchar ), $encrypt_padchar ); \n \n return base64_encode(\n openssl_encrypt(\n $encryptData,\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n )\n );\n}", "function Crypt_AES($mode = CRYPT_AES_MODE_CBC)\n {\n if ( !defined('CRYPT_AES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()):\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_AES_MODE ) {\n case CRYPT_AES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n // ctr doesn't have a constant associated with it even though it appears to be fairly widely\n // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to\n // include a compatibility layer. the layer has been implemented but, for now, is commented out.\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = 'ncfb';\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n\n break;\n default:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n $this->mode = CRYPT_RIJNDAEL_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_CFB;\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_OFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\n }\n }\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) {\n parent::Crypt_Rijndael($this->mode);\n }\n }", "function encrypt($plaintext) {\n $ivsize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $keysize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n //echo \"IV Size: \" . $ivsize . \"\\n\";\n //echo \"Key Size: \" . $keysize . \"\\n\";\n //echo \"Block Size: \" . $blocksize . \"\\n\";\n\n $masterkey = 'masterKeyOfLength29Characters';\n $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');\n\n //$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n\t $ivbytes = array(72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87, 72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87);\n $iv = implode(array_map(\"chr\", $ivbytes));\n\n\t\t//$key = mhash(MHASH_SHA256, $masterkey);\n\t\t//echo \"Key: \" . base64_encode($key) . \"\\n\";\n\t\t \n mcrypt_generic_init($td, $masterkey, $iv);\n //mcrypt_generic_init($td, substr($key, 0, $keysize), $iv);\n //mcrypt_generic_init($td, $key, $iv);\n $crypttext = mcrypt_generic($td, $plaintext);\n mcrypt_generic_deinit($td);\n return base64_encode($iv.$crypttext);\n //return base64_encode($crypttext);\n}", "private function __construct()\n\t{\t\t\n\t\t// Load the Cryptography class\n\t\trequire_once(__DIR__.'/../vendor/crypt/AES.php');\n\t\t\n\t\t// Create a new AES cryptography object\n\t\t$this->aes = new Crypt_AES(); \n\t\t\n\t\t// Set the encryption key\n\t\t$this->setKey($this->cryptKey);\n\t}", "function mysql_aes_key($key)\n{\n $bytes = 16;\n $newKey = \\str_repeat(\\chr(0), $bytes);\n $length = \\strlen($key);\n\n for ($i = 0; $i < $length; $i++) {\n $index = $i % $bytes;\n $newKey[$index] = $newKey[$index] ^ $key[$i];\n }\n\n return $newKey;\n}", "function Enkrip($body, $subject) {\r\n $c = \"\";\r\n for ($h = 0; $h < strlen($subject); $h++) {\r\n $c.=sprintf(\"%08s\", decbin(ord($subject[$h])));\r\n }\r\n $hslkey = $c;\r\n $keyascii = strrev($c);\r\n\r\n //SBox\r\n $SBox[0] = array(4, 10, 9, 2, 13, 8, 0, 14, 6, 11, 1, 12, 7, 15, 5, 3);\r\n $SBox[1] = array(14, 11, 4, 12, 6, 13, 15, 10, 2, 3, 8, 1, 0, 7, 5, 9);\r\n $SBox[2] = array(5, 8, 1, 13, 10, 3, 4, 2, 14, 15, 12, 7, 6, 0, 9, 11);\r\n $SBox[3] = array(7, 13, 10, 1, 0, 8, 9, 15, 14, 4, 6, 12, 11, 2, 5, 3);\r\n $SBox[4] = array(6, 12, 7, 1, 5, 15, 13, 8, 4, 10, 9, 14, 0, 3, 11, 2);\r\n $SBox[5] = array(4, 11, 10, 0, 7, 2, 1, 13, 3, 6, 8, 5, 9, 12, 15, 14);\r\n $SBox[6] = array(13, 11, 4, 1, 3, 15, 5, 9, 0, 10, 14, 7, 6, 8, 2, 12);\r\n $SBox[7] = array(1, 15, 13, 0, 5, 7, 10, 4, 9, 2, 3, 14, 6, 11, 8, 12);\r\n\r\n //Pembagian Kunci dlm bentuk biner\r\n $K = array(substr($keyascii, -32, 32), substr($keyascii, -64, 32), substr($keyascii, -96, 32),\r\n substr($keyascii, -128, 32), substr($keyascii, -160, 32), substr($keyascii, -192, 32),\r\n substr($keyascii, -224, 32), substr($keyascii, 0, 32));\r\n\r\n //penjadwalan kunci enkripsi\r\n $JKe = array(bindec($K[0]), bindec($K[1]), bindec($K[2]), bindec($K[3]), bindec($K[4]), bindec($K[5]),\r\n bindec($K[6]), bindec($K[7]),\r\n bindec($K[0]), bindec($K[1]), bindec($K[2]), bindec($K[3]), bindec($K[4]), bindec($K[5]),\r\n bindec($K[6]), bindec($K[7]),\r\n bindec($K[0]), bindec($K[1]), bindec($K[2]), bindec($K[3]), bindec($K[4]), bindec($K[5]),\r\n bindec($K[6]), bindec($K[7]),\r\n bindec($K[7]), bindec($K[6]), bindec($K[5]), bindec($K[4]), bindec($K[3]), bindec($K[2]),\r\n bindec($K[1]), bindec($K[0]));\r\n\r\n $ja = strlen($body);\r\n $hA = \"\";\r\n\r\n //merubah plainteks menjadi biner\r\n for ($j = 0; $j < $ja; $j++) {\r\n $hA.=sprintf(\"%08s\", decbin(ord($body[$j])));\r\n }\r\n $temphA = $hA;\r\n $arrkA = array();\r\n\r\n // fungsi padding angka 0 pada array indeks tertentu\r\n $l = 0;\r\n for ($o = 0; $o < strlen($temphA); $o+=64) { //fungsi untuk membagi plainteks menjadi beberapa blok\r\n $arrkA[$l] = substr($temphA, $o, 64);\r\n if (strlen($arrkA[$l]) < 64) {\r\n\r\n //hasil padding dimasukkan ke array arrkA\r\n $arrkA[$l] = str_pad($arrkA[$l], 64, \"0\", STR_PAD_LEFT);\r\n }\r\n $l++;\r\n }\r\n\r\n $varkA = \"\";\r\n $varR = array();\r\n $varL = array();\r\n $hasblock = array();\r\n $tempL = \"\";\r\n $blockCounter = count($arrkA);\r\n\r\n $arrBC = array();\r\n $nilkA = array();\r\n\r\n $v = 0;\r\n for ($p = 0; $p < $blockCounter; $p++) {\r\n $varkA = $arrkA[$p];\r\n $kL = strrev(substr($varkA, -32, 32));\r\n $kR = strrev(substr($varkA, 0, 32));\r\n\r\n //proses enkripsi 32 putaran\r\n for ($i = 0; $i < 32; $i++) {\r\n $varL = $kL;\r\n $varRsb = $kR;\r\n $varR = bindec($kR);\r\n $pang = pow(2, 32);\r\n $Total = fmod($varR + $JKe[$i], $pang);\r\n $tempT = decbin($Total);\r\n $pT = strlen($tempT);\r\n\r\n if ($pT < 32) {\r\n $sRK = str_pad($tempT, 32, \"0\", STR_PAD_LEFT);\r\n } else {\r\n $sRK = $tempT;\r\n }\r\n\r\n //pecah hasil Ri+Ki \r\n $pRK[0] = bindec(substr($sRK, 0, 4));\r\n $pRK[1] = bindec(substr($sRK, 4, 4));\r\n $pRK[2] = bindec(substr($sRK, 8, 4));\r\n $pRK[3] = bindec(substr($sRK, 12, 4));\r\n $pRK[4] = bindec(substr($sRK, 16, 4));\r\n $pRK[5] = bindec(substr($sRK, 20, 4));\r\n $pRK[6] = bindec(substr($sRK, 24, 4));\r\n $pRK[7] = bindec(substr($sRK, 28, 4));\r\n\r\n //masukkan ke sbox\r\n for ($e = 0; $e < 8; $e++) {\r\n $hSB[$e] = $SBox[$e][($pRK[$e])];\r\n }\r\n $btemp = array_merge($hSB);\r\n $arrtemp = \"\";\r\n\r\n for ($a = 0; $a < count($btemp); $a++) {\r\n $arrtemp.=sprintf(\"%04s\", decbin($btemp[$a]));\r\n }\r\n\r\n $xa = substr($arrtemp, 0, 11);\r\n $xn = substr($arrtemp, 11);\r\n $ND = $xn . $xa;\r\n\r\n $tempL = $varL;\r\n $XR = array();\r\n for ($r = 0; $r < 32; $r++) {\r\n if ($i == 31) {\r\n $XR[$r] = intval($ND[$r]) ^ intval($kL[$r]);\r\n } else {\r\n $XR[$r] = intval($ND[$r]) ^ intval($tempL[$r]);\r\n }\r\n }\r\n\r\n $kL = $kR;\r\n $kR = implode($XR);\r\n\r\n $hasRL = \"\";\r\n $hasRL = strrev($kL) . strrev($kR);\r\n }\r\n\r\n $hasblock[$v][$p] = $hasRL;\r\n $arrBC = array_merge($hasblock);\r\n $v++;\r\n }\r\n //merubah biner menjadi hexa\r\n $varBlock = \"\";\r\n $hsBC = \"\";\r\n $t = 0;\r\n for ($m = 0; $m < count($arrBC); $m++) {\r\n $varBlock = implode($arrBC[$m]);\r\n for ($b = 0; $b < strlen($varBlock); $b++) {\r\n $tempBC[$b] = base_convert(substr($varBlock, $b * 4, 4), 2, 16);\r\n $hsBC = implode($tempBC);\r\n }\r\n $arrvarBlock[$t] = explode(\"\\n\", $hsBC);\r\n $t++;\r\n }\r\n\r\n $z = 0;\r\n $has2 = \"\";\r\n\r\n for ($a = 0; $a < count($arrvarBlock); $a++) {\r\n $has2.=substr($arrvarBlock[$a][$z], 0, 16);\r\n }\r\n\r\n return $has2;\r\n }", "function break_repeating_key_XOR($args = NULL) {\n\n\n\tif ($args==NULL) {\n\t\treturn false;\n\t}\n\n\t// INIT PARAMETERS\n\t$kl_min = 2;\n\t$kl_max = 10;\n\tif (isset($args['kl_min'])) {\n\t\t$kl_min = $args['kl_min'];\n\t}\n\tif (isset($args['kl_max'])) {\n\t\t$kl_max = $args['kl_max'];\n\t}\n\n\t// Recupero il testo cifrato a seconda che venga passato direttamente\n\t// o sia passato l'url di un file\n\t$cypher = '';\n\tif ($args['file']!=NULL) {\n\t\t$lines = file($args['file'], FILE_IGNORE_NEW_LINES);\n\n\t\tset_time_limit(0);\n\t\tforeach($lines as $line) {\n\t\t\t$cypher .= $line;\n\t\t}\n\t\tset_time_limit(30);\n\t}\n\telse if ($args['string']) {\n\t\t$cypher = $args['string'];\n\t}\n\n\t//echo $cypher.\"<br><br>\";\n\n\t$cypher = $this->base64_to_hex($cypher);\n\t$array_norm_keylegth = array();\n\tfor ($keylength=2; $keylength <= 40; $keylength++) { \n\t\t$sum = 0;\n\t\t$keylength_byte = $keylength*2;\n\t\t//echo $keylength.\"<br>\";\n\t\tfor ($i=0; $i < 4; $i++) { \n\t\t\t$str1 = substr($cypher, ($keylength_byte*2)*$i, $keylength_byte);\n\t\t\t$str2 = substr($cypher, (($keylength_byte*2)*$i)+$keylength_byte, $keylength_byte);\n\t\t\t//echo \"#### \".$str1.\"<br>\";\n\t\t\t//echo \"#### \".$str2.\"<br>\";\n\t\t\t//echo \"#### \".$this->helper->hamming_distance($str1, $str2)/$keylength.\"<br><br>\";\n\t\t\t$sum = $sum + $this->helper->hamming_distance($str1, $str2)/$keylength_byte;\n\t\t}\n\n\t\t//echo \"######## \".$sum.\"<br>\";\n\t\t//echo \"######## \".($sum/4).\"<br>\".\"<br>\";\n\n\t\t//echo \"###################################<br><br>\";\n\t\t\n\t\t$array_norm_keylegth[] = array('norm_keylength' => $sum/4, 'keylength' => $keylength_byte);\n\t\t\n\t}\n\n\tusort($array_norm_keylegth, function($a, $b) {\n\t\t$el1 = $a['norm_keylength'];\n\t\t$el2 = $b['norm_keylength'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t//echo \"<pre>\";\n\t//print_r($array_norm_keylegth);\n\t//echo \"</pre>\";\n\n\t$keylength_candidata = $array_norm_keylegth[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata*2);\n\n\t//echo \"<pre>\";\n\t//print_r($array_blocchi_testo_keylength);\n\t//echo \"</pre>\";\n\n\t$array_string = array();\n\tfor ($i=0; $i<(($keylength_candidata*2)); $i += 2) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= substr($string, $i, 2);\n\t\t}\n\t\t$array_string[] = $partial_string;\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($partial_string, \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0)));\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}/**/\n\n\techo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";\n\n\t// Controllo le ripetizioni di sottostrighe\n\t/*set_time_limit(0);\n\t$array_text = array();\n\n\t$dim_cypher = strlen($cypher);\n\t$occurences = array();\n\n\tfor ($i = floor($dim_cypher/2); $i>0; $i--) {\n\t\t$offset_sx = 0;\n\t\t$offset_dx = $dim_cypher-$i;\n\t\t$finito = false;\n\t\twhile ((($i <= $offset_sx)||($i<=$offset_dx))\n\t\t\t &&($offset_sx<=$dim_cypher)\n\t\t\t &&($offset_dx>=0)) {\n\n\t\t\t$text = substr($cypher, $offset_sx, $i);\n\n\t\t\t$occurences = $this->helper->strpos_all($cypher, $text);\n\t\t\tif (count($occurences)>1) {\n\t\t\t\t$finito = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$offset_sx++;\n\t\t\t$offset_dx--;\n\t\t}\n\n\t\tif ($finito) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tset_time_limit(30);\n\n\t/*echo $text.\"<br>\";\n\tprint_r($occurences);*/\n\n\n\t// Possibili keylengths e valutazione con distanza di hemming\n\t/*set_time_limit(0);\n\t$distance = $occurences[1] - $occurences[0];\n\t//echo \"<br>distance: \".$distance.\"<br>\";\n\n\t$keylengths = 0;\n\t$array_somme = array();\n\t$smaller_avarage_dist = 0;\n\t$guessed_keylength = 0;\n\tfor ($i=1; $i <= $distance; $i++) { \n\t\t//echo \"<br>#### distance%i: \".($distance%$i).\"<br>\";\n\t\tif (($distance%$i)==0) {\n\t\t\t$keylength = $distance/$i; // sottomultipli $distance\n\n\t\t\tif ($keylength>2) {\n\t\t\t\t//echo \"<br>######## keylengths: \".($keylengths).\"<br>\";\n\t\t\t\t$array_blocchi_testo = $this->helper->unique_split_to_array($cypher, $keylength);\n\t\t\t\t//print_r($array_blocchi_testo);\n\t\t\t\t$d_crypt = 0;\n\t\t\t\t$somma_d_crypt = 0;\n\t\t\t\tfor ($j=0; $j < count($array_blocchi_testo)-1; $j += 2) { \n\t\t\t\t\t$str1 = $array_blocchi_testo[$j];\n\t\t\t\t\t$str2 = $array_blocchi_testo[$j+1];\n\n\t\t\t\t\tif (strlen($str1) == strlen($str2)) {\n\t\t\t\t\t\t$d_crypt = $this->helper->hamming_distance($str1, $str2)/$keylength;\n\t\t\t\t\t}\n\n\t\t\t\t\t$somma_d_crypt = $somma_d_crypt + $d_crypt;\n\n\t\t\t\t}\n\t\t\t\t//echo \"<br>######## j-2\".($j-2).\"<br>\";\n\t\t\t\t$array_somme[] = array(\"avar_norm\"=>$somma_d_crypt/($j-2), \"keylength\"=>$keylength);\n\t\t\t}\n\t\t}\n\n\t}\n\tset_time_limit(30);\n\n\tusort($array_somme, function($a, $b) {\n\t\t$el1 = $a['avar_norm'];\n\t\t$el2 = $b['avar_norm'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t$keylength_candidata = $array_somme[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata);\n\n\t/*echo \"<pre>\";\n\tprint_r($array_blocchi_testo_keylength);\n\techo \"</pre>\";*/\n\n\t/*$array_string = array();\n\tfor ($i=0; $i<$keylength_candidata; $i++) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= $string[$i];\n\t\t}\n\t\t$array_string[$i] = $this->base64_to_hex($partial_string);\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($array_string[$i], \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0))[0]);\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}\n\n\t/*echo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";*/\n\n}", "function svc_encryp( $num, $key ) {\r\n\t$now = (new \\DateTime())->format('YmdHis');\r\n\t$tx0 = $now . substr( '00000000000' . $num, -11 );\r\n\r\n\t//creating array \r\n\t$arr0 = array();\r\n\tfor ( $i = 0; $i < 25 ; $i++ ) {\r\n\t\t$arr0[] = substr( $tx0, $i, 1 );\r\n\t}\r\n\r\n\t//storing consistency\r\n\t$chk = \r\n\t\t$arr0[0]+\r\n\t\t$arr0[1]*2+\r\n\t\t$arr0[2]+\r\n\t\t$arr0[3]+\r\n\t\t$arr0[4]*13+\r\n\t\t$arr0[5]+\r\n\t\t$arr0[6]+\r\n\t\t$arr0[7]+\r\n\t\t$arr0[8]*7+\r\n\t\t$arr0[9]+\r\n\t\t$arr0[10]+\r\n\t\t$arr0[11]+\r\n\t\t$arr0[12]+\r\n\t\t$arr0[13]*45+\r\n\t\t$arr0[14]+\r\n\t\t$arr0[15]+\r\n\t\t$arr0[16]+\r\n\t\t$arr0[17]*11+\r\n\t\t$arr0[18]-\r\n\t\t$arr0[19]-\r\n\t\t$arr0[20]-\r\n\t\t$arr0[21]-\r\n\t\t$arr0[22]-\r\n\t\t$arr0[23]+\r\n\t\t$arr0[24];\r\n\t\r\n\t$chk = $chk * $key;\r\n\r\n\t//concatenating with check for consistency\t\t\r\n\t$tx0 = $tx0 . substr( '000' . $chk, -3 );\r\n\r\n\t//creating new array \r\n\t$arr1 = array();\r\n\tfor ( $i = 0; $i < 28 ; $i++ ) {\r\n\t\t$arr1[] = substr( $tx0, $i, 1 );\r\n\t}\r\n\r\n\t//creating new array and changin positions\r\n\t$arr2 = array();\r\n\t$arr2[] = $arr1[9];\r\n\t$arr2[] = $arr1[0];\r\n\t$arr2[] = $arr1[23];\r\n\t$arr2[] = $arr1[4];\r\n\t$arr2[] = $arr1[17];\r\n\t$arr2[] = $arr1[1];\r\n\t$arr2[] = $arr1[7];\r\n\t$arr2[] = $arr1[14];\r\n\t$arr2[] = $arr1[27];\r\n\t$arr2[] = $arr1[15];\r\n\t$arr2[] = $arr1[19];\r\n\t$arr2[] = $arr1[5];\r\n\t$arr2[] = $arr1[20];\r\n\t$arr2[] = $arr1[16];\r\n\t$arr2[] = $arr1[11];\r\n\t$arr2[] = $arr1[6];\r\n\t$arr2[] = $arr1[12];\r\n\t$arr2[] = $arr1[8];\r\n\t$arr2[] = $arr1[2];\r\n\t$arr2[] = $arr1[13];\r\n\t$arr2[] = $arr1[22];\r\n\t$arr2[] = $arr1[10];\r\n\t$arr2[] = $arr1[26];\r\n\t$arr2[] = $arr1[18];\r\n\t$arr2[] = $arr1[21];\r\n\t$arr2[] = $arr1[3];\r\n\t$arr2[] = $arr1[25];\r\n\t$arr2[] = $arr1[24];\r\n\t\r\n\t//concatenating\r\n\t$tx1 = rand( 1, 9 ); //first character = dummy\r\n\tfor ( $i = 0; $i < 28 ; $i++ ) {\r\n\t\t$tx1 = $tx1 . $arr2[$i];\r\n\t}\r\n\r\n\treturn $tx1;\r\n\t\r\n}", "public function __construct($params){\r\n if(!extension_loaded('mcrypt')){\r\n throw new Exception('mcrypt extension is required for this script');\r\n return false;\r\n }\r\n # make sure key is supplied\r\n if(!array_key_exists('key', $params) || !isset($params['key']) || (isset($params['key']) && !$params['key'])){\r\n $error = 'key is a required parameter. see Crypt::listOptions()';\r\n throw new Exception($error);\r\n return false;\r\n }\r\n # set params\r\n $this->raw_key = $params['key'];\r\n $this->algorithms = mcrypt_list_algorithms();\r\n $this->modes = mcrypt_list_modes();\r\n # check availables\r\n if(!count($this->algorithms)){\r\n throw new Exception('there are no available algorithms for mcrypt');\r\n return false;\r\n }\r\n if(!count($this->modes)){\r\n throw new Exception('there are no available modes for mcrypt');\r\n return false;\r\n }\r\n # algorithm\r\n $this->algorithm = $this->algorithms[0]; \r\n if(array_key_exists('algorithm', $params) && in_array($params['algorithm'], $this->algorithms)){\r\n $this->algorithm = $params['algorithm'];\r\n }\r\n # mode\r\n $this->mode = $this->modes[0];\r\n if(array_key_exists('mode', $params) && in_array($params['mode'], $this->modes)){\r\n $this->mode = $params['mode'];\r\n }\r\n # base 64 encoding\r\n $this->base64 = true;\r\n if(array_key_exists('base64', $params) && !$params['base64']){\r\n $this->base64 = false;\r\n }\r\n \r\n return $this->start();\r\n }", "abstract public function createSecretKey();", "private function encryption_parameters(): void\n {\n if ($this->use_encryption()) {\n if (!defined('ENCRYPTION_KEY_VALUE')) {\n define('ENCRYPTION_KEY_VALUE', 'NVWG9bMgetehyASFB4FZIJlOJomwiQKk'); // Default value\n define('ENCRYPTION_KEY_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption key is the default value.\n }\n if (!defined('ENCRYPTION_IV_VALUE')) {\n define('ENCRYPTION_IV_VALUE', 'KddhSnjJQHLLOOEcB1g9AihLTCK0eyFv'); // Default value\n define('ENCRYPTION_IV_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption IV is the default value.\n }\n\n if (!defined('ENCRYPTION_KEY')) {\n define('ENCRYPTION_KEY', hash('sha256', ENCRYPTION_KEY_VALUE));\n }\n if (!defined('ENCRYPTION_IV')) {\n define('ENCRYPTION_IV', substr(hash('sha256', ENCRYPTION_IV_VALUE), 0, 16));\n }\n }\n }", "protected function setUp() {\n # Set up the encryption parameters\n Arc4::setKey(\"0123456789abcdeffedcba9876543210\");\n Arc4::setMagic(\"MAGIC\");\n Arc4::useCompression(\"true\");\n }", "private function initialize() {\n\t\t$f_code = chr(1);\n\t\t$this->region();\n\t\t$enc_key = $this->create_key(37);\n\t\t$model = str_pad('PHP_BMA', 16, chr(0), STR_PAD_RIGHT);\n\n\t\t$data = $f_code.$enc_key.$this->region().$model;\n\t\t$response = $this->send(self::$initialize_uri, self::GENERATE_SIZE, $this->encrypt($data));\n\t\t$data = $this->decrypt(substr($response, 8), $enc_key);\n\n\t\t$this->_set_sync(substr($response, 0, 8));\n\t\t$this->_set_secret(substr($data, 0, 20));\n\t\t$this->set_serial(substr($data, 20));\n\t}", "public function key_setup($key)\n\t{\n if (is_array($key))\n\t\t{\n $this->key = $key;\n }\n\t\telseif (isset($key) AND ! empty($key))\n\t\t{\n $this->key = $this->_str2long(str_pad($key, 16, $key));\n }\n\t\telse\n\t\t{\n $this->key = array(0,0,0,0);\n\t\t}\n\t}", "function mcrypt_enc_is_block_algorithm($td)\n{\n}", "function blake2bInit($outlen, $key) {\n\t\tif ($outlen === 0 || $outlen > 64) {\n\t\t\tthrow new Exception('Illegal output length, expected 0 < length <= 64');\n\t\t}\n\t\tif (is_array($key) && (count($key) <= 0 || count($key) > 64)) {\n\t\t\tthrow new Exception('Illegal key, expected array with 0 < length <= 64');\n\t\t}\n\n\t\t// state, 'param block'\n\t\t$ctx = array(\n\t\t\t'b' => array_fill(0, 128, 0),\n\t\t\t'h' => array_fill(0, 16, 0),\n\t\t\t't' => 0, // input count\n\t\t\t'c' => 0, // pointer within buffer\n\t\t\t'outlen' => $outlen // output length in bytes\n\t\t);\n\n\t\t// initialize hash state\n\t\tfor ($i = 0; $i < 16; $i++) {\n\t\t\t$ctx['h'][$i] = $this->BLAKE2B_IV32[$i];\n\t\t}\n\t\t\n\t\t$keylen = is_array($key) ? count($key) : 0;\n\t\t$ctx['h'][0] ^= 0x01010000 ^ ($keylen << 8) ^ $outlen;\n\n\t\t// key the hash, if applicable\n\t\tif (is_array($key)) {\n\t\t\t$this->blake2bUpdate($ctx, $key);\n\t\t\t// at the end\n\t\t\t$ctx['c'] = 128;\n\t\t}\n\n\t\treturn $ctx;\n\t}", "protected function setUp()\n\t{\n\t\tif (!extension_loaded('mcrypt')) $this->markTestSkipped(\"mcrypt extension is not available\");\n\t\t\n\t\tparent::setUp();\n\t\t$this->Crypt_MCrypt = new Q\\Crypt_MCrypt(array('method'=>'blowfish', 'secret'=>'s3cret'));\n\t}", "function createRsaKeys() {\n\t\t#\n\t\t# RSA keys\n\t\t# Worden gebruikt om te valideren of spots geldig zijn, hoef je normaal niet aan te komen\n\t\t#\n\t\t$rsaKeys = array();\n\t\t$rsaKeys[2] = array('modulo' => 'ys8WSlqonQMWT8ubG0tAA2Q07P36E+CJmb875wSR1XH7IFhEi0CCwlUzNqBFhC+P',\n\t\t\t\t\t\t\t'exponent' => 'AQAB');\n\t\t$rsaKeys[3] = array('modulo' => 'uiyChPV23eguLAJNttC/o0nAsxXgdjtvUvidV2JL+hjNzc4Tc/PPo2JdYvsqUsat',\n\t\t\t\t\t\t\t'exponent' => 'AQAB');\n\t\t$rsaKeys[4] = array('modulo' => '1k6RNDVD6yBYWR6kHmwzmSud7JkNV4SMigBrs+jFgOK5Ldzwl17mKXJhl+su/GR9',\n\t\t\t\t\t\t\t'exponent' => 'AQAB');\n\t\t\n\t\t$this->setIfNot('rsa_keys', $rsaKeys);\n\t}", "private function setAlgoBlockSize() {\n\t$this->algoBlockSize = mcrypt_module_get_algo_block_size($this->cipher);\n }", "public function des ($key) {\r\n var spfunction1 = new Array (0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004);\r\n var spfunction2 = new Array (-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000);\r\n var spfunction3 = new Array (0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200);\r\n var spfunction4 = new Array (0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080);\r\n var spfunction5 = new Array (0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100);\r\n var spfunction6 = new Array (0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010);\r\n var spfunction7 = new Array (0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002);\r\n var spfunction8 = new Array (0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);\r\n\r\n //create the 16 or 48 subkeys we will need\r\n var keys = des_createKeys (key);\r\n var m=0, i, j, temp, temp2, right1, right2, left, right, looping;\r\n var cbcleft, cbcleft2, cbcright, cbcright2\r\n var endloop, loopinc;\r\n var len = message.length;\r\n var chunk = 0;\r\n //set up the loops for single and triple des\r\n var iterations = keys.length == 32 ? 3 : 9; //single or triple des\r\n if (iterations == 3) {looping = encrypt ? new Array (0, 32, 2) : new Array (30, -2, -2);}\r\n else {looping = encrypt ? new Array (0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array (94, 62, -2, 32, 64, 2, 30, -2, -2);}\r\n\r\n //pad the message depending on the padding parameter\r\n if (padding == 2) message += \" \"; //pad the message with spaces\r\n else if (padding == 1) {temp = 8-(len%8); message += String.fromCharCode (temp,temp,temp,temp,temp,temp,temp,temp); if (temp==8) len+=8;} //PKCS7 padding\r\n else if (!padding) message += \"\\0\\0\\0\\0\\0\\0\\0\\0\"; //pad the message out with null bytes\r\n\r\n //store the result here\r\n result = \"\";\r\n tempresult = \"\";\r\n\r\n if (mode == 1) { //CBC mode\r\n cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);\r\n m=0;\r\n }\r\n\r\n //loop through each 64 bit chunk of the message\r\n while (m < len) {\r\n left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);\r\n\r\n //for Cipher Block Chaining mode, xor the message with the previous result\r\n if (mode == 1) {if (encrypt) {left ^= cbcleft; right ^= cbcright;} else {cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right;}}\r\n\r\n //first each 64 but chunk of the message must be permuted according to IP\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n\r\n left = ((left << 1) | (left >>> 31)); \r\n right = ((right << 1) | (right >>> 31)); \r\n\r\n //do this either 1 or 3 times for each chunk of the message\r\n for (j=0; j<iterations; j+=3) {\r\n endloop = looping[j+1];\r\n loopinc = looping[j+2];\r\n //now go through and perform the encryption or decryption \r\n for (i=looping[j]; i!=endloop; i+=loopinc) { //for efficiency\r\n right1 = right ^ keys[i]; \r\n right2 = ((right >>> 4) | (right << 28)) ^ keys[i+1];\r\n //the result is attained by passing these bytes through the S selection functions\r\n temp = left;\r\n left = right;\r\n right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f]\r\n | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f]\r\n | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f]\r\n | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);\r\n }\r\n temp = left; left = right; right = temp; //unreverse left and right\r\n } //for either 1 or 3 iterations\r\n\r\n //move then each one bit to the right\r\n left = ((left >>> 1) | (left << 31)); \r\n right = ((right >>> 1) | (right << 31)); \r\n\r\n //now perform IP-1, which is IP in the opposite direction\r\n temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);\r\n temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);\r\n temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);\r\n temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);\r\n temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);\r\n\r\n //for Cipher Block Chaining mode, xor the message with the previous result\r\n if (mode == 1) {if (encrypt) {cbcleft = left; cbcright = right;} else {left ^= cbcleft2; right ^= cbcright2;}}\r\n tempresult += String.fromCharCode ((left>>>24), ((left>>>16) & 0xff), ((left>>>8) & 0xff), (left & 0xff), (right>>>24), ((right>>>16) & 0xff), ((right>>>8) & 0xff), (right & 0xff));\r\n\r\n chunk += 8;\r\n if (chunk == 512) {result += tempresult; tempresult = \"\"; chunk = 0;}\r\n } //for every 8 characters, or 64 bits in the message\r\n\r\n //return the result as an array\r\n return result + tempresult;\r\n}", "function _decryptBlock($in)\n {\n $state = unpack('N*', $in);\n\n $sbox = $this->isbox;\n $dw = $this->dw;\n $dt0 = $this->dt0;\n $dt1 = $this->dt1;\n $dt2 = $this->dt2;\n $dt3 = $this->dt3;\n\n // addRoundKey\n $s0 = $state[1] ^ $dw[4];\n $s1 = $state[2] ^ $dw[5];\n $s2 = $state[3] ^ $dw[6];\n $s3 = $state[4] ^ $dw[7];\n\n // invShiftRows + invSubBytes + invMixColumns + addRoundKey\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[8];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[9];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[10];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[11];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[12];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[13];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[14];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[15];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[16];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[17];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[18];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[19];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[20];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[21];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[22];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[23];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[24];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[25];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[26];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[27];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[28];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[29];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[30];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[31];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[32];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[33];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[34];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[35];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[36];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[37];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[38];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[39];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[40];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[41];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[42];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[43];\n\n switch ($this->Nr) {\n case 10:\n break;\n\n case 14:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[56];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[57];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[58];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[59];\n break;\n\n case 12:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n break;\n\n case 13:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54];\n $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n break;\n\n default: // 11\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n }\n\n // invSubWord\n $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24);\n $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24);\n $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24);\n $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24);\n\n // invShiftRows + addRoundKey\n return pack('N*',\n ($e0 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $dw[0],\n ($e1 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $dw[1],\n ($e2 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $dw[2],\n ($e3 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $dw[3]\n );\n }", "public function encryptPassword($pass){\r\n\t\t$this->string = array(\r\n\t\t\t\"string\" => $pass,\r\n\t\t\t\"count\" => strlen($pass)\r\n\t\t);\r\n\t\t//the function setCharacters() is executed to get all the initial characters to use for password encryption.\r\n\t\t$characters = $this->setCharacters();\r\n\t\t/* \r\n\t\t\tIn order to encrypt this password with a unique pattern I took the password and found the position\r\n\t\t\ton my character table. I took all positions that are found on my character table and use those numbers like patters\r\n\t\t\tI set the characters location as ranges in my $start_range variable.\r\n\t\t*/\r\n\t\t$start_range = array();\r\n\t\tfor($x=0; $x<$this->string['count']; $x++){\r\n\t\t\t$start_range[$x] = array_search($this->string['string'][$x], $characters);\r\n\t\t}\r\n\t\tforeach ($start_range as $key => $value) {\r\n\t\t\tif($value == null){\r\n\t\t\t\t$start_range[$key] = $this->string['count'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//doubles the range to make the password more complex base on mathematical additions; submitted on the 1.2 update\r\n\t\t$a = 0;\r\n\t\tfor ($i=0; $i < $this->string['count']; $i++) {\r\n\t\t\t$start_range[$this->string['count'] + $a] = round(($start_range[$i] * ($this->string['count'] + $a))); \r\n\t\t\t$a++;\r\n\t\t}\r\n\t\t/*\r\n\t\t\tUnique matrix is created depending on number of characters and the location of the characters\r\n\t\t\tI set for what i call my matrix to be 5000 characters to make the mattern more complex. you can set that to your liking i dont recommend going lower than 1000 characters.\r\n\t\t*/\r\n\t\t$matrix = $this->generateMatrix($characters, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\t@param array will make sure the matrix is as complex as possible.\r\n\t\t*/\r\n\t\t$matrix_final = $this->generateMatrix($matrix, $start_range, $this->matrixLength);\r\n\t\t/*\r\n\t\t\tI have tested with 128 characters, havent test for less or more yet.\r\n\t\t\tthis is where the magic happens and i use the same consept of creating a matrix to create the final encryption.\r\n\t\t*/\r\n\t\t$final_password = $this->generateMatrix($matrix_final, $start_range, $this->passwordEncryptionLenght);\r\n\t\t$this->encPassword = implode('',$final_password);\r\n\t}", "protected function init()\n\t{\n\t\t$this->upVector = array();\n\t\t$this->downVector = array();\n\t\t$this->modifiedA = array();\n\t\t$this->modifiedB = array();\n\t}", "public function testAllCipherMethods()\n {\n if (!in_array($this->environmentVersion, $this->excludedEnvironments)) {\n $supportedCiphers = $this->weakCipher->getSupportedCiphers();\n foreach ($supportedCiphers as $supportedCipher) {\n $cipher = new Cipher($supportedCipher);\n $this->encryption->setCipher($cipher);\n $encrypted = $this->encryption->encrypt(self::PASSWORD, self::SALT, self::USERNAME);\n $decrypted = $this->encryption->decrypt($encrypted, self::SALT, self::USERNAME);\n $this->assertSame(self::PASSWORD, $decrypted);\n }\n }\n }", "public final function setUp(): void {\n\t\tparent::setUp();\n\t\t//\n\t\t$password = \"abc123\";\n\n\t\t$this->VALID_HASH = password_hash($password, PASSWORD_ARGON2I, [\"time_cost\" => 384]);\n\t\t$this->VALID_ACTIVATION = bin2hex(random_bytes(16));\n\t}", "function setEncryptionKey($key){\n\t\tif($key!=\"\"){\n\t\t\t$this->rc4key=$key;\n\t\t\t$this->rc4 = new rc4crypt();\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "protected function setNewEncryptionKeyAndLogOut() {}", "abstract protected function initRotues();", "protected function _encrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n default:\n $string = $this->_plainText;\n $result = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) + ord($keychar));\n $result .= $char;\n }\n $this->_encryptedText = base64_encode($result);\n break;\n }\n }", "function __construct() {\n $this->initial_sram_bytes = array_fill(0, $this::SRAM_SIZE, 0);\n $this->initial_sram_bytes[$this::ROOM_DATA + 0x20D] = 0xF0;\n $this->initial_sram_bytes[$this::ROOM_DATA + 0x20F] = 0xF0;\n $this->initial_sram_bytes[0x379] = 0b01101000;\n $this->initial_sram_bytes[0x401] = 0xFF;\n $this->initial_sram_bytes[0x402] = 0xFF;\n }", "protected abstract function getSecretKey();", "public function __construct()\n {\n $this->_mcryptExists = (!function_exists('mcrypt_encrypt')) ? false : true;\n\n if ($this->_mcryptExists === false) {\n throw new FlyException(Fly::t('fly', 'The Encrypt library requires the Mcrypt extension.'));\n }\n\n Fly::log('debug', \"Encrypt Class Initialized\");\n }", "private function getKey(){\r\n\t\t# convert a string into a key\r\n\t\t# key is specified using hexadecimal\r\n\t\t# show key size use either 16, 24 or 32 byte keys for AES-128, 192\r\n\t\t# and 256 respectively\t\t\r\n\t\t$key = array(\"key\" => $this->_keygen_str, \"key_size\"=>strlen($this->_keygen_str));\r\n\t\t\r\n\t\t# create a random IV to use with CBC encoding\r\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\r\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\r\n\t\t$key[\"iv_size\"] = $iv_size;\r\n\t\t$key[\"iv\"] = $iv;\r\n\t\t\r\n\t\treturn $key;\r\n\t}", "public function encrypt($str, $key, $method = '') {\n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n \n // Create return array\n $return = array('decrypted' => addslashes(trim($str)), 'encrypted' => '', 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array(), 'decryptedlen' => strlen(addslashes(trim($str))), 'encryptedlen' => 0, 'compressedlen' => 0);\n\n // String cannot be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key cannot be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Generate cipher_algorithm string to glue it to output string\n $len = 32;\n $algorithm = $this->textToBinary(mb_substr($this->cipher_algorithm.'_'.$this->generateRandomString($len-strlen($this->cipher_algorithm)), 0, $len));\n if(count(explode(' ',$algorithm)) !== $len) {\n $return['error'][] = 'Algorithm error';\n trigger_error('Algorithm error', E_USER_NOTICE); \n return $return;\n }\n \n // Create an IV and save it as binary\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $return['iv'] = bin2hex($iv); \n \n // Split input to be able to encrypt larger strings\n foreach(str_split($return['decrypted'], 20) as $str) {\n $return['base64_encode'][] = $this->textToBinary(base64_encode(openssl_encrypt($str, $method, $key, OPENSSL_RAW_DATA, $iv)), null);\n }\n \n // Glue everything togeather\n $return['encrypted'] = $algorithm. PHP_EOL . implode(PHP_EOL, $return['base64_encode']) . PHP_EOL . $this->textToBinary($return['iv']);\n $return['encrypted'] = str_replace(array(' ',PHP_EOL),array($this->delimiter_character,$this->delimiter_breaks),$this->delimiter_characters.' '.$return['encrypted'].' '.$this->delimiter_characters);\n $return['encryptedlen'] = strlen($return['encrypted']);\n \n // Compress the string if enabled\n if($this->compress==true) {\n $return['encryptednotcompressed'] = $return['encrypted'];\n $return['encrypted'] = addslashes($this->delimiter_gz.utf8_encode(gzencode($return['encrypted'],9)).$this->delimiter_gz);\n $return['compressedlen'] = strlen($return['encrypted']);\n }\n \n return $return;\n }", "public function encrypt();", "private function getEncryptionKeys(){\n\t\treturn $this->cryptokeys;\n\t\t/*\n\t\treturn array('REGISTRATION'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'EMAIL'=> \tarray(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t32,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'PROFILE'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t*/\n\t\t\n\t\t\t\t\t \t\t\t\n\t}", "protected function _crypt($data, $algorithm, $param = null, $encrypt = true) {}", "function _encipher(&$Xl, &$Xr)\n {\n if ($Xl < 0) {\n $Xl += 4294967296;\n }\n if ($Xr < 0) {\n $Xr += 4294967296;\n }\n\n for ($i = 0; $i < 16; $i++) {\n $temp = $Xl ^ $this->_P[$i];\n if ($temp < 0) {\n $temp += 4294967296;\n }\n\n $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]\n + $this->_S[1][($temp >> 16) & 255], 4294967296) \n ^ $this->_S[2][($temp >> 8) & 255]) \n + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;\n $Xr = $temp;\n }\n $Xr = $this->_binxor($Xl, $this->_P[16]);\n $Xl = $this->_binxor($temp, $this->_P[17]);\n }", "private static function genKey($seed=null) {\r\n\t\tself::seedRand();\r\n\t\t\r\n\t\t$randomness = get_loaded_extensions(); // get an array of the loaded extentions\r\n\t\t$randomness[] = php_uname(); // Get the UNAME of this php install\r\n\t\t$randomness[] = memory_get_usage(); // get the mem usage\r\n\t\t$randomness = implode(rand(), $randomness); // Implode the array with a random integer\r\n\t\t\r\n\t\t$random_key = (!is_null($seed)?hash_hmac('sha256', $randomness, $seed):hash('sha256', $randomness)); // Make a realy, highly entropic key\r\n\t\t\r\n\t\t$seq_key = mcrypt_encrypt( // Generate the Sequance key\r\n\t\t\tself::cpy_aes256, // Using RIJNDAEL_256\r\n\t\t\tsubstr($random_key, 0, mcrypt_get_key_size(self::cpy_aes256, self::mod_ecb)), // Trim the key to fit\r\n\t\t\tmicrotime(), // Feed in microtime()\r\n\t\t\tself::mod_ecb, // Useing ECB mode\r\n\t\t\tself::genNullIV(self::cpy_aes256, self::mod_ecb) // Give it a null IV\r\n\t\t);\r\n\t\t\r\n\t\treturn bin2hex($seq_key); // convert the binary expression to hexidecimal and then return it\r\n\t}", "public static function encrypt($textToEncrypt, $password, $nrBits)\r\n {\r\n $blockSize = 16;\r\n\r\n /**\r\n * AES permite utilizarea cheilor de criptare cu dimensiuni de 128/192/256 biti.\r\n */\r\n if (!($nrBits == 128 || $nrBits == 192 || $nrBits == 256)) {\r\n return '';\r\n }\r\n\r\n /**\r\n * Folosim algoritmul AES pentru criptarea parolei cu care, mai apoi, vom cripta textul.\r\n */\r\n $nBytes = $nrBits / 8;\r\n $pwBytes = array();\r\n for ($i = 0; $i < $nBytes; $i++) {\r\n $pwBytes[$i] = ord(substr($password, $i, 1)) & 0xff;\r\n }\r\n $key = AES::encryptByteArray($pwBytes, AES::keyExpansion($pwBytes));\r\n $key = array_merge($key, array_slice($key, 0, $nBytes - 16)); // marim cheia pana la 16/24/32 de octeti\r\n\r\n /**\r\n * Avem nevoie de a initializa primii 8 octeti cu valori aleatorii, care vor fi unice pentru fiecare incercare de criptare.\r\n */\r\n $counterBlock = array();\r\n $nonce = floor(microtime(true) * 1000);\r\n $nonceMs = $nonce % 1000;\r\n $nonceSec = floor($nonce / 1000);\r\n $nonceRnd = floor(rand(0, 0xffff));\r\n\r\n for ($i = 0; $i < 2; $i++) {\r\n $counterBlock[$i] = self::unsignedRightShift($nonceMs, $i * 8) & 0xff;\r\n }\r\n for ($i = 0; $i < 2; $i++) {\r\n $counterBlock[$i + 2] = self::unsignedRightShift($nonceRnd, $i * 8) & 0xff;\r\n }\r\n for ($i = 0; $i < 4; $i++) {\r\n $counterBlock[$i + 4] = self::unsignedRightShift($nonceSec, $i * 8) & 0xff;\r\n }\r\n\r\n /**\r\n * Transformam din ASCII in caractere\r\n */\r\n $ctrTxt = '';\r\n for ($i = 0; $i < 8; $i++) {\r\n $ctrTxt .= chr($counterBlock[$i]);\r\n }\r\n\r\n /**\r\n * Generam un array din cheia cifrata, pe care-l vom folosi la criptarea textului.\r\n * La fiecare etapa de criptare vom folosi o anumita parte din cheie.\r\n */\r\n $keySchedule = AES::keyExpansion($key);\r\n\r\n $blockCount = ceil(strlen($textToEncrypt) / $blockSize);\r\n $ciphertxt = array();\r\n\r\n for ($b = 0; $b < $blockCount; $b++) {\r\n for ($c = 0; $c < 4; $c++) {\r\n $counterBlock[15 - $c] = self::unsignedRightShift($b, $c * 8) & 0xff;\r\n }\r\n for ($c = 0; $c < 4; $c++) {\r\n $counterBlock[15 - $c - 4] = self::unsignedRightShift($b / 0x100000000, $c * 8) & 0xff;\r\n }\r\n\r\n $cipherCntr = AES::encryptByteArray($counterBlock, $keySchedule);\r\n\r\n $blockLength = $b < $blockCount - 1 ? $blockSize : (strlen($textToEncrypt) - 1) % $blockSize + 1;\r\n $cipherByte = array();\r\n\r\n for ($i = 0; $i < $blockLength; $i++) {\r\n $cipherByte[$i] = $cipherCntr[$i] ^ ord(substr($textToEncrypt, $b * $blockSize + $i, 1));\r\n $cipherByte[$i] = chr($cipherByte[$i]);\r\n }\r\n $ciphertxt[$b] = implode('', $cipherByte);\r\n }\r\n\r\n $ciphertext = $ctrTxt.implode('', $ciphertxt);\r\n $ciphertext = base64_encode($ciphertext);\r\n\r\n return $ciphertext;\r\n }", "function init_cache_setup()\n\t{\n\t\t//--------------------------------\n\t\t// Eaccelerator...\n\t\t//--------------------------------\n\t\t\n\t\tif( function_exists('eaccelerator_get') AND isset($this->vars['use_eaccelerator']) AND $this->vars['use_eaccelerator'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_eaccelerator.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Turck-mmcache...\n\t\t//--------------------------------\n\t\t\n\t\tif( function_exists('mmcache_get') AND isset($this->vars['use_mmcache']) AND $this->vars['use_mmcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_mmcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// Memcache\n\t\t//--------------------------------\t\n\t\t\t\n\t\telse if( function_exists('memcache_connect') AND isset($this->vars['use_memcache']) AND $this->vars['use_memcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_memcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t\t\n\t\t\t$this->cachelib->connect( $this->vars );\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// XCache...\n\t\t//--------------------------------\n\t\t\n\t\telse if( function_exists('xcache_get') AND isset($this->vars['use_xcache']) AND $this->vars['use_xcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_xcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// APC...\n\t\t//--------------------------------\n\t\t\n\t\telse if( function_exists('apc_fetch') AND isset($this->vars['use_apc']) AND $this->vars['use_apc'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_apc.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\t\t\n\t\t\n\t\t//--------------------------------\n\t\t// Diskcache\n\t\t//--------------------------------\t\n\t\t\n\t\telse if( isset($this->vars['use_diskcache']) AND $this->vars['use_diskcache'] == 1 )\n\t\t{\n\t\t\trequire KERNEL_PATH.'class_cache_diskcache.php';\n\t\t\t$this->cachelib = new cache_lib( $this->vars['board_url'] );\n\t\t}\n\t\t\n\t\tif( is_object($this->cachelib) AND $this->cachelib->crashed )\n\t\t{\n\t\t\t// There was a problem - not installed maybe?\n\t\t\t\n\t\t\tunset($this->cachelib);\n\t\t\t$this->cachelib = NULL;\n\t\t}\n\t}", "public static function aes128Encrypt($key, $data) {}", "abstract protected function _init();", "abstract protected function _init();", "function shufflecrypt($action,$string=\"\",$key_hash=\"\"){\n\tglobal $_shufflecrypt;\n\t\t//debug?\n\t\t\t$d=($_shufflecrypt['debug'] ? 1 : 0);\n\t//setup.\n\t\t$_self=array('version'=>'v0.1.20130429105038');\n\t\t$key_hash=base64_decode($key_hash);\n\t\t//do not change.\n\t\t\t$key=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`1234567890-=[]\\;',./~!@#$%^&*()_+{}|:\\\"<>?\";\n\t\t//END: do not change.\n\tif($d){echo \"--\\n\".strlen($key_hash).\"]\".$key_hash.\"\\n[\".strlen($key).\"]\".$key.\"\\n--\";}\n\tif($action==\"ver\" || $action==\"version\"){\n\t\t$o=$_self['version'];\n\t}else if($action==\"decrypt\" || $action==\"unshuffle\"){\n\t\t//de-shuffle.\n\t\t$string=base64_decode($string);\n\t\t$len=strlen($string);\n\t\tif($d){echo \"LEN:\".$len.\"\\n\";}\n\t\tfor($i=0; $i < $len; $i++){\n\t\t\t$pos=strpos($key_hash,$string[$i]);\n\t\t\tif($d){echo $i.\"[POS: \".$pos.\", CHAR:\".$string[$i].\", REPLACE:\".$key[$pos].\"]\\n\";}\n\t\t\t$o.=$key[$pos];\n\t\t}\n\t}else if($action==\"generatehash\"){\n\t\t$o=str_shuffle($key);\n\t\t$o=base64_encode($o);\n\t}else{\n\t\t//shuffle.\n\t\t$len=strlen($string);\n\t\tif($d){echo \"LEN:\".$len.\"\\n\";}\n\t\t\n\t\tfor($i=0; $i < $len; $i++){\n\t\t\t$pos=strpos($key,$string[$i]);\n\t\t\tif($d){echo $i.\"[POS: \".$pos.\", CHAR:\".$string[$i].\", REPLACE:\".$key_hash[$pos].\"]\\n\";}\n\t\t\t$o.=$key_hash[$pos];\n\t\t}\n\t\t$o=base64_encode($o);\n\t}\n\treturn $o;\n}", "public function keyPoolRefill();", "public static function updateEncryptionKeys(array &$keys, $byte)\n {\n /*\n Where update_keys() is defined as:\n\n update_keys(char):\n Key(0) <- crc32(key(0),char)\n Key(1) <- Key(1) + (Key(0) & 000000ffH)\n Key(1) <- Key(1) * 134775813 + 1\n Key(2) <- crc32(key(2),key(1) >> 24)\n end update_keys\n */\n\n $keys[0] = Crc32::updateCrc32($keys[0], $byte);\n $keys[1] = $keys[1] + ($keys[0] & 0xff);\n $keys[1] = ($keys[1] * 134775813 + 1) & 0xffffffff;\n $keys[2] = Crc32::updateCrc32($keys[2], $keys[1] >> 24);\n }", "function xoft_encode($plain_data,$key){\r\n\r\n $key_length=0; //key length counter\r\n $all_bin_chars=\"\";\r\n $cipher_data=\"\";\r\n\r\n for($i=0;$i<mb_strlen($plain_data);$i++){\r\n\t$p=mb_substr($plain_data,$i,1); // p = plaintext\r\n\t$k=mb_substr($key,$key_length,1); // k = key\r\n\t$key_length++;\r\n\r\n\tif($key_length>=mb_strlen($key)){\r\n\t\t$key_length=0;\r\n\t}\r\n\r\n\t$dec_chars=ord($p)^ord($k);\r\n\t$dec_chars=$dec_chars + mb_strlen($key);\r\n\t$bin_chars=decbin($dec_chars);\r\n\r\n\twhile(mb_strlen($bin_chars)<8){\r\n\t\t$bin_chars=\"0\".$bin_chars;\r\n\t}\r\n\r\n\t$all_bin_chars=$all_bin_chars.$bin_chars;\r\n\r\n }\r\n\r\n $m=0;\r\n\r\n for($j=0;$j<mb_strlen($all_bin_chars);$j=$j+4){\r\n\t$four_bit=mb_substr($all_bin_chars,$j,4); // split 8 bit to 4 bit\r\n\t$four_bit_dec=bindec($four_bit);\r\n\r\n\t$decimal_value=$four_bit_dec * 4 + $m; //multiply by 4 plus m where m=0,1,2, or 3\r\n\r\n\t$base64_value=dectobase64($decimal_value); //convert to base64 value\r\n\t$cipher_data=$cipher_data.$base64_value;\r\n\t$m++;\r\n\r\n\tif($m>3){\r\n\t\t$m=0;\r\n\t}\r\n }\r\n\r\n return $cipher_data;\r\n}", "abstract protected function generateKey();", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "public function __construct()\n {\n $this->method = 'des-ecb';\n\n // WinVNC uses a fixed key with reversed bits to encrypt/decrypt password in registry\n // Original Key: \\x17\\x52\\x6B\\x06\\x23\\x4E\\x58\\x07\n // Reversed Bits: \\xE8\\x4A\\xD6\\x60\\xC4\\x72\\x1A\\xE0\n $this->key = hex2bin('e84ad660c4721ae0');\n\n // We are sending raw data with zero padding to OpenSSL\n $this->options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING;\n\n // des-ecb seems to use 8 character block size\n $this->block_size = 8;\n }", "public function getEncryptionDictionary() {}", "private function init() {\n // Set environment variables MUST BE DONE IN THIS ORDER!\n self::initDefaultFormValues(); // Assign default values to forms\n self::initTablePriorityHash();\n self::initTableTypePriorityHash();\n self::initTableHash(); // assign tables.\n self::initTableColumnsHash(); // assign hash with column details.\n #self::initSurveyHash(); // Assign Surveys TODO Place this back in when surveys are merged.\n self::initAstroFilterHash(); // Assign Filters\n self::initQualityFlags(); // assign hash with column details for all quality flag tables.\n }", "private function _generate_enckey()\n {\n // encrypt user id and email so that nobody gets the user information\n $this->_user->enc_key = $this->encryption->encrypt($this->_user->id . '-' . $this->_user->email_address);\n\n // use codeigniters string helper to generate random key\n $string = random_string('alnum', 16);\n\n // encrypt it again just for nothing and then return the key.\n return $this->encryption->encrypt($string);\n }", "public function encender();", "public function initialize()\n {\n $this->config = new \\Configs\\Core\\PasswordResetKeys();\n\n\n }", "abstract protected function getCrypt();", "function encrypt($password,$code_1,$code_2,$dateandtime){\n\t\n\t$pass_length=strlen($password);\n\n\t$rotate_mag=3;\n\n\t\t$rotated_password=$password; //No Rotation\n\n\n\n//\t$rotated_password=substr($password,$rotate_mag).substr($password,0,$rotate_mag);\n\n\t\n\n\t//$code=$code_1.$code_2;\n\n\t$dateandtime_for_encrypt=$code_1.$dateandtime.$code_2;\n\t\t\n\t$password='';\n\t\t\n\t\tfor($i=0;$i<=strlen($rotated_password)-1;$i++){\t\n\t\t\t\n\t\t\tif(($i!=strlen($rotated_password)-1)){\n\t\t\t\t$password.=ord($rotated_password[$i])*ord($dateandtime_for_encrypt[$i]).\" \";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$password.=ord($rotated_password[$i])*ord($dateandtime_for_encrypt[$i]);//FOR THE LAST ONE\t\t\t\n\t\t\t}\t\n\t\t}\n\t\t\nreturn $password;\n}", "public static function getDefaultParams( $params ) {\n if ( !isset( $params['key'] ) ) throw new AblyException ( 'No key specified.', 40003, 400 );\n\n $cipherParams = new CipherParams();\n\n if ( isset( $params['base64Key'] ) && $params['base64Key'] ) {\n $params['key'] = strtr( $params['key'], '_-', '/+' );\n $params['key'] = base64_decode( $params['key'] );\n }\n\n $cipherParams->key = $params['key'];\n $cipherParams->algorithm = isset( $params['algorithm'] ) ? $params['algorithm'] : 'aes';\n\n if ($cipherParams->algorithm == 'aes') {\n $cipherParams->mode = isset( $params['mode'] ) ? $params['mode'] : 'cbc';\n $cipherParams->keyLength = isset( $params['keyLength'] ) ? $params['keyLength'] : strlen( $cipherParams->key ) * 8;\n\n if ( !in_array( $cipherParams->keyLength, [ 128, 256 ] ) ) {\n throw new AblyException ( 'Unsupported keyLength. Only 128 and 256 bits are supported.', 40003, 400 );\n }\n\n if ( $cipherParams->keyLength / 8 != strlen( $cipherParams->key ) ) {\n throw new AblyException ( 'keyLength does not match the actual key length.', 40003, 400 );\n }\n\n if ( !in_array( $cipherParams->getAlgorithmString(), [ 'aes-128-cbc', 'aes-256-cbc' ] ) ) {\n throw new AblyException ( 'Unsupported cipher configuration \"' . $cipherParams->getAlgorithmString()\n . '\". The supported configurations are aes-128-cbc and aes-256-cbc', 40003, 400 );\n }\n } else {\n if ( isset( $params['mode'] ) ) $cipherParams->mode = $params['mode'];\n if ( isset( $params['keyLength'] ) ) $cipherParams->keyLength = $params['keyLength'];\n\n if ( !$cipherParams->checkValidAlgorithm() ) {\n throw new AblyException( 'The specified algorithm \"'.$cipherParams->getAlgorithmString().'\"'\n . ' is not supported by openssl. See openssl_get_cipher_methods.', 40003, 400 );\n }\n }\n\n if ( isset( $params['iv'] ) ) {\n $cipherParams->iv = $params['iv'];\n if ( isset( $params['base64Iv'] ) && $params['base64Iv'] ) {\n $cipherParams->iv = strtr( $cipherParams->iv, '_-', '/+' );\n $cipherParams->iv = base64_decode( $cipherParams->iv );\n }\n } else {\n $cipherParams->generateIV();\n }\n\n return $cipherParams;\n }", "protected function _process()\n {\n //Generate key string, if not already generated\n if (!isset($this->_keyString) || strlen($this->_keyString) == 0) {\n //generate key string from key data\n if (!is_array($this->_keyData)) {\n $this->_keyData = array();\n }\n $this->_keyData['_siteKey'] = self::$_siteKey;\n $this->_generateKey();\n }\n\n //Set cypher used, if not already set\n if (!isset($this->_cypherUsed) || !in_array($this->_cypherUsed, self::$_validCyphers)) {\n $this->_cypherUsed = self::$_defaultCypher;\n }\n\n //Encrypt or decrypt text, depending on which one is not already set\n if (!isset($this->_encryptedText) && isset($this->_plainText)) {\n //go from plain text to encrypted\n $this->_encrypt();\n } elseif (isset($this->_encryptedText) && !isset($this->_plainText)) {\n //go from encrypted to plain text\n $this->_decrypt();\n }\n }", "function rc4($data, $pwd)\n{\n $cipher = '';\n $key[] = \"\";\n $box[] = \"\";\n $pwd_length = strlen($pwd);\n $data_length = strlen($data);\n for ($i = 0; $i < 256; $i++) {\n $key[$i] = ord($pwd[$i % $pwd_length]);\n $box[$i] = $i;\n }\n for ($j = $i = 0; $i < 256; $i++) {\n $j = ($j + $box[$i] + $key[$i]) % 256;\n $tmp = $box[$i];\n $box[$i] = $box[$j];\n $box[$j] = $tmp;\n }\n for ($a = $j = $i = 0; $i < $data_length; $i++) {\n $a = ($a + 1) % 256;\n $j = ($j + $box[$a]) % 256;\n $tmp = $box[$a];\n $box[$a] = $box[$j];\n $box[$j] = $tmp;\n $k = $box[(($box[$a] + $box[$j]) % 256)];\n $cipher .= chr(ord($data[$i]) ^ $k);\n echo \"code:\" . ord($data[$i]) . \"\\tk:$k\". PHP_EOL;\n }\n return $cipher;\n}", "abstract protected function initializeExtendedKernel();", "public function generate() {\n\t\tif (!is_dir($this->keystoresPath) && !file_exists($this->keystoresPath)) {\n\t\t\tmkdir($this->keystoresPath, 0777, true);\n\t\t}\n\n\t\t$pemFile = sprintf('%1$s/%2$s_private.pem', $this->keystoresPath, $this->uuid);\n\t\t$derFile = sprintf('%1$s/%2$s_public.der', $this->keystoresPath, $this->uuid);\n\t\t$encPemFile = sprintf('%1$s/%2$s_enc_private.pem', $this->keystoresPath, $this->uuid);\n\t\t$certFile = sprintf('%1$s/%2$s_cert.csr', $this->keystoresPath, $this->uuid);\n\n\t\t$privKey = openssl_pkey_new(self::$PKEY_CONFIG);\n\t\t$csr = openssl_csr_new(self::$DN, $privKey);\n\t\t$sscert = openssl_csr_sign($csr, null, $privKey, $this->keyDays);\n\t\topenssl_csr_export($csr, $csrOut);\n\t\topenssl_x509_export($sscert, $certOut);\n\t\topenssl_pkey_export($privKey, $privateKey);\n\n\t\tfile_put_contents($pemFile, $privateKey);\n\t\tfile_put_contents($certFile, $csrOut);\n\t\texec(\"openssl x509 -req -in $certFile -out $derFile -outform der -signkey $pemFile\");\n\n\t\t$count = 0;\n\t\t$wait = true;\n\t\twhile ($wait && $count < 5) {\n\t\t\tif (file_exists($derFile)) {\n\t\t\t\t$wait = false;\n\t\t\t}\n\t\t\t$count++;\n\t\t\tsleep(1);\n\t\t}\n\t\t$this->certKey = base64_encode($certOut);\n\t\t$this->enCryptKey = base64_encode(file_get_contents($derFile));\n\t\t$this->deCryptKey = base64_encode($privateKey);\n\t\treturn $this;\n\t}", "function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}", "protected function _generateKey()\n {\n $key = '';\n ksort($this->_keyData); //so that the order of the array doesn't matter in the key that is generated.\n foreach ($this->_keyData as $i => $val) {\n //\"clean\" the data some\n if (is_numeric($val)) {\n $val = (float)$val;\n //force it to be 4 decimal places every single time, and use thousands\n //seperator, just because we can and we need all numbers to be uniform\n //so they look the same even after getting sent to the database and coming back again.\n $val = number_format($val, 4, '.', ',');\n } else {\n $val = trim($val);\n }\n //NOTE: May need to do further \"cleaning\" to ensure value always stays\n //the same even after getting sent to and from the DB... if so do that\n //cleaning here, NOT outside of this class... we need 1 solution in 1\n //place, not 20 different solutions...\n\n $key = \"$i:_:{$key}:_:$val\";\n }\n //If debug enabled, show what the key is before hash, so we can troubleshoot\n //problems caused by the key changing when trying to decrypt.\n if (self::DEBUG) {\n trigger_error('DEBUG CRYPT: Key used before hash=' . $key);\n }\n $this->_keyString = sha1($key);\n }", "abstract protected function _init( );", "public function __construct()\n {\n # Creates a major progression matrix\n $this->cypherMatrix = array(\n 'I' => array ('V', 'vi', 'ii', 'iii', 'VI6'),\n 'ii' => array ('iii', 'V', 'vi','I', 'VII65'),\n 'II6' => 'V',\n 'iii' => array ('I', 'V', 'IV'),\n 'III6' => 'vi',\n 'IV' => array ('V', 'I', 'bVII', 'vi', 'II6'),\n 'V' => array ('I', 'ii', 'iii', 'III6'),\n 'V6' => 'I',\n 'vi' => array ('ii', 'V6', 'IV'),\n 'VI6' => 'ii',\n 'bVII' => 'IV',\n 'viidim' => 'I',\n 'VII65' => 'iii'\n \n );\n \n \n # Creates a 12 tone MAJOR cypher scale\n $this->cypherScale = array(\n '1' => 'I',\n '2' => 'VI6',\n '3' => 'ii',\n '4' => 'VII65',\n '5' => 'iii',\n '6' => 'IV',\n '7' => 'II6',\n '8' => 'V',\n '9' => 'III6',\n '10' => 'vi',\n '11' => 'bVII',\n '12' => 'viidim',\n );\n \n \n \n # Creates a MINOR cypher progression matrix\n $this->cypherMatrixMinor = array(\n 'i' => array ('V', 'VI', 'iv', 'iidim56', 'I6'),\n 'I6' => array ('iv', 'II6'),\n 'iidim56' => 'V',\n 'II' => 'v',\n 'II6' => 'v',\n 'III' => array ('i', 'V', 'iv'),\n 'iv' => array ('V', 'i', 'iidim56', 'III'),\n 'IV6' => 'VII',\n 'v' => array ('III', 'V'),\n 'V' => 'i',\n 'V65' => 'i',\n 'VI' => array ('III', 'VII', 'iv'),\n 'VII' => 'V', \n );\n\n \n \n # Creates a 12 tone MINOR cypher scale\n $this->cypherScaleMinor = array(\n '1' => 'i',\n '2' => 'V65',\n '3' => 'iidim7',\n '4' => 'III', \n '5' => 'I6', # Doesn't exist in minor scale\n '6' => 'iv',\n '7' => 'II6', # Another first inversion to cover exception\n '8' => 'V',\n '9' => 'VI',\n '10' => 'IV6',\n '11' => 'VII',\n '12' => 'V65',\n );\n \n # Creates a chord progression matrix\n $this->fullChordMatrix = array(\n 'c' => array('g6', 'am', 'dmaj7', 'dm'),\n 'dm' => array('emaj7', 'g', 'g6', 'amaj7'),\n 'dmaj7' => array('g', 'g6'),\n 'em' => array('c', 'emaj7'),\n 'emaj7' => 'am',\n 'g' => array('g7', 'c', 'dmaj7', 'em'),\n 'g6' => array('dmaj7', 'amaj7'),\n 'g7' => 'c',\n 'am' => array('dm', 'bmaj7'),\n 'amaj7' => array('dm', 'bb'),\n 'bb' => 'g6',\n 'bmaj7' => 'emaj7', \n );\n \n # Creates a 12 tone scale array\n $this->serialScale = array(\n '1' => 'c',\n '2' => 'c#',\n '3' => 'd',\n '4' => 'd#',\n '5' => 'e',\n '6' => 'f',\n '7' => 'f#',\n '8' => 'g',\n '9' => 'g#',\n '10' => 'a',\n '11' => 'a#',\n '12' => 'b',\n \n );\n \n # Creates a 12 tone scale array in MAJOR\n $this->serialScaleMajor = array(\n '1' => 'C',\n '2' => 'C#',\n '3' => 'D',\n '4' => 'D#',\n '5' => 'E',\n '6' => 'F',\n '7' => 'F#',\n '8' => 'G',\n '9' => 'G#',\n '10' => 'A',\n '11' => 'A#',\n '12' => 'B',\n \n );\n \n \n \n $this->tonalityIndex = array (\n \n 'FIndexMajor' => array(\n 'I' => 'F',\n 'ii' => 'g',\n 'iii' => 'a',\n 'IV' => 'Bb',\n 'V' => 'C',\n 'vi' => 'd',\n 'viidim' => 'edim', \n ),\n \n 'GIndexMajor' => array(\n 'I' => 'G',\n 'ii' => 'a',\n 'iii' => 'b',\n 'IV' => 'C',\n 'V' => 'D',\n 'vi' => 'e',\n 'viidim' => 'f#dim6',\n ),\n \n 'GIndexMinor' => array(\n 'i' => 'G',\n 'iidim7' => 'adim7',\n 'III' => 'Bb',\n 'iv' => 'c7',\n 'V' => 'D',\n 'VI' => 'Eb',\n 'VII' => 'f',\n ),\n \n 'CIndexMajor' => array(\n 'I' => 'C',\n 'ii' => 'd7',\n 'II6' => 'D6',\n 'iii' => 'e',\n 'III6' => 'E6',\n 'IV' => 'F',\n 'V' => 'G',\n 'V6' => 'G6',\n 'vi' => 'a',\n 'VI6' => 'A6',\n 'bVII' => 'Bb',\n 'viidim' => 'bdim',\n 'VII65' => 'bhalfdim',\n ),\n \n 'AbIndexMajor' => array(\n 'I' => 'Ab',\n 'ii' => 'bb',\n 'II6' => 'Bb6',\n 'iii' => 'c',\n 'III6' => 'C6',\n 'IV' => 'Db',\n 'V' => 'Eb',\n 'V6' => 'Eb6',\n 'vi' => 'f',\n 'VI6' => 'F6',\n 'bVII' => 'Gb',\n 'viidim' => 'gdim6',\n 'VII65' => 'ghalfdim',\n ),\n \n \n 'AIndexMinor' => array(\n 'i' => 'a',\n 'I6' => 'A6',\n 'iidim7' => 'bdim7',\n 'iidim56' => 'bdim56',\n 'II' => 'B',\n 'II6' => 'B6',\n 'III' => 'C',\n 'iv' => 'd',\n 'IV6' => 'D6',\n 'v' => 'e',\n 'V' => 'E',\n 'V65' => 'E65',\n 'VI' => 'F',\n 'VII' => 'G',\n ),\n \n 'CIndexMinor' => array(\n 'i' => 'c',\n 'I6' => 'C6',\n 'iidim7' => 'ddim7',\n 'iidim56' => 'ddim56',\n 'II' => 'D',\n 'II6' => 'D6',\n 'III' => 'Eb',\n 'iv' => 'f',\n 'IV6' => 'D6',\n 'v' => 'g',\n 'V' => 'G',\n 'V65' => 'G65',\n 'VI' => 'Ab',\n 'VII' => 'Bb', \n ),\n );\n \n # Progressions ending on same degree as start\n $this->progressionListMaj1 = array (\"5\", \"6\", \"5\", \"5\", \"5\", \"5\", \"5\"); # a \"6-5\" progression\n $this->progressionListMaj2 = array (\"7\", \"2\", \"7\", \"1\", \"-5\"); # a \"5-2\" progression\n \n $this->progressionListMin1 = array (\"5\", \"5\", \"5\", \"5\", \"6\", \"5\", \"5\"); # 6-5\n $this->progressionListMin2 = array (\"7\", \"1\", \"7\", \"2\", \"7\"); # 5-2\n \n }", "public static function init($dataDir = null, $debug = false)\r\n\t{\r\n\t\tif(self::$_started)\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tself::$debug = $debug;\r\n\r\n\t\tif(!defined(\"PHP_VERSION_ID\") || PHP_VERSION_ID < 50300)\r\n\t\t{\r\n\t\t\tself::addDebug(\"PHP version must be >= 5.3 to run KeePassPHP.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!extension_loaded(\"hash\"))\r\n\t\t{\r\n\t\t\tself::addDebug(\"hash must be loaded to use KeePassPHP.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(PHP_VERSION_ID >= 50400 && extension_loaded(\"openssl\"))\r\n\t\t{\r\n\t\t\tself::addDebug(\"KeePassPHP will use the OpenSSL extension.\");\r\n\t\t}\r\n\t\telse if(!extension_loaded(\"mcrypt\"))\r\n\t\t{\r\n\t\t\tself::addDebug(\"No suitable cryptography extension found.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(!defined(\"MCRYPT_RIJNDAEL_128\"))\r\n\t\t{\r\n\t\t\tself::addDebug(\"Rijndael 128 is not supported by your libmcrypt (it is probably too old).\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tself::addDebug(\"KeePassPHP will use the Mcrypt extension.\");\r\n\t\t\tif(PHP_VERSION_ID >= 70100)\r\n\t\t\t{\r\n\t\t\t\tself::addDebug(\"The Mcrypt extension is deprecated since PHP 7.1. KeePassPHP will use it anyway, but consider installing OpenSSL.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($dataDir === null)\r\n\t\t\t$dataDir = dirname(__FILE__) . '/' . self::DEFAULT_DATA_DIR;\r\n\t\telse\r\n\t\t\t$dataDir = rtrim($dataDir, '/') . '/';\r\n\r\n\t\tself::$_kphpdbManager = new FileManager(\r\n\t\t\t$dataDir . self::DIR_KPHPDB, self::PREFIX_KPHPDB, true, false);\r\n\t\tself::$_databaseManager = new FileManager(\r\n\t\t\t$dataDir . self::DIR_DATABASE, self::PREFIX_DATABASE, true, false);\r\n\t\tself::$_keyManager = new FileManager(\r\n\t\t\t$dataDir . self::DIR_KEY, self::PREFEXT_KEY, true, false);\r\n\r\n\t\tself::$_started = true;\r\n\t\tself::addDebug(\"KeePassPHP application started.\");\r\n\t\treturn true;\r\n\t}", "public function init()\n\t{\n\t\t$this->dictionary = new Dictionary($this->iblockId);\n\t\t$this->storage = new Storage($this->iblockId);\n\t\tif (self::$catalog === null)\n\t\t{\n\t\t\tself::$catalog = \\Bitrix\\Main\\Loader::includeModule(\"catalog\");\n\t\t}\n\n\t\tif (self::$catalog)\n\t\t{\n\t\t\t$catalog = \\CCatalogSKU::getInfoByProductIBlock($this->iblockId);\n\t\t\tif (!empty($catalog) && is_array($catalog))\n\t\t\t{\n\t\t\t\t$this->skuIblockId = $catalog[\"IBLOCK_ID\"];\n\t\t\t\t$this->skuPropertyId = $catalog[\"SKU_PROPERTY_ID\"];\n\t\t\t}\n\t\t}\n\t}", "public function testEncryptionKeyGeneration()\n {\n $generator = $this->getTokenGeneratorForTesting(new PseudoRandom());\n\n $resultOne = $generator->getEncryptionKey(64);\n $resultTwo = $generator->getEncryptionKey(64);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $resultOne = $generator->getEncryptionKey(64, false);\n $resultTwo = $generator->getEncryptionKey(64, false);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $generator->seedRandomGenerator(42);\n $resultOne = $generator->getEncryptionKey(64);\n\n $generator->seedRandomGenerator(42);\n $resultTwo = $generator->getEncryptionKey(64);\n\n $this->assertEquals($resultOne, $resultTwo);\n }", "protected function _init()\r\n\t{\r\n\t}", "public function getEncryptionDictionary();", "public function testMiddleKey2()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be demonstrate it\\'s behaviors');\n }\n\n $this->setExpectedException('PHPUnit_Framework_Error_Warning');\n\n $key = str_repeat('z', 20);\n $iv = str_repeat('z', 16);\n\n $plaintext = 'a';\n\n mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv);\n }", "abstract protected function buildCipherMethod($cipherName, $iv, $keySize);", "function cs_encrypt_decrypt($string)\r\n{\r\n\t//Function : encrypt/decrypt a string message v.1.0 without a known key\r\n\t//Author : Aitor Solozabal Merino (spain)\r\n\t//Email : [email protected]\r\n\t//Date : 01-04-2005\r\n $strlen = strlen($string);\r\n $strencrypted = '';\r\n for ($pos = 0; $pos < $strlen ; $pos++)\r\n {\r\n\t\t// long code of the function to explain the algoritm\r\n\t\t// this function can be tailored by the programmer modifyng the formula\r\n\t\t// to calculate the key to use for every character in the string.\r\n\t\t$usekey = (($strlen+$pos)+1); // (+5 or *3 or ^2)\r\n\t\t// after that we need a module division because can´t be greater than 255\r\n\t\t$usekey = (255+$usekey) % 255;\r\n\t\t$encryptbyte = substr($string, $pos, 1);\r\n\t\t$asciibyte = ord($encryptbyte);\r\n\t\t$xorbyte = $asciibyte ^ $usekey; // xor operation\r\n\t\t$encrypted = chr($xorbyte);\r\n\t\t$strencrypted .= $encrypted;\r\n\t\t \r\n\t\t//short code of the function once explained\r\n\t\t// $str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255));\r\n\t}\r\n\treturn $strencrypted;\r\n}", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}" ]
[ "0.7504815", "0.66660774", "0.6450248", "0.64355314", "0.5972656", "0.58532196", "0.56727195", "0.55533665", "0.5488739", "0.5255982", "0.5244018", "0.52023715", "0.5190923", "0.51331705", "0.50723475", "0.50573784", "0.503888", "0.50308675", "0.49726826", "0.49585512", "0.49446833", "0.49383", "0.4937824", "0.49322772", "0.4921632", "0.4914971", "0.49123374", "0.49054447", "0.48943576", "0.48864803", "0.4878115", "0.4875144", "0.48627743", "0.48619735", "0.48409343", "0.48109388", "0.47731936", "0.47562453", "0.47368354", "0.46983185", "0.4682936", "0.46779636", "0.4667925", "0.46578422", "0.46280238", "0.46126586", "0.45873803", "0.45710135", "0.4549491", "0.45371056", "0.4530892", "0.45276013", "0.4522533", "0.45130035", "0.45102623", "0.4492004", "0.44775572", "0.4477455", "0.44612846", "0.44572118", "0.44528335", "0.4445568", "0.44419432", "0.4440656", "0.44371393", "0.4427193", "0.44139194", "0.44139194", "0.44126648", "0.44119868", "0.44090027", "0.43863142", "0.43853036", "0.4380923", "0.43785304", "0.4371617", "0.43678164", "0.43674937", "0.43631107", "0.43607584", "0.43545875", "0.43524706", "0.43523806", "0.43514222", "0.43501914", "0.43499768", "0.43478507", "0.43445554", "0.43395096", "0.43173495", "0.4307318", "0.42926732", "0.4289929", "0.4281646", "0.42797247", "0.42753422", "0.42720848", "0.426919", "0.42663524", "0.4259403" ]
0.49340275
23
Dummy function Since Crypt_AES extends Crypt_Rijndael, this function is, technically, available, but it doesn't do anything.
function setBlockLength($length) { return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Crypt_AES($mode = CRYPT_AES_MODE_CBC)\n {\n if ( !defined('CRYPT_AES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()):\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_AES_MODE ) {\n case CRYPT_AES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n // ctr doesn't have a constant associated with it even though it appears to be fairly widely\n // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to\n // include a compatibility layer. the layer has been implemented but, for now, is commented out.\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = 'ncfb';\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n\n break;\n default:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n $this->mode = CRYPT_RIJNDAEL_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_CFB;\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_OFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\n }\n }\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) {\n parent::Crypt_Rijndael($this->mode);\n }\n }", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "function mysql_aes_key($key)\n{\n $bytes = 16;\n $newKey = \\str_repeat(\\chr(0), $bytes);\n $length = \\strlen($key);\n\n for ($i = 0; $i < $length; $i++) {\n $index = $i % $bytes;\n $newKey[$index] = $newKey[$index] ^ $key[$i];\n }\n\n return $newKey;\n}", "function my_simple_crypt($string, $action = 'e')\n{\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public function testEncryptPadding(): void\n {\n $rc2 = new RC2('ecb');\n\n // unlike Crypt_AES / Crypt_Rijndael, when you tell Crypt_RC2 that the key length is 128-bits the key isn't null padded to that length.\n // instead, RC2 key expansion is used to extend it out to that length. this isn't done for AES / Rijndael since that doesn't define any\n // sort of key expansion algorithm.\n\n // admittedly, phpseclib is inconsistent in this regard. RC4 and Blowfish support arbitrary key lengths between a certain range, as well,\n // and they don't have any way to set the key length. but then again, neither do those algorithms have their own key expansion algorithm,\n // whereas RC2 does. and technically, AES / Rijndael (and even Twofish) don't support arbitrary key lengths - they support variable key\n // lengths. so in some ways, i suppose this inconsistency somewhat makes sense, although the fact that Crypt_Twofish doesn't have a\n // setKeyLength() function whereas Crypt_AES / Crypt_Rijndael do not is, itself, an inconsistency.\n\n // but that said, Crypt_RC2 is inconsistent in other ways: if you pass a 128-bit (16-byte) key to it via setKey() the key is not treated\n // as a 128-bit key but rather as a 1024-bit key and is expanded accordingly, not via null padding, but via RC2's key expansion algorithm.\n\n // this behavior is in contrast to mcrypt, which extends keys via null padding to 1024 bits. it is also in contrast to OpenSSL, which\n // extends keys, via null padding, to 128 bits. mcrypt's approach seems preferable as one can simulate 128 bit keys by using RC2's\n // key expansion algorithm to extend the key to 1024 bits and then changing the first byte of the new key with an inverse pitable mapping.\n // in contrast, to my knowledge, there is no technique for expanding a key less than 128 bits to 128 bits, via RC2 key expansion. the only\n // scenario in that regard is null padding.\n\n // simple truncation is insufficient, since, quoting RFC2268, \"the purpose of the key-expansion algorithm [in RC2] is to modify the key buffer\n // so that each bit of the expanded key depends in a complicated way on every bit of the supplied input key\".\n\n // now, to OpenSSL's credit, null padding is internally consistent with OpenSSL. OpenSSL only supports fixed length keys. For rc2, rc4 and\n // bf (blowfish), all keys are 128 bits (or are null padded / truncated accordingly). to use 40-bit or 64-bit keys with RC4 with OpenSSL you\n // don't use the rc4 algorithm - you use the rc4-40 or rc4-64 algorithm. and similarly, it's not aes-cbc that you use - it's either aes-128-cbc\n // or aes-192-cbc or aes-256-cbc. this is in contrast to mcrypt, which (with the exception of RC2) actually supports variable and arbitrary\n // length keys.\n\n // superficially, it seens like Rijndael would be another exception to mcrypt's key length handling, but it in fact is not. the reason being that,\n // with mcrypt, when you specify MCRYPT_RIJNDAEL_128 or MCRYPT_RIJNDAEL_192 or MCRYPT_RIJNDAEL_256 the numbers at the end aren't referring to the\n // key length, but rather, the block length. ie. Rijndael, unlike most block ciphers, doesn't just have a variable (but not arbitrary) key length -\n // it also has a variable block length. AES's block length, however, is not variable, so technically, only MCRYPT_RIJNDAEL_128 is AES.\n\n $rc2->setKey(str_repeat('d', 16), 128);\n\n $rc2->setPreferredEngine('PHP');\n $internal = $rc2->encrypt('d');\n\n $result = pack('H*', 'e3b36057f4821346');\n $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result');\n\n $rc2->setPreferredEngine('OpenSSL');\n if ($rc2->getEngine() == 'OpenSSL') {\n $openssl = $rc2->encrypt('d');\n $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result');\n } else {\n self::markTestSkipped('Unable to initialize OpenSSL engine');\n }\n }", "public function testNullPadding()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be installed to compare the output of the shim to the original mcrypt');\n }\n\n $key = str_repeat('z', 16);\n $iv = str_repeat('z', 16);\n\n // a plaintext / ciphertext of length 1 is of an insufficient length for cbc mode\n $plaintext = $ciphertext = 'a';\n\n $mcrypt = bin2hex(mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n\n $mcrypt = bin2hex(mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $compat = bin2hex(phpseclib_mcrypt_decrypt('rijndael-128', $key, $ciphertext, 'cbc', $iv));\n $this->assertEquals($mcrypt, $compat);\n }", "function encrypt_decrypt($action, $string) {\n\n if ( !function_exists(\"openssl_encrypt\") )\n {\n die (\"openssl function openssl_encrypt does not exist\");\n }\n if ( !function_exists(\"hash\") )\n {\n die (\"function hash does not exist\");\n }\n\n global $encryption_key;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //echo \"$encryption_key\\n\";\n $secret_iv = 'RgX54.Ju7h';\n\n\n // hash\n $key = hash('sha256', $encryption_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' )\n {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' )\n {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}", "function encryptData($data)\n{\n $cypher = \"aes-256-cbc\";\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($cypher));\n $key = base64_encode(gethostname());\n\n\n\n return openssl_encrypt($data,$cypher,$key,0,$iv);\n}", "function simple_encode($data, $passwd, $method='aes-128-cbc', $options=0, $iv='SomeA1AweS0meK5y') {\n return openssl_encrypt ($data, $method, $passwd, $options, $iv);\n}", "function aes_encrypt($decrypted, $salt = null)\n{\n if (null === $salt) {\n if (!($salt = \\getenv('AES_SALT'))) {\n throw new \\Limepie\\Exception('Missing encryption salt.');\n }\n }\n\n $key = \\Limepie\\mysql_aes_key($salt);\n\n $cypher = 'aes-128-ecb';\n\n return \\openssl_encrypt($decrypted, $cypher, $key, \\OPENSSL_RAW_DATA);\n}", "function encryptAES($content, $secret){\n return openssl_encrypt($content, \"AES-256-CBC\", $secret);\n}", "function encrypt_decrypt($action, $string, $key, $iv) {\n\t//global $config;\n\t$secret_key = $key;\n\t$secret_iv = $iv;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' ) {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "function _mcryptSetup()\n {\n if (!$this->changed) {\n return;\n }\n\n if (!$this->explicit_key_length) {\n // this just copied from Crypt_Rijndael::_setup()\n $length = strlen($this->key) >> 2;\n if ($length > 8) {\n $length = 8;\n } else if ($length < 4) {\n $length = 4;\n }\n $this->Nk = $length;\n $this->key_size = $length << 2;\n }\n\n switch ($this->Nk) {\n case 4: // 128\n $this->key_size = 16;\n break;\n case 5: // 160\n case 6: // 192\n $this->key_size = 24;\n break;\n case 7: // 224\n case 8: // 256\n $this->key_size = 32;\n }\n\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));\n\n if (!isset($this->enmcrypt)) {\n $mode = $this->mode;\n //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode;\n\n $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n\n if ($mode == 'ncfb') {\n $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');\n }\n\n } // else should mcrypt_generic_deinit be called?\n\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n $this->changed = false;\n }", "function simple_encrypt($text){\n \treturn base64_encode(openssl_encrypt($text, \"AES-256-CTR\", \"GhratnaXbS\", 0, \"0123456789abcdef\"));\n }", "function key_encrypt($message, $key, $cipher_method=AES_256) {\n\t\n\t$length = key_length($cipher_method);\n\t\n\t$key = str_pad($key, $length, '*');\n\n\t$iv_length = openssl_cipher_iv_length($cipher_method);\n\t$iv = openssl_random_pseudo_bytes($iv_length);\n\n\t$encrypted = openssl_encrypt($message, $cipher_method, $key, OPENSSL_RAW_DATA, $iv);\n\t$encrypted_message = $iv . $encrypted;\n\n return base64_encode($encrypted_message);\n}", "function encrypt_decrypt($action, $string) {\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'This is my secret key';\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n \n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n }\n else if( $action == 'decrypt' ){\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "public function encrypt();", "function my_simple_crypt( $string, $action = 'd') {\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n \n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash( 'sha256', $secret_key );\n $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );\n \n if( $action == 'e' ) {\n $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );\n }\n \n return $output;\n }", "function ehash_encrypt($pure_string, $encryption_key) {\n \n\tif (empty($pure_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, $pure_string, MCRYPT_MODE_ECB, $iv));\n \n return $encrypted_string;\n}", "function customEncrypt($text, $key)\n {\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, padEncryptionSalt($key), $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function encrypt($plaintext) {\n $ivsize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $keysize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n //echo \"IV Size: \" . $ivsize . \"\\n\";\n //echo \"Key Size: \" . $keysize . \"\\n\";\n //echo \"Block Size: \" . $blocksize . \"\\n\";\n\n $masterkey = 'masterKeyOfLength29Characters';\n $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');\n\n //$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n\t $ivbytes = array(72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87, 72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87);\n $iv = implode(array_map(\"chr\", $ivbytes));\n\n\t\t//$key = mhash(MHASH_SHA256, $masterkey);\n\t\t//echo \"Key: \" . base64_encode($key) . \"\\n\";\n\t\t \n mcrypt_generic_init($td, $masterkey, $iv);\n //mcrypt_generic_init($td, substr($key, 0, $keysize), $iv);\n //mcrypt_generic_init($td, $key, $iv);\n $crypttext = mcrypt_generic($td, $plaintext);\n mcrypt_generic_deinit($td);\n return base64_encode($iv.$crypttext);\n //return base64_encode($crypttext);\n}", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "protected function generateEncryptionKeyIfNeeded() {}", "function crypt_data($string, $action = 'e') \n{\n $secret_key \t= \"@#@ @@&&*$ bhufjg *@ !@#432 3783\"; // 32bits\n\n $secret_iv \t\t= md5('sA*(DH');\n $secret_iv \t\t= md5($secret_iv);\n\n $output \t\t= false;\n $encrypt_method = \"AES-256-CBC\";\n $key \t\t\t= hash('sha256', $secret_key);\n $iv \t\t\t= substr(hash('sha256', $secret_iv), 0, 16);\n\n \n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } elseif ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "function encrypt_decrypt($string, $action = 'encrypt')\n{\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'AA74CDCC2BBRT935136HH7B63C27'; // user define private key\n $secret_iv = '5fgf5HJ5g27'; // user define secret key\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16); // sha256 is hash_hmac_algo\n if ($action == 'encrypt') {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if ($action == 'decrypt') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "function aesdecrypt($encrypted_chaine)\n {\n $key_password = \"la clé\";\n $decrypted_chaine = openssl_decrypt($encrypted_chaine, \"AES-128-ECB\" ,$key_password);\n var_dump($encrypted_chaine);\n \n }", "function km200_Encrypt( $encryptData ) \n{ \n $blocksize = 16;\n $encrypt_padchar = $blocksize - ( strlen( $encryptData ) % $blocksize ); \n $encryptData .= str_repeat( chr( $encrypt_padchar ), $encrypt_padchar ); \n \n return base64_encode(\n openssl_encrypt(\n $encryptData,\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n )\n );\n}", "function crypto($payload, $password, $doDecrypt = false)\n{\n$encryption_protocol = ('aes-256-cbc');\n$output = '';\nif($doDecrypt)\n{\n $payload = urlDecode($payload);\n list($aes256iv, $encrypted_payload, $decryption_salt) = explode('::', base64_decode($payload), 3);\n $encryption_key = base64_decode($password.$decryption_salt);\n $output = openssl_decrypt($encrypted_payload, $encryption_protocol, $encryption_key, 0, $aes256iv);\n}\nelse\n{\n$encryption_salt = openssl_random_pseudo_bytes(10);\n$encryption_key = base64_decode($password.$encryption_salt);\n $aes256iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($encryption_protocol));\n $encrypted_payload = openssl_encrypt($payload, $encryption_protocol, $encryption_key, 0, $aes256iv);\n $output = base64_encode($aes256iv . '::' . $encrypted_payload. '::'.$encryption_salt);\n}\nreturn urlEncode($output);\n}", "function encrypt ($data, $key, $base64=false) {\n\t\n\tif (!$td = mcrypt_module_open('rijndael-256', '', 'ctr', '')) return false;\n\t\n\t$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n\t\n\tif (mcrypt_generic_init($td, $key, $iv) !== 0) return false;\n\t\n\t$data = serialize($data);\n\t\n\t$data\t= mcrypt_generic($td, $data);\n\t$data\t= $iv.$data;\n\t$mac\t= self::keygen($data, $key, 1000, 32);\n\t$data .= $mac;\n\t\n\tmcrypt_generic_deinit($td);\n\tmcrypt_module_close($td);\n\t\n\tif ($base64) $data = base64_encode($data);\n\t\n\treturn $data;\n}", "function _setup()\r\n {\r\n // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.\r\n // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse\r\n static $rcon = array(0,\r\n 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,\r\n 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,\r\n 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,\r\n 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,\r\n 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,\r\n 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000\r\n );\r\n\r\n if (!$this->changed) {\r\n return;\r\n }\r\n\r\n if (!$this->explicit_key_length) {\r\n // we do >> 2, here, and not >> 5, as we do above, since strlen($this->key) tells us the number of bytes - not bits\r\n $length = strlen($this->key) >> 2;\r\n if ($length > 8) {\r\n $length = 8;\r\n } else if ($length < 4) {\r\n $length = 4;\r\n }\r\n $this->Nk = $length;\r\n $this->key_size = $length << 2;\r\n }\r\n\r\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\r\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, chr(0));\r\n\r\n // see Rijndael-ammended.pdf#page=44\r\n $this->Nr = max($this->Nk, $this->Nb) + 6;\r\n\r\n // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,\r\n // \"Table 8: Shift offsets in Shiftrow for the alternative block lengths\"\r\n // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,\r\n // \"Table 2: Shift offsets for different block lengths\"\r\n switch ($this->Nb) {\r\n case 4:\r\n case 5:\r\n case 6:\r\n $this->c = array(0, 1, 2, 3);\r\n break;\r\n case 7:\r\n $this->c = array(0, 1, 2, 4);\r\n break;\r\n case 8:\r\n $this->c = array(0, 1, 3, 4);\r\n }\r\n\r\n $key = $this->key;\r\n\r\n $w = array_values(unpack('N*words', $key));\r\n\r\n $length = $this->Nb * ($this->Nr + 1);\r\n for ($i = $this->Nk; $i < $length; $i++) {\r\n $temp = $w[$i - 1];\r\n if ($i % $this->Nk == 0) {\r\n // according to <http://php.net/language.types.integer>, \"the size of an integer is platform-dependent\".\r\n // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,\r\n // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'\r\n // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.\r\n $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord\r\n $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];\r\n } else if ($this->Nk > 6 && $i % $this->Nk == 4) {\r\n $temp = $this->_subWord($temp);\r\n }\r\n $w[$i] = $w[$i - $this->Nk] ^ $temp;\r\n }\r\n\r\n // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns\r\n // and generate the inverse key schedule. more specifically,\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3), \r\n // \"The key expansion for the Inverse Cipher is defined as follows:\r\n // 1. Apply the Key Expansion.\r\n // 2. Apply InvMixColumn to all Round Keys except the first and the last one.\"\r\n // also, see fips-197.pdf#page=27, \"5.3.5 Equivalent Inverse Cipher\"\r\n $temp = array();\r\n for ($i = $row = $col = 0; $i < $length; $i++, $col++) {\r\n if ($col == $this->Nb) {\r\n if ($row == 0) {\r\n $this->dw[0] = $this->w[0];\r\n } else {\r\n // subWord + invMixColumn + invSubWord = invMixColumn\r\n $j = 0;\r\n while ($j < $this->Nb) {\r\n $dw = $this->_subWord($this->w[$row][$j]);\r\n $temp[$j] = $this->dt0[$dw & 0xFF000000] ^ \r\n $this->dt1[$dw & 0x00FF0000] ^ \r\n $this->dt2[$dw & 0x0000FF00] ^ \r\n $this->dt3[$dw & 0x000000FF];\r\n $j++;\r\n }\r\n $this->dw[$row] = $temp;\r\n }\r\n\r\n $col = 0;\r\n $row++;\r\n }\r\n $this->w[$row][$col] = $w[$i];\r\n }\r\n\r\n $this->dw[$row] = $this->w[$row];\r\n\r\n $this->changed = false;\r\n }", "protected function _decrypt() {}", "protected function _decrypt() {}", "abstract protected function getCrypt();", "function mcrypt_enc_is_block_algorithm($td)\n{\n}", "function encrypt_decrypt($action, $string) {\r\n $output = false;\r\n\r\n $key = 'My strong random secret key';\r\n\r\n // initialization vector \r\n $iv = md5(md5($key));\r\n\r\n if( $action == 'encrypt' ) {\r\n $output = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, $iv);\r\n $output = base64_encode($output);\r\n }\r\n else if( $action == 'decrypt' ){\r\n $output = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, $iv);\r\n $output = rtrim($output, \"\");\r\n }\r\n return $output;\r\n}", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "function encrypt($plaintext, $passphrase, $iv) {\n try {\n $padded_str = pad_pkcs5($plaintext);\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $passphrase, $padded_str, MCRYPT_MODE_CBC, $iv);\n return $ciphertext;\n } catch (Exception $e) {\n echo \"Encryption exception in encrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "function cs_encrypt_decrypt($string)\r\n{\r\n\t//Function : encrypt/decrypt a string message v.1.0 without a known key\r\n\t//Author : Aitor Solozabal Merino (spain)\r\n\t//Email : [email protected]\r\n\t//Date : 01-04-2005\r\n $strlen = strlen($string);\r\n $strencrypted = '';\r\n for ($pos = 0; $pos < $strlen ; $pos++)\r\n {\r\n\t\t// long code of the function to explain the algoritm\r\n\t\t// this function can be tailored by the programmer modifyng the formula\r\n\t\t// to calculate the key to use for every character in the string.\r\n\t\t$usekey = (($strlen+$pos)+1); // (+5 or *3 or ^2)\r\n\t\t// after that we need a module division because can´t be greater than 255\r\n\t\t$usekey = (255+$usekey) % 255;\r\n\t\t$encryptbyte = substr($string, $pos, 1);\r\n\t\t$asciibyte = ord($encryptbyte);\r\n\t\t$xorbyte = $asciibyte ^ $usekey; // xor operation\r\n\t\t$encrypted = chr($xorbyte);\r\n\t\t$strencrypted .= $encrypted;\r\n\t\t \r\n\t\t//short code of the function once explained\r\n\t\t// $str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255));\r\n\t}\r\n\treturn $strencrypted;\r\n}", "public function testEncrypt()\n\t{\n\t\t$this->assertEquals(mcrypt_encrypt('blowfish', 's3cret', \"a test string\", MCRYPT_MODE_ECB), $this->Crypt_MCrypt->encrypt(\"a test string\"));\n\t}", "function encryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_encrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "function acf_encrypt($data = '')\n{\n}", "function safeDecryptK(string $crypted, string $key, string $pub, string $nonce): string\n{\n\n$decryption_key = sodium_crypto_box_keypair_from_secretkey_and_publickey(hex2bin($key), hex2bin($pub));\n\n$decrypted = sodium_crypto_box_open(hex2bin($crypted), hex2bin($nonce), $decryption_key);\n sodium_memzero($crypted);\n sodium_memzero($key);\n return $decrypted;\n}", "function dec_enc($action, $string) {\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'society key';\n $secret_iv = 'society iv';\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n if ($action == 'encrypt') {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if ($action == 'decrypt') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "function decrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Decrypt($string,$key);\r\n\treturn $result;\r\n}", "public function decrypt();", "abstract public function encrypt($data);", "protected function _crypt($data, $algorithm, $param = null, $encrypt = true) {}", "function aes256Encrypt($plaintext, $password) {\n // hash the key\n $key = pack(\"H*\", substr(hash(\"sha512\", $password), 0, 64));\n\n // generate an initialization vector (IV)\n $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);\n\n // pad the plaintext\n $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $plaintext = pkcs5Pad($plaintext, $blocksize);\n\n // encrypt the plaintext\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);\n $ciphertext = $iv . $ciphertext;\n return(base64_encode($ciphertext));\n}", "public function encrypt($str, $key, $method = '') {\n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n \n // Create return array\n $return = array('decrypted' => addslashes(trim($str)), 'encrypted' => '', 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array(), 'decryptedlen' => strlen(addslashes(trim($str))), 'encryptedlen' => 0, 'compressedlen' => 0);\n\n // String cannot be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key cannot be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Generate cipher_algorithm string to glue it to output string\n $len = 32;\n $algorithm = $this->textToBinary(mb_substr($this->cipher_algorithm.'_'.$this->generateRandomString($len-strlen($this->cipher_algorithm)), 0, $len));\n if(count(explode(' ',$algorithm)) !== $len) {\n $return['error'][] = 'Algorithm error';\n trigger_error('Algorithm error', E_USER_NOTICE); \n return $return;\n }\n \n // Create an IV and save it as binary\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $return['iv'] = bin2hex($iv); \n \n // Split input to be able to encrypt larger strings\n foreach(str_split($return['decrypted'], 20) as $str) {\n $return['base64_encode'][] = $this->textToBinary(base64_encode(openssl_encrypt($str, $method, $key, OPENSSL_RAW_DATA, $iv)), null);\n }\n \n // Glue everything togeather\n $return['encrypted'] = $algorithm. PHP_EOL . implode(PHP_EOL, $return['base64_encode']) . PHP_EOL . $this->textToBinary($return['iv']);\n $return['encrypted'] = str_replace(array(' ',PHP_EOL),array($this->delimiter_character,$this->delimiter_breaks),$this->delimiter_characters.' '.$return['encrypted'].' '.$this->delimiter_characters);\n $return['encryptedlen'] = strlen($return['encrypted']);\n \n // Compress the string if enabled\n if($this->compress==true) {\n $return['encryptednotcompressed'] = $return['encrypted'];\n $return['encrypted'] = addslashes($this->delimiter_gz.utf8_encode(gzencode($return['encrypted'],9)).$this->delimiter_gz);\n $return['compressedlen'] = strlen($return['encrypted']);\n }\n \n return $return;\n }", "public function testEncryptB() {\n // Initialize variables\n $string = 'Hello World!';\n\n // Encrypt string in two different ways\n $encrypted_string = security::encrypt( $string, 'random-hash' );\n $base64_encoded_encrypted_string = security::encrypt( $string, 'random-hash', true );\n\n $this->assertEquals( base64_encode( $encrypted_string ), $base64_encoded_encrypted_string );\n }", "public function _setupInlineCrypt() {\n\t\t$lambda_functions = &Crypt_RC2::_getLambdaFunctions();\n\n\t\t// The first 10 generated $lambda_functions will use the $keys hardcoded as integers\n\t\t// for the mixing rounds, for better inline crypt performance [~20% faster].\n\t\t// But for memory reason we have to limit those ultra-optimized $lambda_functions to an amount of 10.\n\t\t// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)\n\t\t$gen_hi_opt_code = (bool) ( count( $lambda_functions ) < 10 );\n\n\t\t// Generation of a uniqe hash for our generated code\n\t\t$code_hash = \"Crypt_RC2, {$this->mode}\";\n\t\tif ( $gen_hi_opt_code ) {\n\t\t\t$code_hash = str_pad( $code_hash, 32 ) . $this->_hashInlineCryptFunction( $this->key );\n\t\t}\n\n\t\t// Is there a re-usable $lambda_functions in there?\n\t\t// If not, we have to create it.\n\t\tif ( ! isset( $lambda_functions[ $code_hash ] ) ) {\n\t\t\t// Init code for both, encrypt and decrypt.\n\t\t\t$init_crypt = '$keys = $self->keys;';\n\n\t\t\tswitch ( true ) {\n\t\t\t\tcase $gen_hi_opt_code:\n\t\t\t\t\t$keys = $this->keys;\n\t\t\t\tdefault:\n\t\t\t\t\t$keys = [];\n\t\t\t\t\tforeach ( $this->keys as $k => $v ) {\n\t\t\t\t\t\t$keys[ $k ] = '$keys[' . $k . ']';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $in is the current 8 bytes block which has to be en/decrypt\n\t\t\t$encrypt_block = $decrypt_block = '\n $in = unpack(\"v4\", $in);\n $r0 = $in[1];\n $r1 = $in[2];\n $r2 = $in[3];\n $r3 = $in[4];\n ';\n\n\t\t\t// Create code for encryption.\n\t\t\t$limit = 20;\n\t\t\t$actions = [ $limit => 44, 44 => 64 ];\n\t\t\t$j = 0;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// Mixing round.\n\t\t\t\t$encrypt_block .= '\n $r0 = (($r0 + ' . $keys[ $j ++ ] . ' +\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF) << 1;\n $r0 |= $r0 >> 16;\n $r1 = (($r1 + ' . $keys[ $j ++ ] . ' +\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF) << 2;\n $r1 |= $r1 >> 16;\n $r2 = (($r2 + ' . $keys[ $j ++ ] . ' +\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF) << 3;\n $r2 |= $r2 >> 16;\n $r3 = (($r3 + ' . $keys[ $j ++ ] . ' +\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;\n $r3 |= $r3 >> 16;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 64 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Mashing round.\n\t\t\t\t\t$encrypt_block .= '\n $r0 += $keys[$r3 & 0x3F];\n $r1 += $keys[$r0 & 0x3F];\n $r2 += $keys[$r1 & 0x3F];\n $r3 += $keys[$r2 & 0x3F];';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$encrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Create code for decryption.\n\t\t\t$limit = 44;\n\t\t\t$actions = [ $limit => 20, 20 => 0 ];\n\t\t\t$j = 64;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// R-mixing round.\n\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 | ($r3 << 16)) >> 5;\n $r3 = ($r3 - ' . $keys[ -- $j ] . ' -\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF;\n $r2 = ($r2 | ($r2 << 16)) >> 3;\n $r2 = ($r2 - ' . $keys[ -- $j ] . ' -\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF;\n $r1 = ($r1 | ($r1 << 16)) >> 2;\n $r1 = ($r1 - ' . $keys[ -- $j ] . ' -\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF;\n $r0 = ($r0 | ($r0 << 16)) >> 1;\n $r0 = ($r0 - ' . $keys[ -- $j ] . ' -\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 0 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// R-mashing round.\n\t\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 - $keys[$r2 & 0x3F]) & 0xFFFF;\n $r2 = ($r2 - $keys[$r1 & 0x3F]) & 0xFFFF;\n $r1 = ($r1 - $keys[$r0 & 0x3F]) & 0xFFFF;\n $r0 = ($r0 - $keys[$r3 & 0x3F]) & 0xFFFF;';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$decrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Creates the inline-crypt function\n\t\t\t$lambda_functions[ $code_hash ] = $this->_createInlineCryptFunction(\n\t\t\t\t[\n\t\t\t\t\t'init_crypt' => $init_crypt,\n\t\t\t\t\t'encrypt_block' => $encrypt_block,\n\t\t\t\t\t'decrypt_block' => $decrypt_block\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Set the inline-crypt function as callback in: $this->inline_crypt\n\t\t$this->inline_crypt = $lambda_functions[ $code_hash ];\n\t}", "function disableContinuousBuffer()\n {\n parent::disableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n }", "function encrypt($str) {\n return Crypt::encrypt($str);\n}", "public function testEncryptA() {\n // Initialize variables\n $string = 'Hello World!';\n\n // Encrypt string\n $encrypted_string = security::encrypt( $string, 'random-hash' );\n\n // Make sure it's not there\n $this->assertFalse( stristr( $encrypted_string, $string ) );\n }", "public function testBadParamsMcryptCompat()\n {\n $this->setExpectedException('PHPUnit_Framework_Error_Warning');\n\n phpseclib_mcrypt_encrypt('rijndael-128', 'abc', 'asdf', 'cbc', 'zz');\n }", "function encrypt_decrypt( $string, $action = 'e' ) {\n $secret_key = 'jhgfdf89g5df7g5@';\n $secret_iv = 'jhb^&%&*^kljhjg@';\n $result = false;\n $enc_method = \"AES-256-CBC\";\n $key = hash( 'sha256', $secret_key );\n $iv = substr( hash( 'sha256', $secret_iv ), 0,16 );\n if( $action == 'e' ) {\n $result = base64_encode( openssl_encrypt( $string, $enc_method, $key, 0, $iv ) );\n }\n else if( $action == 'd' ){\n $result = openssl_decrypt( base64_decode( $string ), $enc_method, $key, 0, $iv );\n }\n return $result;\n }", "public function testMiddleKey2()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be demonstrate it\\'s behaviors');\n }\n\n $this->setExpectedException('PHPUnit_Framework_Error_Warning');\n\n $key = str_repeat('z', 20);\n $iv = str_repeat('z', 16);\n\n $plaintext = 'a';\n\n mcrypt_encrypt('rijndael-128', $key, $plaintext, 'cbc', $iv);\n }", "function aes_decrypt($encrypted, $salt = null)\n{\n if (null === $salt) {\n if (!($salt = \\getenv('AES_SALT'))) {\n throw new \\Limepie\\Exception('Missing encryption salt.');\n }\n }\n\n $key = \\Limepie\\mysql_aes_key($salt);\n\n $cypher = 'aes-128-ecb';\n\n return \\openssl_decrypt($encrypted, $cypher, $key, \\OPENSSL_RAW_DATA);\n}", "function decrypt($ciphertext)\n {\n if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) {\n $this->_mcryptSetup();\n\n if ($this->mode == 'ncfb' && $this->continuousBuffer) {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 16 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 16) {\n $cb = substr($ciphertext, $i, $len - $len % 16);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -16);\n $len%= 16;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n\n return $plaintext;\n }\n\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 15) & 0xFFFFFFF0, chr(0));\n }\n\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n return parent::decrypt($ciphertext);\n }", "function init()\n {\n return $this->_crypt->init();\n }", "private function __construct()\n\t{\t\t\n\t\t// Load the Cryptography class\n\t\trequire_once(__DIR__.'/../vendor/crypt/AES.php');\n\t\t\n\t\t// Create a new AES cryptography object\n\t\t$this->aes = new Crypt_AES(); \n\t\t\n\t\t// Set the encryption key\n\t\t$this->setKey($this->cryptKey);\n\t}", "protected function _createSalt()\n {\n return (\\function_exists('random_bytes')) ? random_bytes(16) : mcrypt_create_iv(16, \\MCRYPT_DEV_URANDOM);\n }", "public static function getAES()\n {\n if (!isset(self::$_data[self::KEY_AES]))\n {\n $_aes = new \\Raneko\\Crypt\\AES();\n $_aes->setKey(self::getConfig(\"app\", \"aes\", \"key\"));\n $_aes->setIV($_aes->generateIV());\n\n self::$_data[self::KEY_AES] = $_aes;\n }\n return self::$_data[self::KEY_AES];\n }", "function m_decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n}", "static function encrypt($key, $iv, $data) {\n if (strlen($key) < PHP_AES_Cipher::$CIPHER_KEY_LEN) {\n $key = str_pad(\"$key\", PHP_AES_Cipher::$CIPHER_KEY_LEN, \"0\"); //0 pad to len 16\n } else if (strlen($key) > PHP_AES_Cipher::$CIPHER_KEY_LEN) {\n $key = substr($str, 0, PHP_AES_Cipher::$CIPHER_KEY_LEN); //truncate to 16 bytes\n }\n\n $encodedEncryptedData = base64_encode(openssl_encrypt($data, PHP_AES_Cipher::$OPENSSL_CIPHER_NAME, $key, OPENSSL_RAW_DATA, $iv));\n $encodedIV = base64_encode($iv);\n $encryptedPayload = $encodedEncryptedData.\":\".$encodedIV;\n\n return $encryptedPayload;\n }", "function encrypt_decrypt($action, $string) {\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'This is my secret key';\n $secret_iv = 'This is my secret iv';\n // hash\n $key = hash('sha256', $secret_key);\n \n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n if ( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' ) {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n }", "static public function encrypt($data,$key,$test=false) {\r\n if ($test) {\r\n $iv=\"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0A\\x0B\\x0C\\x0D\\x0E\\x0F\"; \r\n } else { \r\n $iv=self::getRandomBytes(16); \r\n // Padding PKCS#7\r\n $datalen=strlen($data);\r\n $padlen=16-($datalen%16);\r\n $data.=str_repeat(chr($padlen), $padlen);\r\n } \r\n // 128 is blocksize, not keysize!\r\n $out= mcrypt_encrypt(MCRYPT_RIJNDAEL_128,$key,$data,MCRYPT_MODE_CBC, $iv);\r\n if ($test)\r\n return $out;\r\n else \r\n return $iv.$out; \r\n }", "function encrypt($plain){\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function decrypt($encrypted_string, $decryption_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $decryption_iv = '1234567891011121';\r\n $string = openssl_decrypt ($encrypted_string, $ciphering, $decryption_key, $options, $decryption_iv);\r\n return $string;\r\n}", "public static function aes128Encrypt($key, $data) {}", "function xoft_encode($plain_data,$key){\r\n\r\n $key_length=0; //key length counter\r\n $all_bin_chars=\"\";\r\n $cipher_data=\"\";\r\n\r\n for($i=0;$i<mb_strlen($plain_data);$i++){\r\n\t$p=mb_substr($plain_data,$i,1); // p = plaintext\r\n\t$k=mb_substr($key,$key_length,1); // k = key\r\n\t$key_length++;\r\n\r\n\tif($key_length>=mb_strlen($key)){\r\n\t\t$key_length=0;\r\n\t}\r\n\r\n\t$dec_chars=ord($p)^ord($k);\r\n\t$dec_chars=$dec_chars + mb_strlen($key);\r\n\t$bin_chars=decbin($dec_chars);\r\n\r\n\twhile(mb_strlen($bin_chars)<8){\r\n\t\t$bin_chars=\"0\".$bin_chars;\r\n\t}\r\n\r\n\t$all_bin_chars=$all_bin_chars.$bin_chars;\r\n\r\n }\r\n\r\n $m=0;\r\n\r\n for($j=0;$j<mb_strlen($all_bin_chars);$j=$j+4){\r\n\t$four_bit=mb_substr($all_bin_chars,$j,4); // split 8 bit to 4 bit\r\n\t$four_bit_dec=bindec($four_bit);\r\n\r\n\t$decimal_value=$four_bit_dec * 4 + $m; //multiply by 4 plus m where m=0,1,2, or 3\r\n\r\n\t$base64_value=dectobase64($decimal_value); //convert to base64 value\r\n\t$cipher_data=$cipher_data.$base64_value;\r\n\t$m++;\r\n\r\n\tif($m>3){\r\n\t\t$m=0;\r\n\t}\r\n }\r\n\r\n return $cipher_data;\r\n}", "public function getDefaultCrypt(): Encrypter|null;", "public function encryptionCryptEncryptBase64(UnitTester $I)\n {\n $I->wantToTest('Encryption\\Crypt - encryptBase64()');\n\n $tests = [\n md5(uniqid()) => str_repeat('x', mt_rand(1, 255)),\n time() . time() => str_shuffle('abcdefeghijklmnopqrst'),\n 'le$ki12432543543543543' => '',\n ];\n\n $ciphers = [\n 'AES-128-CBC',\n 'AES-128-CFB',\n 'AES-128-OFB',\n 'AES128',\n ];\n\n $crypt = new Crypt();\n\n foreach ($ciphers as $cipher) {\n $crypt->setCipher($cipher);\n\n foreach ($tests as $key => $test) {\n $crypt->setKey(substr($key, 0, 16));\n\n $encryption = $crypt->encryptBase64($test);\n $actual = rtrim($crypt->decryptBase64($encryption), \"\\0\");\n $I->assertSame($test, $actual);\n }\n\n foreach ($tests as $key => $test) {\n $encryption = $crypt->encryptBase64(\n $test,\n substr($key, 0, 16)\n );\n\n $actual = rtrim(\n $crypt->decryptBase64(\n $encryption,\n substr($key, 0, 16)\n ),\n \"\\0\"\n );\n\n $I->assertSame($test, $actual);\n }\n }\n }", "protected abstract function getSecretKey();", "function util_encrypt_data($plaintext, $key, $iv)\n{\n\t// Currently, the production machine does not have support for mcrypt. Hence we do not\n\t// have the ability to encrypt/decrypt information. Only the cookie information is being requested\n\t// to be encrypted right now. It is decided that, for now it is not a security violation to skip\n\t// encryption of cookie data.\n\treturn $plaintext ;\n\t\n\t/*\n\t$iv = base64_decode($iv);\n\t$crypted_data = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $plaintext, MCRYPT_MODE_ECB, $iv);\n\t$crypt_string = base64_encode($crypted_data);\n\treturn $crypt_string;\n\t*/\n}", "function MyJamiaEncrypt($str) {\n\t\t\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n \n\t\t// Non-NULL Initialization Vector for encryption \n\t\t$encryption_iv = '1234567891011121'; \n \n\t\t// Store the encryption key \n\t\t$encryption_key = \"MyJamiaEncryptionString\"; \n \n\t\t// Use openssl_encrypt() function to encrypt the data \n\t\treturn openssl_encrypt($str, $ciphering, \n\t\t $encryption_key, $options, $encryption_iv); \n \t}", "public function testAllCipherMethods()\n {\n if (!in_array($this->environmentVersion, $this->excludedEnvironments)) {\n $supportedCiphers = $this->weakCipher->getSupportedCiphers();\n foreach ($supportedCiphers as $supportedCipher) {\n $cipher = new Cipher($supportedCipher);\n $this->encryption->setCipher($cipher);\n $encrypted = $this->encryption->encrypt(self::PASSWORD, self::SALT, self::USERNAME);\n $decrypted = $this->encryption->decrypt($encrypted, self::SALT, self::USERNAME);\n $this->assertSame(self::PASSWORD, $decrypted);\n }\n }\n }", "public function encryptionCryptEncryptBase64Safe(UnitTester $I)\n {\n $I->wantToTest('Encryption\\Crypt - encryptBase64() - safe');\n\n $key = substr(md5(uniqid()), 0, 16);\n $source = 'BvQrk+D^b&saR/L#mQig+8V9v^W&S/&moY7';\n\n $crypt = new Crypt();\n\n $encrypted = $crypt->encryptBase64($source, $key, true);\n $decrypted = $crypt->decryptBase64($encrypted, $key, true);\n $I->assertSame($source, $decrypted);\n }", "function ehash_decrypt($encrypted_string, $encryption_key) {\n \n\tif (empty($encrypted_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_decode($encrypted_string);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n \n return $decrypted_string;\n}", "function encrypt_decrypt($action, $string) {\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'This is my secret key';\n $secret_iv = 'This is my secret iv';\n // hash\n $key = hash('sha256', $secret_key);\n \n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n if ( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' ) {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n }", "private static function _iv() {\n return openssl_random_pseudo_bytes(self::_ivLength());\n }", "public function testEncryptingTheSameDataTwice()\n {\n $randomData = random_bytes(32);\n $randomKey = random_bytes(2);\n\n $this->assertEquals(\n NativeRc4::encryptData($randomKey, $randomData),\n NativeRc4::encryptData($randomKey, $randomData)\n );\n }", "public function encrypt($plain){\t\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "abstract public function createSecretKey();", "public function getAsymmetricCipher();", "static function encrypt($data){\n # Setup the initialization vector\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n # Encrypt the data\n $encryptedMessage = openssl_encrypt($data, \"AES-256-CBC\", self::getEncryptKey(), 0, $iv);\n return base64_encode($encryptedMessage.'~~~'.$iv);\n }", "function util_getiv()\n{\n\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n return $iv;\n}", "function encrypt($pure_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n\t\treturn $encrypted_string;\n\t}", "function simple_decrypt($text, $salt = \"VUHuiU6b8jgieEG0p79Yx9T4G8Zqp880\") {\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n}", "public function AesEncrypt ($buffer, $key)\r\n\t{\r\n\t\tif (strlen ($key) != 32)\r\n\t\t{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\r\n\t\t$size = mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\r\n\t\t$iv = mcrypt_create_iv ($size, MCRYPT_RAND);\r\n\t\t\r\n\t\treturn bin2hex ($iv . mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $buffer, MCRYPT_MODE_CBC, $iv));\r\n\t}", "public function encrypt() \r\n {\r\n //TODO: Implement encrypt method\r\n }", "private function _getCipher()\n {\n if ($this->_mcryptCipher == '') {\n $this->_mcryptCipher = MCRYPT_RIJNDAEL_256;\n }\n return $this->_mcryptCipher;\n }", "function vcrypt($clear)\n{\n //$salt = join '', ('.','/', 0..9,'A'..'Z', 'a'..'z')[rand 64, rand 64];\n //$vcrypt = crypt($clear, $salt).\"\\n\";\n //We need a Standard DES-Hash so we need to set a 2-Char salt\n $salt = \"he\";\n $vcrypt = crypt($clear, $salt);\n return $vcrypt;\n}", "protected function _computeEncryptionKey($password = '') {}", "public function encender();", "function encrypt_decrypt($action, $string) {\n $secret_key = $GLOBALS['ENCRYPT_KEY'];\n $secret_iv = $GLOBALS['ENCRYPT_KEY'];\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'encrypt') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'decrypt') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n }", "function getFixedIv8Byte()\r\n{\r\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";}", "function encrypt($pure_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n return $encrypted_string;\n }", "function encrypt($str, $key) {\n $key = str_pad($key, 16);\n //$key = $this->hex2bin($key);\n $iv = $this->iv;\n\n $td = mcrypt_module_open('rijndael-128', '', 'cbc', $iv);\n\n mcrypt_generic_init($td, $key, $iv);\n $encrypted = mcrypt_generic($td, $str);\n\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n return bin2hex($encrypted);\n }", "function generateSalt($bytes = '16'){\n\treturn mcrypt_create_iv($bytes, MCRYPT_RAND);\n}" ]
[ "0.70600533", "0.6840477", "0.6516851", "0.64750034", "0.64164424", "0.63959247", "0.6384273", "0.63773197", "0.6264365", "0.6248467", "0.62139404", "0.6203956", "0.6203276", "0.62009025", "0.6200142", "0.6187953", "0.6156585", "0.611297", "0.60847163", "0.6053436", "0.60482675", "0.60404485", "0.60380286", "0.6026429", "0.6005827", "0.6005741", "0.597929", "0.5972639", "0.59621185", "0.5931801", "0.59176093", "0.59132314", "0.59132314", "0.5908102", "0.59029704", "0.5891371", "0.58671874", "0.5846719", "0.58464247", "0.5803577", "0.58025074", "0.5801282", "0.57971895", "0.5783616", "0.5773241", "0.57430786", "0.573927", "0.573794", "0.5727455", "0.5715108", "0.5706835", "0.5697198", "0.5697077", "0.5695376", "0.56951714", "0.5682714", "0.56767124", "0.5666887", "0.56651604", "0.5654518", "0.565344", "0.5653112", "0.564864", "0.564246", "0.56379193", "0.5632059", "0.5623421", "0.562221", "0.56171906", "0.5613356", "0.561309", "0.55987155", "0.5593708", "0.5583262", "0.5579406", "0.55780387", "0.5561388", "0.5555062", "0.5553657", "0.5547253", "0.5540411", "0.5537498", "0.55347186", "0.55288744", "0.55198205", "0.55126584", "0.55114055", "0.54954195", "0.5468464", "0.54602385", "0.5456575", "0.5451288", "0.5448918", "0.5448212", "0.54457295", "0.54452753", "0.54414064", "0.5439306", "0.5429103", "0.54151404", "0.54080474" ]
0.0
-1
Sets the initialization vector. (optional) SetIV is not required when CRYPT_RIJNDAEL_MODE_ECB is being used. If not explictly set, it'll be assumed to be all zero's.
function setIV($iv) { parent::setIV($iv); if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) { $this->changed = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setIV($iv)\r\n {\r\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($iv, 0, $this->block_size), $this->block_size, chr(0));;\r\n }", "private function setIVSize() {\n // Calculate the necessary IV size.\n $this->ivSize = mcrypt_get_iv_size($this->cipher, $this->mode);\n }", "public function setIv($var)\n {\n GPBUtil::checkString($var, False);\n $this->iv = $var;\n\n return $this;\n }", "private function setUpBaseCipherSetIv(BaseCipher $cipher, $initializationVector)\n {\n $cipher->expects($this->once())\n ->method('setIV')\n ->with($this->identicalTo($initializationVector));\n }", "public function change_iv() {\r\n\t\t$str_iv = Encryptor::generate_iv();\r\n\t\t\r\n\t\tforeach ($this->socket_array as $socket) {\r\n\t\t\t$socket->change_iv($str_iv);\r\n\t\t}\r\n\t\t\r\n\t\tEncryptor::set_iv($str_iv);\r\n\t}", "public static function initialize($key = 'hey i am the key', $iv = 'oh i cannot be empty') {\n\t\tself::$key = $key;\n\t\tself::$iv = $iv;\n\t}", "private static function iv($key) {\n self::$key = hash('sha256', $key, true);\n self::$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM);\n }", "private function _getIV()\n {\n $size = mcrypt_get_iv_size(self::CIPHER, self::CIPHER_MODE);\n return mcrypt_create_iv($size, MCRYPT_RAND);\n }", "public function IV($iv = \"\")\n\t{\n\t\treturn $this->mode->IV($iv);\n\t}", "protected function createIV()\n\t{\n\t\tif ($this->mode != MCRYPT_MODE_ECB) {\n\t\t\tsrand();\n\t\t\treturn mcrypt_create_iv($this->getIVSize(), MCRYPT_RAND);\n\t\t}\n\t\telse {\n\t\t\treturn str_repeat(' ', $this->getIVSize());\n\t\t}\n\t}", "private static function _iv() {\n return openssl_random_pseudo_bytes(self::_ivLength());\n }", "protected static function getInitializationVector($encryptionMethod = null, $encryptionMode = null)\n {\n if (!$encryptionMethod) {\n $encryptionMethod = self::$encryptionMethod;\n }\n if (!$encryptionMode) {\n $encryptionMode = self::$encryptionMode;\n }\n\n $iv_size = mcrypt_get_iv_size($encryptionMethod, $encryptionMode);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n return $iv;\n }", "function util_getiv()\n{\n\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n return $iv;\n}", "public function testInitializationVectorGeneration()\n {\n $generator = $this->getTokenGeneratorForTesting(new PseudoRandom());\n\n $resultOne = $generator->getEncryptionInitializationVector(64);\n $resultTwo = $generator->getEncryptionInitializationVector(64);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $resultOne = $generator->getEncryptionInitializationVector(64, false);\n $resultTwo = $generator->getEncryptionInitializationVector(64, false);\n\n $this->assertNotEquals($resultOne, $resultTwo);\n\n $generator->seedRandomGenerator(42);\n $resultOne = $generator->getEncryptionInitializationVector(64);\n\n $generator->seedRandomGenerator(42);\n $resultTwo = $generator->getEncryptionInitializationVector(64);\n\n $this->assertEquals($resultOne, $resultTwo);\n }", "public function __construct($key, $iVector) {\n\t\t\t// $this->_key = (strlen($sha256_32) > 32) ? substr($sha256_32, 0, 32):$sha256_32;\n\t\t\t$this->_key = $key;\n\t\t\t$this->_initializationVector = $iVector;\n\t\t\t$this->_initializationVectorSize = mcrypt_get_iv_size($this->_cipher, $this->_mode);\n\n\t\t\tif (strlen($key) > ($keyMaxLength = mcrypt_get_key_size($this->_cipher, $this->_mode))) {\n\t\t\t\tthrow new InvalidArgumentException(\"The key length must be less or equal than $keyMaxLength.\");\n\t\t\t}\n\t\t}", "function _mcryptSetup()\n {\n if (!$this->changed) {\n return;\n }\n\n if (!$this->explicit_key_length) {\n // this just copied from Crypt_Rijndael::_setup()\n $length = strlen($this->key) >> 2;\n if ($length > 8) {\n $length = 8;\n } else if ($length < 4) {\n $length = 4;\n }\n $this->Nk = $length;\n $this->key_size = $length << 2;\n }\n\n switch ($this->Nk) {\n case 4: // 128\n $this->key_size = 16;\n break;\n case 5: // 160\n case 6: // 192\n $this->key_size = 24;\n break;\n case 7: // 224\n case 8: // 256\n $this->key_size = 32;\n }\n\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0));\n\n if (!isset($this->enmcrypt)) {\n $mode = $this->mode;\n //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode;\n\n $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, '');\n\n if ($mode == 'ncfb') {\n $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');\n }\n\n } // else should mcrypt_generic_deinit be called?\n\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n\n if ($this->mode == 'ncfb') {\n mcrypt_generic_init($this->ecb, $this->key, \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\");\n }\n\n $this->changed = false;\n }", "private static function genNullIV($cypher, $mode) {\r\n\t\t$size = mcrypt_get_iv_size($cypher, $mode); // Find how big the IV needs to be\r\n\t\t$return = ''; // Initilize the return string\r\n\t\t\r\n\t\tfor ($i=0; $i<$size; ++$i) // Create the string of the appropreate legnth\r\n\t\t\t$return .= self::chr_null; // Append a null\r\n\t\t\r\n\t\treturn $return; // Return the string of nulls\r\n\t}", "private static function _ivLength() {\n return openssl_cipher_iv_length(static::$cipher);\n }", "public function getIv()\n {\n return $this->iv;\n }", "function x_construct($key = null, $iv = null)\n {\n $this->_iv = $iv . ((strlen($iv) < $this->_iv_size)\n ? str_repeat(chr(0), $this->_iv_size - strlen($iv))\n : '');\n if (!is_null($key)) {\n $this->setKey($key, $this->_iv);\n }\n }", "function cipher_iv_size() {\n return mcrypt_get_iv_size(CIPHER_TYPE, CIPHER_MODE);\n }", "public function __construct(\r\n \\CryptLib\\Cipher\\Block\\Cipher $cipher,\r\n $initv,\r\n array $options = array()\r\n ) {\r\n parent::__construct($cipher, $initv, $options);\r\n $this->bigMath = BigMath::createFromServerConfiguration();\r\n }", "protected static function updateIV( CipherParams $cipherParams ) {\n $raw = defined( 'OPENSSL_RAW_DATA' ) ? OPENSSL_RAW_DATA : true;\n\n $ivLength = strlen( $cipherParams->iv ?? '' );\n\n $cipherParams->iv = openssl_encrypt( str_repeat( ' ', $ivLength ), $cipherParams->getAlgorithmString(), $cipherParams->key, $raw, $cipherParams->iv ?? '' );\n $cipherParams->iv = substr( $cipherParams->iv, 0, $ivLength );\n }", "static public function iv()\n {\n return substr(hash('sha256', static::$secret_iv), 0, 16);\n }", "function _setup()\r\n {\r\n // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.\r\n // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse\r\n static $rcon = array(0,\r\n 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,\r\n 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,\r\n 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,\r\n 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,\r\n 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,\r\n 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000\r\n );\r\n\r\n if (!$this->changed) {\r\n return;\r\n }\r\n\r\n if (!$this->explicit_key_length) {\r\n // we do >> 2, here, and not >> 5, as we do above, since strlen($this->key) tells us the number of bytes - not bits\r\n $length = strlen($this->key) >> 2;\r\n if ($length > 8) {\r\n $length = 8;\r\n } else if ($length < 4) {\r\n $length = 4;\r\n }\r\n $this->Nk = $length;\r\n $this->key_size = $length << 2;\r\n }\r\n\r\n $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0));\r\n $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, chr(0));\r\n\r\n // see Rijndael-ammended.pdf#page=44\r\n $this->Nr = max($this->Nk, $this->Nb) + 6;\r\n\r\n // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,\r\n // \"Table 8: Shift offsets in Shiftrow for the alternative block lengths\"\r\n // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,\r\n // \"Table 2: Shift offsets for different block lengths\"\r\n switch ($this->Nb) {\r\n case 4:\r\n case 5:\r\n case 6:\r\n $this->c = array(0, 1, 2, 3);\r\n break;\r\n case 7:\r\n $this->c = array(0, 1, 2, 4);\r\n break;\r\n case 8:\r\n $this->c = array(0, 1, 3, 4);\r\n }\r\n\r\n $key = $this->key;\r\n\r\n $w = array_values(unpack('N*words', $key));\r\n\r\n $length = $this->Nb * ($this->Nr + 1);\r\n for ($i = $this->Nk; $i < $length; $i++) {\r\n $temp = $w[$i - 1];\r\n if ($i % $this->Nk == 0) {\r\n // according to <http://php.net/language.types.integer>, \"the size of an integer is platform-dependent\".\r\n // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,\r\n // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'\r\n // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.\r\n $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord\r\n $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];\r\n } else if ($this->Nk > 6 && $i % $this->Nk == 4) {\r\n $temp = $this->_subWord($temp);\r\n }\r\n $w[$i] = $w[$i - $this->Nk] ^ $temp;\r\n }\r\n\r\n // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns\r\n // and generate the inverse key schedule. more specifically,\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3), \r\n // \"The key expansion for the Inverse Cipher is defined as follows:\r\n // 1. Apply the Key Expansion.\r\n // 2. Apply InvMixColumn to all Round Keys except the first and the last one.\"\r\n // also, see fips-197.pdf#page=27, \"5.3.5 Equivalent Inverse Cipher\"\r\n $temp = array();\r\n for ($i = $row = $col = 0; $i < $length; $i++, $col++) {\r\n if ($col == $this->Nb) {\r\n if ($row == 0) {\r\n $this->dw[0] = $this->w[0];\r\n } else {\r\n // subWord + invMixColumn + invSubWord = invMixColumn\r\n $j = 0;\r\n while ($j < $this->Nb) {\r\n $dw = $this->_subWord($this->w[$row][$j]);\r\n $temp[$j] = $this->dt0[$dw & 0xFF000000] ^ \r\n $this->dt1[$dw & 0x00FF0000] ^ \r\n $this->dt2[$dw & 0x0000FF00] ^ \r\n $this->dt3[$dw & 0x000000FF];\r\n $j++;\r\n }\r\n $this->dw[$row] = $temp;\r\n }\r\n\r\n $col = 0;\r\n $row++;\r\n }\r\n $this->w[$row][$col] = $w[$i];\r\n }\r\n\r\n $this->dw[$row] = $this->w[$row];\r\n\r\n $this->changed = false;\r\n }", "function __construct($key = null, $iv = null)\n {\n $this->x_construct($key, $iv);\n }", "public function getCurrentIv();", "public function generateRandomIV()\n {\n $allowedIVString = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_';\n\n try {\n // Invalid method will throw a warning.\n $length = openssl_cipher_iv_length($this->getOptions('method'));\n } catch (Throwable $t) {\n throw new NotSecureIVGenerated(\"Unable to generate random IV.\");\n }\n\n // For any reason if required IV size needs greater value.\n if ($length > strlen($allowedIVString)) {\n $repeatedIVString = str_repeat($allowedIVString, ceil($length/strlen($allowedIVString)));\n $allowedIVString .= $repeatedIVString;\n }\n\n return substr(str_shuffle($allowedIVString), 0, $length);\n }", "public function setVector($vector)\n\t{\n\t\t$this->mVector = $vector;\t\n\t}", "public function __construct(?string $iv4OrderId = null)\n {\n $this\n ->setIv4OrderId($iv4OrderId);\n }", "function openssl_cipher_iv_length(string $cipher_algo): int|false {}", "public function createIV($src = self::RAND)\n\t{\n\t\treturn $this->mode->createIV($src);\n\t}", "public function setCipherId($cipherId) {}", "function disableContinuousBuffer()\n {\n parent::disableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n }", "public function decrypt($iv, $data, $tag = null, $aad = '');", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}", "function getFixedIv8Byte()\r\n{\r\n return \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";}", "function init()\n {\n return $this->_crypt->init();\n }", "private function setAlgoBlockSize() {\n\t$this->algoBlockSize = mcrypt_module_get_algo_block_size($this->cipher);\n }", "function GenerarClave()\n\t{\n\t\t$this->Clave = CifradorCodigo::generarNumero(\n\t\tCifradorCodigo::LongitudBitsClaveMaximo\n\t\t);\n\t}", "public function _setupMcrypt() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\tparent::_setupMcrypt();\n\t}", "public static function ctrCrypt($data, $key, $initializationVector)\n {\n Validate::isString($data, 'data');\n Validate::isString($key, 'key');\n Validate::isString($initializationVector, 'initializationVector');\n\n Validate::isTrue(\n (strlen($key) == 16 || strlen($key) == 24 || strlen($key) == 32),\n sprintf(Resources::INVALID_STRING_LENGTH, 'key', '16, 24, 32')\n );\n\n Validate::isTrue(\n (strlen($initializationVector) == 16),\n sprintf(Resources::INVALID_STRING_LENGTH, 'initializationVector', '16')\n );\n\n return openssl_encrypt(\n $data,\n 'aes-256-ctr',\n $key,\n OPENSSL_RAW_DATA,\n $initializationVector\n );\n }", "private function determineIV($deterministic)\n {\n return $deterministic ? str_repeat(\"\\0\", $this->iv_size) : $this->randomIV();\n }", "function _generate_iv() {\n\t\t\t// Initialize pseudo random generator\n\t\t\tsrand ((double)microtime()*1000000);\n\t\t\t\n\t\t\t// Collect random data.\n\t\t\t// Add as many \"pseudo\" random sources as you can find.\n\t\t\t// Possible sources: Memory usage, diskusage, file and directory content...\n\t\t\t$iv = $this->salt;\n\t\t\t$iv .= rand(0,getrandmax());\n\t\t\t// Changed to serialize as the second parameter to print_r is not available in php prior to version 4.4\n\t\t\t$iv .= serialize($GLOBALS);\n\t\t\treturn $this->_hash($iv);\n\t\t}", "private function __construct()\n\t{\t\t\n\t\t// Load the Cryptography class\n\t\trequire_once(__DIR__.'/../vendor/crypt/AES.php');\n\t\t\n\t\t// Create a new AES cryptography object\n\t\t$this->aes = new Crypt_AES(); \n\t\t\n\t\t// Set the encryption key\n\t\t$this->setKey($this->cryptKey);\n\t}", "function getIVSize()\n {\n return $this->_iv_size;\n }", "public function ivGenerator() \n {\n $chars = \"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,#,@,$,%,&,!\";\n $chars = explode(\",\", $chars);\n $ints = array();\n for ($i = 0; $i < 4; $i++) {\n array_push($ints, rand(0, 64));\n }\n $password = array();\n\n //composing the password\n foreach ($ints as $int) {\n $char = $chars[$int * rand(0, 3)];\n if (($int * rand(0, 3)) % 2 == 0) {\n $char = strtoupper($char);\n array_push($password, $int);\n }\n array_push($password, $char);\n }\n\n //convert the password array to string\n $stringpass = '';\n foreach ($password as $char) {\n $stringpass.=$char;\n }\n return $stringpass;\n }", "public function encrypt($iv, $data, &$tag = null, $aad = '');", "function setCipher($cipher)\n {\n $this->_mcryptCipher = $cipher;\n }", "private function setUpSplitValueBagGetInitializationVector(SplitValueBag $decodedValueBag, $initializationVector)\n {\n $decodedValueBag->expects($this->once())\n ->method('getInitializationVector')\n ->with()\n ->will($this->returnValue($initializationVector));\n }", "public static function aes256Decrypt($key, $data) {}", "public function testShortKeyIVStream()\n {\n if (!extension_loaded('mcrypt')) {\n $this->markTestSkipped('mcrypt must be installed to compare the output of the shim to the original mcrypt');\n }\n\n $plaintext = 'Secret secret secret data';\n\n $iv = 'z';\n $key = 'z';\n $opts = array('iv' => $iv, 'key' => $key);\n\n $fp = fopen('php://memory', 'wb+');\n stream_filter_append($fp, 'mcrypt.tripledes', STREAM_FILTER_WRITE, $opts);\n fwrite($fp, $plaintext);\n rewind($fp);\n $mcrypt = bin2hex(fread($fp, 1024));\n fclose($fp);\n\n $fp = fopen('php://memory', 'wb+');\n stream_filter_append($fp, 'phpseclib.mcrypt.tripledes', STREAM_FILTER_WRITE, $opts);\n fwrite($fp, $plaintext);\n rewind($fp);\n $compat = bin2hex(fread($fp, 1024));\n fclose($fp);\n\n $this->assertEquals($mcrypt, $compat);\n }", "protected function getIVSize()\n\t{\n\t\treturn mcrypt_get_iv_size($this->cipher, $this->mode);\n\t}", "protected function init()\n\t{\n\t\t$this->upVector = array();\n\t\t$this->downVector = array();\n\t\t$this->modifiedA = array();\n\t\t$this->modifiedB = array();\n\t}", "public static function aes256Encrypt($key, $data) {}", "function Crypt_AES($mode = CRYPT_AES_MODE_CBC)\n {\n if ( !defined('CRYPT_AES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()):\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_AES_MODE ) {\n case CRYPT_AES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n // ctr doesn't have a constant associated with it even though it appears to be fairly widely\n // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to\n // include a compatibility layer. the layer has been implemented but, for now, is commented out.\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = 'ncfb';\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n\n break;\n default:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n $this->mode = CRYPT_RIJNDAEL_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_CFB;\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_OFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\n }\n }\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) {\n parent::Crypt_Rijndael($this->mode);\n }\n }", "public function __construct( $mode = CRYPT_RC2_MODE_CBC ) {\n\t\tparent::Crypt_Base( $mode );\n\t}", "public function genSalt(){\n return mcrypt_create_iv(16, MCRYPT_DEV_URANDOM);\n }", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "private function encryption_parameters(): void\n {\n if ($this->use_encryption()) {\n if (!defined('ENCRYPTION_KEY_VALUE')) {\n define('ENCRYPTION_KEY_VALUE', 'NVWG9bMgetehyASFB4FZIJlOJomwiQKk'); // Default value\n define('ENCRYPTION_KEY_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption key is the default value.\n }\n if (!defined('ENCRYPTION_IV_VALUE')) {\n define('ENCRYPTION_IV_VALUE', 'KddhSnjJQHLLOOEcB1g9AihLTCK0eyFv'); // Default value\n define('ENCRYPTION_IV_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption IV is the default value.\n }\n\n if (!defined('ENCRYPTION_KEY')) {\n define('ENCRYPTION_KEY', hash('sha256', ENCRYPTION_KEY_VALUE));\n }\n if (!defined('ENCRYPTION_IV')) {\n define('ENCRYPTION_IV', substr(hash('sha256', ENCRYPTION_IV_VALUE), 0, 16));\n }\n }\n }", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('featurevector');\n\t\t$this->setPhpName('Featurevector');\n\t\t$this->setClassname('Featurevector');\n\t\t$this->setPackage('lib.model.smafe');\n\t\t$this->setUseIdGenerator(false);\n\t\t// columns\n\t\t$this->addForeignPrimaryKey('TRACK_ID', 'TrackId', 'INTEGER' , 'track', 'ID', true, null, null);\n\t\t$this->addForeignPrimaryKey('FEATUREVECTORTYPE_ID', 'FeaturevectortypeId', 'INTEGER' , 'featurevectortype', 'ID', true, null, null);\n\t\t$this->addColumn('DATA', 'Data', 'BLOB', false, null, null);\n\t\t$this->addForeignKey('FILE_ID', 'FileId', 'INTEGER', 'file', 'ID', false, null, null);\n\t\t$this->addColumn('INSERTED', 'Inserted', 'TIMESTAMP', false, -4, null);\n\t\t$this->addColumn('UPDATED', 'Updated', 'TIMESTAMP', false, -4, null);\n\t\t// validators\n\t}", "public static function encrypt($data, $key, $iv, &$tag);", "public function __construct()\n {\n $this->method = 'des-ecb';\n\n // WinVNC uses a fixed key with reversed bits to encrypt/decrypt password in registry\n // Original Key: \\x17\\x52\\x6B\\x06\\x23\\x4E\\x58\\x07\n // Reversed Bits: \\xE8\\x4A\\xD6\\x60\\xC4\\x72\\x1A\\xE0\n $this->key = hex2bin('e84ad660c4721ae0');\n\n // We are sending raw data with zero padding to OpenSSL\n $this->options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING;\n\n // des-ecb seems to use 8 character block size\n $this->block_size = 8;\n }", "private function _getCipher()\n {\n if ($this->_mcryptCipher == '') {\n $this->_mcryptCipher = MCRYPT_RIJNDAEL_256;\n }\n return $this->_mcryptCipher;\n }", "function vcrypt($clear)\n{\n //$salt = join '', ('.','/', 0..9,'A'..'Z', 'a'..'z')[rand 64, rand 64];\n //$vcrypt = crypt($clear, $salt).\"\\n\";\n //We need a Standard DES-Hash so we need to set a 2-Char salt\n $salt = \"he\";\n $vcrypt = crypt($clear, $salt);\n return $vcrypt;\n}", "public function getCurrentIv(): string;", "public function setInitValeur($initValeur) {\n $this->initValeur = $initValeur;\n return $this;\n }", "function encrypt_decrypt($action, $string, $key, $iv) {\n\t//global $config;\n\t$secret_key = $key;\n\t$secret_iv = $iv;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' ) {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "public function set_ID($str_VMS_ID) {\n $this->vms_id = $str_VMS_ID;\n }", "public function vectors()\n {\n return array(\n // Test vectors from https://cseweb.ucsd.edu/~mihir/papers/eax.html\n array(\n '',\n '233952DEE4D5ED5F9B9C6D6FF80FF478',\n '62EC67F9C3A4A407FCB2A8C49031A8B3',\n '6BFB914FD07EAE6B',\n '',\n 'E037830E8389F27B025A2D6527E79D01',\n ),\n array(\n 'F7FB',\n '91945D3F4DCBEE0BF45EF52255F095A4',\n 'BECAF043B0A23D843194BA972C66DEBD',\n 'FA3BFD4806EB53FA',\n '19DD',\n '5C4C9331049D0BDAB0277408F67967E5',\n ),\n array(\n '1A47CB4933',\n '01F74AD64077F2E704C0F60ADA3DD523',\n '70C3DB4F0D26368400A10ED05D2BFF5E',\n '234A3463C1264AC6',\n 'D851D5BAE0',\n '3A59F238A23E39199DC9266626C40F80',\n ),\n array(\n '481C9E39B1',\n 'D07CF6CBB7F313BDDE66B727AFD3C5E8',\n '8408DFFF3C1A2B1292DC199E46B7D617',\n '33CCE2EABFF5A79D',\n '632A9D131A',\n 'D4C168A4225D8E1FF755939974A7BEDE',\n ),\n array(\n '40D0C07DA5E4',\n '35B6D0580005BBC12B0587124557D2C2',\n 'FDB6B06676EEDC5C61D74276E1F8E816',\n 'AEB96EAEBE2970E9',\n '071DFE16C675',\n 'CB0677E536F73AFE6A14B74EE49844DD',\n ),\n array(\n '4DE3B35C3FC039245BD1FB7D',\n 'BD8E6E11475E60B268784C38C62FEB22',\n '6EAC5C93072D8E8513F750935E46DA1B',\n 'D4482D1CA78DCE0F',\n '835BB4F15D743E350E728414',\n 'ABB8644FD6CCB86947C5E10590210A4F',\n ),\n array(\n '8B0A79306C9CE7ED99DAE4F87F8DD61636',\n '7C77D6E813BED5AC98BAA417477A2E7D',\n '1A8C98DCD73D38393B2BF1569DEEFC19',\n '65D2017990D62528',\n '02083E3979DA014812F59F11D52630DA30',\n '137327D10649B0AA6E1C181DB617D7F2',\n ),\n array(\n '1BDA122BCE8A8DBAF1877D962B8592DD2D56',\n '5FFF20CAFAB119CA2FC73549E20F5B0D',\n 'DDE59B97D722156D4D9AFF2BC7559826',\n '54B9F04E6A09189A',\n '2EC47B2C4954A489AFC7BA4897EDCDAE8CC3',\n '3B60450599BD02C96382902AEF7F832A',\n ),\n array(\n '6CF36720872B8513F6EAB1A8A44438D5EF11',\n 'A4A4782BCFFD3EC5E7EF6D8C34A56123',\n 'B781FCF2F75FA5A8DE97A9CA48E522EC',\n '899A175897561D7E',\n '0DE18FD0FDD91E7AF19F1D8EE8733938B1E8',\n 'E7F6D2231618102FDB7FE55FF1991700',\n ),\n array(\n 'CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7',\n '8395FCF1E95BEBD697BD010BC766AAC3',\n '22E7ADD93CFC6393C57EC0B3C17D6B44',\n '126735FCC320D25A',\n 'CB8920F87A6C75CFF39627B56E3ED197C552D295A7',\n 'CFC46AFC253B4652B1AF3795B124AB6E',\n ),\n );\n }", "function __construct($init)\n {\n if(is_array($init))\n {\n if(sizeof($init) == 0) \n {\n throw new VectorException(\"Array input was empty\");\n } \n else\n {\n for($i = 0; $i < sizeof($init); $i++)\n {\n $this->vector[$i] = (float)$init[$i];\n }\n $this->dim = sizeof($init);\n }\n\n }\n else\n {\n $init = (int)$init;\n if($init <= 0)\n {\n throw new VectorException(\"Vector size must be +ve\");\n } \n else\n {\n $this->vector = array_fill(0, $init, 0.0);\n $this->dim = $init;\n }\n }\n }", "public function _setupInlineCrypt() {\n\t\t$lambda_functions = &Crypt_RC2::_getLambdaFunctions();\n\n\t\t// The first 10 generated $lambda_functions will use the $keys hardcoded as integers\n\t\t// for the mixing rounds, for better inline crypt performance [~20% faster].\n\t\t// But for memory reason we have to limit those ultra-optimized $lambda_functions to an amount of 10.\n\t\t// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)\n\t\t$gen_hi_opt_code = (bool) ( count( $lambda_functions ) < 10 );\n\n\t\t// Generation of a uniqe hash for our generated code\n\t\t$code_hash = \"Crypt_RC2, {$this->mode}\";\n\t\tif ( $gen_hi_opt_code ) {\n\t\t\t$code_hash = str_pad( $code_hash, 32 ) . $this->_hashInlineCryptFunction( $this->key );\n\t\t}\n\n\t\t// Is there a re-usable $lambda_functions in there?\n\t\t// If not, we have to create it.\n\t\tif ( ! isset( $lambda_functions[ $code_hash ] ) ) {\n\t\t\t// Init code for both, encrypt and decrypt.\n\t\t\t$init_crypt = '$keys = $self->keys;';\n\n\t\t\tswitch ( true ) {\n\t\t\t\tcase $gen_hi_opt_code:\n\t\t\t\t\t$keys = $this->keys;\n\t\t\t\tdefault:\n\t\t\t\t\t$keys = [];\n\t\t\t\t\tforeach ( $this->keys as $k => $v ) {\n\t\t\t\t\t\t$keys[ $k ] = '$keys[' . $k . ']';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $in is the current 8 bytes block which has to be en/decrypt\n\t\t\t$encrypt_block = $decrypt_block = '\n $in = unpack(\"v4\", $in);\n $r0 = $in[1];\n $r1 = $in[2];\n $r2 = $in[3];\n $r3 = $in[4];\n ';\n\n\t\t\t// Create code for encryption.\n\t\t\t$limit = 20;\n\t\t\t$actions = [ $limit => 44, 44 => 64 ];\n\t\t\t$j = 0;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// Mixing round.\n\t\t\t\t$encrypt_block .= '\n $r0 = (($r0 + ' . $keys[ $j ++ ] . ' +\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF) << 1;\n $r0 |= $r0 >> 16;\n $r1 = (($r1 + ' . $keys[ $j ++ ] . ' +\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF) << 2;\n $r1 |= $r1 >> 16;\n $r2 = (($r2 + ' . $keys[ $j ++ ] . ' +\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF) << 3;\n $r2 |= $r2 >> 16;\n $r3 = (($r3 + ' . $keys[ $j ++ ] . ' +\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;\n $r3 |= $r3 >> 16;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 64 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Mashing round.\n\t\t\t\t\t$encrypt_block .= '\n $r0 += $keys[$r3 & 0x3F];\n $r1 += $keys[$r0 & 0x3F];\n $r2 += $keys[$r1 & 0x3F];\n $r3 += $keys[$r2 & 0x3F];';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$encrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Create code for decryption.\n\t\t\t$limit = 44;\n\t\t\t$actions = [ $limit => 20, 20 => 0 ];\n\t\t\t$j = 64;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// R-mixing round.\n\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 | ($r3 << 16)) >> 5;\n $r3 = ($r3 - ' . $keys[ -- $j ] . ' -\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF;\n $r2 = ($r2 | ($r2 << 16)) >> 3;\n $r2 = ($r2 - ' . $keys[ -- $j ] . ' -\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF;\n $r1 = ($r1 | ($r1 << 16)) >> 2;\n $r1 = ($r1 - ' . $keys[ -- $j ] . ' -\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF;\n $r0 = ($r0 | ($r0 << 16)) >> 1;\n $r0 = ($r0 - ' . $keys[ -- $j ] . ' -\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 0 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// R-mashing round.\n\t\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 - $keys[$r2 & 0x3F]) & 0xFFFF;\n $r2 = ($r2 - $keys[$r1 & 0x3F]) & 0xFFFF;\n $r1 = ($r1 - $keys[$r0 & 0x3F]) & 0xFFFF;\n $r0 = ($r0 - $keys[$r3 & 0x3F]) & 0xFFFF;';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$decrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Creates the inline-crypt function\n\t\t\t$lambda_functions[ $code_hash ] = $this->_createInlineCryptFunction(\n\t\t\t\t[\n\t\t\t\t\t'init_crypt' => $init_crypt,\n\t\t\t\t\t'encrypt_block' => $encrypt_block,\n\t\t\t\t\t'decrypt_block' => $decrypt_block\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Set the inline-crypt function as callback in: $this->inline_crypt\n\t\t$this->inline_crypt = $lambda_functions[ $code_hash ];\n\t}", "public function init( $vargs )\n {\n // Noop\n }", "public function init()\n {\n\n // initialize the prepared statements\n $this->eavAttributeSetStmt =\n $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::EAV_ATTRIBUTE_SET));\n $this->eavAttributeSetsByEntityTypeIdStmt =\n $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::EAV_ATTRIBUTE_SETS_BY_ENTITY_TYPE_ID));\n $this->eavAttributeSetByEntityTypeIdAndAttributeSetNameStmt =\n $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::EAV_ATTRIBUTE_SET_BY_ENTITY_TYPE_ID_AND_ATTRIBUTE_SET_NAME));\n $this->eavAttributeSetByEntityTypeCodeAndAttributeSetNameStmt =\n $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::EAV_ATTRIBUTE_SET_BY_ENTITY_TYPE_CODE_AND_ATTRIBUTE_SET_NAME));\n }", "function encryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_encrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "function aes256_cbc_decrypt($key, $data, $iv) {\n $data = openssl_decrypt($data, \"aes-256-cbc\", $key, OPENSSL_RAW_DATA, $iv);\n return $data;\n}", "final public function cypherIVLength($cypher = '')\n {\n return openssl_cipher_iv_length($cypher);\n }", "function decrypt($ciphertext)\n {\n if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) {\n $this->_mcryptSetup();\n\n if ($this->mode == 'ncfb' && $this->continuousBuffer) {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 16 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 16) {\n $cb = substr($ciphertext, $i, $len - $len % 16);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -16);\n $len%= 16;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n\n return $plaintext;\n }\n\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 15) & 0xFFFFFFF0, chr(0));\n }\n\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n return parent::decrypt($ciphertext);\n }", "function cifrar($datos, $llave) {\n // Quitamos la codificacion base64 de nuestra llave\n $clave_cifrado = base64_decode($llave);\n // Generamos un vector de inicialización para nuestra clave\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n // Ciframos los datos utilizando AES 256 en modo CBC utilizando nuestra llave y nuestro IV generado\n $cifrado = openssl_encrypt($datos, 'aes-256-cbc', $clave_cifrado, 0, $iv);\n // El IV es importantísimo para poder descifrar nuestra clave, así que lo vamos a almacenar junto a nuestra clave cifrada usando el separador (::)\n return base64_encode($cifrado . '::' . $iv);\n}", "public function setInit($init)\n {\n\n }", "public function _setupKey() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\t// Key has already been expanded in Crypt_RC2::setKey():\n\t\t// Only the first value must be altered.\n\t\t$l = unpack( 'Ca/Cb/v*', $this->key );\n\t\tarray_unshift( $l, $this->pitable[ $l['a'] ] | ( $l['b'] << 8 ) );\n\t\tunset( $l['a'] );\n\t\tunset( $l['b'] );\n\t\t$this->keys = $l;\n\t}", "public function encrypt($str, $key, $method = '') {\n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n \n // Create return array\n $return = array('decrypted' => addslashes(trim($str)), 'encrypted' => '', 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array(), 'decryptedlen' => strlen(addslashes(trim($str))), 'encryptedlen' => 0, 'compressedlen' => 0);\n\n // String cannot be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key cannot be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Generate cipher_algorithm string to glue it to output string\n $len = 32;\n $algorithm = $this->textToBinary(mb_substr($this->cipher_algorithm.'_'.$this->generateRandomString($len-strlen($this->cipher_algorithm)), 0, $len));\n if(count(explode(' ',$algorithm)) !== $len) {\n $return['error'][] = 'Algorithm error';\n trigger_error('Algorithm error', E_USER_NOTICE); \n return $return;\n }\n \n // Create an IV and save it as binary\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $return['iv'] = bin2hex($iv); \n \n // Split input to be able to encrypt larger strings\n foreach(str_split($return['decrypted'], 20) as $str) {\n $return['base64_encode'][] = $this->textToBinary(base64_encode(openssl_encrypt($str, $method, $key, OPENSSL_RAW_DATA, $iv)), null);\n }\n \n // Glue everything togeather\n $return['encrypted'] = $algorithm. PHP_EOL . implode(PHP_EOL, $return['base64_encode']) . PHP_EOL . $this->textToBinary($return['iv']);\n $return['encrypted'] = str_replace(array(' ',PHP_EOL),array($this->delimiter_character,$this->delimiter_breaks),$this->delimiter_characters.' '.$return['encrypted'].' '.$this->delimiter_characters);\n $return['encryptedlen'] = strlen($return['encrypted']);\n \n // Compress the string if enabled\n if($this->compress==true) {\n $return['encryptednotcompressed'] = $return['encrypted'];\n $return['encrypted'] = addslashes($this->delimiter_gz.utf8_encode(gzencode($return['encrypted'],9)).$this->delimiter_gz);\n $return['compressedlen'] = strlen($return['encrypted']);\n }\n \n return $return;\n }", "public function __construct( UserVectorsInterface $userVectors)\n {\n $this->userVectors = $userVectors;\n parent::__construct();\n }", "public function getIvBytesLength()\n {\n $bytesLength = openssl_cipher_iv_length($this->cipherMethodString());\n if ($bytesLength === false) {\n throw new CipherException();\n }\n return $bytesLength;\n }", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "function encrypt_decrypt($action, $string) {\n\n if ( !function_exists(\"openssl_encrypt\") )\n {\n die (\"openssl function openssl_encrypt does not exist\");\n }\n if ( !function_exists(\"hash\") )\n {\n die (\"function hash does not exist\");\n }\n\n global $encryption_key;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //echo \"$encryption_key\\n\";\n $secret_iv = 'RgX54.Ju7h';\n\n\n // hash\n $key = hash('sha256', $encryption_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' )\n {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' )\n {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "public function setEstadoCivil($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->estado_civil !== $v) {\n\t\t\t$this->estado_civil = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::ESTADO_CIVIL;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setCVV($cvv = '') {\n $security = array(\n 'x_card_code'=>$cvv,\n );\n $this->NVP = array_merge($this->NVP, $security); \n }", "function decrypt($encrypted_string, $decryption_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $decryption_iv = '1234567891011121';\r\n $string = openssl_decrypt ($encrypted_string, $ciphering, $decryption_key, $options, $decryption_iv);\r\n return $string;\r\n}", "public function init()\n\t{\n\t\t$this->dictionary = new Dictionary($this->iblockId);\n\t\t$this->storage = new Storage($this->iblockId);\n\t\tif (self::$catalog === null)\n\t\t{\n\t\t\tself::$catalog = \\Bitrix\\Main\\Loader::includeModule(\"catalog\");\n\t\t}\n\n\t\tif (self::$catalog)\n\t\t{\n\t\t\t$catalog = \\CCatalogSKU::getInfoByProductIBlock($this->iblockId);\n\t\t\tif (!empty($catalog) && is_array($catalog))\n\t\t\t{\n\t\t\t\t$this->skuIblockId = $catalog[\"IBLOCK_ID\"];\n\t\t\t\t$this->skuPropertyId = $catalog[\"SKU_PROPERTY_ID\"];\n\t\t\t}\n\t\t}\n\t}", "function _init()\n {\n $defaults = new Crypt_Blowfish_DefaultKey();\n $this->_P = $defaults->P;\n $this->_S = $defaults->S;\n }", "public function init()\n {\n $this->setEnv();\n }", "public function setTokenEncryptionKeyId($val)\n {\n $this->_propDict[\"tokenEncryptionKeyId\"] = $val;\n return $this;\n }", "abstract protected function buildCipherMethod($cipherName, $iv, $keySize);", "function encrypt_decrypt($action, $string) {\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'This is my secret key';\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n \n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n }\n else if( $action == 'decrypt' ){\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "protected function setNewEncryptionKeyAndLogOut() {}", "public function setVCenter($value) {\n\t}", "function setEncryptionKey($key){\n\t\tif($key!=\"\"){\n\t\t\t$this->rc4key=$key;\n\t\t\t$this->rc4 = new rc4crypt();\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "public function setVolSalt($newVolSalt) {\n\t\t//verify salt is hex\n\t\tif((ctype_xdigit($newVolSalt)) === false) {\n\t\t\t\tthrow (new InvalidArgumentException(\"salt is empty or insecure\"));\n\t\t\t}\n\n\t\t//verify salt is exactly 64\n\t\tif(strlen($newVolSalt) !== 64) {\n\t\t\tthrow (new RangeException(\"salt is not 64 characters\"));\n\t\t}\n\t\t$this->volSalt = $newVolSalt;\n\t}", "public function encrypt($key,$iv,$toEncrypt) {\r\n\t\t\r\n\t\t$this->error = false;\r\n\t\t\r\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); //Size\r\n\t\tif(strlen($iv) != $iv_size){ //Size Wrong 16 CH\r\n\t\t\t$this->error = \"IV Size Wrong!\";\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t\r\n\t\t$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key,$toEncrypt, MCRYPT_MODE_CBC, $iv);\r\n\t\t\r\n\t\t$this->encrypt = base64_encode($ciphertext);\r\n\t\t\r\n\t\treturn (true);\r\n\t}" ]
[ "0.688854", "0.6720343", "0.67095953", "0.6704769", "0.61690897", "0.5989857", "0.59624827", "0.5898109", "0.58632225", "0.5698325", "0.55948955", "0.5588087", "0.5510615", "0.5504956", "0.54960024", "0.5405649", "0.5249301", "0.5222614", "0.5211789", "0.5163581", "0.51494163", "0.5074342", "0.50608367", "0.5012796", "0.49712572", "0.49504396", "0.48947713", "0.4894521", "0.48851037", "0.48113042", "0.48095185", "0.47818565", "0.4706167", "0.45971367", "0.4589352", "0.45852503", "0.45656526", "0.45457768", "0.4544734", "0.45401973", "0.45314884", "0.4526489", "0.45121217", "0.4497572", "0.44863296", "0.44769412", "0.44689125", "0.44661173", "0.44599178", "0.44534755", "0.44514176", "0.44306684", "0.44281125", "0.44241253", "0.44205296", "0.4406628", "0.44000843", "0.43885115", "0.43688858", "0.4366728", "0.43654364", "0.43642882", "0.4360021", "0.43418682", "0.43300712", "0.43221888", "0.4292234", "0.4288964", "0.42751718", "0.4271238", "0.42699933", "0.42694655", "0.42664185", "0.42510447", "0.4235196", "0.42314306", "0.42289034", "0.42197534", "0.42191437", "0.42071638", "0.41903427", "0.4186893", "0.4174776", "0.4169429", "0.41595122", "0.41504905", "0.41419393", "0.41411445", "0.41397738", "0.413803", "0.41267487", "0.4125115", "0.4117737", "0.41145682", "0.4112836", "0.410832", "0.4099781", "0.40960705", "0.4092268", "0.40782362" ]
0.70608187
0
Decrypts a message. If strlen($ciphertext) is not a multiple of 16, null bytes will be added to the end of the string until it is.
function decrypt($ciphertext) { if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) { $this->_mcryptSetup(); if ($this->mode == 'ncfb' && $this->continuousBuffer) { $iv = &$this->decryptIV; $pos = &$this->debuffer['pos']; $len = strlen($ciphertext); $plaintext = ''; $i = 0; if ($pos) { $orig_pos = $pos; $max = 16 - $pos; if ($len >= $max) { $i = $max; $len-= $max; $pos = 0; } else { $i = $len; $pos+= $len; $len = 0; } // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize $plaintext = substr($iv, $orig_pos) ^ $ciphertext; $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); } if ($len >= 16) { $cb = substr($ciphertext, $i, $len - $len % 16); $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb; $iv = substr($cb, -16); $len%= 16; } if ($len) { $iv = mcrypt_generic($this->ecb, $iv); $plaintext.= $iv ^ substr($ciphertext, -$len); $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len); $pos = $len; } return $plaintext; } if ($this->paddable) { // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic : // "The data is padded with "\0" to make sure the length of the data is n * blocksize." $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 15) & 0xFFFFFFF0, chr(0)); } $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext); if (!$this->continuousBuffer) { mcrypt_generic_init($this->demcrypt, $this->key, $this->iv); } return $this->paddable ? $this->_unpad($plaintext) : $plaintext; } return parent::decrypt($ciphertext); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decrypt($ciphertext)\r\n {\r\n $this->_setup();\r\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\r\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\r\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + $this->block_size - 1) % $this->block_size, chr(0));\r\n\r\n $plaintext = '';\r\n switch ($this->mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $this->block_size));\r\n }\r\n break;\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $xor = $this->decryptIV;\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $block = substr($ciphertext, $i, $this->block_size);\r\n $plaintext.= $this->_decryptBlock($block) ^ $xor;\r\n $xor = $block;\r\n }\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = $xor;\r\n }\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }", "public function decrypt($ciphertext) {\n\t\t\n\t\t$key = self::PWD; // Password is set above at the Constants\n\t\t$ciphertext = hex2bin($ciphertext);\n\t\t$c = base64_decode($ciphertext);\n\t\t$ivlen = openssl_cipher_iv_length($cipher=\"AES-256-CTR\");\n\t\t$iv = substr($c, 0, $ivlen);\n\t\t$hmac = substr($c, $ivlen, $sha2len=32);\n\t\t$ciphertext_raw = substr($c, $ivlen+$sha2len);\n\t\t$original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n\t\t$calcmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);\n\t\t\n\t\tif (hash_equals($hmac, $calcmac)) { //PHP 5.6+ timing attack safe comparison\n\t\t\treturn $original_plaintext;\n\t\t}\n\t}", "function aes256Decrypt($ciphertext, $password) {\n // hash the key\n $key = pack(\"H*\", substr(hash(\"sha512\", $password), 0, 64));\n\n // divide the initialization vector and encrypted data\n $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $rawBlock = base64_decode($ciphertext);\n $rawIv = substr($rawBlock, 0, $ivSize);\n $rawCiphertext = substr($rawBlock, $ivSize);\n\n // unpad the plaintext before returning it\n try {\n $plaintext = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $rawCiphertext, MCRYPT_MODE_CBC, $rawIv);\n $plaintext = pkcs5Unpad($plaintext);\n } catch(InvalidArgumentException $invalidArgument) {\n throw(new InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n }\n return($plaintext);\n}", "function decrypt($ciphertext, $passphrase, $iv) {\n try {\n\t\t$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $passphrase, $ciphertext, MCRYPT_MODE_CBC, $iv);\n\t\treturn unpad_pkcs5($decrypted);\n } catch (Exception $e) {\n echo \"Encryption exception in decrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "function decrypt($ciphertext)\n {\n $ciphertext = strtolower($ciphertext);\n $plaintext = \"\";\n \n for ( $i = 0; $i < strlen($ciphertext); $i++ )\n {\n $x = $this->alphabet->indexOf($ciphertext[$i]);\n $decodedIndex = mod(($x - $this->shift), $this->alphabet->sizeOf());\n $plaintext = $plaintext . ($this->alphabet->get($decodedIndex)[0]);\n }\n return $plaintext;\n }", "public function decrypt();", "function decrypt($string) {\n\t\t\t// Apply base64 decoding if necessary\n\t\t\tif($this->base64) $string = base64_decode($string);\n\t\t\t\n\t\t\t// Extract encrypted IV from input\n\t\t\t$tmp_iv = substr($string,0,$this->hash_length);\n\t\t\t\n\t\t\t// Extract encrypted message from input\n\t\t\t$string = substr($string,$this->hash_length,strlen($string) - $this->hash_length);\n\t\t\t$iv = $out = '';\n\t\t\t\n\t\t\t// Regenerate IV by xor-ing encrypted IV from block 1 and $this->hashed_key\n\t\t\t// Mathematics: (IV XOR KeY) XOR Key = IV\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) \n\t\t\t{\n\t\t\t\t$iv .= chr(ord($tmp_iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\t\t// Use IV as key for decrypting the first block cyphertext\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\t\t\n\t\t\t// Loop through the whole input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($out,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "protected function _decrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n\n default:\n $result = '';\n $string = base64_decode($this->_encryptedText);\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) - ord($keychar));\n $result .= $char;\n }\n $this->_plainText = $result;\n break;\n }\n }", "static public function decrypt($data,$key) {\r\n $iv= substr($data, 0,16); \r\n $data=substr($data,16);\r\n // 128 is blocksize, not keysize!\r\n $out=mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$data,MCRYPT_MODE_CBC, $iv);\r\n $padlen=ord(substr($out,-1));\r\n return substr($out,0, strlen($out)-$padlen);\r\n }", "static function decrypt($encrypted){\n # Separate the encrypted data from the initialization vector ($iv)\n $data = explode('~~~', base64_decode($encrypted));\n # Decrypt the data\n if(isset($data[1])){\n $decryptedMessage = openssl_decrypt($data[0], \"AES-256-CBC\", self::getEncryptKey(), 0, $data[1]);\n return $decryptedMessage;\n } else {\n return $encrypted;\n }\n }", "function ciphertext_only($ciphertext)\n {\n \n for($i=0; $i < $this->alphabet->sizeOf(); $i++)\n {\n $cipher = new Caesar($i, $this->alphabet);\n echo $cipher->decrypt($ciphertext) . \"\\n\";\n }\n }", "public function decrypt( $ciphertext ) {\n\t\tif ( CRYPT_ENGINE_OPENSSL == $this->engine ) {\n\t\t\t$temp = $this->key;\n\t\t\t$this->key = $this->orig_key;\n\t\t\t$result = parent::decrypt( $ciphertext );\n\t\t\t$this->key = $temp;\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn parent::decrypt( $ciphertext );\n\t}", "function new_decrypt($data, $key) {\n if(empty($key)){\n $key = $encryption_key;\n }\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key, 0, $iv);\n}", "public static function aes256Decrypt($key, $data) {}", "public function decrypt($iv, $data, $tag = null, $aad = '');", "function md5_decrypt( $enc_text, $password, $iv_len = 16 )\n\t{\n \t$enc_text = base64_decode( $enc_text );\n \t$n = strlen( $enc_text );\n \t$i = $iv_len;\n \t$plain_text = '';\n \t$iv = substr( $password ^ substr( $enc_text, 0, $iv_len ), 0, 512 );\n \twhile ( $i < $n )\n \t{\n \t$block = substr( $enc_text, $i, 16 );\n \t$plain_text .= $block ^ pack( 'H*', md5( $iv ) );\n \t$iv = substr( $block . $iv, 0, 512 ) ^ $password;\n \t$i += 16;\n \t}\n \treturn preg_replace( '/\\\\x13\\\\x00*$/', '', $plain_text );\n\t}", "protected static function plainDecrypt(\n $ciphertext,\n #[\\SensitiveParameter]\n $key,\n #[\\SensitiveParameter]\n $iv,\n $cipherMethod\n )\n {\n Core::ensureConstantExists('OPENSSL_RAW_DATA');\n Core::ensureFunctionExists('openssl_decrypt');\n\n /** @var string $plaintext */\n $plaintext = \\openssl_decrypt(\n $ciphertext,\n $cipherMethod,\n $key,\n OPENSSL_RAW_DATA,\n $iv\n );\n Core::ensureTrue(\\is_string($plaintext), 'openssl_decrypt() failed.');\n\n return $plaintext;\n }", "function aes256_cbc_decrypt($key, $data, $iv) {\n $data = openssl_decrypt($data, \"aes-256-cbc\", $key, OPENSSL_RAW_DATA, $iv);\n return $data;\n}", "function decrypt($encrypted_string, $decryption_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $decryption_iv = '1234567891011121';\r\n $string = openssl_decrypt ($encrypted_string, $ciphering, $decryption_key, $options, $decryption_iv);\r\n return $string;\r\n}", "function decodeCaesar($ciphertext, $key){\n\t$cleartext='';\n\tfor($i=0; $i<strlen($ciphertext); $i++){\n\t\t$c=substr($ciphertext, $i, 1);\n\t\t$decodedchar=chr(ord($c)-$key);\n\t\t$cleartext.=$decodedchar;\n\t}\n\treturn $cleartext;\n}", "public function decrypt($cipherText, $secretKey);", "function decrypt( $key, $ciphertext, $meta = '' ) {\n\n\t// Generate valid key\n\t$key = hash_pbkdf2( 'sha256', $key, '', 10000, 0, true );\n\n\t// Serialize metadata\n\t$meta = serialize($meta);\n\n\t// Derive two subkeys from the original key\n\t$mac_key = hash_hmac( 'sha256', 'mac', $key, true );\n\t$enc_key = hash_hmac( 'sha256', 'enc', $key, true );\n\t$enc_key = substr( $enc_key, 0, 32 );\n\n\t// Unpack MAC, nonce and encrypted message from the ciphertext\n\t$enc = base64_decode( $ciphertext );\n\t$siv = substr( $enc, 0, 16 );\n\t$nonce = substr( $enc, 16, 16 );\n\t$enc = substr( $enc, 16 + 16 );\n\n\t// Decrypt message\n\t$plaintext = mcrypt_decrypt( 'rijndael-128', $enc_key, $enc, 'ctr', $siv );\n\n\t// Verify MAC, return null if message is invalid\n\t$temp = $nonce;\n\t$temp .= hash_hmac( 'sha256', $plaintext, $mac_key, true );\n\t$temp .= hash_hmac( 'sha256', $meta, $mac_key, true );\n\t$mac = hash_hmac( 'sha256', $temp, $mac_key, true );\n\tif ( $siv !== substr( $mac, 0, 16 ) ) return null;\n\n\treturn $plaintext;\n\n}", "function decrypt( $key, $ciphertext, $meta = '' ) {\n\t// Generate valid key\n\t$key = hash_pbkdf2( 'sha256', $key, '', 10000, 0, true );\n\t// Serialize metadata\n\t$meta = serialize($meta);\n\t// Derive two subkeys from the original key\n\t$mac_key = hash_hmac( 'sha256', 'mac', $key, true );\n\t$enc_key = hash_hmac( 'sha256', 'enc', $key, true );\n\t$enc_key = substr( $enc_key, 0, 32 );\n\t// Unpack MAC, nonce and encrypted message from the ciphertext\n\t$enc = base64_decode( $ciphertext );\n\t$siv = substr( $enc, 0, 16 );\n\t$nonce = substr( $enc, 16, 16 );\n\t$enc = substr( $enc, 16 + 16 );\n\t// Decrypt message\n\t$plaintext = mcrypt_decrypt( 'rijndael-128', $enc_key, $enc, 'ctr', $siv );\n\t// Verify MAC, return null if message is invalid\n\t$temp = $nonce;\n\t$temp .= hash_hmac( 'sha256', $plaintext, $mac_key, true );\n\t$temp .= hash_hmac( 'sha256', $meta, $mac_key, true );\n\t$mac = hash_hmac( 'sha256', $temp, $mac_key, true );\n\tif ( $siv !== substr( $mac, 0, 16 ) ) return null;\n\treturn $plaintext;\n}", "public static function decrypt($cyphertext, $key)\n {\n\n // Silently abort if cypher text is null is not long enough\n if ($cyphertext === null || strlen($cyphertext) < 64) {\n return false;\n }\n\n // Get the normalized decryption key\n $key = self::_key($key);\n\n // Find the IV at the beginning of the cypher text\n $iv = substr($cyphertext, 0, 32);\n\n // Gather the checksum portion of the cypher text.\n $chksum = substr($cyphertext, 32, 32);\n\n // Get the cyphertext from the input blob.\n $cyphertext = substr($cyphertext, 64);\n\n // If chksum could not be verified return false.\n /*\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * Checksum validation has been disabled...\n * DO NOT USE THIS LIBRARY EVER\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n */\n # if (self::_chksumcreate($cyphertext, $iv, $key) !== $chksum) {\n # return false;\n # }\n // Decrypt the cyphertext data.\n $plaintext = mcrypt_decrypt(\n MCRYPT_RIJNDAEL_256, $key, $cyphertext, MCRYPT_MODE_CBC, $iv\n );\n\n /*\n * Unpad the string by reading the last bit of padding and removing\n * that many bytes of data from the end\n */\n return Pkcs7::unpad($plaintext);\n }", "public function decrypt(string $cipher, ?string $nonce = null, string $additionalData = null): string;", "function decrypt_string($iv_with_string, $key=KEY) {\n $iv = substr($iv_with_string, 0, cipher_iv_size());\n $encrypted = substr($iv_with_string, cipher_iv_size());\n // Needs a key of length 16, 24, or 32\n $key = str_pad($key, 32, '*');\n\n // Decrypt\n return mcrypt_decrypt(CIPHER_TYPE, $key, $encrypted, CIPHER_MODE, $iv);\n }", "public function decrypt($text)\n\t{\n\t\t// check that an iv is set, if required by the mode\n\t\t$this->mode->checkIV();\n\n\t\t// the decryption is done inside the mode\n\t\t$this->mode->decrypt($text);\n\t\treturn $text;\n\t}", "public static function decryptString($key, $string)\n {\n if (strlen($key) < 4)\n {\n throw new \\Exception('Please provide a key that is more than 3 characters');\n }\n $ciphertext_dec = base64_decode($string);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv_dec = substr($ciphertext_dec, 0, $iv_size);\n $ciphertext_dec = substr($ciphertext_dec, $iv_size);\n $plaintext_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, self::pad_key($key),\n $ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);\n\n return $plaintext_dec;\n }", "abstract public function decrypt($data);", "public function decrypt($data)\n {\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($this->key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key,\n 0, $iv);\n }", "public function decrypt($string)\n {\n $key = $this->secretKey;\n //using hexadecimal\n $key = pack('H*', (string)$key);\n\n $cipherText = self::decode($string);\n\n $ivSize = self::getIvSize();\n //retrieves the IV, iv_size should be created using mcrypt_get_iv_size()\n $iv = substr($cipherText, 0, $ivSize);\n\n //retrieves the cipher text (everything except the $iv_size in the front)\n $cipherText = substr($cipherText, $ivSize);\n $decrypted = self::getPlainText($cipherText, $key, $iv);\n $decrypted = rtrim($decrypted, \"\\0\\4\");\n\n return $decrypted;\n }", "function decryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_decrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "function fsl_decrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // To decrypt, separate the encrypted data from the initialization vector ($iv).\n $parts = explode(':', $string);\n\n // Don't forget to base64-decode the $iv before feeding it back to\n //openssl_decrypt\n $decrypted = openssl_decrypt($parts[0], 'aes-256-cbc', $encryption_key, 0, base64_decode($parts[1]));\n return $decrypted;\n}", "private function decryptCipherTextEncryptionKey()\n {\n $result = $this->getAws()->createKms()->decrypt([\n 'CiphertextBlob' => base64_decode($this->getProtectedHeader(self::KEY_CIPHERTEXT_HEADER_NAME))\n ]);\n return $result['Plaintext'];\n }", "function decrypt($string, $key='humanbody_messages_2') {\r\n $result = '';\r\n $string = base64_decode($string);\r\n for($i=0; $i<strlen($string); $i++) {\r\n $char = substr($string, $i, 1);\r\n $keychar = substr($key, ($i % strlen($key))-1, 1);\r\n $char = chr(ord($char)-ord($keychar));\r\n $result.=$char;\r\n }\r\n return $result;\r\n }", "public function decrypt($encrypted_text, $key = '', $iv = '', $bit_check = 8, $cipher_type = MCRYPT_TRIPLEDES)\n {\n try {\n /* Ensure the key & IV is the same for both encrypt & decrypt. */\n if (!empty($encrypted_text)) {\n $cipher = mcrypt_module_open($cipher_type, '', 'cbc', '');\n\n mcrypt_generic_init($cipher, $key, $iv);\n $decrypted = mdecrypt_generic($cipher, base64_decode($encrypted_text));\n\n mcrypt_generic_deinit($cipher);\n $last_char = substr($decrypted, -1);\n\n for ($i = 0; $i < $bit_check; $i++) {\n if (chr($i) == $last_char) {\n $decrypted = substr($decrypted, 0, strlen($decrypted) - $i);\n break;\n }\n }\n\n mcrypt_module_close($cipher);\n\n return $decrypted;\n } else {\n return $encrypted_text;\n }\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "protected function _decrypt() {}", "protected function _decrypt() {}", "public function decrypt($cypher){\n\t\t$cypher = str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "function decrypt($encrypted_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n\t\treturn $decrypted_string;\n\t}", "function m_decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n}", "function decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n }", "public static function decrypt($data, $key) {\n self::iv($key);\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, self::$key, hex2bin($data), MCRYPT_MODE_ECB, self::$iv));\n }", "function ehash_decrypt($encrypted_string, $encryption_key) {\n \n\tif (empty($encrypted_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_decode($encrypted_string);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n \n return $decrypted_string;\n}", "function decrypt($cypher){\n\t\t$cypher =str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "public final function Decrypt($input, $key=null)\r\n\t\t{\r\n\t\t\tif (!$key)\r\n\t\t\t\t$key = $this->Key;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t$this->CheckMcrypt();\r\n\t\t\t$inputd = base64_decode($input);\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$td = mcrypt_module_open($this->CryptoAlgo, '', 'ecb', '');\r\n\t\t\t\t$key = substr($key, 0, mcrypt_enc_get_key_size($td));\r\n\t\t\t\t$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\r\n\t\t\t\tmcrypt_generic_init($td, $key, $iv);\r\n\t\t\t\t$retval = mdecrypt_generic($td, $inputd);\r\n\t\t\t\t\r\n\t\t\t\tmcrypt_generic_deinit($td);\r\n\t\t\t\tmcrypt_module_close($td);\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn trim($retval, \"\\x00..\\x1F\");\r\n\t\t}", "public function AesDecrypt ($buffer, $key)\r\n\t{\r\n\t\tif (strlen ($key) != 32)\r\n\t\t{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\t\r\n\t\t$buffer = $this->_hex2bin ($buffer);\r\n\t\t\r\n\t\t$size = mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\r\n\r\n\t\tif ($size > strlen ($buffer))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$iv = substr ($buffer, 0, $size);\t\t\r\n\t\t$buffer = substr ($buffer, $size);\r\n\t\t\r\n\t\treturn rtrim (mcrypt_decrypt (MCRYPT_RIJNDAEL_256, $key, $buffer, MCRYPT_MODE_CBC, $iv) );\r\n\t}", "public function decrypt(): string\n {\n $decrypted = openssl_decrypt(\n $this->encryptedString,\n $this->encryptionMethod,\n $this->salt,\n 0,\n $this->getInitializationVector(),\n );\n\n assert(is_string($decrypted)); // Make phpstan happy\n\n return $decrypted;\n }", "function decrypt($string, $key = 'mykey', $secret = 'SecretKey', $method = 'AES-256-CBC') {\n // hash\n $key = hash('sha256', $key);\n // create iv - encrypt method AES-256-CBC expects 16 bytes\n $iv = substr(hash('sha256', $secret), 0, 16);\n // decode\n $string = base64_decode($string);\n // decrypt\n return openssl_decrypt($string, $method, $key, 0, $iv);\n }", "public function decrypt(UuidInterface $flowUuid, string $encryptedValue) : string;", "public function decryptCBC($encryptStr) {\n $localIV = $this->ivCBC;\n $encryptKey = $this->secret_key;\n $module = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, $localIV);\n\n mcrypt_generic_init($module, $encryptKey, $localIV);\n\n $encryptedData = base64_decode($encryptStr);\n $encryptedData = mdecrypt_generic($module, $encryptedData);\n\n return $encryptedData;\n }", "public function decrypt() \r\n {\r\n //TODO: Implement decrypt method\r\n }", "function km200_Decrypt( $decryptData ) \n{ \n $decrypt = openssl_decrypt( \n base64_decode( $decryptData ),\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n );\n// var_dump($decryptData);\n\n // remove zero padding \n $decrypt = rtrim( $decrypt, \"\\x00\" ); \n // remove PKCS #7 padding \n $decrypt_len = strlen( $decrypt ); \n $decrypt_padchar = ord( $decrypt[ $decrypt_len - 1 ] ); \n for ( $i = 0; $i < $decrypt_padchar ; $i++ ) \n { \n if ( $decrypt_padchar != ord( $decrypt[$decrypt_len - $i - 1] ) ) \n break; \n } \n if ( $i != $decrypt_padchar ) \n return $decrypt; \n else \n return substr( \n $decrypt, \n 0, \n $decrypt_len - $decrypt_padchar \n ); \n}", "public static function decrypt($string)\n {\n /*\n * ------------------------------------------------\n * ALGORITHMS\n * ------------------------------------------------\n * MCRYPT_3DES MCRYPT_PANAMA\n * MCRYPT_ARCFOUR MCRYPT_RAND\n * MCRYPT_ARCFOUR_IV MCRYPT_RC2\n * MCRYPT_BLOWFISH MCRYPT_RC6\n * MCRYPT_BLOWFISH_COMPAT MCRYPT_RIJNDAEL_128\n * MCRYPT_CAST_128 MCRYPT_RIJNDAEL_192\n * MCRYPT_CAST_256 MCRYPT_RIJNDAEL_256\n * MCRYPT_CRYPT MCRYPT_SAFER128\n * MCRYPT_DECRYPT MCRYPT_SAFER64\n * MCRYPT_DES MCRYPT_SAFERPLUS\n * MCRYPT_DEV_RANDOM MCRYPT_SERPENT\n * MCRYPT_DEV_URANDOM MCRYPT_SKIPJACK\n * MCRYPT_ENCRYPT MCRYPT_THREEWAY\n * MCRYPT_ENIGNA MCRYPT_TRIPLEDES\n * MCRYPT_GOST MCRYPT_TWOFISH\n * MCRYPT_IDEA MCRYPT_WAKE\n * MCRYPT_LOKI97 MCRYPT_XTEA\n * MCRYPT_MARS\n * ------------------------------------------------\n * MODES\n * ------------------------------------------------\n * MCRYPT_MODE_CBC MCRYPT_MODE_NOFB\n * MCRYPT_MODE_CFB MCRYPT_MODE_OFB\n * MCRYPT_MODE_ECB MCRYPT_MODE_STREAM\n */\n \n $algorithm = MCRYPT_RIJNDAEL_256;\n $mode = MCRYPT_MODE_ECB;\n $iv_size = mcrypt_get_iv_size ($algorithm, $mode );\n\t$iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND );\n\t$key = \"Curso-Yii2-Capa8tv\";\n\t\t\t\t\n\t$encrypt = base64_decode ( $string );\n\t\t\t\t\n\treturn MCRYPT_DECRYPT ( $algorithm, $key, $encrypt, $mode, $iv );\n }", "function decrypt($string, $key)\n{ \n\t$result = '';\n\t$string = base64_decode($string);\n\tfor($i=0; $i<strlen($string); $i++)\n\t{\n\t\t$char = substr($string, $i, 1);\n\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\n\t\t$char = chr(ord($char)-ord($keychar));\n\t\t$result.=$char;\n\t}\n\treturn $result;\n}", "public function testDecrypt()\n\t{\n\t $encrypted = mcrypt_encrypt('blowfish', 's3cret', \"a test string\", MCRYPT_MODE_ECB);\n\t $this->assertEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "public static function decrypt($data)\r\n {\r\n return openssl_decrypt(\r\n base64_decode($data),\r\n self::OPENSSL_CIPHER_NAME,\r\n self::ENCRYPTION_KEY,\r\n OPENSSL_RAW_DATA,\r\n self::ENCRYPTION_IV\r\n );\r\n }", "public function decryptString($data, $param = null);", "protected function doDecrypt($payload)\n {\n $nonce = $this->extractNonce($payload);\n $ciphertext = $this->extractCipherText($payload);\n\n switch ($this->cipher) {\n case static::CIPHER_AES_256:\n return sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_CHACHA:\n return sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_CHACHA_IETF:\n return sodium_crypto_aead_chacha20poly1305_ietf_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_X_CHACHA_IETF:\n return sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n default:\n return false;\n }\n }", "public static function aes128Decrypt($key, $data) {}", "public function decrypt($data)\n {\n if (is_null($data)) {\n return $data;\n }\n\n $data = base64_decode($data);\n\n $data = $this->removeCipherNoise($data, $this->getKey());\n $init_size = openssl_cipher_iv_length($this->cipher);\n\n if ($init_size > strlen($data)) {\n return null;\n }\n\n $init_vect = substr($data, 0, $init_size);\n $data = substr($data, $init_size);\n return rtrim(\n \\openssl_decrypt(\n $data,\n $this->cipher,\n $this->getKey(),\n $this->encryptOptions,\n $init_vect\n ),\n \"\\0\"\n );\n }", "function Decrypt($string, $key=''){\r\n\t\tglobal $global_config;\r\n\t\t\r\n\t\tif($key == '')\r\n\t\t\t$key = $global_config[\"en_decrypt_keys\"];\r\n\t\t$result = '';\r\n\t\tfor($i=1; $i<=strlen($string); $i++){\r\n\t\t\t$char = substr($string, $i-1, 1);\r\n\t\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\r\n\t\t\t$char = chr(ord($char)-ord($keychar));\r\n\t\t\t$result.=$char;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public static function blowfishDecrypt($encrypted_string, $encryption_key = null) {\n $encrypted_string = base64_decode($encrypted_string);\n $encryption_key = $encryption_key === null ? self::$default_key : $encryption_key;\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n }", "public function decrypt(string $message, string $pubKey): string\n {\n openssl_public_decrypt(base64_decode($message), $decrypted, $pubKey);\n return $decrypted;\n }", "public function decrypt($data)\n {\n $this->cwsDebug->titleH2('Decrypt data');\n\n if (empty($this->encryptionKey)) {\n $this->error = 'You have to set the encryption key...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n if (empty($data)) {\n $this->error = 'Data empty...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n $this->cwsDebug->labelValue('Encryption key', $this->encryptionKey);\n $this->cwsDebug->dump('Encrypted data', strval($data));\n\n $result = null;\n $td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CFB, '');\n\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = substr($data, 0, $ivsize);\n $key = $this->validateKey($this->encryptionKey, mcrypt_enc_get_key_size($td));\n\n if ($iv) {\n $data = substr($data, $ivsize);\n mcrypt_generic_init($td, $key, $iv);\n $decryptData = mdecrypt_generic($td, $data);\n $result = $this->decode($decryptData);\n }\n\n $this->cwsDebug->dump('Data', $result);\n\n return $result;\n }", "public static function decrypt( $payload, $cipherParams ) {\n $raw = defined( 'OPENSSL_RAW_DATA' ) ? OPENSSL_RAW_DATA : true;\n\n $ivLength = openssl_cipher_iv_length( $cipherParams->getAlgorithmString() );\n $iv = substr( $payload, 0, $ivLength );\n $ciphertext = substr( $payload, $ivLength );\n return openssl_decrypt( $ciphertext, $cipherParams->getAlgorithmString(), $cipherParams->key, $raw, $iv );\n }", "public function decrypt($string)\n\t{\n\t\tglobal $mybb;\n\n\t\t$key = $mybb->config['pluginuploader_ftp_key'];\n\n\t\treturn rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), \"\\0\");\n\t}", "public function decrypt($encrypted): string\n {\n return $this->zero_unpad(openssl_decrypt(hex2bin($encrypted), $this->method, $this->key, $this->options));\n }", "public function decrypt($str, $key, $method = '') {\n if(trim($str)=='') {\n $return['decrypted'] = $str;\n return $return;\n }\n if(!is_string($str)) {\n // If input is array, check if its from the encrypt script if that works set new $str else trigger error\n if((is_array($str)) && (isset($str['encrypted']))) {\n $str = $str['encrypted'];\n } else {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid: \"'.$str.'\"';\n trigger_error($str, E_USER_NOTICE); \n return $return;\n }\n }\n $str = trim(stripslashes($str));\n if($str==\"\") {\n $return['decrypted'] = $str;\n return $return;\n }\n \n // If compress is active and if string start with the delimiter - decompress input\n if(($this->compress==true) && (($this->startsWith($str, $this->delimiter_gz)) && ($this->endsWith($str, $this->delimiter_gz)))) {\n $str = gzdecode(trim(utf8_decode($str),$this->delimiter_gz));\n }\n \n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n $rawencrypted = $str;\n \n // Clean input\n $str = str_replace(array($this->delimiter_character,$this->delimiter_breaks),array(' ',PHP_EOL),$str);\n \n // If string don't start and ends with the delimiters trigger error. If it does - clean string. Else trigger error.\n if((!$this->startsWith($str, $this->delimiter_characters)) || (!$this->endsWith($str, $this->delimiter_characters))) {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n } else if(($this->startsWith($str, $this->delimiter_characters)) && ($this->endsWith($str, $this->delimiter_characters))) {\n $str = trim(substr(substr($str,strlen($this->delimiter_characters)), 0, (0-strlen($this->delimiter_characters))));\n } else {\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n }\n\n // Generate retur string\n $return = array('decrypted' => '', 'encrypted' => trim($str), 'rawencrypted' => $rawencrypted, 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array());\n \n // String can't be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key can't be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Explode input\n $decrypts = explode(PHP_EOL, $return['encrypted']);\n \n // Create an IV and find the encrypted IV in input\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $ivlen = strlen(bin2hex($iv)); \n $iv = hex2bin($this->binaryToText(end($decrypts)));\n $return['iv'] = bin2hex($iv); \n \n // Remove IV from input\n array_pop($decrypts);\n\n // Find algorithm in input\n $algorithm = explode('_',$this->binaryToText(current($decrypts)));\n array_pop($algorithm);\n $algorithm = implode('_',$algorithm);\n unset($decrypts[0]);\n \n // Go through the decrypted data and decrypt each line.\n $return['base64_encode'] = $decrypts;\n foreach($return['base64_encode'] as $decrypting) {\n $return['decrypted'] .= $str = openssl_decrypt(base64_decode($this->binaryToText($decrypting)), $method, $key, OPENSSL_RAW_DATA, $iv);\n }\n $return['decrypted'] = stripslashes($return['decrypted']);\n \n return $return;\n }", "final public static function decrypt(string $encryptedText, string $key = null, string $method = null): string\n {\n if ($method === null) {\n $method = static::getMethod();\n\n if (!in_array($method, openssl_get_cipher_methods())) {\n throw new CryptException(\"OpenSSL method={$method} defined in application config is not available\");\n }\n } else {\n if (!in_array($method, openssl_get_cipher_methods())) {\n throw new CryptException(\"Passed OpenSSL method={$method} is not available\");\n }\n }\n\n $text = explode(':', $encryptedText);\n\n if (count($text) == 1) {\n throw new CryptException('Invalid encrypted text provided');\n }\n\n $key = Util::str2hex($key ?? Application::getKey());\n $iv = hex2bin($text[1]);\n\n $decrypted = @openssl_decrypt($text[0], $method, $key, 0, $iv);\n\n if ($decrypted === false || !ctype_print($decrypted)) {\n throw new MalformedException('Decrypted string contains non-printable characters, which are probably caused by corrupted encrypted text');\n }\n\n return $decrypted;\n }", "public function decrypt(string $data, string $key, string $iv)\n {\n $decodedKey = $this->encoder->decode($key);\n $decodedData = $this->encoder->decode($data);\n $decodedIv = $this->encoder->decode($iv);\n $decryptedData = openssl_decrypt($decodedData, $this->cipherMethodString(), $decodedKey, 0, $decodedIv);\n if ($decryptedData === false) {\n throw new CipherException();\n }\n return $decryptedData;\n }", "function symDecrypt($cryptText, $key) {\n $cryptText = $this->hex2bin($cryptText);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $plainText = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $cryptText, MCRYPT_MODE_ECB, $iv);\n \n return $plainText;\n }", "public static function decrypt(string $encyptedInput):string\n\t{\n list($encrypted_data, $iv) = explode('::', base64_decode($encyptedInput), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', self::$securekey, 0, $iv);\n }", "public static function decrypt($string) {\n $secret_key = Config::get('constants.DEFAULT_DATA.ENC_SECRET');\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n return openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }", "function util_decrypt_data($crypted_id, $key, $iv)\n{\n\t// Currently, the production machine does not have support for mcrypt. Hence we do not\n\t// have the ability to encrypt/decrypt information. Only the cookie information is being requested\n\t// to be encrypted right now. It is decided that, for now it is not a security violation to skip\n\t// encryption of cookie data.\n\treturn $crypted_id ;\n\t\n\t/*\n\t$iv = base64_decode($iv);\n\t$crypted_id = base64_decode($crypted_id);\n\t$decrypt_data = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypted_id, MCRYPT_MODE_ECB, $iv);\n\treturn str_replace(\"\\x0\", '', $decrypt_data);\t\n\t*/\n}", "function decrypt( $crypttext )\n\t{\n\t\t$priv_key = $this->RsaPrivateKey;\n\t\t$tt = explode( \":::\", $crypttext );\n\t\t$cnt = count( $tt );\n\t\t$i = 0;\n\t\t$str = '';\n\t\twhile( $i < $cnt )\n\t\t{\n\t\t\topenssl_private_decrypt( $tt[$i], $str1, $priv_key );\n\t\t\t$str .= $str1;\n\t\t\t$i++;\n\t\t}\n\t\treturn $str;\n\t}", "public function decrypt($data)\n {\n if(!is_string($data) || empty($data)) return false;\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Decode base64 coded $data\n $mix = base64_decode($data);\n\n // Get length of IV from crypt first method\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n\n // Get IV from decoded $data\n $iv = substr($mix, 0, $iv_length);\n // Get second encrypted $data from $mix\n $second_encrypted = substr($mix, $iv_length, 64);\n // Get first encrypted $data from $mix\n $first_encrypted = substr($mix, $iv_length + 64);\n\n // Decrypt first encrypted $data with first encryption method\n $data = openssl_decrypt($first_encrypted, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n $second_encrypted_new = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Check if new second encrypted data is equals to previous second encrypted data,\n // then return decrypted data\n if (hash_equals($second_encrypted, $second_encrypted_new)) {\n $this->has_error = false;\n return $data;\n }\n\n // Otherwise it has modefied\n $this->has_error = true;\n return false;\n }", "function decrypt( $input,$securekey ) {\n\n \t\t// remove the first char which is @ to flag this is AES encrypted\n \t$input = substr($input,1);\n\n \t// HEX decoding\n \t$input = pack('H*', $input);\n\n \treturn mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $securekey, $input, MCRYPT_MODE_CBC, $securekey);\n }", "public function testDecrypt_WrongSecret()\n\t{\n\t\t$encrypted = mcrypt_encrypt('blowfish', 'another_secret', \"a test string\", MCRYPT_MODE_ECB);\n\t\t$this->assertNotEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "function simple_decrypt($text, $salt = \"VUHuiU6b8jgieEG0p79Yx9T4G8Zqp880\") {\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n}", "static public function decrypt($ciphertextFileName, Config $config = null) {\n // Instantiate the client, authenticate, and add scopes.\n $kms = self::getService();\n $name = self::getDefaultKeyName($config);\n // Use the KMS API to decrypt the text.\n $ciphertext = base64_encode(file_get_contents($ciphertextFileName));\n $request = new \\Google_Service_CloudKMS_DecryptRequest();\n $request->setCiphertext($ciphertext);\n $response = $kms->projects_locations_keyRings_cryptoKeys->decrypt(\n $name,\n $request\n );\n return base64_decode($response['plaintext']);\n }", "public static function do_mdecrypt($input, $key)\r\n {\r\n $iv_arr = array(0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef);\r\n\t\t$iv = self::toStr($iv_arr);\r\n $input = trim(chop(base64_decode($input)));\r\n $td = mcrypt_module_open('des', '', 'cbc', '');\r\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\r\n mcrypt_generic_init($td, $key, $iv);\r\n $decrypted_data = mdecrypt_generic($td, $input);\r\n mcrypt_generic_deinit($td);\r\n mcrypt_module_close($td);\r\n return trim(chop($decrypted_data));\r\n }", "function decryptData($data, $key) {\r\n $chiper = \"des-ede3\"; //Algorthim used to decrypt\r\n $data = $this->hex2ByteArray($data);\r\n $data = $this->byteArray2String($data);\r\n $data = base64_encode($data);\r\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($chiper));\r\n $decrypted = openssl_decrypt($data, $chiper, $key, OPENSSL_ZERO_PADDING,$iv);\r\n return $decrypted;\r\n}", "function decryptPassword($password)\n\t{\n\t\t$key = pack('H*', \"bcb04b7e103a05afe34763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3\");\n\n\t $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\t $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n\t $ciphertext_dec = base64_decode($password);\n\t $iv_dec = substr($ciphertext_dec, 0, $iv_size);\n\t $ciphertext_dec = substr($ciphertext_dec, $iv_size);\n\n\t $password = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);\n\n\t \t$count = 0;\n\t \t$length = strlen($password);\n\n\t for ($i = $length - 1; $i >= 0; $i --)\n\t {\n\t \tif (ord($password{$i}) === 0)\n\t \t{\n\t \t\t$count ++;\n\t \t}\n\t }\n\n\t $password = substr($password, 0, $length - $count);\n\n\t return $password;\n\t}", "public static function decrypt(\n string $subject,\n string $salt = null,\n string $nonce = null,\n string $key = null\n ): string {\n return substr(\n sodium_crypto_secretbox_open(\n base64_decode($subject),\n $nonce ?: base64_decode(getenv('APP_CRYPT_NONCE')),\n $key ?: base64_decode(getenv('APP_CRYPT_KEY'))\n ),\n strlen($salt ?: base64_decode(getenv('APP_CRYPT_SALT')))\n );\n }", "public static function decrypt($encrypted_string_b64) {\n return Encryption::decryptWKey($encrypted_string_b64, Encryption::_Key1());\n }", "function decode($encryptedText, $key)\n\t{\n\t\t$newString = \"\";\n\t\tfor($i = 0; $i < strlen($encryptedText); $i++)\n\t\t{\n\t\t\t$newString .= shift( $encryptedText{$i}, (-$key) );\n\t\t}\n\t\treturn $newString;\n\t}", "protected function decrypt($data) {\n if ($this->hash_passwords) {\n return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($this->secret), base64_decode($data), MCRYPT_MODE_CBC, md5(md5($this->secret))), \"\\0\");\n } else {\n return $data;\n }\n }", "public function decrypt($data, $deterministic);", "function DecodeMcrypt( $string )\n\t{\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$result = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, $string, MCRYPT_MODE_ECB, $iv);\n\t\t$result = rtrim($result, \"\\0\");\n\t\treturn $result;\n\t}", "private function decrypt($data, $key) {\n\t\treturn Authenticator_Crypto::decrypt($data, $key);\n\t}", "public function decrypt(string $data) : string|bool\n {\n $json = Jso::hay(base64_decode($data))->decode(true);\n\n if (! Jso::valid() || !$this->validate((array)$json)) {\n throw new DecrypterException('Could not validate the decrypted data pack');\n }\n\n $iv = base64_decode($json['iv']);\n $encrypted = base64_decode($json['data']);\n $decrypted = sodium_crypto_secretbox_open($encrypted, $iv, $this->appKey);\n\n if (! $decrypted) {\n throw new DecrypterException('Could not decrypt the requested data');\n }\n\n sodium_memzero($encrypted);\n return $decrypted;\n }", "private static function decryptInternal($ciphertext, KeyOrPassword $secret, $raw_binary)\n {\n RuntimeTests::runtimeTest();\n\n if (! $raw_binary) {\n try {\n $ciphertext = Encoding::hexToBin($ciphertext);\n } catch (Ex\\BadFormatException $ex) {\n throw new Ex\\WrongKeyOrModifiedCiphertextException(\n 'Ciphertext has invalid hex encoding.'\n );\n }\n }\n\n if (Core::ourStrlen($ciphertext) < Core::MINIMUM_CIPHERTEXT_SIZE) {\n throw new Ex\\WrongKeyOrModifiedCiphertextException(\n 'Ciphertext is too short.'\n );\n }\n\n // Get and check the version header.\n /** @var string $header */\n $header = Core::ourSubstr($ciphertext, 0, Core::HEADER_VERSION_SIZE);\n if ($header !== Core::CURRENT_VERSION) {\n throw new Ex\\WrongKeyOrModifiedCiphertextException(\n 'Bad version header.'\n );\n }\n\n // Get the salt.\n /** @var string $salt */\n $salt = Core::ourSubstr(\n $ciphertext,\n Core::HEADER_VERSION_SIZE,\n Core::SALT_BYTE_SIZE\n );\n Core::ensureTrue(\\is_string($salt));\n\n // Get the IV.\n /** @var string $iv */\n $iv = Core::ourSubstr(\n $ciphertext,\n Core::HEADER_VERSION_SIZE + Core::SALT_BYTE_SIZE,\n Core::BLOCK_BYTE_SIZE\n );\n Core::ensureTrue(\\is_string($iv));\n\n // Get the HMAC.\n /** @var string $hmac */\n $hmac = Core::ourSubstr(\n $ciphertext,\n Core::ourStrlen($ciphertext) - Core::MAC_BYTE_SIZE,\n Core::MAC_BYTE_SIZE\n );\n Core::ensureTrue(\\is_string($hmac));\n\n // Get the actual encrypted ciphertext.\n /** @var string $encrypted */\n $encrypted = Core::ourSubstr(\n $ciphertext,\n Core::HEADER_VERSION_SIZE + Core::SALT_BYTE_SIZE +\n Core::BLOCK_BYTE_SIZE,\n Core::ourStrlen($ciphertext) - Core::MAC_BYTE_SIZE - Core::SALT_BYTE_SIZE -\n Core::BLOCK_BYTE_SIZE - Core::HEADER_VERSION_SIZE\n );\n Core::ensureTrue(\\is_string($encrypted));\n\n // Derive the separate encryption and authentication keys from the key\n // or password, whichever it is.\n $keys = $secret->deriveKeys($salt);\n\n if (self::verifyHMAC($hmac, $header . $salt . $iv . $encrypted, $keys->getAuthenticationKey())) {\n $plaintext = self::plainDecrypt($encrypted, $keys->getEncryptionKey(), $iv, Core::CIPHER_METHOD);\n return $plaintext;\n } else {\n throw new Ex\\WrongKeyOrModifiedCiphertextException(\n 'Integrity check failed.'\n );\n }\n }", "public function decrypt($data, $deterministic)\n {\n // Return data if not annotated as encrypted\n if (strncmp($this->prefix, $data, strlen($this->prefix)) !== 0) {\n return $data;\n }\n\n // Strip annotation and decode data encoded with MIME base64\n $base64_decoded = base64_decode(substr($data, strlen($this->prefix)));\n\n // Split Initialization Vector\n $iv = substr($base64_decoded, 0, $this->iv_size);\n $iv_removed = substr($base64_decoded, $this->iv_size);\n\n // return decrypted, de-salted, and trimed value\n $saltedDecrypted = openssl_decrypt(\n $iv_removed,\n self::CIPHER,\n $this->secretKey,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING,\n $iv\n );\n\n $result = rtrim(\n $this->removeSalt($saltedDecrypted),\n \"\\0\"\n );\n\n return $result;\n }", "public static function decrypt($v_text){\n\n\t\treturn mcrypt_decrypt(MCRYPT_BLOWFISH,Config::getVariable('blowfish_key'),$v_text,MCRYPT_MODE_CFB, CryptoUtil::$iv);\n\t\t\n\t}", "function caesarDecode($encryptedText, $key)\n\t{\n\t\treturn decode($encryptedText, $key);\n\t}", "public function decrypt3DES($text, $key) {\n $key = base64_decode($key);\n $str = $this->hex2bin($text);\n $size = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($size, MCRYPT_RAND);\n $decrypted = mcrypt_decrypt(MCRYPT_3DES, $key, $str, MCRYPT_MODE_ECB, $iv);\n $info = rtrim($this->pkcs5_unpad($decrypted));\n\t\t//log_message('error', 'data decrypt: ' . print_r($info, true));\n return $info;\n }", "function decryptBlock($privateKey, $msg){\n\treturn bcmod(bcpow($msg, $privateKey->other), $privateKey->N);\n}", "private function decrypt($data, $secret)\n {\n $key = md5(utf8_encode($secret), true);\n\n //Take first 8 bytes of $key and append them to the end of $key.\n $key .= substr($key, 0, 8);\n\n $data = base64_decode($data);\n\n $data = openssl_decrypt($data, 'des-ecb', $key);\n\n $len = strlen($data);\n $pad = ord($data[$len-1]);\n\n return substr($data, 0, strlen($data) - $pad);\n }", "function aes_128_decrypt($key, $data) {\n $base64_original = str_replace(array('-', '_'), array('+', '/'), $data);\n\n // Get binary data\n $decoded = base64_decode($base64_original);\n\n // Initialization vector is the first 16 bytes of the received data\n $iv = substr($decoded, 0, 16);\n\n // The payload itself is is the rest of the received data\n $payload = substr($decoded, 16);\n\n // Decrypt raw binary payload\n $json = openssl_decrypt($payload, \"aes-128-cbc\", $key, OPENSSL_RAW_DATA, $iv);\n //$json = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $payload, MCRYPT_MODE_CBC, $iv); // You can use this instead of openssl_decrupt, if mcrypt is enabled in your system\n\n return $json;\n }" ]
[ "0.79142594", "0.7124871", "0.6857203", "0.6782716", "0.67569494", "0.65169835", "0.649053", "0.6482878", "0.64794", "0.6374997", "0.63651884", "0.6365097", "0.6315007", "0.6235899", "0.62346184", "0.621279", "0.61925685", "0.61866647", "0.6185431", "0.6167007", "0.6165751", "0.61315554", "0.61302084", "0.6123703", "0.61083746", "0.6101878", "0.6086223", "0.6077929", "0.60477704", "0.6043366", "0.60413367", "0.6028963", "0.6006199", "0.5997876", "0.59921795", "0.59886205", "0.5985719", "0.5985719", "0.5982954", "0.5982257", "0.59797984", "0.59538525", "0.59500337", "0.5941618", "0.59375775", "0.5926005", "0.58835095", "0.5864886", "0.5838392", "0.58333635", "0.58313215", "0.5824096", "0.5816771", "0.5809733", "0.57948864", "0.57933104", "0.5785361", "0.5780629", "0.57798654", "0.5776661", "0.5773325", "0.5765847", "0.5739905", "0.5723679", "0.5701606", "0.569877", "0.569551", "0.5695028", "0.5679858", "0.56734467", "0.5671223", "0.5669278", "0.56654894", "0.5661723", "0.56614524", "0.5629301", "0.56241876", "0.56210065", "0.56175965", "0.56123924", "0.5597104", "0.5585727", "0.558431", "0.55617267", "0.5559568", "0.5553642", "0.55512446", "0.55229586", "0.55099934", "0.54871804", "0.54827607", "0.54740846", "0.54675525", "0.5463918", "0.5460164", "0.5448104", "0.54431474", "0.5436808", "0.5436717", "0.54360694" ]
0.7830097
1
Setup mcrypt Validates all the variables.
function _mcryptSetup() { if (!$this->changed) { return; } if (!$this->explicit_key_length) { // this just copied from Crypt_Rijndael::_setup() $length = strlen($this->key) >> 2; if ($length > 8) { $length = 8; } else if ($length < 4) { $length = 4; } $this->Nk = $length; $this->key_size = $length << 2; } switch ($this->Nk) { case 4: // 128 $this->key_size = 16; break; case 5: // 160 case 6: // 192 $this->key_size = 24; break; case 7: // 224 case 8: // 256 $this->key_size = 32; } $this->key = str_pad(substr($this->key, 0, $this->key_size), $this->key_size, chr(0)); $this->encryptIV = $this->decryptIV = $this->iv = str_pad(substr($this->iv, 0, 16), 16, chr(0)); if (!isset($this->enmcrypt)) { $mode = $this->mode; //$mode = $this->mode == CRYPT_AES_MODE_CTR ? MCRYPT_MODE_ECB : $this->mode; $this->demcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, ''); $this->enmcrypt = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', $mode, ''); if ($mode == 'ncfb') { $this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, ''); } } // else should mcrypt_generic_deinit be called? mcrypt_generic_init($this->demcrypt, $this->key, $this->iv); mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv); if ($this->mode == 'ncfb') { mcrypt_generic_init($this->ecb, $this->key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); } $this->changed = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _setupMcrypt() {\n\t\tif ( ! isset( $this->key ) ) {\n\t\t\t$this->setKey( '' );\n\t\t}\n\n\t\tparent::_setupMcrypt();\n\t}", "protected function setUp(){\n $this->hashedPass = hash('sha512', Cons::USER_PASS );\n }", "public final function setUp(): void {\n\t\tparent::setUp();\n\t\t//\n\t\t$password = \"abc123\";\n\n\t\t$this->VALID_HASH = password_hash($password, PASSWORD_ARGON2I, [\"time_cost\" => 384]);\n\t\t$this->VALID_ACTIVATION = bin2hex(random_bytes(16));\n\t}", "protected function prepareForValidation()\n {\n $this->merge([\n 'current_password' => trim($this->current_password),\n 'password' => trim($this->password),\n ]);\n }", "protected function setUp()\n\t{\n\t\tif (!extension_loaded('mcrypt')) $this->markTestSkipped(\"mcrypt extension is not available\");\n\t\t\n\t\tparent::setUp();\n\t\t$this->Crypt_MCrypt = new Q\\Crypt_MCrypt(array('method'=>'blowfish', 'secret'=>'s3cret'));\n\t}", "protected function setUp()\n {\n $this->object = new Crypt;\n }", "protected function setUp() {\n\t\tparent::setUp ();\n\t\t$this->Password = new Password(12, '1234567890qwrypasdfghnz');\n\t}", "public function setUp()\n {\n $this->config = array(\n 's1' => 'string',\n 's2' => 'str',\n 'i1' => 'integer',\n 'i2' => 'int',\n 'i3' => '+integer',\n 'i4' => '+int',\n 'i5' => '-integer',\n 'i6' => '-int',\n 'f1' => 'float',\n 'f2' => '+float',\n 'f3' => '-float',\n 'b' => 'boolean',\n 'a' => 'array',\n 'm' => array(true, 'false'),\n 'r' => '/^member/',\n );\n $this->helper = new ConfigValidator($this->config);\n }", "public final function setUp() : void {\n\t\tparent::setUp();\n\n\t\t// creating hashed password and random token\n\t\t$password = \"1234abcd\";\n\t\t$this->VALID_PROFILE_HASH = password_hash($password, PASSWORD_ARGON2I, [\"time_cost\" => 384]);\n\t\t$this->VALID_ACTIVATION_TOKEN = bin2hex(random_bytes(16));\n\t}", "public function setUp()\n {\n $this->initTestEnvironment('htpasswd_crypt');\n }", "protected function set_up()\n {\n $this->_validator = new Zend_Validate_StringLength(4, 8);\n }", "function _setupValidation(&$Model) {\r\n\t\textract ($this->settings[$Model->alias]['fields']);\r\n\t\t$Model->validate[$password_confirm] = array('notSame' => array('rule' => 'validateConfirmMatch',\r\n\t\t\t$password));\r\n\t\t$Model->validate[$current] = array('notCurrent' => array('rule' => 'validateCurrentPassword'));\r\n\t\t$Model->validate[$password] = array(\r\n\t\t\t'missing' => array('rule' => 'validatePasswordNotEmpty', $password_confirm, 'last' => true),\r\n\t\t\t'tooShort' => array('rule' => 'validatePasswordLength', $password_confirm, 'last' => true),\r\n\t\t\t'containsUsername' => array('rule' => 'validatePasswordUsername', 'confirm', $username, 'last' => true),\r\n\t\t\t'number' => array('rule' => 'validatePasswordNumber', $password_confirm, 'last' => true),\r\n\t\t\t'case' => array('rule' => 'validatePasswordCase', $password_confirm, 'last' => true),\r\n\t\t\t'special' => array('rule' => 'validatePasswordSpecialChar', $password_confirm, 'last' => true),\r\n\t\t\t'notChanged' => array('rule' => 'validatePasswordDifferent', $password_confirm, $current, 'last' => true),\r\n\t\t);\r\n\t\t$Model->validate[$tos][] = array('rule' => array('equalTo', '1'));\r\n\t}", "protected function setupValidation()\n {\n }", "function setUp() {\n\t\t$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');\n\t\t$this->dataShort = 'hats';\n\t\t$this->dataUrl = __DIR__ . '/../lib/crypt.php';\n\t\t$this->legacyData = __DIR__ . '/legacy-text.txt';\n\t\t$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';\n\t\t$this->randomKey = Encryption\\Crypt::generateKey();\n\n\t\t$keypair = Encryption\\Crypt::createKeypair();\n\t\t$this->genPublicKey = $keypair['publicKey'];\n\t\t$this->genPrivateKey = $keypair['privateKey'];\n\n\t\t$this->view = new \\OC_FilesystemView('/');\n\n\t\t\\OC_User::setUserId(\\Test_Encryption_Keymanager::TEST_USER);\n\t\t$this->userId = \\Test_Encryption_Keymanager::TEST_USER;\n\t\t$this->pass = \\Test_Encryption_Keymanager::TEST_USER;\n\n\t\t$userHome = \\OC_User::getHome($this->userId);\n\t\t$this->dataDir = str_replace('/' . $this->userId, '', $userHome);\n\n\t\t// remember files_trashbin state\n\t\t$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');\n\n\t\t// we don't want to tests with app files_trashbin enabled\n\t\t\\OC_App::disable('files_trashbin');\n\t}", "protected function setUp()\n\t{\n\t\t$this->object = PPCredentialManager::getInstance();\n\t}", "protected function prepareValidations() {}", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "public final function setUp() : void {\nparent::setUp();\n\n$password = \"mypassword12\";\n$this->VALID_HASH = password_hash($password, PASSWORD_ARGON2I, [\"time_cost\" => 7]);\n$this->VALID_ACTIVATION = bin2hex(random_bytes(16));\n}", "protected function setupValidation()\n\t{\n\t\t$this->setInputFactory(new InputFactory(new Builder));\n\t\t$this->setValidator(new Validator\\Illuminate(App::make('validator')));\n\t}", "public function initialize()\n {\n $this->autoboxer = new Autoboxer;\n if ($_POST) {\n $this->post = new HashMap;\n foreach ($_POST as $key => $value) {\n $value = $this->secure($value);\n $this->post->put(new Mystring($key), $this->autoboxer->wrap($value));\n }\n unset($_POST);\n }\n }", "private final function CheckMcrypt()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mcrypt_module_open\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mcrypt_module_open(). Mcrypt extension not installed?\", E_ERROR);\r\n\t\t}", "public function _initPhpass()\n {\n $options = $this->getOptions();\n\n $iterations = isset($options['phpassIterations']) \n ? $options['phpassIterations']\n : 8;\n $phpass = new Phpass($iterations);\n AuthModel::setDefaultPhpass($phpass);\n }", "public final function setUp() {\n //create new zip code for testing\n //creates password salt for testing\n $this->VALID_SALT = bin2hex(random_bytes(32));\n //creates password hash for testing\n $this->VALID_HASH = hash_pbkdf2(\"sha512\", \"this is a password\", $this->VALID_SALT, 262144);\n\n $user = new User(null, \"deaton747\",\"Daniel\",\"Eaton\",\"[email protected]\",$this->VALID_HASH,$this->VALID_SALT);\n $user->insert($this->getPDO());\n $this->VALID_USER_ID = $user->getUserId();\n $this->VALID_SCHEDULE_START_TIME = new DateTime(\"2018-04-12T08:28:12.000000+0000\");\n $this->VALID_SCHEDULE_END_TIME = new DateTime(\"2018-04-12T08:28:12.000000+0000\");\n }", "public function setUp() {\n $this->command = new GeneratePrivateKey();\n\n $application = new Application();\n $application->add($this->command);\n }", "public function __construct()\n {\n $this->_mcryptExists = (!function_exists('mcrypt_encrypt')) ? false : true;\n\n if ($this->_mcryptExists === false) {\n throw new FlyException(Fly::t('fly', 'The Encrypt library requires the Mcrypt extension.'));\n }\n\n Fly::log('debug', \"Encrypt Class Initialized\");\n }", "public function setup() {\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $this->settings['site_key'] ) || empty( $this->settings['secret_key'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $this->settings['login'] ) {\n\t\t\tadd_action( 'woocommerce_login_form', array( $this, 'add_to_login_form' ) );\n\t\t}\n\n\t\tif ( $this->settings['register'] ) {\n\t\t\tadd_action( 'woocommerce_register_form', array( $this, 'add_to_register_form' ) );\n\t\t\tadd_action( 'woocommerce_after_checkout_registration_form', array( $this, 'add_to_register_form' ) );\n\t\t\tadd_filter( 'woocommerce_process_registration_errors', array( $this, 'validate_register_form' ) );\n\t\t\tadd_filter( 'woocommerce_registration_errors', array( $this, 'validate_register_form' ) );\n\t\t}\n\n\t\tif ( $this->settings['reset_pass'] ) {\n\t\t\tadd_action( 'woocommerce_lostpassword_form', [ $this, 'add_to_reset_pass_form' ] );\n\t\t}\n\t}", "protected function configureSaltedPasswords() {}", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\t\t// Сбросим валидатор, чтобы не было влияния одних тестов на другие\n\t\tValidator::reset();\n\t}", "protected function afterValidate()\n {\n \tparent::afterValidate();\n \tif(!$this->hasErrors())\n \t\t$this->password = $this->hashPassword($this->password);\n }", "public function initialize()\n {\n $this->config = new \\Configs\\Core\\PasswordResetKeys();\n\n\n }", "function init()\n {\n return $this->_crypt->init();\n }", "protected function checkInstallToolPasswordNotSet() {}", "protected function setup() {\n $this->state[\"user\"] = $this->env->get_test_user();\n $this->env->log_user_in($this->state[\"user\"]->username);\n $this->state[\"fields\"] = array(\n \"token\" => str_repeat(\"0\", 64),\n \"uuid\" => str_repeat(\"0\", 36)\n );\n }", "protected function setUp() {\n # Set up the encryption parameters\n Arc4::setKey(\"0123456789abcdeffedcba9876543210\");\n Arc4::setMagic(\"MAGIC\");\n Arc4::useCompression(\"true\");\n }", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "public function validateEnvironment(Varien_Event_Observer $observer) {\n $groups = $observer->getObject()->getGroups();\n\n $enabled = false;\n\n if(isset($groups['password'])\n && isset($groups['password']['fields'])\n && isset($groups['password']['fields']['native_passwords_enabled'])\n && isset($groups['password']['fields']['native_passwords_enabled']['value'])) {\n $enabled = (bool)$groups['password']['fields']['native_passwords_enabled']['value'];\n }\n\n if(!$enabled) {\n return; //nothing to do here\n }\n\n /* @var $helper EW_NativePasswords_Helper_Data */\n $helper = Mage::helper('ew_nativepasswords');\n\n $oldCost = $helper->getConfiguredCost();\n $cost = intval($groups['password']['fields']['native_passwords_cost']['value']);\n\n $this->_validateEnvironment();\n\n if($oldCost != $cost) {\n $this->_validateCost($cost);\n }\n }", "public function setupValidatorRules()\n { }", "public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }", "protected function prepare(): void\n {\n config(['dluwang-auth.entities.permission' => \\Dluwang\\Auth\\Tests\\Permission::class]);\n $gate = $this->app->make(Gate::class);\n\n $gate->define('permission-test', function($user){\n return true;\n });\n\n $gate->policy(\\Dluwang\\Auth\\Tests\\User::class, UserPolicy::class);\n $this->artisan('dluwang-auth:install');\n $this->artisan('migrate');\n }", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "public function testValidationRules() {\n\t\t// fake the submision\n\t\t$this->data['User']['password'] = 'cd4f70413dececd8b813e1d5c56c6421e1a35018';\n\t\t$this->data['User']['email'] = '[email protected]';\n\t\t$this->Model->set($this->data['User']);\n\n\t\t// pw regex simple\n\t\tConfigure::write('Website.password_regex', '[a-z]');\n\t\t$field['confirm_password'] = 'simplepw';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertTrue($result);\n\n\t\t$field['confirm_password'] = '�^%&^%*^&�$%�';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertFalse($result);\n\n\t\t// pw regex advanced\n\t\tConfigure::write('Website.password_regex', '^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s).{4,8}$');\n\t\t$field['confirm_password'] = 'aBcD123';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertTrue($result);\n\n\t\t$field['confirm_password'] = 'something';\n\t\t$result = $this->Model->validatePassword($field);\n\t\t$this->assertFalse($result);\n\t}", "public function setUp() {\n\t\tparent::setUp();\n\t\t$this->EmailConfirmationKey = ClassRegistry::init('EmailConfirmationKey');\n\t}", "private function init() {\n // Set environment variables MUST BE DONE IN THIS ORDER!\n self::initDefaultFormValues(); // Assign default values to forms\n self::initTablePriorityHash();\n self::initTableTypePriorityHash();\n self::initTableHash(); // assign tables.\n self::initTableColumnsHash(); // assign hash with column details.\n #self::initSurveyHash(); // Assign Surveys TODO Place this back in when surveys are merged.\n self::initAstroFilterHash(); // Assign Filters\n self::initQualityFlags(); // assign hash with column details for all quality flag tables.\n }", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "public function __sanitise() { $this->username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $hashed_password = password_hash($password, PASSWORD_BCRYPT);\n $this->email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_SPECIAL_CHARS);\n $this->usertype = filter_input(INPUT_POST, 'lib_code', FILTER_SANITIZE_SPECIAL_CHARS);\n }", "protected function prepareForValidation(): void\n {\n $this->merge([\n 'commonName' => $this->input('commonName') . $this->input('domainName')\n ]);\n }", "function __construct() {\n\t\tif ( !parent::getOption('profile-public-enable') )\n\t\t\tprotect('*');\n\n\t\t/* If the admin requires users to update their password. */\n\t\tif(!empty($_SESSION['pickme']['forcePwUpdate']))\n\t\t\t$msg = \"<div class='alert alert-warning'>\" . _('<strong>Alert</strong>: The administrator has requested all users to update their passwords.') . \"</div>\";\n\n\t\t// Save the username\n\t\t$this->username = !empty($_SESSION['pickme']['username']) ? $_SESSION['pickme']['username'] : _('Guest');\n\n\t\t/* Check if the user is a guest to this profile. */\n\t\t$this->determineGuest();\n\n\t\tif (!$this->guest && !empty($_POST)) :\n\t\t\t$this->retrieveFields();\n//echo '<pre>';print_r($_POST);echo '</pre>';\n\t\t\tforeach ($_POST as $field => $value)\n\t\t\t\t$this->settings[$field] = parent::secure($value);\n \n\t\t\t// Validate fields\n\t\t\t$this->validate();\n\n\t\t\t// Process form\n\t\t\tif(empty($this->error)) $this->process();\n\n\t\tendif;\n\n\t\t$this->retrieveFields();\n\n\t\tif(!$this->guest && isset($_GET['key']) && strlen($_GET['key']) == 32) {\n\t\t\t$this->key = parent::secure($_GET['key']);\n\t\t\t$this->updateEmailorPw();\n\t\t\t$this->retrieveFields();\n\t\t}\n\n\t\tif ( !empty ( $this->error ) || !empty ( $msg ) )\n\t\t\tparent::displayMessage( !empty($this->error) ? $this->error : (!empty($msg) ? $msg : ''), false);\n\n\t}", "public function __construct($options = array())\n\t{\n\t\tif (isset($options['minPassSize']))\n\t\t\t$this->minPassSize = $options['minPassSize'];\n\t\telse\n\t\t\t$this->minPassSize = 8;\n\t\t\t\n\t\t/* set maximum password size */\n\t\tif (isset($options['maxPassSize']))\n\t\t\t$this->maxPassSize = $options['maxPassSize'];\n\t\telse\n\t\t\t$this->maxPassSize = 15;\n\t\t\n\t\t/* set minimum char set required in password */\n\t\tif (isset($options['minCharSet']))\n\t\t\t$this->minCharSet = $options['minCharSet'];\n\t\telse\n\t\t\t$this->minCharSet = 2;\n\t\t\t\n\t\t/* set allowed symbols */\n\t\t$this->allowedSymbols = array ('!','@','#','$','%','_','&',',');\n\t\tif (isset($options['allowedSymbols']))\n\t\t{\n\t\t\tif (is_array($options['allowedSymbols']))\n\t\t\t\t$this->allowedSymbols = $options['allowedSymbols'];\n\t\t}\n\t\t\n\t\t/* set minPassSize = maxPassSize if min is > max */\n\t\tif ($this->minPassSize > $this->maxPassSize)\n\t\t\t$this->minPassSize = $this->maxPassSize;\n\t}", "public function validate_config_on_save($host) {\n\t\t\tif($host->free_shipping_enabled && !strlen($host->free_shipping_min_amount))\n\t\t\t\t$host->validation->setError('Please specify minimum order amount for free shipping or disable the free shipping option', 'free_shipping_min_amount', true);\n\t\t\t\t\n\t\t\t$hash_value = trim($host->api_key_password); \n\t\t\t\n\t\t\tif(!strlen($hash_value)) { \n\t\t\t\tif(!isset($host->fetched_data['api_key_password']) || !strlen($host->fetched_data['api_key_password'])) \n\t\t\t\t\t$host->validation->setError('Please enter your API key password', 'api_key_password', true); \n\n\t\t\t\t$host->api_key_password = $host->fetched_data['api_key_password']; \n\t\t\t}\n\t\t}", "protected function setup() : void\n {\n $this->subject = new Product(\n 'ACCESS_KEY',\n 'SECRET_KEY',\n 1\n );\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->validations = [\n 'name' => 'required|min:3',\n 'admin' => 'required|min:3',\n 'admin_email' => 'required|email',\n 'health_email' => 'required|email',\n 'timezone' => 'required|min:3',\n 'timezone_update' => 'required|boolean',\n 'php_post_max_size' => 'required',\n 'php_upload_max_filesize' => 'required',\n 'php_memory_limit' => 'required',\n 'pma_version' => 'required',\n 'pma_update_version' => 'required|boolean',\n 'smtp_relay_host' => 'required',\n 'smtp_relay_domain' => 'required',\n 'smtp_relay_user' => 'required|email',\n 'smtp_relay_password' => 'required'\n ];\n }", "public static function initialise() {\n\t\tif(file_exists(DCRDCERT)) $dcrdcert = DCRDCERT; else $dcrdcert = \".\" . DCRDCERT;\n\t\tif(file_exists(WALLETCERT)) $walletcert = WALLETCERT; else $walletcert = \".\" . WALLETCERT;\n\t\t\n\t\tself::$dcrd_certificate = \" --rpccert='\" . $dcrdcert . \"' \";\n\t\tself::$wallet_certificate = \" --rpccert='\" . $walletcert . \"' \";\n\t\tself::$base_cmd = DCRCTLLOCATION . \" -u '\" . USERNAME . \"' -P '\" . PASSWORD . \"'\";\n\t\tself::$end_cmd = \" 2>&1\";\n }", "public function setUp(): void\n {\n $this->mobileNumberValidator = new RecipientValidator();\n }", "protected function setUp()\n {\n// $this->validOptions = array(\n// 'checksum' => true,\n// 'delete'\n// );\n }", "public function _init_store_variables(){\n //Check if Store Id is defined in module configuration\n if(Mage::getStoreConfig(Minematic_Connector_Model_Config::CONFIG_PATH_STORE_VIEW)){\n $this->store_id = Mage::getStoreConfig(Minematic_Connector_Model_Config::CONFIG_PATH_STORE_VIEW);\n } else {\n //Get Default Store ID for current Website.\n $this->store_id = Mage::app()\n ->getWebsite()\n ->getDefaultGroup()\n ->getDefaultStoreId();\n }\n\n //Get Website ID\n $this->website_id = Mage::getModel('core/store')->load($this->store_id)->getWebsiteId();\n\n //Validate variables\n if(empty($this->store_id) || empty($this->website_id)){\n throw new Exception(\"Store ID or Webstite variables are not initializated.\");\n }\n }", "private function validateConfig()\n {\n // Throw error when username is missing from the config files.\n if (! config('mailcamp.username')) {\n throw new MailcampException('Mailcamp API error: No username is specified for connecting with Mailcamp.');\n }\n\n // Throw error when token is missing from the config files.\n if (! config('mailcamp.token')) {\n throw new MailcampException('Mailcamp API error: No token is specified for connecting with Mailcamp.');\n }\n\n // Throw error when endpoint is missing from the config files.\n if (! config('mailcamp.endpoint')) {\n throw new MailcampException('Mailcamp API error: No endpoint is specified for connecting with Mailcamp.');\n }\n\n // Set connection details.\n $this->config = new \\stdClass();\n $this->config->username = config('mailcamp.username');\n $this->config->token = config('mailcamp.token');\n $this->config->endpoint = config('mailcamp.endpoint');\n }", "public function __construct()\n\t{\n\t\t$this->form_rules = array(\n\t\t\t'email' => 'required|email',\n\t\t\t'password' => 'required',\n\t\t);\n\t}", "protected function setUp()\n {\n $this->_captcha = Text_CAPTCHA::factory(\"Equation\");\n }", "private function __get_all_form_validate_params()\n {\n $this->__all_form_validation_params =\n require_once(FORM_REQUEST_VALIDATE_PARAMS_CONFIG_FILE)\n ;\n }", "public function setPassword(){\n\t}", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "function __construct(){\n\t\t$this->mSMS_pwd\t\t= SMS_PWD;\n\t\t$this->mSMS_usr\t\t= SMS_USR;\n\t}", "private function encryption_parameters(): void\n {\n if ($this->use_encryption()) {\n if (!defined('ENCRYPTION_KEY_VALUE')) {\n define('ENCRYPTION_KEY_VALUE', 'NVWG9bMgetehyASFB4FZIJlOJomwiQKk'); // Default value\n define('ENCRYPTION_KEY_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption key is the default value.\n }\n if (!defined('ENCRYPTION_IV_VALUE')) {\n define('ENCRYPTION_IV_VALUE', 'KddhSnjJQHLLOOEcB1g9AihLTCK0eyFv'); // Default value\n define('ENCRYPTION_IV_VALUE_DEFAULT', TRUE); // Flag the fact that the encryption IV is the default value.\n }\n\n if (!defined('ENCRYPTION_KEY')) {\n define('ENCRYPTION_KEY', hash('sha256', ENCRYPTION_KEY_VALUE));\n }\n if (!defined('ENCRYPTION_IV')) {\n define('ENCRYPTION_IV', substr(hash('sha256', ENCRYPTION_IV_VALUE), 0, 16));\n }\n }\n }", "private static function secureEnvConfig() {\n //check session config\n //check db, plugin, encryption\n //make sure default apps are all registered\n $titleCheck = (!isset(DSettings::$globalName[2]) || isset(DSettings::$globalName[29]));\n $routerCheck = empty(DSettings::$router['apps']) || empty(DSettings::$router['apps']);\n if ($titleCheck)\n trigger_error(DMainLang::$errorConsts['websiteTitleError']);\n elseif ($routerCheck)\n trigger_error(DMainLang::$errorConsts['routerInitError']);\n }", "public function __construct() {\n\n $this->inputmanager = new Validator();\n\n $this->config = $this->configuration();\n\n $this->validation = $this->validate(); \n\n }", "public function setUpResetPasswordValidationRules() {\n\t\treturn array(\n\t\t\t'new_password' => $this->validate['password'],\n\t\t\t'confirm_password' => array(\n\t\t\t\t'required' => array(\n\t\t\t\t\t'rule' => array('compareFields', 'new_password', 'confirm_password'),\n\t\t\t\t\t'message' => __d('users', 'The passwords are not equal.'))));\n\t}", "public function setup()\n {\n parent::setup();\n \n // Build some fuxture values\n $this->userName = 'fixture';\n $this->firstName = 'Test';\n $this->lastName = 'User';\n $this->email = '[email protected]';\n $this->password = '123123';\n $this->roleName = 'Fixture';\n // Generate the fixture\n $this->createAdminUserFixture(); \n }", "private function _initUser()\n {\n $this->username = Request::varchar('f_username', true);\n $this->password = Request::varchar('f_password');\n $this->name = Request::varchar('f_name', true);\n $this->email = Request::email();\n }", "private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }", "function __construct() {\r\n $this->setPasscode(filter_input(INPUT_POST, 'passcode'));\r\n }", "public function initialize() : void\n {\n // Use to initialise member variables.\n $this->db = \"active\";\n $this->validator = new Validator();\n }", "function __construct($input_helper_settings, $ascii_table){\n\n\t\t\t$this->min_pass_length = $input_helper_settings['min_pass_length'];\n\t\t\t$this->max_pass_length = $input_helper_settings['max_pass_length'];\n\t\t\t$this->min_user_name_length = $input_helper_settings['min_user_name_length'];\n\t\t\t$this->max_user_name_length = $input_helper_settings['max_user_name_length'];\n\t\t\t$this->main_user_name_char_regex = $input_helper_settings['main_user_name_char_regex'];\n\t\t\t$this->alpha_space = $input_helper_settings['alpha_space'];\n\t\t\t$this->password_salt = $input_helper_settings['password_salt'];\n\t\t\t$this->hash_algorithm = $input_helper_settings['hash_algorithm'];\n\t\t\t$this->password_addenda = $input_helper_settings['password_addenda'];\n\t\t\t$this->len_pass_error_msg = $input_helper_settings['len_pass_error_msg'];\n\t\t\t$this->len_user_name_error_msg = $input_helper_settings['len_user_name_error_msg'];\t\n\t\t\t$this->char_user_name_error_msg = $input_helper_settings['char_user_name_error_msg'];\t\t\t\t\n\t\t\t$this->alpha_space_error_msg = $input_helper_settings['alpha_space_error_msg'];\t\n\t\t\t\n\t\t\t\n\n\t\t\t$this->ascii_table = $ascii_table;\n\n\n\t\t}", "protected static function booted(): void\n {\n static::creating(static function (self $user): void {\n $user->password = $user->password ?: Hash::make(Str::random(10));\n });\n }", "public function __construct()\n {\n $this->productsValidations = [\n 'product_id' => 'required|integer',\n 'quantity' => 'required|integer',\n 'unit_price' => 'required|numeric'\n ];\n\n }", "protected function configureValidations()\n {\n }", "public function setUp()\n\t{\n\t\t$this->prepare_tables(\n\t\t\t'Model_User', \n\t\t\t'Model_Role', \n\t\t\t'Model_Roles_Users', \n\t\t\t'Model_User_Token'\n\t\t\t);\n\t}", "protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }", "protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }", "protected function setUp()\n {\n $this->_validator = new Zend_Validate_Sitemap_Lastmod();\n }", "protected function _set_rules($params)\n\t{\n\t\t$password_lenght = model('user')->_password_lenght;\n\t\t$rules = array();\n\t\t$rules['method'] = array('security_method', 'required|trim|callback__check_method');\n\t\t$rules['password_old'] = array('password_old', 'required|trim|callback__check_password_old');\n\t\t$rules['password'] = array('password', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['password_confirm'] = array('password_confirm', 'required|trim|xss_clean|matches[password]');\n\t\t$rules['pin_old'] = array('pin_old', 'required|trim|callback__check_pin_old');\n\t\t$rules['pin'] = array('pin', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['pin_confirm'] = array('pin_confirm', 'required|trim|xss_clean|matches[pin]');\n\t\t$rules[$this->_mod()->param()] = array('security_value', 'required|callback__check_user_security');\n\t\t$this->form_validation->set_rules_params($params, $rules);\n\t}", "public function initadminpassword() {\n if (isAuthorized('utilisateurs', 'initpassword')) :\n $this->Utilisateur->id = 1;\n $record = $this->Utilisateur->read();\n unset($record['Utilisateur']['password']); \n unset($record['Utilisateur']['created']);\n unset($record['Utilisateur']['modified']);\n $record['Utilisateur']['password']='@DMIN'; \n $record['Utilisateur']['created'] = $this->Utilisateur->read('created');\n $record['Utilisateur']['modified'] = date('Y-m-d'); \n if ($this->Utilisateur->save($record)) {\n $this->save_history(1,'<b style=\"color:red;\">Initialisation du mot de passe administrateur</b>');\n $this->Session->setFlash(__('Mot de passe de l\\'administrateur initialisé',true),'flash_success');\n $this->History->goBack(1);\n } \n $this->Session->setFlash(__('Mot de passe de l\\'administrateur <b>NON</b> initialisé',true),'flash_failure');\n $this->History->goBack(1);\n else :\n $this->Session->setFlash(__('Action non autorisée, veuillez contacter l\\'administrateur.',true),'flash_warning');\n throw new UnauthorizedException(\"Vous n'êtes pas autorisé à utiliser cette fonctionnalité de l'outil\");\n endif; \n }", "public function setUp()\n {\n $this->amount = 500;\n $this->currency = 'RUB';\n $this->sector = 222;\n $this->password = 'qwprc1';\n $this->id = 400;\n\n parent::setUp();\n }", "public function setUp(): void\n {\n parent::setUp();\n\n $this->obf = $this->app[\"obfuscate.serial\"];\n }", "public function checkSetup()\n {\n if ($this->itemType == \"\") {\n die(\"No itemType provided!\");\n }\n if ($this->classPathBase == \"\") {\n die(\"No classPathBase provided!\");\n }\n if ($this->listView == \"\" && empty($this->listNames)) {\n die(\"Provide either a list view OR fields!\");\n }\n if ($this->createView == \"\" && empty($this->editSettings)) {\n die(\"No create view OR editSettings provided!\");\n }\n\n if (! empty($this->editSettings)) {\n $fields = ['label','type'];\n foreach ($this->editSettings as $key => $es) {\n foreach ($fields as $f) {\n if (empty($es[$f])) {\n die(\"An edit parameter - {$f} - is missing or blank in your config for \\\"{$key}\\\".\");\n }\n }\n }\n }\n }", "public function run()\n {\n $this->makeUser('Erdősi Péter','[email protected]',bcrypt('12345678'),'',true);\n $this->makeUser('Hires Krisztián','[email protected]',bcrypt('12345678'),'',true);\n }", "public function check() {\n // Use preg_match() with a regular expression to check the password for whitespace.\n if (preg_match('/\\s/', $this->_password)) {\n // if there is a whitespace, an error message is stored in the current instance's $_errors array property.\n $this->_errors[] = 'Password cannot contain spaces.';\t\n }\n \n // Check that the value in the current instance's $_password property is less than our set minimum.\n if (strlen($this->_password) < $this->_minimumChars) {\n\t $this->_errors[] = \"Password must be at least $this->_minimumChars characters.\";\n } \n \n // This runs only if the requireMixedCase method is called before check().\n // If $_mixedCase is set to true\n\tif ($this->_mixedCase) {\n // Create a regex pattern to match the value against (checks for characters that are upper and lowercase).\n\t $pattern = '/(?=.*[a-z])(?=.*[A-Z])/';\n // Using preg_match, test characters inside the current instance's $_password property for upper and lowercase.\n\t if (!preg_match($pattern, $this->_password)) {\n\t\t$this->_errors[] = 'Password should include uppercase and lowercase characters.';\n\t }\n\t}\n \n // This runs only if the requireNumbers method is called before check().\n\tif ($this->_minimumNumbers) { \n // Create a regex pattern to check the value in $_password against.\n\t $pattern = '/\\d/'; \n\t $found = preg_match_all($pattern, $this->_password, $matches); // number of matches stored in $found\n \n // If the number of matches is less than the set minimum number property, an error message is passed to the \n // current instance's $_errors property.\n\t if ($found < $this->_minimumNumbers) {\n\t\t$this->_errors[] = \"Password should include at least $this->_minimumNumbers number(s).\";\n\t }\n\t}\n \n // If $_errors has values, check() returns false, indicating the password failed validation; otherwise check() returns true.\n\treturn $this->_errors ? false : true;\n }", "public function __construct() {\n if (self::$siteKey === null || self::$siteKey === '' || self::$secretKey === null || self::$secretKey === '')\n die('siteKey or secretKey can not be empty .');\n\n if (self::$verifyUrl === null || self::$verifyUrl === '')\n die('verifyUrl can not be empty .');\n\n if (self::$apiUrl === null || self::$apiUrl === '')\n die('apiUrl can not be empty .');\n }", "public function setup() {\n $this->matcher = new JWT(new ArrayContainsComparator());\n }", "public function init() {\n if (!$this->_helper->requireAuth()->setAuthParams('sitestore_store', null, \"view\")->isValid())\n return;\n \n if (!$this->_helper->requireAuth()->setAuthParams('sitestoreproduct_product', null, \"view\")->isValid())\n return;\n }", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "protected function setUp() {\n $this->object = new Qwin_ValidationResult;\n\n\n }", "public function setUp(): void\n {\n parent::setUp();\n\n self::$user['password'] = Hash::make(self::$password);\n User::updateOrCreate(\n ['email' => self::$user['email']],\n self::$user\n );\n }", "private function setup()\n {\n $home = getenv('PHLEXGET_HOME');\n $cacheDir = getenv('PHLEXGET_CACHE_DIR');\n if (!$home) {\n if (defined('PHP_WINDOWS_VERSION_MAJOR')) {\n $home = strtr(getenv('APPDATA'), '\\\\', '/') . '/Phlexget';\n } else {\n $home = rtrim(getenv('HOME'), '/') . '/.phlexget';\n }\n }\n if (!$cacheDir) {\n if (defined('PHP_WINDOWS_VERSION_MAJOR')) {\n if ($cacheDir = getenv('LOCALAPPDATA')) {\n $cacheDir .= '/Phlexget';\n } else {\n $cacheDir = getenv('APPDATA') . '/Phlexget/cache';\n }\n $cacheDir = strtr($cacheDir, '\\\\', '/');\n } else {\n $cacheDir = $home.'/cache';\n }\n }\n\n // Protect directory against web access. Since HOME could be\n // the www-data's user home and be web-accessible it is a\n // potential security risk\n foreach (array($home, $cacheDir) as $dir) {\n if (!file_exists($dir . '/.htaccess')) {\n if (!is_dir($dir)) {\n @mkdir($dir, 0777, true);\n }\n @file_put_contents($dir . '/.htaccess', 'Deny from all');\n }\n }\n\n $this->homeDir = $home;\n $this->cacheDir = $cacheDir;\n }", "function check_definitions() {\n\tglobal $config, $install_errors;\n\tif(is_localhost()) return true;\n\t\n\t// Crypt salt\n\tif(!check_value(__CHV_CRYPT_SALT__)) {\n\t\t$install_errors[] = 'You need to set <code>__CHV_CRYPT_SALT__</code> in <code>includes/definitions.php</code>. You only need to change this only the first time you install Chevereto';\n\t}\n\tif(__CHV_CRYPT_SALT__=='changeme') {\n\t\t$install_errors[] = 'You haven\\'t changed the default <code>__CHV_CRYPT_SALT__</code>. Please set this value in <code>includes/definitions.php</code>';\n\t}\n\tif(count($install_errors)==0) return true;\n}", "private function __construct() {\n\n $this->\n database = \\FluitoPHP\\Database\\Database::GetInstance();\n\n require_once( dirname(__FILE__) . DS . 'User.class.php' );\n\n $appConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetConfig('AUTHENTICATION');\n\n $appConfig = $appConfig ? $appConfig : [];\n\n $moduleConfig = \\FluitoPHP\\FluitoPHP::GetInstance()->\n GetModuleConfig('AUTHENTICATION');\n\n $moduleConfig = $moduleConfig ? $moduleConfig : [];\n\n $appConfig = array_replace_recursive($appConfig, $moduleConfig);\n\n $this->\n UpdateConfig($appConfig);\n }", "protected function preInstCheck()\n {\n // PHP Version\n if(!version_compare(PHP_VERSION,$this->prereqs['phpversion'],'>=')) {\n $this->errors[] = array(\n 'check' => 'PHP-Version',\n 'required' => $this->prereqs['phpversion'],\n 'actual' => PHP_VERSION\n );\n }\n if(!version_compare(PHP_VERSION,$this->suggested['phpversion'],\">=\")) {\n $this->warnings[] = array(\n 'check' => 'PHP-Version',\n 'suggestion' => ( isset($suggestion_text['phpversion'][$lang]) ? $suggestion_text['phpversion'][$lang] : 'en'),\n 'actual' => PHP_VERSION\n );\n }\n // PHP Settings\n foreach($this->prereqs['phpsettings'] as $key => $value) {\n $actual_setting = ($temp=ini_get($key)) ? $temp : 0;\n if($actual_setting !== $value) {\n $this->errors[] = array(\n 'check' => 'PHP-Settings -&gt; '.$key,\n 'required' => $value,\n 'actual' => $actual_setting,\n );\n }\n }\n // Check if AddDefaultCharset is set\n $sapi = php_sapi_name();\n if(strpos($sapi,'apache') !== false || strpos($sapi,'nsapi') !== false ) {\n \tflush();\n \t$apache_rheaders = apache_response_headers();\n \tforeach($apache_rheaders as $h) {\n \t\tif(strpos($h,'html; charset') !== false && (!strpos(strtolower($h),'utf-8')) ) {\n \t\t\tpreg_match( '/charset\\s*=\\s*([a-zA-Z0-9- _]+)/', $h, $match );\n \t\t\t$apache_charset = $match[1];\n \t\t\t$this->errors[] = array(\n 'check' => 'Apache-Settings',\n 'required' => 'unset',\n 'actual' => $apache_charset,\n );\n \t\t}\n \t}\n }\n // check installer\n $seen = array();\n foreach($this->installdata as $file) {\n if(file_exists(__dir__.'/../data/'.$file)) {\n $seen[] = $file;\n }\n }\n if(count($seen)!=count($this->installdata)) {\n $this->errors[] = array(\n 'check' => $this->t('Installation data'),\n 'required' => implode(\"<br />\",$this->installdata),\n 'actual' => implode(\"<br />\",$seen)\n );\n }\n\n }", "public function setUp() {\n // Bootstrap\n $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');\n parent::setUp();\n\n // Login a user\n $this->auth = new Application_Model_Auth();\n $email = '[email protected]';\n $password = 'frp!#@FRP';\n $s = $this->auth->authenticate($email, $password);\n }", "public function boot() {\n Schema::defaultStringLength(191);\n Validator::extend('equal', function($attribute, $value, $parameters) {\n \n if(!Hash::check($parameters[0], $parameters[1])){\n return false;\n }\n else {return true;}\n });\n\n Validator::extend('uniquename', function($attribute, $value, $parameters) {\n \n if ($parameters[0] > 0) {\n return false;\n } else {\n return true;\n }\n });\n \n Validator::extend('newpassword', function($attribute, $value, $parameters) {\n \n if(!Hash::check($parameters[0], $parameters[1])){\n return true;\n }\n else {return false;}\n });\n }", "protected function initialize() {\n //validaciones\n $this->validates_presence_of('nombre', 'message: Debe escribir un <b>Nombre</b>');\n \n $this->validates_uniqueness_of('nombre', 'message: Este Municipio <b>ya existe</b> en el sistema');\n }", "protected function setUp() {\n $this->object = new AccountBalanceValidators;\n }" ]
[ "0.70387685", "0.6604097", "0.63280123", "0.6327536", "0.6326665", "0.6087714", "0.60864264", "0.6014754", "0.5936855", "0.59333867", "0.5880005", "0.58623075", "0.5809043", "0.5691901", "0.5667262", "0.5649977", "0.5639558", "0.55943847", "0.5592834", "0.55908424", "0.5541961", "0.5540604", "0.55272305", "0.546311", "0.5447717", "0.54277164", "0.54237896", "0.54216677", "0.5406804", "0.54041976", "0.5399583", "0.5384231", "0.53679097", "0.53612876", "0.53413516", "0.53410304", "0.5335507", "0.5331615", "0.53273505", "0.532398", "0.5321536", "0.5318939", "0.5310761", "0.5302052", "0.5290425", "0.52863765", "0.5277809", "0.5271708", "0.52703786", "0.52702904", "0.526727", "0.5265455", "0.52568436", "0.52476186", "0.524275", "0.5233216", "0.5230164", "0.5229453", "0.52147895", "0.52133197", "0.52129745", "0.5198717", "0.51966107", "0.5195657", "0.5187945", "0.518037", "0.51702553", "0.5169334", "0.51646805", "0.5157384", "0.51554024", "0.51517016", "0.51460046", "0.5143648", "0.51366776", "0.5133751", "0.51300085", "0.51300085", "0.51185006", "0.5117279", "0.5108041", "0.51062536", "0.51056194", "0.51014656", "0.50979996", "0.5097941", "0.5097914", "0.50968415", "0.5096423", "0.50961024", "0.5095234", "0.5093674", "0.5083233", "0.5073791", "0.506875", "0.50665736", "0.50617146", "0.50602436", "0.5056118", "0.50538105" ]
0.6234412
5
Encrypts a block Optimized over Crypt_Rijndael's implementation by means of loop unrolling.
function _encryptBlock($in) { $state = unpack('N*', $in); $sbox = $this->sbox; $w = $this->w; $t0 = $this->t0; $t1 = $this->t1; $t2 = $this->t2; $t3 = $this->t3; // addRoundKey $s0 = $state[1] ^ $w[4]; $s1 = $state[2] ^ $w[5]; $s2 = $state[3] ^ $w[6]; $s3 = $state[4] ^ $w[7]; // shiftRows + subWord + mixColumns + addRoundKey $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[8]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[9]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[10]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[11]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[12]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[13]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[14]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[15]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[16]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[17]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[18]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[19]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[20]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[21]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[22]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[23]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[24]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[25]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[26]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[27]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[28]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[29]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[30]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[31]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[32]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[33]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[34]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[35]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[36]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[37]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[38]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[39]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[40]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[41]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[42]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[43]; switch ($this->Nr) { case 10: break; case 14: $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[56]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[57]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[58]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[59]; break; case 12: $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51]; break; case 13: $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46]; $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47]; $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48]; $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49]; $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50]; $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51]; $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54]; $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55]; // Note: Here we skip $s3 but using $e3 $e0 = $s0; $e1 = $s1; $e2 = $s2; // $e3 = $s3; break; default: // 11 $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44]; $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45]; $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46]; $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47]; // Note: Here we skip $s3 but using $e3 $e0 = $s0; $e1 = $s1; $e2 = $s2; // $e3 = $s3; } // subWord $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24); $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24); $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24); $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24); // shiftRows + addRoundKey return pack('N*', ($e0 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $w[0], ($e1 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $w[1], ($e2 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $w[2], ($e3 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $w[3] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function km200_Encrypt( $encryptData ) \n{ \n $blocksize = 16;\n $encrypt_padchar = $blocksize - ( strlen( $encryptData ) % $blocksize ); \n $encryptData .= str_repeat( chr( $encrypt_padchar ), $encrypt_padchar ); \n \n return base64_encode(\n openssl_encrypt(\n $encryptData,\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n )\n );\n}", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "function encryptBlock($publicKey, $msg, $blockSize){\n\t$encr = bcmod(bcpow($msg, $publicKey->other),$publicKey->N);\n\t$encrNumDig = numDigits(((int)$encr)); // number of digits in the encrypted message\n\t\n\tif($encrNumDig < $blockSize){\n\t\t// if the number of digits in the encrypted message is less that the block size\n\t\t$zeroes = '';\n\t\t// add some zeroes at the beginning\n\t\tfor($i = 0; $i < $blockSize - $encrNumDig; $i++)\n\t\t\t$zeroes = $zeroes . '0';\n\t\t$encr = $zeroes . $encr;\n\t}\n\n\treturn $encr;\n}", "protected function encryptBlock($data) {\r\n $this->state = $this->cipher->encryptBlock($this->state);\r\n return $this->state ^ $data;\r\n }", "function encrypt($plaintext) {\n $ivsize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $keysize = mcrypt_get_key_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\n //echo \"IV Size: \" . $ivsize . \"\\n\";\n //echo \"Key Size: \" . $keysize . \"\\n\";\n //echo \"Block Size: \" . $blocksize . \"\\n\";\n\n $masterkey = 'masterKeyOfLength29Characters';\n $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');\n\n //$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n\t $ivbytes = array(72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87, 72, 163, 99, 62, 219, 111, 163, 114, 15, 47, 65, 99, 231, 108, 110, 87);\n $iv = implode(array_map(\"chr\", $ivbytes));\n\n\t\t//$key = mhash(MHASH_SHA256, $masterkey);\n\t\t//echo \"Key: \" . base64_encode($key) . \"\\n\";\n\t\t \n mcrypt_generic_init($td, $masterkey, $iv);\n //mcrypt_generic_init($td, substr($key, 0, $keysize), $iv);\n //mcrypt_generic_init($td, $key, $iv);\n $crypttext = mcrypt_generic($td, $plaintext);\n mcrypt_generic_deinit($td);\n return base64_encode($iv.$crypttext);\n //return base64_encode($crypttext);\n}", "protected function encryptBlock($data) {\r\n $size = $this->cipher->getBlockSize();\r\n $state = str_pad(\r\n BaseConverter::convertToBinary($this->state, '0123456789'),\r\n $size,\r\n chr(0),\r\n STR_PAD_LEFT\r\n );\r\n $stub = $this->cipher->encryptBlock($state);\r\n $this->state = $this->bigMath->add($this->state, 1);\r\n return $stub ^ $data;\r\n }", "public function encrypt();", "protected function _encrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n default:\n $string = $this->_plainText;\n $result = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) + ord($keychar));\n $result .= $char;\n }\n $this->_encryptedText = base64_encode($result);\n break;\n }\n }", "function aes_encrypt($decrypted, $salt = null)\n{\n if (null === $salt) {\n if (!($salt = \\getenv('AES_SALT'))) {\n throw new \\Limepie\\Exception('Missing encryption salt.');\n }\n }\n\n $key = \\Limepie\\mysql_aes_key($salt);\n\n $cypher = 'aes-128-ecb';\n\n return \\openssl_encrypt($decrypted, $cypher, $key, \\OPENSSL_RAW_DATA);\n}", "public function _setupInlineCrypt() {\n\t\t$lambda_functions = &Crypt_RC2::_getLambdaFunctions();\n\n\t\t// The first 10 generated $lambda_functions will use the $keys hardcoded as integers\n\t\t// for the mixing rounds, for better inline crypt performance [~20% faster].\n\t\t// But for memory reason we have to limit those ultra-optimized $lambda_functions to an amount of 10.\n\t\t// (Currently, for Crypt_RC2, one generated $lambda_function cost on php5.5@32bit ~60kb unfreeable mem and ~100kb on php5.5@64bit)\n\t\t$gen_hi_opt_code = (bool) ( count( $lambda_functions ) < 10 );\n\n\t\t// Generation of a uniqe hash for our generated code\n\t\t$code_hash = \"Crypt_RC2, {$this->mode}\";\n\t\tif ( $gen_hi_opt_code ) {\n\t\t\t$code_hash = str_pad( $code_hash, 32 ) . $this->_hashInlineCryptFunction( $this->key );\n\t\t}\n\n\t\t// Is there a re-usable $lambda_functions in there?\n\t\t// If not, we have to create it.\n\t\tif ( ! isset( $lambda_functions[ $code_hash ] ) ) {\n\t\t\t// Init code for both, encrypt and decrypt.\n\t\t\t$init_crypt = '$keys = $self->keys;';\n\n\t\t\tswitch ( true ) {\n\t\t\t\tcase $gen_hi_opt_code:\n\t\t\t\t\t$keys = $this->keys;\n\t\t\t\tdefault:\n\t\t\t\t\t$keys = [];\n\t\t\t\t\tforeach ( $this->keys as $k => $v ) {\n\t\t\t\t\t\t$keys[ $k ] = '$keys[' . $k . ']';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// $in is the current 8 bytes block which has to be en/decrypt\n\t\t\t$encrypt_block = $decrypt_block = '\n $in = unpack(\"v4\", $in);\n $r0 = $in[1];\n $r1 = $in[2];\n $r2 = $in[3];\n $r3 = $in[4];\n ';\n\n\t\t\t// Create code for encryption.\n\t\t\t$limit = 20;\n\t\t\t$actions = [ $limit => 44, 44 => 64 ];\n\t\t\t$j = 0;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// Mixing round.\n\t\t\t\t$encrypt_block .= '\n $r0 = (($r0 + ' . $keys[ $j ++ ] . ' +\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF) << 1;\n $r0 |= $r0 >> 16;\n $r1 = (($r1 + ' . $keys[ $j ++ ] . ' +\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF) << 2;\n $r1 |= $r1 >> 16;\n $r2 = (($r2 + ' . $keys[ $j ++ ] . ' +\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF) << 3;\n $r2 |= $r2 >> 16;\n $r3 = (($r3 + ' . $keys[ $j ++ ] . ' +\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;\n $r3 |= $r3 >> 16;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 64 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Mashing round.\n\t\t\t\t\t$encrypt_block .= '\n $r0 += $keys[$r3 & 0x3F];\n $r1 += $keys[$r0 & 0x3F];\n $r2 += $keys[$r1 & 0x3F];\n $r3 += $keys[$r2 & 0x3F];';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$encrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Create code for decryption.\n\t\t\t$limit = 44;\n\t\t\t$actions = [ $limit => 20, 20 => 0 ];\n\t\t\t$j = 64;\n\n\t\t\tfor ( ; ; ) {\n\t\t\t\t// R-mixing round.\n\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 | ($r3 << 16)) >> 5;\n $r3 = ($r3 - ' . $keys[ -- $j ] . ' -\n ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF;\n $r2 = ($r2 | ($r2 << 16)) >> 3;\n $r2 = ($r2 - ' . $keys[ -- $j ] . ' -\n ((($r3 ^ $r0) & $r1) ^ $r3)) & 0xFFFF;\n $r1 = ($r1 | ($r1 << 16)) >> 2;\n $r1 = ($r1 - ' . $keys[ -- $j ] . ' -\n ((($r2 ^ $r3) & $r0) ^ $r2)) & 0xFFFF;\n $r0 = ($r0 | ($r0 << 16)) >> 1;\n $r0 = ($r0 - ' . $keys[ -- $j ] . ' -\n ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';\n\n\t\t\t\tif ( $j === $limit ) {\n\t\t\t\t\tif ( 0 === $limit ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// R-mashing round.\n\t\t\t\t\t$decrypt_block .= '\n $r3 = ($r3 - $keys[$r2 & 0x3F]) & 0xFFFF;\n $r2 = ($r2 - $keys[$r1 & 0x3F]) & 0xFFFF;\n $r1 = ($r1 - $keys[$r0 & 0x3F]) & 0xFFFF;\n $r0 = ($r0 - $keys[$r3 & 0x3F]) & 0xFFFF;';\n\t\t\t\t\t$limit = $actions[ $limit ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$decrypt_block .= '$in = pack(\"v4\", $r0, $r1, $r2, $r3);';\n\n\t\t\t// Creates the inline-crypt function\n\t\t\t$lambda_functions[ $code_hash ] = $this->_createInlineCryptFunction(\n\t\t\t\t[\n\t\t\t\t\t'init_crypt' => $init_crypt,\n\t\t\t\t\t'encrypt_block' => $encrypt_block,\n\t\t\t\t\t'decrypt_block' => $decrypt_block\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\t// Set the inline-crypt function as callback in: $this->inline_crypt\n\t\t$this->inline_crypt = $lambda_functions[ $code_hash ];\n\t}", "function _decryptBlock($in)\n {\n $state = unpack('N*', $in);\n\n $sbox = $this->isbox;\n $dw = $this->dw;\n $dt0 = $this->dt0;\n $dt1 = $this->dt1;\n $dt2 = $this->dt2;\n $dt3 = $this->dt3;\n\n // addRoundKey\n $s0 = $state[1] ^ $dw[4];\n $s1 = $state[2] ^ $dw[5];\n $s2 = $state[3] ^ $dw[6];\n $s3 = $state[4] ^ $dw[7];\n\n // invShiftRows + invSubBytes + invMixColumns + addRoundKey\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[8];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[9];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[10];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[11];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[12];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[13];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[14];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[15];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[16];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[17];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[18];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[19];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[20];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[21];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[22];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[23];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[24];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[25];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[26];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[27];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[28];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[29];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[30];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[31];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[32];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[33];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[34];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[35];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[36];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[37];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[38];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[39];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[40];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[41];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[42];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[43];\n\n switch ($this->Nr) {\n case 10:\n break;\n\n case 14:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[56];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[57];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[58];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[59];\n break;\n\n case 12:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n break;\n\n case 13:\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n\n $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48];\n $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49];\n $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50];\n $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51];\n\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54];\n $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n break;\n\n default: // 11\n $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44];\n $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45];\n $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46];\n $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n }\n\n // invSubWord\n $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24);\n $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24);\n $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24);\n $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24);\n\n // invShiftRows + addRoundKey\n return pack('N*',\n ($e0 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $dw[0],\n ($e1 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $dw[1],\n ($e2 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $dw[2],\n ($e3 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $dw[3]\n );\n }", "abstract public function encrypt($data);", "public function encrypt() \r\n {\r\n //TODO: Implement encrypt method\r\n }", "function encrypt($string) {\n\t\t\t$iv = $this->_generate_iv();\n\t\t\t\n\t\t\t// Clear output\n\t\t\t$out = '';\n\t\t\t\n\t\t\t// First block of output is ($this->hash_hey XOR IV)\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) {\n\t\t\t\t$out .= chr(ord($iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\n\t\t\t// Use IV as first key\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\n\t\t\t// Go through input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($string,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\t// Apply base64 encoding if necessary\n\t\t\tif($this->base64) $out = base64_encode($out);\n\t\t\treturn $out;\n\t\t}", "static function encrypt($data){\n # Setup the initialization vector\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n # Encrypt the data\n $encryptedMessage = openssl_encrypt($data, \"AES-256-CBC\", self::getEncryptKey(), 0, $iv);\n return base64_encode($encryptedMessage.'~~~'.$iv);\n }", "function mcrypt_enc_is_block_algorithm($td)\n{\n}", "function encryptText($publicKey, $text, $blockSize, $opt){\n\t/* $opt = 0 --> encrypt $opt = 1 --> decrtypt*/\n\n\t$encrypted = ''; // stores the encrypted/decrypted integer string (the encrypted text)\n\t$auxRemainder = strlen($text) % $blockSize; // used to check if the text has the appropriate ammount of characters to block size\n\n\tif ($auxRemainder != 0)\n\t\t// if number of digits in text is not a multiple of $blockSize, concatenate some spaces at the end\n\t\tfor ($i = 0; $i < $auxRemainder; $i++)\n\t\t\t$text = $text . '32';\n\t\n\tfor($counter = 0; $counter < strlen($text) - $blockSize; $counter += $blockSize){\n\t\t$block = ''; // block of text to encrypt/decrypt\n\n\t\tfor ($i = $counter; $i < $blockSize + $counter; $i++)\n\t\t\t// built the block of text to encrypt\n\t\t\t$block = $block . $text[$i];\n\n\t\t// encrypt an single block of text and add it to the encrypted string\n\t\t$encrypted = $encrypted . ($opt?decryptBlock($publicKey, $block, $blockSize):encryptBlock($publicKey, $block, $blockSize));\t\t\t\n\t}\n\n\treturn $encrypted;\n}", "function cs_encrypt_decrypt($string)\r\n{\r\n\t//Function : encrypt/decrypt a string message v.1.0 without a known key\r\n\t//Author : Aitor Solozabal Merino (spain)\r\n\t//Email : [email protected]\r\n\t//Date : 01-04-2005\r\n $strlen = strlen($string);\r\n $strencrypted = '';\r\n for ($pos = 0; $pos < $strlen ; $pos++)\r\n {\r\n\t\t// long code of the function to explain the algoritm\r\n\t\t// this function can be tailored by the programmer modifyng the formula\r\n\t\t// to calculate the key to use for every character in the string.\r\n\t\t$usekey = (($strlen+$pos)+1); // (+5 or *3 or ^2)\r\n\t\t// after that we need a module division because can´t be greater than 255\r\n\t\t$usekey = (255+$usekey) % 255;\r\n\t\t$encryptbyte = substr($string, $pos, 1);\r\n\t\t$asciibyte = ord($encryptbyte);\r\n\t\t$xorbyte = $asciibyte ^ $usekey; // xor operation\r\n\t\t$encrypted = chr($xorbyte);\r\n\t\t$strencrypted .= $encrypted;\r\n\t\t \r\n\t\t//short code of the function once explained\r\n\t\t// $str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255));\r\n\t}\r\n\treturn $strencrypted;\r\n}", "public function encrypt( $plaintext ) {\n\t\tif ( CRYPT_ENGINE_OPENSSL == $this->engine ) {\n\t\t\t$temp = $this->key;\n\t\t\t$this->key = $this->orig_key;\n\t\t\t$result = parent::encrypt( $plaintext );\n\t\t\t$this->key = $temp;\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn parent::encrypt( $plaintext );\n\t}", "function encrypt($plaintext, $passphrase, $iv) {\n try {\n $padded_str = pad_pkcs5($plaintext);\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $passphrase, $padded_str, MCRYPT_MODE_CBC, $iv);\n return $ciphertext;\n } catch (Exception $e) {\n echo \"Encryption exception in encrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "function encrypt($plaintext)\n {\n switch ($this->encryptionMode) {\n case self::ENCRYPTION_NONE:\n $plaintext = str_split($plaintext, $this->k);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_raw_encrypt($m);\n }\n return $ciphertext;\n case self::ENCRYPTION_PKCS1:\n $length = $this->k - 11;\n if ($length <= 0) {\n return false;\n }\n\n $plaintext = str_split($plaintext, $length);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_rsaes_pkcs1_v1_5_encrypt($m);\n }\n return $ciphertext;\n //case self::ENCRYPTION_OAEP:\n default:\n $length = $this->k - 2 * $this->hLen - 2;\n if ($length <= 0) {\n return false;\n }\n\n $plaintext = str_split($plaintext, $length);\n $ciphertext = '';\n foreach ($plaintext as $m) {\n $ciphertext.= $this->_rsaes_oaep_encrypt($m);\n }\n return $ciphertext;\n }\n }", "function encryptAES($content, $secret){\n return openssl_encrypt($content, \"AES-256-CBC\", $secret);\n}", "function encrypt ($data, $key, $base64=false) {\n\t\n\tif (!$td = mcrypt_module_open('rijndael-256', '', 'ctr', '')) return false;\n\t\n\t$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\n\t\n\tif (mcrypt_generic_init($td, $key, $iv) !== 0) return false;\n\t\n\t$data = serialize($data);\n\t\n\t$data\t= mcrypt_generic($td, $data);\n\t$data\t= $iv.$data;\n\t$mac\t= self::keygen($data, $key, 1000, 32);\n\t$data .= $mac;\n\t\n\tmcrypt_generic_deinit($td);\n\tmcrypt_module_close($td);\n\t\n\tif ($base64) $data = base64_encode($data);\n\t\n\treturn $data;\n}", "static public function encrypt($data,$key,$test=false) {\r\n if ($test) {\r\n $iv=\"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0A\\x0B\\x0C\\x0D\\x0E\\x0F\"; \r\n } else { \r\n $iv=self::getRandomBytes(16); \r\n // Padding PKCS#7\r\n $datalen=strlen($data);\r\n $padlen=16-($datalen%16);\r\n $data.=str_repeat(chr($padlen), $padlen);\r\n } \r\n // 128 is blocksize, not keysize!\r\n $out= mcrypt_encrypt(MCRYPT_RIJNDAEL_128,$key,$data,MCRYPT_MODE_CBC, $iv);\r\n if ($test)\r\n return $out;\r\n else \r\n return $iv.$out; \r\n }", "function mysql_aes_key($key)\n{\n $bytes = 16;\n $newKey = \\str_repeat(\\chr(0), $bytes);\n $length = \\strlen($key);\n\n for ($i = 0; $i < $length; $i++) {\n $index = $i % $bytes;\n $newKey[$index] = $newKey[$index] ^ $key[$i];\n }\n\n return $newKey;\n}", "function encrypt($str, $key) {\n $key = str_pad($key, 16);\n //$key = $this->hex2bin($key);\n $iv = $this->iv;\n\n $td = mcrypt_module_open('rijndael-128', '', 'cbc', $iv);\n\n mcrypt_generic_init($td, $key, $iv);\n $encrypted = mcrypt_generic($td, $str);\n\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n return bin2hex($encrypted);\n }", "function key_encrypt($message, $key, $cipher_method=AES_256) {\n\t\n\t$length = key_length($cipher_method);\n\t\n\t$key = str_pad($key, $length, '*');\n\n\t$iv_length = openssl_cipher_iv_length($cipher_method);\n\t$iv = openssl_random_pseudo_bytes($iv_length);\n\n\t$encrypted = openssl_encrypt($message, $cipher_method, $key, OPENSSL_RAW_DATA, $iv);\n\t$encrypted_message = $iv . $encrypted;\n\n return base64_encode($encrypted_message);\n}", "function encryptData($value){\n\t\t\tglobal $key;\n $cipher = new Crypt_Rijndael(CRYPT_RIJNDAEL_MODE_ECB);\n\t\t\t$cipher->setKey($key);\n\t\t\treturn $cipher->encrypt($value);\n\t\t}", "public static function aes128Encrypt($key, $data) {}", "function encryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_encrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "public static function aes256Encrypt($key, $data) {}", "function encryptData($data)\n{\n $cypher = \"aes-256-cbc\";\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($cypher));\n $key = base64_encode(gethostname());\n\n\n\n return openssl_encrypt($data,$cypher,$key,0,$iv);\n}", "function TOencrypt($decrypted, $password, $salt='!kQm*fF3pXe1Kbm%9') {\r\n // Build a 256-bit $key which is a SHA256 hash of $salt and $password.\r\n $key = hash('SHA256', $salt . $password, true);\r\n // Build $iv and $iv_base64. We use a block size of 128 bits (AES compliant) and CBC mode. (Note: ECB mode is inadequate as IV is not used.)\r\n srand(); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);\r\n if (strlen($iv_base64 = rtrim(base64_encode($iv), '=')) != 22) return false;\r\n // Encrypt $decrypted and an MD5 of $decrypted using $key. MD5 is fine to use here because it's just to verify successful decryption.\r\n $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $decrypted . md5($decrypted), MCRYPT_MODE_CBC, $iv));\r\n // We're done!\r\n return $iv_base64 . $encrypted;\r\n }", "function rc4($data, $pwd)\n{\n $cipher = '';\n $key[] = \"\";\n $box[] = \"\";\n $pwd_length = strlen($pwd);\n $data_length = strlen($data);\n for ($i = 0; $i < 256; $i++) {\n $key[$i] = ord($pwd[$i % $pwd_length]);\n $box[$i] = $i;\n }\n for ($j = $i = 0; $i < 256; $i++) {\n $j = ($j + $box[$i] + $key[$i]) % 256;\n $tmp = $box[$i];\n $box[$i] = $box[$j];\n $box[$j] = $tmp;\n }\n for ($a = $j = $i = 0; $i < $data_length; $i++) {\n $a = ($a + 1) % 256;\n $j = ($j + $box[$a]) % 256;\n $tmp = $box[$a];\n $box[$a] = $box[$j];\n $box[$j] = $tmp;\n $k = $box[(($box[$a] + $box[$j]) % 256)];\n $cipher .= chr(ord($data[$i]) ^ $k);\n echo \"code:\" . ord($data[$i]) . \"\\tk:$k\". PHP_EOL;\n }\n return $cipher;\n}", "public function encrypt($plaintext) {\n\t\t\n\t\t$key = self::PWD; // Password is set above at the Constants\n\t\t$ivlen = openssl_cipher_iv_length($cipher=\"AES-256-CTR\");\n\t\t$iv = openssl_random_pseudo_bytes($ivlen);\n\t\t$ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n\t\t$hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);\n\t\t$ciphertext = base64_encode($iv.$hmac.$ciphertext_raw );\n\t\n\t\treturn bin2hex($ciphertext);\n\t\n\t}", "function aes256Encrypt($plaintext, $password) {\n // hash the key\n $key = pack(\"H*\", substr(hash(\"sha512\", $password), 0, 64));\n\n // generate an initialization vector (IV)\n $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);\n\n // pad the plaintext\n $blocksize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $plaintext = pkcs5Pad($plaintext, $blocksize);\n\n // encrypt the plaintext\n $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);\n $ciphertext = $iv . $ciphertext;\n return(base64_encode($ciphertext));\n}", "public function Encrypt($data)\n {\n $pad = $this->blocksize - (strlen($data) % $this->blocksize);\n $data = $data . str_repeat(chr($pad), $pad);\n return bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_128,\n $this->encryptKey,\n $data, MCRYPT_MODE_CBC, $this->iv));\n }", "public function encender();", "function fsl_encrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // Generate an initialization vector\n // This *MUST* be available for decryption as well\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n\n // Create some data to encrypt\n \n // Encrypt $data using aes-256-cbc cipher with the given encryption key and\n // our initialization vector. The 0 gives us the default options, but can\n // be changed to OPENSSL_RAW_DATA or OPENSSL_ZERO_PADDING\n $encrypted = openssl_encrypt($string, 'aes-256-cbc', $encryption_key, 0, $iv);\n\n // If we lose the $iv variable, we can't decrypt this, so:\n // - $encrypted is already base64-encoded from openssl_encrypt\n // - Append a separator that we know won't exist in base64, \":\"\n // - And then append a base64-encoded $iv\n $encrypted = $encrypted . ':' . base64_encode($iv);\n\n return $encrypted;\n}", "function simple_encrypt($text){\n \treturn base64_encode(openssl_encrypt($text, \"AES-256-CTR\", \"GhratnaXbS\", 0, \"0123456789abcdef\"));\n }", "protected function _computeEncryptionKey(array $envelopes, $seed, $encryptMetadata = true) {}", "public function encrypt($plaintext) {\n\t\t//Capitalize all the characters\n\t\t$plaintext = strtoupper($plaintext); // see https://www.php.net/manual/en/function.strtoupper.php\n\t\t//convert the string to an array, and then loop over the \n\t\t$plaintext = str_split ($plaintext); //see https://www.php.net/manual/en/function.str-split.php\n\t\t\t\t\t\t\t\t\t\t\t\t//also see https://www.php.net/manual/en/function.explode.php\n\t\t\n\t\t//var_dump($plaintext); //Debug code uncomment to see the array\n\t\t\n\t\t$cyphertext = array(); //create an empty array for our cyphertext\n\t\t\n\t\t//temporary variables for our script. This is inelegant, but easy to follow.\n\t\t$tmp_plain_num = 0;\n\t\t$tmp_crypt_num = 0;\n\t\tforeach ($plaintext as $char) {\n\t\t\t//check to make sure we have a letter. If we do not, just stick it in the cyphertext unencrypted.\n\t\t\tif(ctype_alpha($char)) {\n\t\t\t\t$tmp_plain_num = self::$lettersToNumbers[$char]; //gets the number\n\t\t\t\t/**\n\t\t\t\t *\tIn php, mod takes precedence over addition, so we need parenthesis. What would happen without them?\n\t\t\t\t */\n\t\t\t\t$tmp_crypt_num = ($tmp_plain_num + $this->shift_key) % 26; // See https://www.php.net/manual/en/language.operators.precedence.php for php's PEMDAS\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t *\tIn php (as opposed to some other languages), we can append an element to the end of an array \n\t\t\t\t * by simply leaving the index empty.\n\t\t\t\t */\n\t\t\t\t$cyphertext[] = self::$numbersToLetters[$tmp_crypt_num]; //encrypt the letter, and append it to the array.\n\t\t\t} else {\n\t\t\t\t$cyphertext[] = $char; //stick the non-letter in.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//var_dump($cyphertext); //Debug code Uncomment to see the array\n\t\t\n\t\t$cyphertext = implode($cyphertext); //convert back to a string. See https://www.php.net/manual/en/function.implode.php\n\t\t\n\t\treturn($cyphertext);\n\t}", "public function encrypt($data)\n {\n $this->cwsDebug->titleH2('Encrypt data');\n\n if (empty($this->encryptionKey)) {\n $this->error = 'You have to set the encryption key...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n if (empty($data)) {\n $this->error = 'Data empty...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n $this->cwsDebug->labelValue('Encryption key', $this->encryptionKey);\n $this->cwsDebug->dump('Data', $data);\n\n $td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CFB, '');\n\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = mcrypt_create_iv($ivsize, MCRYPT_DEV_URANDOM);\n $key = $this->validateKey($this->encryptionKey, mcrypt_enc_get_key_size($td));\n\n mcrypt_generic_init($td, $key, $iv);\n\n $encryptedData = mcrypt_generic($td, $this->encode($data));\n mcrypt_generic_deinit($td);\n\n $result = $iv.$encryptedData;\n $this->cwsDebug->dump('Encrypted data', $result);\n\n return $result;\n }", "public function encrypt($data, $deterministic);", "public function AesEncrypt ($buffer, $key)\r\n\t{\r\n\t\tif (strlen ($key) != 32)\r\n\t\t{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\r\n\t\t$size = mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\r\n\t\t$iv = mcrypt_create_iv ($size, MCRYPT_RAND);\r\n\t\t\r\n\t\treturn bin2hex ($iv . mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $buffer, MCRYPT_MODE_CBC, $iv));\r\n\t}", "function xor_encrypt($string, $key)\n\t{\n\t\tfor ($a=0; $a < strlen($string); $a++)\n\t\t{\n\t\t\tfor ($b=0; $b < strlen($key); $b++)\n\t\t\t{\n\t\t\t\t$string[$a] = $string[$a]^$key[$b];\n\t\t\t}\n\t\t}\n\t\n\t\treturn $string; \n\t}", "public function update(string $cipherTextBlock): void;", "function encrypt($decrepted_string, $encrytion_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $encryption_iv = '1234567891011121';\r\n $string = openssl_encrypt($decrepted_string, $ciphering, $encrytion_key, $options, $encryption_iv);\r\n return $string;\r\n}", "public static function encrypt($string) {\n $secret_key = Config::get('constants.DEFAULT_DATA.ENC_SECRET');\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n return base64_encode($output);\n }", "public function encrypt($plain){\t\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function _encipher(&$Xl, &$Xr)\n {\n if ($Xl < 0) {\n $Xl += 4294967296;\n }\n if ($Xr < 0) {\n $Xr += 4294967296;\n }\n\n for ($i = 0; $i < 16; $i++) {\n $temp = $Xl ^ $this->_P[$i];\n if ($temp < 0) {\n $temp += 4294967296;\n }\n\n $Xl = fmod((fmod($this->_S[0][($temp >> 24) & 255]\n + $this->_S[1][($temp >> 16) & 255], 4294967296) \n ^ $this->_S[2][($temp >> 8) & 255]) \n + $this->_S[3][$temp & 255], 4294967296) ^ $Xr;\n $Xr = $temp;\n }\n $Xr = $this->_binxor($Xl, $this->_P[16]);\n $Xl = $this->_binxor($temp, $this->_P[17]);\n }", "function encrypt_decrypt($action, $string) {\n\n if ( !function_exists(\"openssl_encrypt\") )\n {\n die (\"openssl function openssl_encrypt does not exist\");\n }\n if ( !function_exists(\"hash\") )\n {\n die (\"function hash does not exist\");\n }\n\n global $encryption_key;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //echo \"$encryption_key\\n\";\n $secret_iv = 'RgX54.Ju7h';\n\n\n // hash\n $key = hash('sha256', $encryption_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' )\n {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' )\n {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "function encrypt($_input, $_key='your salt', $_type='mcrypt')\n{\n if (function_exists('mcrypt') && $_type=='mcrypt') {\n\n $td = mcrypt_module_open(MCRYPT_TWOFISH256, '', 'ofb', '');\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_BLOWFISH);\n\n mcrypt_generic_init($td, $_key, $iv);\n $encryptedData = mcrypt_generic($td, $_input);\n mcrypt_generic_deinit($td);\n mcrypt_module_close($td);\n\n //else use md5\n } else {\n\n if(version_compare(PHP_VERSION, '5.0.0', '>='))\n $bool = true;\n else $bool = false;\n\n $encryptedKey = md5($_key, $bool) . md5($_input, $bool);\n $encryptedData = md5($encryptedKey, $bool);\n\n }\n\n // return generated password\n // enjoy\n return utf8_encode($encryptedData);\n\n}", "public function encrypt($plaintext, $secret = '')\n {\n $mode = 'AES-256-CBC';\n $check = false;\n $ivlen = openssl_cipher_iv_length($mode);\n $iv = openssl_random_pseudo_bytes($ivlen, $check);\n\n if (!$check) {\n throw new Exception('Non-cryptographically strong algorithm used for iv generation. This IV is not safe to use.');\n }\n\n return \\Base91\\Base91::encode(base64_encode($iv).':'.base64_encode(openssl_encrypt($plaintext, $mode, $secret, 0, $iv)));\n }", "function my_simple_crypt($string, $action = 'e')\n{\n $secret_key = 'my_simple_secret_key';\n $secret_iv = 'my_simple_secret_iv';\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n $key = hash('sha256', $secret_key);\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } else if ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "function encrypt($decrypted, $password, $salt='!kQm*fF3pXe1Kbm%9') {\n\t\t$key = hash('SHA256', $salt . $password, true);\n\t\t// Build $iv and $iv_base64. We use a block size of 128 bits (AES compliant) and CBC mode. (Note: ECB mode is inadequate as IV is not used.)\n\t\tsrand(); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND);\n\t\tif (strlen($iv_base64 = rtrim(base64_encode($iv), '=')) != 22) return false;\n\t\t// Encrypt $decrypted and an MD5 of $decrypted using $key. MD5 is fine to use here because it's just to verify successful decryption.\n\t\t$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $decrypted . md5($decrypted), MCRYPT_MODE_CBC, $iv));\n\t\t// We're done!\n\t\treturn $iv_base64 . $encrypted;\n\t}", "public function encrypt($data)\n {\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($this->key);\n // Generate an initialization vector\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));\n // Encrypt the data using AES 256 encryption in CBC mode using our encryption key and initialization vector.\n $encrypted = openssl_encrypt($data, 'aes-256-cbc', $encryption_key,\n 0, $iv);\n // The $iv is just as important as the key for decrypting, so save it with our encrypted data using a unique separator (::)\n return base64_encode($encrypted.'::'.$iv);\n }", "function mc_encrypt($encrypt, $key){\n $encrypt = serialize($encrypt);\n $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);\n $key = pack('H*', $key);\n $mac = hash_hmac('sha256', $encrypt, substr(bin2hex($key), -32));\n $passcrypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $encrypt.$mac, MCRYPT_MODE_CBC, $iv);\n $encoded = base64_encode($passcrypt).'|'.base64_encode($iv);\n return $encoded;\n }", "public final function Encrypt($input, $key=NULL)\r\n\t\t{\r\n\t\t\tif (!$key)\r\n\t\t\t\t$key = $this->Key;\r\n\r\n\t\t\t$key = substr($key, 0, 24);\r\n\t\t\t\r\n\t\t\t$this->CheckMcrypt();\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$tdes = mcrypt_module_open($this->CryptoAlgo, '', 'ecb', '');\r\n\t\t\t\t$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($tdes), MCRYPT_RAND);\r\n\t\t\t\tmcrypt_generic_init($tdes, $key, $iv);\r\n\t\t\t\t$ct = mcrypt_generic($tdes, $input);\r\n\t\t\t\tmcrypt_module_close($tdes);\r\n\t\t\t\t$retval=base64_encode($ct);\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\tCore::ThrowException(\"Crypto::Encrypt throwed exception: {$e->getMessage()}\", E_ERROR);\r\n\t\t\t}\r\n\t\t\treturn ($retval);\r\n\t\t}", "function encrypt($plain){\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->key, $plain, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "function MyJamiaEncrypt($str) {\n\t\t\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n \n\t\t// Non-NULL Initialization Vector for encryption \n\t\t$encryption_iv = '1234567891011121'; \n \n\t\t// Store the encryption key \n\t\t$encryption_key = \"MyJamiaEncryptionString\"; \n \n\t\t// Use openssl_encrypt() function to encrypt the data \n\t\treturn openssl_encrypt($str, $ciphering, \n\t\t $encryption_key, $options, $encryption_iv); \n \t}", "public function encrypt($data)\n {\n if (empty($data)) {\n $this->has_error = true;\n return false;\n }\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Create an IV for encryption\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n $iv = openssl_random_pseudo_bytes($iv_length);\n\n // Encrypt for first time with first crypt key\n $first_encrypted = openssl_encrypt($data, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n // Encrypt first encryption for second time with second crypt key\n $second_encrypted = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Encode second crypted data to base64 with created IV\n $output = base64_encode($iv . $second_encrypted . $first_encrypted);\n\n // Return the crypted value\n $this->has_error = false;\n return $output;\n }", "public function encrypt($str, $key, $method = '') {\n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n \n // Create return array\n $return = array('decrypted' => addslashes(trim($str)), 'encrypted' => '', 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array(), 'decryptedlen' => strlen(addslashes(trim($str))), 'encryptedlen' => 0, 'compressedlen' => 0);\n\n // String cannot be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key cannot be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Generate cipher_algorithm string to glue it to output string\n $len = 32;\n $algorithm = $this->textToBinary(mb_substr($this->cipher_algorithm.'_'.$this->generateRandomString($len-strlen($this->cipher_algorithm)), 0, $len));\n if(count(explode(' ',$algorithm)) !== $len) {\n $return['error'][] = 'Algorithm error';\n trigger_error('Algorithm error', E_USER_NOTICE); \n return $return;\n }\n \n // Create an IV and save it as binary\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $return['iv'] = bin2hex($iv); \n \n // Split input to be able to encrypt larger strings\n foreach(str_split($return['decrypted'], 20) as $str) {\n $return['base64_encode'][] = $this->textToBinary(base64_encode(openssl_encrypt($str, $method, $key, OPENSSL_RAW_DATA, $iv)), null);\n }\n \n // Glue everything togeather\n $return['encrypted'] = $algorithm. PHP_EOL . implode(PHP_EOL, $return['base64_encode']) . PHP_EOL . $this->textToBinary($return['iv']);\n $return['encrypted'] = str_replace(array(' ',PHP_EOL),array($this->delimiter_character,$this->delimiter_breaks),$this->delimiter_characters.' '.$return['encrypted'].' '.$this->delimiter_characters);\n $return['encryptedlen'] = strlen($return['encrypted']);\n \n // Compress the string if enabled\n if($this->compress==true) {\n $return['encryptednotcompressed'] = $return['encrypted'];\n $return['encrypted'] = addslashes($this->delimiter_gz.utf8_encode(gzencode($return['encrypted'],9)).$this->delimiter_gz);\n $return['compressedlen'] = strlen($return['encrypted']);\n }\n \n return $return;\n }", "public function encrypt($plainText, $secretKey);", "function ehash_encrypt($pure_string, $encryption_key) {\n \n\tif (empty($pure_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, $pure_string, MCRYPT_MODE_ECB, $iv));\n \n return $encrypted_string;\n}", "public function rawEncrypt($name, RawEncryptRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('rawEncrypt', [$params], RawEncryptResponse::class);\n }", "public function Encrypt($input) {\n $text_arr = str_split($input, $this->bit_check); \n //bit_check - jumlah string dari text_arr index terakhir di kurangi 1\n $text_num = $this->bit_check - strlen($text_arr[count($text_arr) - 1]);\n //loops\n for($a = 1; $a < $text_num; $a++){\n //update input dengan menambahkan character specifik dengan integer text_num\n $input = $input .chr($text_num);\n }\n //encrypt dengan Mcrypt\n $chiper = mcrypt_module_open('rijndael-128', '', 'cbc', '');\n mcrypt_generic_init($chiper, $this->key, $this->iv);\n $encrypted_data = mcrypt_generic($chiper, $input);\n mcrypt_generic_deinit($chiper);\n mcrypt_module_close($chiper);\n //return encrypt data with base64\n return base64_encode($encrypted_data);\n }", "private static function encryptInternal($plaintext, KeyOrPassword $secret, $raw_binary)\n {\n RuntimeTests::runtimeTest();\n\n $salt = Core::secureRandom(Core::SALT_BYTE_SIZE);\n $keys = $secret->deriveKeys($salt);\n $ekey = $keys->getEncryptionKey();\n $akey = $keys->getAuthenticationKey();\n $iv = Core::secureRandom(Core::BLOCK_BYTE_SIZE);\n\n $ciphertext = Core::CURRENT_VERSION . $salt . $iv . self::plainEncrypt($plaintext, $ekey, $iv);\n $auth = \\hash_hmac(Core::HASH_FUNCTION_NAME, $ciphertext, $akey, true);\n $ciphertext = $ciphertext . $auth;\n\n if ($raw_binary) {\n return $ciphertext;\n }\n return Encoding::binToHex($ciphertext);\n }", "protected function _crypt($data, $algorithm, $param = null, $encrypt = true) {}", "function break_repeating_key_XOR($args = NULL) {\n\n\n\tif ($args==NULL) {\n\t\treturn false;\n\t}\n\n\t// INIT PARAMETERS\n\t$kl_min = 2;\n\t$kl_max = 10;\n\tif (isset($args['kl_min'])) {\n\t\t$kl_min = $args['kl_min'];\n\t}\n\tif (isset($args['kl_max'])) {\n\t\t$kl_max = $args['kl_max'];\n\t}\n\n\t// Recupero il testo cifrato a seconda che venga passato direttamente\n\t// o sia passato l'url di un file\n\t$cypher = '';\n\tif ($args['file']!=NULL) {\n\t\t$lines = file($args['file'], FILE_IGNORE_NEW_LINES);\n\n\t\tset_time_limit(0);\n\t\tforeach($lines as $line) {\n\t\t\t$cypher .= $line;\n\t\t}\n\t\tset_time_limit(30);\n\t}\n\telse if ($args['string']) {\n\t\t$cypher = $args['string'];\n\t}\n\n\t//echo $cypher.\"<br><br>\";\n\n\t$cypher = $this->base64_to_hex($cypher);\n\t$array_norm_keylegth = array();\n\tfor ($keylength=2; $keylength <= 40; $keylength++) { \n\t\t$sum = 0;\n\t\t$keylength_byte = $keylength*2;\n\t\t//echo $keylength.\"<br>\";\n\t\tfor ($i=0; $i < 4; $i++) { \n\t\t\t$str1 = substr($cypher, ($keylength_byte*2)*$i, $keylength_byte);\n\t\t\t$str2 = substr($cypher, (($keylength_byte*2)*$i)+$keylength_byte, $keylength_byte);\n\t\t\t//echo \"#### \".$str1.\"<br>\";\n\t\t\t//echo \"#### \".$str2.\"<br>\";\n\t\t\t//echo \"#### \".$this->helper->hamming_distance($str1, $str2)/$keylength.\"<br><br>\";\n\t\t\t$sum = $sum + $this->helper->hamming_distance($str1, $str2)/$keylength_byte;\n\t\t}\n\n\t\t//echo \"######## \".$sum.\"<br>\";\n\t\t//echo \"######## \".($sum/4).\"<br>\".\"<br>\";\n\n\t\t//echo \"###################################<br><br>\";\n\t\t\n\t\t$array_norm_keylegth[] = array('norm_keylength' => $sum/4, 'keylength' => $keylength_byte);\n\t\t\n\t}\n\n\tusort($array_norm_keylegth, function($a, $b) {\n\t\t$el1 = $a['norm_keylength'];\n\t\t$el2 = $b['norm_keylength'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t//echo \"<pre>\";\n\t//print_r($array_norm_keylegth);\n\t//echo \"</pre>\";\n\n\t$keylength_candidata = $array_norm_keylegth[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata*2);\n\n\t//echo \"<pre>\";\n\t//print_r($array_blocchi_testo_keylength);\n\t//echo \"</pre>\";\n\n\t$array_string = array();\n\tfor ($i=0; $i<(($keylength_candidata*2)); $i += 2) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= substr($string, $i, 2);\n\t\t}\n\t\t$array_string[] = $partial_string;\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($partial_string, \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0)));\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}/**/\n\n\techo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";\n\n\t// Controllo le ripetizioni di sottostrighe\n\t/*set_time_limit(0);\n\t$array_text = array();\n\n\t$dim_cypher = strlen($cypher);\n\t$occurences = array();\n\n\tfor ($i = floor($dim_cypher/2); $i>0; $i--) {\n\t\t$offset_sx = 0;\n\t\t$offset_dx = $dim_cypher-$i;\n\t\t$finito = false;\n\t\twhile ((($i <= $offset_sx)||($i<=$offset_dx))\n\t\t\t &&($offset_sx<=$dim_cypher)\n\t\t\t &&($offset_dx>=0)) {\n\n\t\t\t$text = substr($cypher, $offset_sx, $i);\n\n\t\t\t$occurences = $this->helper->strpos_all($cypher, $text);\n\t\t\tif (count($occurences)>1) {\n\t\t\t\t$finito = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$offset_sx++;\n\t\t\t$offset_dx--;\n\t\t}\n\n\t\tif ($finito) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tset_time_limit(30);\n\n\t/*echo $text.\"<br>\";\n\tprint_r($occurences);*/\n\n\n\t// Possibili keylengths e valutazione con distanza di hemming\n\t/*set_time_limit(0);\n\t$distance = $occurences[1] - $occurences[0];\n\t//echo \"<br>distance: \".$distance.\"<br>\";\n\n\t$keylengths = 0;\n\t$array_somme = array();\n\t$smaller_avarage_dist = 0;\n\t$guessed_keylength = 0;\n\tfor ($i=1; $i <= $distance; $i++) { \n\t\t//echo \"<br>#### distance%i: \".($distance%$i).\"<br>\";\n\t\tif (($distance%$i)==0) {\n\t\t\t$keylength = $distance/$i; // sottomultipli $distance\n\n\t\t\tif ($keylength>2) {\n\t\t\t\t//echo \"<br>######## keylengths: \".($keylengths).\"<br>\";\n\t\t\t\t$array_blocchi_testo = $this->helper->unique_split_to_array($cypher, $keylength);\n\t\t\t\t//print_r($array_blocchi_testo);\n\t\t\t\t$d_crypt = 0;\n\t\t\t\t$somma_d_crypt = 0;\n\t\t\t\tfor ($j=0; $j < count($array_blocchi_testo)-1; $j += 2) { \n\t\t\t\t\t$str1 = $array_blocchi_testo[$j];\n\t\t\t\t\t$str2 = $array_blocchi_testo[$j+1];\n\n\t\t\t\t\tif (strlen($str1) == strlen($str2)) {\n\t\t\t\t\t\t$d_crypt = $this->helper->hamming_distance($str1, $str2)/$keylength;\n\t\t\t\t\t}\n\n\t\t\t\t\t$somma_d_crypt = $somma_d_crypt + $d_crypt;\n\n\t\t\t\t}\n\t\t\t\t//echo \"<br>######## j-2\".($j-2).\"<br>\";\n\t\t\t\t$array_somme[] = array(\"avar_norm\"=>$somma_d_crypt/($j-2), \"keylength\"=>$keylength);\n\t\t\t}\n\t\t}\n\n\t}\n\tset_time_limit(30);\n\n\tusort($array_somme, function($a, $b) {\n\t\t$el1 = $a['avar_norm'];\n\t\t$el2 = $b['avar_norm'];\n\n\t\tif ($el1 == $el2) return 0;\n\n\t\treturn ($el1 < $el2) ? -1 : 1;\n\t});\n\n\t$keylength_candidata = $array_somme[0]['keylength'];\n\n\t$array_blocchi_testo_keylength = $this->helper->unique_split_to_array($cypher, $keylength_candidata);\n\n\t/*echo \"<pre>\";\n\tprint_r($array_blocchi_testo_keylength);\n\techo \"</pre>\";*/\n\n\t/*$array_string = array();\n\tfor ($i=0; $i<$keylength_candidata; $i++) { \n\t\t$partial_string = '';\n\t\tforeach ($array_blocchi_testo_keylength as $string) {\n\t\t\t$partial_string .= $string[$i];\n\t\t}\n\t\t$array_string[$i] = $this->base64_to_hex($partial_string);\n\n\t\techo \"<pre>\";\n\t\tprint_r($this->single_byte_xor_cipher($array_string[$i], \n\t\t\t\t\t\t\t\t\t\t \t 16, \n\t\t\t\t\t\t\t\t\t\t \t array('min'=>0, 'max'=>255),\n\t\t\t\t\t\t\t\t\t\t \t array('total_letter'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'first_letter'=>0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'second_letter'=>0))[0]);\n\t\techo \"</pre>\";\n\n\t\techo \"<br>################################################</br>\";\n\t}\n\n\t/*echo \"<pre>\";\n\tprint_r($array_string);\n\techo \"</pre>\";*/\n\n}", "public function encrypt($text)\n\t{\n\t\t// check that an iv is set, if required by the mode\n\t\t$this->mode->checkIV();\n\n\t\t// the encryption is done inside the mode\n\t\t$this->mode->encrypt($text);\n\t\treturn $text;\n\t}", "function encrypt( $key, $plaintext, $meta = '' ) {\n\n\t// Generate valid key\n\t$key = hash_pbkdf2( 'sha256', $key, '', 10000, 0, true );\n\n\t// Serialize metadata\n\t$meta = serialize($meta);\n\n\t// Derive two subkeys from the original key\n\t$mac_key = hash_hmac( 'sha256', 'mac', $key, true );\n\t$enc_key = hash_hmac( 'sha256', 'enc', $key, true );\n\t$enc_key = substr( $enc_key, 0, 32 );\n\n\t// Derive a \"synthetic IV\" from the nonce, plaintext and metadata\n\t$temp = $nonce = ( 16 > 0 ? mcrypt_create_iv( 16 ) : \"\" );\n\t$temp .= hash_hmac( 'sha256', $plaintext, $mac_key, true );\n\t$temp .= hash_hmac( 'sha256', $meta, $mac_key, true );\n\t$mac = hash_hmac( 'sha256', $temp, $mac_key, true );\n\t$siv = substr( $mac, 0, 16 );\n\n\t// Encrypt the message\n\t$enc = mcrypt_encrypt( 'rijndael-128', $enc_key, $plaintext, 'ctr', $siv );\n\treturn base64_encode( $siv . $nonce . $enc );\n\n}", "public function encrypt($string)\n {\n $key = $this->secretKey;\n //using hexadecimal\n $key = pack('H*', (string)$key);\n\n //$keySize = self::getKeySize($key);\n $iv = self::getIv();\n $cipherText = self::getCipherText($string, $key, $iv);\n\n //prepend the IV for it to be available for decryption\n $cipherText = $iv.$cipherText;\n\n return self::encode($cipherText);\n }", "function encrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Encrypt($string,$key);\r\n\treturn $result;\r\n}", "function simple_encode($data, $passwd, $method='aes-128-cbc', $options=0, $iv='SomeA1AweS0meK5y') {\n return openssl_encrypt ($data, $method, $passwd, $options, $iv);\n}", "public static function encrypt($data, $key, $iv, &$tag);", "public static function encrypt($textToEncrypt, $password, $nrBits)\r\n {\r\n $blockSize = 16;\r\n\r\n /**\r\n * AES permite utilizarea cheilor de criptare cu dimensiuni de 128/192/256 biti.\r\n */\r\n if (!($nrBits == 128 || $nrBits == 192 || $nrBits == 256)) {\r\n return '';\r\n }\r\n\r\n /**\r\n * Folosim algoritmul AES pentru criptarea parolei cu care, mai apoi, vom cripta textul.\r\n */\r\n $nBytes = $nrBits / 8;\r\n $pwBytes = array();\r\n for ($i = 0; $i < $nBytes; $i++) {\r\n $pwBytes[$i] = ord(substr($password, $i, 1)) & 0xff;\r\n }\r\n $key = AES::encryptByteArray($pwBytes, AES::keyExpansion($pwBytes));\r\n $key = array_merge($key, array_slice($key, 0, $nBytes - 16)); // marim cheia pana la 16/24/32 de octeti\r\n\r\n /**\r\n * Avem nevoie de a initializa primii 8 octeti cu valori aleatorii, care vor fi unice pentru fiecare incercare de criptare.\r\n */\r\n $counterBlock = array();\r\n $nonce = floor(microtime(true) * 1000);\r\n $nonceMs = $nonce % 1000;\r\n $nonceSec = floor($nonce / 1000);\r\n $nonceRnd = floor(rand(0, 0xffff));\r\n\r\n for ($i = 0; $i < 2; $i++) {\r\n $counterBlock[$i] = self::unsignedRightShift($nonceMs, $i * 8) & 0xff;\r\n }\r\n for ($i = 0; $i < 2; $i++) {\r\n $counterBlock[$i + 2] = self::unsignedRightShift($nonceRnd, $i * 8) & 0xff;\r\n }\r\n for ($i = 0; $i < 4; $i++) {\r\n $counterBlock[$i + 4] = self::unsignedRightShift($nonceSec, $i * 8) & 0xff;\r\n }\r\n\r\n /**\r\n * Transformam din ASCII in caractere\r\n */\r\n $ctrTxt = '';\r\n for ($i = 0; $i < 8; $i++) {\r\n $ctrTxt .= chr($counterBlock[$i]);\r\n }\r\n\r\n /**\r\n * Generam un array din cheia cifrata, pe care-l vom folosi la criptarea textului.\r\n * La fiecare etapa de criptare vom folosi o anumita parte din cheie.\r\n */\r\n $keySchedule = AES::keyExpansion($key);\r\n\r\n $blockCount = ceil(strlen($textToEncrypt) / $blockSize);\r\n $ciphertxt = array();\r\n\r\n for ($b = 0; $b < $blockCount; $b++) {\r\n for ($c = 0; $c < 4; $c++) {\r\n $counterBlock[15 - $c] = self::unsignedRightShift($b, $c * 8) & 0xff;\r\n }\r\n for ($c = 0; $c < 4; $c++) {\r\n $counterBlock[15 - $c - 4] = self::unsignedRightShift($b / 0x100000000, $c * 8) & 0xff;\r\n }\r\n\r\n $cipherCntr = AES::encryptByteArray($counterBlock, $keySchedule);\r\n\r\n $blockLength = $b < $blockCount - 1 ? $blockSize : (strlen($textToEncrypt) - 1) % $blockSize + 1;\r\n $cipherByte = array();\r\n\r\n for ($i = 0; $i < $blockLength; $i++) {\r\n $cipherByte[$i] = $cipherCntr[$i] ^ ord(substr($textToEncrypt, $b * $blockSize + $i, 1));\r\n $cipherByte[$i] = chr($cipherByte[$i]);\r\n }\r\n $ciphertxt[$b] = implode('', $cipherByte);\r\n }\r\n\r\n $ciphertext = $ctrTxt.implode('', $ciphertxt);\r\n $ciphertext = base64_encode($ciphertext);\r\n\r\n return $ciphertext;\r\n }", "function crypt_data($string, $action = 'e') \n{\n $secret_key \t= \"@#@ @@&&*$ bhufjg *@ !@#432 3783\"; // 32bits\n\n $secret_iv \t\t= md5('sA*(DH');\n $secret_iv \t\t= md5($secret_iv);\n\n $output \t\t= false;\n $encrypt_method = \"AES-256-CBC\";\n $key \t\t\t= hash('sha256', $secret_key);\n $iv \t\t\t= substr(hash('sha256', $secret_iv), 0, 16);\n\n \n if ($action == 'e') {\n $output = base64_encode(openssl_encrypt($string, $encrypt_method, $key, 0, $iv));\n } elseif ($action == 'd') {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n}", "function encrypt($plaintext)\n {\n $plaintext = strtolower($plaintext);\n $ciphertext = \"\";\n \n for ( $i = 0; $i < strlen($plaintext); $i++ )\n {\n $x = $this->alphabet->indexOf($plaintext[$i]);\n $encodedIndex = mod(($x + $this->shift), $this->alphabet->sizeOf());\n $ciphertext = $ciphertext . ($this->alphabet->get($encodedIndex)[0]);\n }\n return $ciphertext;\n }", "protected function generateEncryptionKeyIfNeeded() {}", "public function encryptionCryptEncryptBase64(UnitTester $I)\n {\n $I->wantToTest('Encryption\\Crypt - encryptBase64()');\n\n $tests = [\n md5(uniqid()) => str_repeat('x', mt_rand(1, 255)),\n time() . time() => str_shuffle('abcdefeghijklmnopqrst'),\n 'le$ki12432543543543543' => '',\n ];\n\n $ciphers = [\n 'AES-128-CBC',\n 'AES-128-CFB',\n 'AES-128-OFB',\n 'AES128',\n ];\n\n $crypt = new Crypt();\n\n foreach ($ciphers as $cipher) {\n $crypt->setCipher($cipher);\n\n foreach ($tests as $key => $test) {\n $crypt->setKey(substr($key, 0, 16));\n\n $encryption = $crypt->encryptBase64($test);\n $actual = rtrim($crypt->decryptBase64($encryption), \"\\0\");\n $I->assertSame($test, $actual);\n }\n\n foreach ($tests as $key => $test) {\n $encryption = $crypt->encryptBase64(\n $test,\n substr($key, 0, 16)\n );\n\n $actual = rtrim(\n $crypt->decryptBase64(\n $encryption,\n substr($key, 0, 16)\n ),\n \"\\0\"\n );\n\n $I->assertSame($test, $actual);\n }\n }\n }", "public function testEncryptPadding(): void\n {\n $rc2 = new RC2('ecb');\n\n // unlike Crypt_AES / Crypt_Rijndael, when you tell Crypt_RC2 that the key length is 128-bits the key isn't null padded to that length.\n // instead, RC2 key expansion is used to extend it out to that length. this isn't done for AES / Rijndael since that doesn't define any\n // sort of key expansion algorithm.\n\n // admittedly, phpseclib is inconsistent in this regard. RC4 and Blowfish support arbitrary key lengths between a certain range, as well,\n // and they don't have any way to set the key length. but then again, neither do those algorithms have their own key expansion algorithm,\n // whereas RC2 does. and technically, AES / Rijndael (and even Twofish) don't support arbitrary key lengths - they support variable key\n // lengths. so in some ways, i suppose this inconsistency somewhat makes sense, although the fact that Crypt_Twofish doesn't have a\n // setKeyLength() function whereas Crypt_AES / Crypt_Rijndael do not is, itself, an inconsistency.\n\n // but that said, Crypt_RC2 is inconsistent in other ways: if you pass a 128-bit (16-byte) key to it via setKey() the key is not treated\n // as a 128-bit key but rather as a 1024-bit key and is expanded accordingly, not via null padding, but via RC2's key expansion algorithm.\n\n // this behavior is in contrast to mcrypt, which extends keys via null padding to 1024 bits. it is also in contrast to OpenSSL, which\n // extends keys, via null padding, to 128 bits. mcrypt's approach seems preferable as one can simulate 128 bit keys by using RC2's\n // key expansion algorithm to extend the key to 1024 bits and then changing the first byte of the new key with an inverse pitable mapping.\n // in contrast, to my knowledge, there is no technique for expanding a key less than 128 bits to 128 bits, via RC2 key expansion. the only\n // scenario in that regard is null padding.\n\n // simple truncation is insufficient, since, quoting RFC2268, \"the purpose of the key-expansion algorithm [in RC2] is to modify the key buffer\n // so that each bit of the expanded key depends in a complicated way on every bit of the supplied input key\".\n\n // now, to OpenSSL's credit, null padding is internally consistent with OpenSSL. OpenSSL only supports fixed length keys. For rc2, rc4 and\n // bf (blowfish), all keys are 128 bits (or are null padded / truncated accordingly). to use 40-bit or 64-bit keys with RC4 with OpenSSL you\n // don't use the rc4 algorithm - you use the rc4-40 or rc4-64 algorithm. and similarly, it's not aes-cbc that you use - it's either aes-128-cbc\n // or aes-192-cbc or aes-256-cbc. this is in contrast to mcrypt, which (with the exception of RC2) actually supports variable and arbitrary\n // length keys.\n\n // superficially, it seens like Rijndael would be another exception to mcrypt's key length handling, but it in fact is not. the reason being that,\n // with mcrypt, when you specify MCRYPT_RIJNDAEL_128 or MCRYPT_RIJNDAEL_192 or MCRYPT_RIJNDAEL_256 the numbers at the end aren't referring to the\n // key length, but rather, the block length. ie. Rijndael, unlike most block ciphers, doesn't just have a variable (but not arbitrary) key length -\n // it also has a variable block length. AES's block length, however, is not variable, so technically, only MCRYPT_RIJNDAEL_128 is AES.\n\n $rc2->setKey(str_repeat('d', 16), 128);\n\n $rc2->setPreferredEngine('PHP');\n $internal = $rc2->encrypt('d');\n\n $result = pack('H*', 'e3b36057f4821346');\n $this->assertEquals($result, $internal, 'Failed asserting that the internal engine produced the correct result');\n\n $rc2->setPreferredEngine('OpenSSL');\n if ($rc2->getEngine() == 'OpenSSL') {\n $openssl = $rc2->encrypt('d');\n $this->assertEquals($result, $openssl, 'Failed asserting that the OpenSSL engine produced the correct result');\n } else {\n self::markTestSkipped('Unable to initialize OpenSSL engine');\n }\n }", "function encrypt_decrypt($action, $string, $key, $iv) {\n\t//global $config;\n\t$secret_key = $key;\n\t$secret_iv = $iv;\n\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if ( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if( $action == 'decrypt' ) {\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "public static function encrypt( $plaintext, $cipherParams ) {\n $raw = defined( 'OPENSSL_RAW_DATA' ) ? OPENSSL_RAW_DATA : true;\n\n $ciphertext = openssl_encrypt( $plaintext, $cipherParams->getAlgorithmString(), $cipherParams->key, $raw, $cipherParams->iv ?? '' );\n\n if ($ciphertext === false) {\n return false;\n }\n\n $iv = $cipherParams->iv;\n\n self::updateIV( $cipherParams );\n\n return $iv.$ciphertext;\n }", "public function encrypt($message)\n {\n if (is_null($message)) {\n return $message;\n }\n\n $init_size = \\openssl_cipher_iv_length($this->cipher);\n $init_vect = \\openssl_random_pseudo_bytes($init_size);\n\n $message_padded = $message;\n if (strlen($message_padded) % $init_size) {\n $padLength = strlen($message_padded) + $init_size - strlen($message_padded) % $init_size;\n $message_padded = str_pad($message_padded, $padLength, \"\\0\");\n }\n\n $value = \\openssl_encrypt(\n $message_padded,\n $this->cipher,\n $this->getKey(),\n $this->encryptOptions,\n $init_vect\n );\n $value = $this->addCipherNoise($init_vect . $value, $this->getKey());\n\n return trim(base64_encode($value));\n }", "function decrypt($ciphertext)\n {\n if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) {\n $this->_mcryptSetup();\n\n if ($this->mode == 'ncfb' && $this->continuousBuffer) {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 16 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 16) {\n $cb = substr($ciphertext, $i, $len - $len % 16);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -16);\n $len%= 16;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n\n return $plaintext;\n }\n\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 15) & 0xFFFFFFF0, chr(0));\n }\n\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n return parent::decrypt($ciphertext);\n }", "function encrypt_decrypt($action, $string) {\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_key = 'This is my secret key';\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n \n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n if( $action == 'encrypt' ) {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n }\n else if( $action == 'decrypt' ){\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n return $output;\n}", "public function testEncrypt()\n\t{\n\t\t$this->assertEquals(mcrypt_encrypt('blowfish', 's3cret', \"a test string\", MCRYPT_MODE_ECB), $this->Crypt_MCrypt->encrypt(\"a test string\"));\n\t}", "public static function encrypt($data, $key) {\n self::iv($key);\n return bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, self::$key, $data, MCRYPT_MODE_ECB, self::$iv));\n }", "public function encrypt($plaintext, $password = '') {\n\t\tif($password === '') {\n\t\t\t$password = $this->config->getSecret();\n\t\t}\n\t\t$this->cipher->setPassword($password);\n\t\t$iv = $this->random->getLowStrengthGenerator()->generate($this->ivLength);\n\t\t$this->cipher->setIV($iv);\n\t\t$ciphertext = bin2hex($this->cipher->encrypt($plaintext));\n\t\t$hmac = bin2hex($this->calculateHMAC($ciphertext.$iv, $password));\n\t\treturn $ciphertext.'|'.$iv.'|'.$hmac;\n\t}", "public function encryptor($action, $string) {\n $output = false;\n $encrypt_method = \"AES-256-CBC\";\n //pls set your unique hashing key\n $secret_key = 'chinu';\n $secret_iv = 'uk';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n\n //do the encyption given text/string/number\n if ($action == 'encrypt') {\n $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);\n $output = base64_encode($output);\n } else if ($action == 'decrypt') {\n //decrypt the given text/string/number\n $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }\n\n return $output;\n }", "public function encrypt($key,$iv,$toEncrypt) {\r\n\t\t\r\n\t\t$this->error = false;\r\n\t\t\r\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); //Size\r\n\t\tif(strlen($iv) != $iv_size){ //Size Wrong 16 CH\r\n\t\t\t$this->error = \"IV Size Wrong!\";\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t\r\n\t\t$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key,$toEncrypt, MCRYPT_MODE_CBC, $iv);\r\n\t\t\r\n\t\t$this->encrypt = base64_encode($ciphertext);\r\n\t\t\r\n\t\treturn (true);\r\n\t}", "function svc_encryp( $num, $key ) {\r\n\t$now = (new \\DateTime())->format('YmdHis');\r\n\t$tx0 = $now . substr( '00000000000' . $num, -11 );\r\n\r\n\t//creating array \r\n\t$arr0 = array();\r\n\tfor ( $i = 0; $i < 25 ; $i++ ) {\r\n\t\t$arr0[] = substr( $tx0, $i, 1 );\r\n\t}\r\n\r\n\t//storing consistency\r\n\t$chk = \r\n\t\t$arr0[0]+\r\n\t\t$arr0[1]*2+\r\n\t\t$arr0[2]+\r\n\t\t$arr0[3]+\r\n\t\t$arr0[4]*13+\r\n\t\t$arr0[5]+\r\n\t\t$arr0[6]+\r\n\t\t$arr0[7]+\r\n\t\t$arr0[8]*7+\r\n\t\t$arr0[9]+\r\n\t\t$arr0[10]+\r\n\t\t$arr0[11]+\r\n\t\t$arr0[12]+\r\n\t\t$arr0[13]*45+\r\n\t\t$arr0[14]+\r\n\t\t$arr0[15]+\r\n\t\t$arr0[16]+\r\n\t\t$arr0[17]*11+\r\n\t\t$arr0[18]-\r\n\t\t$arr0[19]-\r\n\t\t$arr0[20]-\r\n\t\t$arr0[21]-\r\n\t\t$arr0[22]-\r\n\t\t$arr0[23]+\r\n\t\t$arr0[24];\r\n\t\r\n\t$chk = $chk * $key;\r\n\r\n\t//concatenating with check for consistency\t\t\r\n\t$tx0 = $tx0 . substr( '000' . $chk, -3 );\r\n\r\n\t//creating new array \r\n\t$arr1 = array();\r\n\tfor ( $i = 0; $i < 28 ; $i++ ) {\r\n\t\t$arr1[] = substr( $tx0, $i, 1 );\r\n\t}\r\n\r\n\t//creating new array and changin positions\r\n\t$arr2 = array();\r\n\t$arr2[] = $arr1[9];\r\n\t$arr2[] = $arr1[0];\r\n\t$arr2[] = $arr1[23];\r\n\t$arr2[] = $arr1[4];\r\n\t$arr2[] = $arr1[17];\r\n\t$arr2[] = $arr1[1];\r\n\t$arr2[] = $arr1[7];\r\n\t$arr2[] = $arr1[14];\r\n\t$arr2[] = $arr1[27];\r\n\t$arr2[] = $arr1[15];\r\n\t$arr2[] = $arr1[19];\r\n\t$arr2[] = $arr1[5];\r\n\t$arr2[] = $arr1[20];\r\n\t$arr2[] = $arr1[16];\r\n\t$arr2[] = $arr1[11];\r\n\t$arr2[] = $arr1[6];\r\n\t$arr2[] = $arr1[12];\r\n\t$arr2[] = $arr1[8];\r\n\t$arr2[] = $arr1[2];\r\n\t$arr2[] = $arr1[13];\r\n\t$arr2[] = $arr1[22];\r\n\t$arr2[] = $arr1[10];\r\n\t$arr2[] = $arr1[26];\r\n\t$arr2[] = $arr1[18];\r\n\t$arr2[] = $arr1[21];\r\n\t$arr2[] = $arr1[3];\r\n\t$arr2[] = $arr1[25];\r\n\t$arr2[] = $arr1[24];\r\n\t\r\n\t//concatenating\r\n\t$tx1 = rand( 1, 9 ); //first character = dummy\r\n\tfor ( $i = 0; $i < 28 ; $i++ ) {\r\n\t\t$tx1 = $tx1 . $arr2[$i];\r\n\t}\r\n\r\n\treturn $tx1;\r\n\t\r\n}", "function encryptPassword()\n\t{\n\t\t$userPassword = $_POST['userPassword'];\n\n\t $key = pack('H*', \"bcb04b7e103a05afe34763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3\");\n\t $key_size = strlen($key);\n\n\t $plaintext = $userPassword;\n\n\t $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\t $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n\t $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaintext, MCRYPT_MODE_CBC, $iv);\n\t $ciphertext = $iv . $ciphertext;\n\n\t $userPassword = base64_encode($ciphertext);\n\n\t return $userPassword;\n\t}", "protected function chunkRows(bool $encrypt): void\n {\n $call = $encrypt ? 'encryptString' : 'decryptString';\n $encrypter = Crypt::getFacadeRoot();\n $query = DB::table('two_factor_authentications');\n\n $query->clone()->select('id', 'shared_secret', 'recovery_codes')\n ->chunkById(\n 1000,\n static function (Collection $chunk) use ($encrypter, $query, $call): void {\n DB::beginTransaction();\n foreach ($chunk as $item) {\n $query->clone()->where('id', $item->id)->update([\n 'shared_secret' => $encrypter->$call($item->shared_secret),\n 'recovery_codes' => $item->recovery_codes ? $encrypter->$call($item->recovery_codes) : null,\n ]);\n }\n DB::commit();\n }\n );\n }", "function customEncrypt($text, $key)\n {\n return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, padEncryptionSalt($key), $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));\n }", "public static function encrypt($v_text){\n\t\n\t\treturn mcrypt_encrypt(MCRYPT_BLOWFISH,Config::getVariable('blowfish_key'),$v_text,MCRYPT_MODE_CFB, CryptoUtil::$iv);\n\t\t\n\t}", "function encryptData($payload, $key) {\r\n \r\n $chiper = \"des-ede3\"; //Algorthim used to encrypt\r\n if((strlen($payload)%8)!=0) {\r\n //Perform right padding\r\n $payload = $this->rightPadZeros($payload);\r\n }\r\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($chiper));\r\n $encrypted = openssl_encrypt($payload, $chiper, $key,OPENSSL_RAW_DATA,$iv);\r\n \r\n $encrypted=unpack('C*', ($encrypted));\r\n $encrypted=$this->byteArray2Hex($encrypted);\r\n return strtoupper($encrypted); \r\n}", "public function encryption($store = null);", "function encrypt($pure_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$encrypted_string = mcrypt_encrypt(MCRYPT_BLOWFISH, $encryption_key, utf8_encode($pure_string), MCRYPT_MODE_ECB, $iv);\n\t\treturn $encrypted_string;\n\t}" ]
[ "0.615092", "0.6010846", "0.59849", "0.59708965", "0.58145046", "0.57784194", "0.5734786", "0.56484807", "0.56092525", "0.55364186", "0.54946417", "0.5492775", "0.548641", "0.5474624", "0.5423855", "0.5410865", "0.54020375", "0.53976184", "0.5324886", "0.5315803", "0.52990234", "0.52681667", "0.5240915", "0.5240437", "0.5235987", "0.5222702", "0.5210131", "0.52069366", "0.5189934", "0.5181973", "0.51657075", "0.51655287", "0.5149861", "0.51316756", "0.5129804", "0.51133865", "0.5099193", "0.5085204", "0.5073645", "0.5070108", "0.50506717", "0.50504124", "0.5049828", "0.50267", "0.5021759", "0.5009294", "0.5001444", "0.49976447", "0.49878827", "0.4984", "0.4983535", "0.49664307", "0.49624214", "0.49371427", "0.49350113", "0.49266672", "0.4920405", "0.49181998", "0.49122792", "0.49116525", "0.49037713", "0.4897067", "0.48920786", "0.48844463", "0.48689157", "0.4867738", "0.4863178", "0.48619488", "0.485665", "0.4856646", "0.48527902", "0.48520747", "0.4850093", "0.4840298", "0.483857", "0.4829893", "0.48154613", "0.48050925", "0.48031032", "0.47970527", "0.47960526", "0.47851816", "0.47731358", "0.475165", "0.47424698", "0.47307485", "0.47215214", "0.4720416", "0.4720091", "0.47068083", "0.46989375", "0.4698105", "0.46940553", "0.4693386", "0.46896577", "0.46887544", "0.46842685", "0.46692163", "0.4666967", "0.46633068" ]
0.66266936
0
Decrypts a block Optimized over Crypt_Rijndael's implementation by means of loop unrolling.
function _decryptBlock($in) { $state = unpack('N*', $in); $sbox = $this->isbox; $dw = $this->dw; $dt0 = $this->dt0; $dt1 = $this->dt1; $dt2 = $this->dt2; $dt3 = $this->dt3; // addRoundKey $s0 = $state[1] ^ $dw[4]; $s1 = $state[2] ^ $dw[5]; $s2 = $state[3] ^ $dw[6]; $s3 = $state[4] ^ $dw[7]; // invShiftRows + invSubBytes + invMixColumns + addRoundKey $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[8]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[9]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[10]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[11]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[12]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[13]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[14]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[15]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[16]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[17]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[18]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[19]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[20]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[21]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[22]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[23]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[24]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[25]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[26]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[27]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[28]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[29]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[30]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[31]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[32]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[33]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[34]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[35]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[36]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[37]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[38]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[39]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[40]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[41]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[42]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[43]; switch ($this->Nr) { case 10: break; case 14: $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[56]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[57]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[58]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[59]; break; case 12: $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51]; break; case 13: $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46]; $s3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47]; $e0 = $dt0[($s0 >> 24) & 0xff] ^ $dt1[($s3 >> 16) & 0xff] ^ $dt2[($s2 >> 8) & 0xff] ^ $dt3[$s1 & 0xff] ^ $dw[48]; $e1 = $dt0[($s1 >> 24) & 0xff] ^ $dt1[($s0 >> 16) & 0xff] ^ $dt2[($s3 >> 8) & 0xff] ^ $dt3[$s2 & 0xff] ^ $dw[49]; $e2 = $dt0[($s2 >> 24) & 0xff] ^ $dt1[($s1 >> 16) & 0xff] ^ $dt2[($s0 >> 8) & 0xff] ^ $dt3[$s3 & 0xff] ^ $dw[50]; $e3 = $dt0[($s3 >> 24) & 0xff] ^ $dt1[($s2 >> 16) & 0xff] ^ $dt2[($s1 >> 8) & 0xff] ^ $dt3[$s0 & 0xff] ^ $dw[51]; $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[52]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[53]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[54]; $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[55]; // Note: Here we skip $s3 but using $e3 $e0 = $s0; $e1 = $s1; $e2 = $s2; // $e3 = $s3; break; default: // 11 $s0 = $dt0[($e0 >> 24) & 0xff] ^ $dt1[($e3 >> 16) & 0xff] ^ $dt2[($e2 >> 8) & 0xff] ^ $dt3[$e1 & 0xff] ^ $dw[44]; $s1 = $dt0[($e1 >> 24) & 0xff] ^ $dt1[($e0 >> 16) & 0xff] ^ $dt2[($e3 >> 8) & 0xff] ^ $dt3[$e2 & 0xff] ^ $dw[45]; $s2 = $dt0[($e2 >> 24) & 0xff] ^ $dt1[($e1 >> 16) & 0xff] ^ $dt2[($e0 >> 8) & 0xff] ^ $dt3[$e3 & 0xff] ^ $dw[46]; $e3 = $dt0[($e3 >> 24) & 0xff] ^ $dt1[($e2 >> 16) & 0xff] ^ $dt2[($e1 >> 8) & 0xff] ^ $dt3[$e0 & 0xff] ^ $dw[47]; // Note: Here we skip $s3 but using $e3 $e0 = $s0; $e1 = $s1; $e2 = $s2; // $e3 = $s3; } // invSubWord $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24); $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24); $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24); $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24); // invShiftRows + addRoundKey return pack('N*', ($e0 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $dw[0], ($e1 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $dw[1], ($e2 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $dw[2], ($e3 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $dw[3] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decrypt($ciphertext)\r\n {\r\n $this->_setup();\r\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\r\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\r\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + $this->block_size - 1) % $this->block_size, chr(0));\r\n\r\n $plaintext = '';\r\n switch ($this->mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $this->block_size));\r\n }\r\n break;\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $xor = $this->decryptIV;\r\n for ($i = 0; $i < strlen($ciphertext); $i+=$this->block_size) {\r\n $block = substr($ciphertext, $i, $this->block_size);\r\n $plaintext.= $this->_decryptBlock($block) ^ $xor;\r\n $xor = $block;\r\n }\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = $xor;\r\n }\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }", "public function decrypt();", "function decrypt($ciphertext)\n {\n if ( CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT ) {\n $this->_mcryptSetup();\n\n if ($this->mode == 'ncfb' && $this->continuousBuffer) {\n $iv = &$this->decryptIV;\n $pos = &$this->debuffer['pos'];\n $len = strlen($ciphertext);\n $plaintext = '';\n $i = 0;\n if ($pos) {\n $orig_pos = $pos;\n $max = 16 - $pos;\n if ($len >= $max) {\n $i = $max;\n $len-= $max;\n $pos = 0;\n } else {\n $i = $len;\n $pos+= $len;\n $len = 0;\n }\n // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize\n $plaintext = substr($iv, $orig_pos) ^ $ciphertext;\n $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i);\n }\n if ($len >= 16) {\n $cb = substr($ciphertext, $i, $len - $len % 16);\n $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;\n $iv = substr($cb, -16);\n $len%= 16;\n }\n if ($len) {\n $iv = mcrypt_generic($this->ecb, $iv);\n $plaintext.= $iv ^ substr($ciphertext, -$len);\n $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);\n $pos = $len;\n }\n\n return $plaintext;\n }\n\n if ($this->paddable) {\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 15) & 0xFFFFFFF0, chr(0));\n }\n\n $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);\n\n if (!$this->continuousBuffer) {\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n\n return $this->paddable ? $this->_unpad($plaintext) : $plaintext;\n }\n\n return parent::decrypt($ciphertext);\n }", "protected function decryptBlock($data) {\r\n return $this->encryptBlock($data);\r\n }", "protected function decryptBlock($data) {\r\n return $this->encryptBlock($data);\r\n }", "protected function _decrypt()\n {\n switch ($this->_cypherUsed) {\n case self::CYPHER_BASIC:\n //break ommited on purpose\n\n default:\n $result = '';\n $string = base64_decode($this->_encryptedText);\n for ($i = 0; $i < strlen($string); $i++) {\n $char = substr($string, $i, 1);\n $keychar = substr($this->_keyString, ($i % strlen($this->_keyString)) - 1, 1);\n $char = chr(ord($char) - ord($keychar));\n $result .= $char;\n }\n $this->_plainText = $result;\n break;\n }\n }", "abstract public function decrypt($data);", "static function decrypt($encrypted){\n # Separate the encrypted data from the initialization vector ($iv)\n $data = explode('~~~', base64_decode($encrypted));\n # Decrypt the data\n if(isset($data[1])){\n $decryptedMessage = openssl_decrypt($data[0], \"AES-256-CBC\", self::getEncryptKey(), 0, $data[1]);\n return $decryptedMessage;\n } else {\n return $encrypted;\n }\n }", "function decryptBlock($privateKey, $msg){\n\treturn bcmod(bcpow($msg, $privateKey->other), $privateKey->N);\n}", "function decrypt($string) {\n\t\t\t// Apply base64 decoding if necessary\n\t\t\tif($this->base64) $string = base64_decode($string);\n\t\t\t\n\t\t\t// Extract encrypted IV from input\n\t\t\t$tmp_iv = substr($string,0,$this->hash_length);\n\t\t\t\n\t\t\t// Extract encrypted message from input\n\t\t\t$string = substr($string,$this->hash_length,strlen($string) - $this->hash_length);\n\t\t\t$iv = $out = '';\n\t\t\t\n\t\t\t// Regenerate IV by xor-ing encrypted IV from block 1 and $this->hashed_key\n\t\t\t// Mathematics: (IV XOR KeY) XOR Key = IV\n\t\t\tfor($c=0;$c < $this->hash_length;$c++) \n\t\t\t{\n\t\t\t\t$iv .= chr(ord($tmp_iv[$c]) ^ ord($this->hash_key[$c]));\n\t\t\t}\n\t\t\t// Use IV as key for decrypting the first block cyphertext\n\t\t\t$key = $iv;\n\t\t\t$c = 0;\n\t\t\t\n\t\t\t// Loop through the whole input string\n\t\t\twhile($c < strlen($string)) {\n\t\t\t\t// If we have used all characters of the current key we switch to a new one\n\t\t\t\tif(($c != 0) and ($c % $this->hash_length == 0)) {\n\t\t\t\t\t// New key is the hash of current key and last block of plaintext\n\t\t\t\t\t$key = $this->_hash($key . substr($out,$c - $this->hash_length,$this->hash_length));\n\t\t\t\t}\n\t\t\t\t// Generate output by xor-ing input and key character for character\n\t\t\t\t$out .= chr(ord($key[$c % $this->hash_length]) ^ ord($string[$c]));\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\treturn $out;\n\t\t}", "public function decrypt() \r\n {\r\n //TODO: Implement decrypt method\r\n }", "public static function aes256Decrypt($key, $data) {}", "static public function decrypt($data,$key) {\r\n $iv= substr($data, 0,16); \r\n $data=substr($data,16);\r\n // 128 is blocksize, not keysize!\r\n $out=mcrypt_decrypt(MCRYPT_RIJNDAEL_128,$key,$data,MCRYPT_MODE_CBC, $iv);\r\n $padlen=ord(substr($out,-1));\r\n return substr($out,0, strlen($out)-$padlen);\r\n }", "public function decryptCBC($encryptStr) {\n $localIV = $this->ivCBC;\n $encryptKey = $this->secret_key;\n $module = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, $localIV);\n\n mcrypt_generic_init($module, $encryptKey, $localIV);\n\n $encryptedData = base64_decode($encryptStr);\n $encryptedData = mdecrypt_generic($module, $encryptedData);\n\n return $encryptedData;\n }", "public function decrypt($data)\n {\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($this->key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key,\n 0, $iv);\n }", "function aes256_cbc_decrypt($key, $data, $iv) {\n $data = openssl_decrypt($data, \"aes-256-cbc\", $key, OPENSSL_RAW_DATA, $iv);\n return $data;\n}", "protected function _decrypt() {}", "protected function _decrypt() {}", "function new_decrypt($data, $key) {\n if(empty($key)){\n $key = $encryption_key;\n }\n // Remove the base64 encoding from our key\n $encryption_key = base64_decode($key);\n // To decrypt, split the encrypted data from our IV - our unique separator used was \"::\"\n list($encrypted_data, $iv) = explode('::', base64_decode($data), 2);\n return openssl_decrypt($encrypted_data, 'aes-256-cbc', $encryption_key, 0, $iv);\n}", "function decryptData($openssl_data, $openssl_pass, $openssl_iv){\n\t$method = 'AES-256-CBC';\n\n\tif(strlen($openssl_iv) > '128'){\n\t\t$openssl_iv = substr($openssl_iv, 0, 128);\n\t}\n\n\treturn trim(openssl_decrypt($openssl_data, $method, $openssl_pass, FALSE, $openssl_iv));\n}", "public function decrypt($text)\n\t{\n\t\t// check that an iv is set, if required by the mode\n\t\t$this->mode->checkIV();\n\n\t\t// the decryption is done inside the mode\n\t\t$this->mode->decrypt($text);\n\t\treturn $text;\n\t}", "function aes256Decrypt($ciphertext, $password) {\n // hash the key\n $key = pack(\"H*\", substr(hash(\"sha512\", $password), 0, 64));\n\n // divide the initialization vector and encrypted data\n $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $rawBlock = base64_decode($ciphertext);\n $rawIv = substr($rawBlock, 0, $ivSize);\n $rawCiphertext = substr($rawBlock, $ivSize);\n\n // unpad the plaintext before returning it\n try {\n $plaintext = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $rawCiphertext, MCRYPT_MODE_CBC, $rawIv);\n $plaintext = pkcs5Unpad($plaintext);\n } catch(InvalidArgumentException $invalidArgument) {\n throw(new InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n }\n return($plaintext);\n}", "public function decrypt( $ciphertext ) {\n\t\tif ( CRYPT_ENGINE_OPENSSL == $this->engine ) {\n\t\t\t$temp = $this->key;\n\t\t\t$this->key = $this->orig_key;\n\t\t\t$result = parent::decrypt( $ciphertext );\n\t\t\t$this->key = $temp;\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn parent::decrypt( $ciphertext );\n\t}", "public function decrypt($cipherText, $secretKey);", "function openssl_private_decrypt($data, &$decrypted, $key, $padding = false)\n{\n}", "public function AesDecrypt ($buffer, $key)\r\n\t{\r\n\t\tif (strlen ($key) != 32)\r\n\t\t{\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\t\r\n\t\t$buffer = $this->_hex2bin ($buffer);\r\n\t\t\r\n\t\t$size = mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);\r\n\r\n\t\tif ($size > strlen ($buffer))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$iv = substr ($buffer, 0, $size);\t\t\r\n\t\t$buffer = substr ($buffer, $size);\r\n\t\t\r\n\t\treturn rtrim (mcrypt_decrypt (MCRYPT_RIJNDAEL_256, $key, $buffer, MCRYPT_MODE_CBC, $iv) );\r\n\t}", "function decrypt($string, $key = 'mykey', $secret = 'SecretKey', $method = 'AES-256-CBC') {\n // hash\n $key = hash('sha256', $key);\n // create iv - encrypt method AES-256-CBC expects 16 bytes\n $iv = substr(hash('sha256', $secret), 0, 16);\n // decode\n $string = base64_decode($string);\n // decrypt\n return openssl_decrypt($string, $method, $key, 0, $iv);\n }", "public static function decrypt($string) {\n $secret_key = Config::get('constants.DEFAULT_DATA.ENC_SECRET');\n $output = false;\n\n $encrypt_method = \"AES-256-CBC\";\n $secret_iv = 'This is my secret iv';\n\n // hash\n $key = hash('sha256', $secret_key);\n\n // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n $iv = substr(hash('sha256', $secret_iv), 0, 16);\n return openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);\n }", "function decryptData($encryptedString)\r\n\t\t{\r\n\t\t$arrayDataReturn\t= null;\r\n\t\t$baseString \t\t\t= urldecode($encryptedString);\r\n\t\t$arrayDataLine\t\t= explode('#|#',$baseString);\t// Breakes blocks apart (Block = key ~|~ value ~|~ md5 hash)\r\n\t\t\r\n\t\tif(!is_array($arrayDataLine)) return null;\r\n\t\t\r\n\t\tforeach($arrayDataLine as $value) {\r\n\t\t\t$arrayTemp = explode('~|~',$value);\t// The Block is split in 3 sub-blocks\r\n\t\t\tif(!is_array($arrayTemp) || count($arrayTemp) != 3) continue;\r\n\t\t\t\r\n\t\t\tlist($key,$value,$md5hash) = $arrayTemp;\r\n\t\t\t$key = str_rot13($key);\r\n\t\t\t$value = str_rot13($value);\r\n\t\t\t\r\n\t\t\tif($md5hash == md5($key . $value . $this->_confuser)){\r\n\t\t\t\t$arrayDataReturn[$key] = $value;\r\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t//debug($key . ' V:' . $value,1);\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $arrayDataReturn;\r\n\t}", "public function decrypt($data, $deterministic);", "function MyJamiaDecrypt($str) {\n\n\t\t// Store the cipher method \n\t\t$ciphering = \"AES-128-CTR\"; \n \n\t\t// Use OpenSSl Encryption method \n\t\t$iv_length = openssl_cipher_iv_length($ciphering); \n\t\t$options = 0; \n\t\t\t\t\n\t\t// Non-NULL Initialization Vector for decryption \n\t\t$decryption_iv = '1234567891011121'; \n\t\t \n\t\t// Store the decryption key \n\t\t$decryption_key = \"MyJamiaEncryptionString\"; \n\t\t \n\t\t// Use openssl_decrypt() function to decrypt the data \n\t\treturn openssl_decrypt ($str, $ciphering, \n\t\t $decryption_key, $options, $decryption_iv); \t \n\t}", "public function decrypt($cypher){\n\t\t$cypher = str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "function decrypt($cypher){\n\t\t$cypher =str_replace('%20','+',str_replace(' ','+',$cypher));\t\t\t\n\t\treturn trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->key, base64_decode($cypher), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n }", "public function decrypt($ciphertext) {\n\t\t\n\t\t$key = self::PWD; // Password is set above at the Constants\n\t\t$ciphertext = hex2bin($ciphertext);\n\t\t$c = base64_decode($ciphertext);\n\t\t$ivlen = openssl_cipher_iv_length($cipher=\"AES-256-CTR\");\n\t\t$iv = substr($c, 0, $ivlen);\n\t\t$hmac = substr($c, $ivlen, $sha2len=32);\n\t\t$ciphertext_raw = substr($c, $ivlen+$sha2len);\n\t\t$original_plaintext = openssl_decrypt($ciphertext_raw, $cipher, $key, $options=OPENSSL_RAW_DATA, $iv);\n\t\t$calcmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);\n\t\t\n\t\tif (hash_equals($hmac, $calcmac)) { //PHP 5.6+ timing attack safe comparison\n\t\t\treturn $original_plaintext;\n\t\t}\n\t}", "public static function decrypt($data)\r\n {\r\n return openssl_decrypt(\r\n base64_decode($data),\r\n self::OPENSSL_CIPHER_NAME,\r\n self::ENCRYPTION_KEY,\r\n OPENSSL_RAW_DATA,\r\n self::ENCRYPTION_IV\r\n );\r\n }", "public function decrypt($data)\n {\n $this->cwsDebug->titleH2('Decrypt data');\n\n if (empty($this->encryptionKey)) {\n $this->error = 'You have to set the encryption key...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n if (empty($data)) {\n $this->error = 'Data empty...';\n $this->cwsDebug->error($this->error);\n\n return;\n }\n\n $this->cwsDebug->labelValue('Encryption key', $this->encryptionKey);\n $this->cwsDebug->dump('Encrypted data', strval($data));\n\n $result = null;\n $td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CFB, '');\n\n $ivsize = mcrypt_enc_get_iv_size($td);\n $iv = substr($data, 0, $ivsize);\n $key = $this->validateKey($this->encryptionKey, mcrypt_enc_get_key_size($td));\n\n if ($iv) {\n $data = substr($data, $ivsize);\n mcrypt_generic_init($td, $key, $iv);\n $decryptData = mdecrypt_generic($td, $data);\n $result = $this->decode($decryptData);\n }\n\n $this->cwsDebug->dump('Data', $result);\n\n return $result;\n }", "public static function decrypt($data, $key) {\n self::iv($key);\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, self::$key, hex2bin($data), MCRYPT_MODE_ECB, self::$iv));\n }", "protected function doDecrypt($payload)\n {\n $nonce = $this->extractNonce($payload);\n $ciphertext = $this->extractCipherText($payload);\n\n switch ($this->cipher) {\n case static::CIPHER_AES_256:\n return sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_CHACHA:\n return sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_CHACHA_IETF:\n return sodium_crypto_aead_chacha20poly1305_ietf_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n case static::CIPHER_X_CHACHA_IETF:\n return sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $nonce, $nonce, $this->getKey());\n\n default:\n return false;\n }\n }", "public function decrypt($string)\n {\n $key = $this->secretKey;\n //using hexadecimal\n $key = pack('H*', (string)$key);\n\n $cipherText = self::decode($string);\n\n $ivSize = self::getIvSize();\n //retrieves the IV, iv_size should be created using mcrypt_get_iv_size()\n $iv = substr($cipherText, 0, $ivSize);\n\n //retrieves the cipher text (everything except the $iv_size in the front)\n $cipherText = substr($cipherText, $ivSize);\n $decrypted = self::getPlainText($cipherText, $key, $iv);\n $decrypted = rtrim($decrypted, \"\\0\\4\");\n\n return $decrypted;\n }", "function decrypt($encrypted_string, $decryption_key){\r\n $ciphering = \"AES-128-CTR\";\r\n $options = 0;\r\n $decryption_iv = '1234567891011121';\r\n $string = openssl_decrypt ($encrypted_string, $ciphering, $decryption_key, $options, $decryption_iv);\r\n return $string;\r\n}", "function fsl_decrypt($string, $key = NULL){\n\n //set key to default key if no key passed to function \n $encryption_key = (empty($key)) ? option('fsl_global_encryption_key') : $key;\n\n // To decrypt, separate the encrypted data from the initialization vector ($iv).\n $parts = explode(':', $string);\n\n // Don't forget to base64-decode the $iv before feeding it back to\n //openssl_decrypt\n $decrypted = openssl_decrypt($parts[0], 'aes-256-cbc', $encryption_key, 0, base64_decode($parts[1]));\n return $decrypted;\n}", "function decrypt($ciphertext, $passphrase, $iv) {\n try {\n\t\t$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $passphrase, $ciphertext, MCRYPT_MODE_CBC, $iv);\n\t\treturn unpad_pkcs5($decrypted);\n } catch (Exception $e) {\n echo \"Encryption exception in decrypt: \" . $e->getMessage() . \"\\n\";\n }\n}", "public static function decrypt($string)\n {\n /*\n * ------------------------------------------------\n * ALGORITHMS\n * ------------------------------------------------\n * MCRYPT_3DES MCRYPT_PANAMA\n * MCRYPT_ARCFOUR MCRYPT_RAND\n * MCRYPT_ARCFOUR_IV MCRYPT_RC2\n * MCRYPT_BLOWFISH MCRYPT_RC6\n * MCRYPT_BLOWFISH_COMPAT MCRYPT_RIJNDAEL_128\n * MCRYPT_CAST_128 MCRYPT_RIJNDAEL_192\n * MCRYPT_CAST_256 MCRYPT_RIJNDAEL_256\n * MCRYPT_CRYPT MCRYPT_SAFER128\n * MCRYPT_DECRYPT MCRYPT_SAFER64\n * MCRYPT_DES MCRYPT_SAFERPLUS\n * MCRYPT_DEV_RANDOM MCRYPT_SERPENT\n * MCRYPT_DEV_URANDOM MCRYPT_SKIPJACK\n * MCRYPT_ENCRYPT MCRYPT_THREEWAY\n * MCRYPT_ENIGNA MCRYPT_TRIPLEDES\n * MCRYPT_GOST MCRYPT_TWOFISH\n * MCRYPT_IDEA MCRYPT_WAKE\n * MCRYPT_LOKI97 MCRYPT_XTEA\n * MCRYPT_MARS\n * ------------------------------------------------\n * MODES\n * ------------------------------------------------\n * MCRYPT_MODE_CBC MCRYPT_MODE_NOFB\n * MCRYPT_MODE_CFB MCRYPT_MODE_OFB\n * MCRYPT_MODE_ECB MCRYPT_MODE_STREAM\n */\n \n $algorithm = MCRYPT_RIJNDAEL_256;\n $mode = MCRYPT_MODE_ECB;\n $iv_size = mcrypt_get_iv_size ($algorithm, $mode );\n\t$iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND );\n\t$key = \"Curso-Yii2-Capa8tv\";\n\t\t\t\t\n\t$encrypt = base64_decode ( $string );\n\t\t\t\t\n\treturn MCRYPT_DECRYPT ( $algorithm, $key, $encrypt, $mode, $iv );\n }", "public function testDecrypt()\n\t{\n\t $encrypted = mcrypt_encrypt('blowfish', 's3cret', \"a test string\", MCRYPT_MODE_ECB);\n\t $this->assertEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "public static function decrypt($encrypted_string_b64) {\n return Encryption::decryptWKey($encrypted_string_b64, Encryption::_Key1());\n }", "function km200_Decrypt( $decryptData ) \n{ \n $decrypt = openssl_decrypt( \n base64_decode( $decryptData ),\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n );\n// var_dump($decryptData);\n\n // remove zero padding \n $decrypt = rtrim( $decrypt, \"\\x00\" ); \n // remove PKCS #7 padding \n $decrypt_len = strlen( $decrypt ); \n $decrypt_padchar = ord( $decrypt[ $decrypt_len - 1 ] ); \n for ( $i = 0; $i < $decrypt_padchar ; $i++ ) \n { \n if ( $decrypt_padchar != ord( $decrypt[$decrypt_len - $i - 1] ) ) \n break; \n } \n if ( $i != $decrypt_padchar ) \n return $decrypt; \n else \n return substr( \n $decrypt, \n 0, \n $decrypt_len - $decrypt_padchar \n ); \n}", "function m_decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n}", "function decryptData($data, $key) {\r\n $chiper = \"des-ede3\"; //Algorthim used to decrypt\r\n $data = $this->hex2ByteArray($data);\r\n $data = $this->byteArray2String($data);\r\n $data = base64_encode($data);\r\n $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($chiper));\r\n $decrypted = openssl_decrypt($data, $chiper, $key, OPENSSL_ZERO_PADDING,$iv);\r\n return $decrypted;\r\n}", "function decrypt( $crypttext )\n\t{\n\t\t$priv_key = $this->RsaPrivateKey;\n\t\t$tt = explode( \":::\", $crypttext );\n\t\t$cnt = count( $tt );\n\t\t$i = 0;\n\t\t$str = '';\n\t\twhile( $i < $cnt )\n\t\t{\n\t\t\topenssl_private_decrypt( $tt[$i], $str1, $priv_key );\n\t\t\t$str .= $str1;\n\t\t\t$i++;\n\t\t}\n\t\treturn $str;\n\t}", "public static function aes128Decrypt($key, $data) {}", "public function decrypt($iv, $data, $tag = null, $aad = '');", "public function rawDecrypt($name, RawDecryptRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('rawDecrypt', [$params], RawDecryptResponse::class);\n }", "function decrypt ($data, $key, $base64=false) {\n\t\n\tif ($base64) $data = base64_decode($data);\n\t\n\tif (!$td = mcrypt_module_open('rijndael-256', '', 'ctr', '')) return false;\n\t\n\t$iv\t\t= substr($data, 0, 32);\n\t$em\t\t= substr($data, strlen($data) - 32);\n\t$data\t= substr($data, 32, strlen($data)-64);\n\t$mac\t= self::keygen($iv.$data, $key, 1000, 32);\n\t\n\t// verify embedded mac matches and mcrypt can be initialized\n\tif (($em !== $mac) || (mcrypt_generic_init($td, $key, $iv) !== 0)) return false;\n\t\n\t$data = unserialize(mdecrypt_generic($td, $data));\n\t\n\tmcrypt_generic_deinit($td);\n\tmcrypt_module_close($td);\n\t\n\treturn $data;\n}", "public function SeedDecrypt(\n\t\t\t\t\t$pbData=array(), \t\t\t\t\t// [in] encrypted data\n\t\t\t\t\t$pdwRoundKey=array(), \t\t\t// [in] round keys for decryption\n\t\t\t\t\t&$outData=array()\t\t\t\t\t// [out] data to be encrypted\n\t\t\t\t\t)\n\t{\n\t $L0 = 0x0; $L1 = 0x0; $R0 = 0x0; $R1 = 0x0;\n\t $K=array();\n\t $nCount = 31;\n\n// Set up input values for decryption\n\t $L0 = ($pbData[0]&0x000000ff);\n\t $L0 = ($L0<<8)^($pbData[1]&0x000000ff);\n\t $L0 = ($L0<<8)^($pbData[2]&0x000000ff);\n\t $L0 = ($L0<<8)^($pbData[3]&0x000000ff);\n\n\t $L1 = ($pbData[4]&0x000000ff);\n\t $L1 = ($L1<<8)^($pbData[5]&0x000000ff);\n\t $L1 = ($L1<<8)^($pbData[6]&0x000000ff);\n\t $L1 = ($L1<<8)^($pbData[7]&0x000000ff);\n\n\t $R0 = ($pbData[8]&0x000000ff);\n\t $R0 = ($R0<<8)^($pbData[9]&0x000000ff);\n\t $R0 = ($R0<<8)^($pbData[10]&0x000000ff);\n\t $R0 = ($R0<<8)^($pbData[11]&0x000000ff);\n\n\t $R1 = ($pbData[12]&0x000000ff);\n\t $R1 = ($R1<<8)^($pbData[13]&0x000000ff);\n\t $R1 = ($R1<<8)^($pbData[14]&0x000000ff);\n\t $R1 = ($R1<<8)^($pbData[15]&0x000000ff);\n\n// Reorder for little endian\n\t\tif (!$this->ENDIAN) { $this->EndianChange($L0); $this->EndianChange($L1); $this->EndianChange($R0); $this->EndianChange($R1); }\n\n\t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n \t$this->SeedRound($L0, $L1, $R0, $R1, $K); /* 1 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n \t$this->SeedRound($R0, $R1, $L0, $L1, $K); /* 2 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 3 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 4 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 5 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 6 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 7 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 8 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 9 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 10 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 11 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 12 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 13 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 14 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount--];\n $this->SeedRound($L0, $L1, $R0, $R1, $K); /* 15 */\n\n \t\t$K[1] = $pdwRoundKey[$nCount--];\t\t$K[0] = $pdwRoundKey[$nCount];\n $this->SeedRound($R0, $R1, $L0, $L1, $K); /* 16 */\n\n\t\tif (!$this->ENDIAN) {$this->EndianChange($L0); $this->EndianChange($L1); $this->EndianChange($R0); $this->EndianChange($R1);}\n\n// Copy output values from last round to outData\n\t\tfor ($i=0;$i<16;$i++) $outData[$i] = null;\n \tfor ($i=0; $i<4; $i++)\n \t{\n\t \t$outData[$i] = $this->ConvertByte(($R0>>(8*(3-$i)))&0xff);\n\t \t$outData[4+$i] = $this->ConvertByte(($R1>>(8*(3-$i)))&0xff);\n\t \t$outData[8+$i] = $this->ConvertByte(($L0>>(8*(3-$i)))&0xff);\n\t \t$outData[12+$i] = $this->ConvertByte(($L1>>(8*(3-$i)))&0xff);\n\t }\n \t \treturn $outData;\n\t}", "function symDecrypt($cryptText, $key) {\n $cryptText = $this->hex2bin($cryptText);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $plainText = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $cryptText, MCRYPT_MODE_ECB, $iv);\n \n return $plainText;\n }", "public function decrypt($data)\n {\n if(!is_string($data) || empty($data)) return false;\n\n // Decode crypt keys\n $first_key = base64_decode($this->config['main_key']);\n $second_key = base64_decode($this->config['assured_key']);\n\n // Decode base64 coded $data\n $mix = base64_decode($data);\n\n // Get length of IV from crypt first method\n $iv_length = openssl_cipher_iv_length($this->encrypt_fst_method);\n\n // Get IV from decoded $data\n $iv = substr($mix, 0, $iv_length);\n // Get second encrypted $data from $mix\n $second_encrypted = substr($mix, $iv_length, 64);\n // Get first encrypted $data from $mix\n $first_encrypted = substr($mix, $iv_length + 64);\n\n // Decrypt first encrypted $data with first encryption method\n $data = openssl_decrypt($first_encrypted, $this->encrypt_fst_method, $first_key, OPENSSL_RAW_DATA, $iv);\n $second_encrypted_new = hash_hmac($this->encrypt_snd_method, $first_encrypted, $second_key, TRUE);\n\n // Check if new second encrypted data is equals to previous second encrypted data,\n // then return decrypted data\n if (hash_equals($second_encrypted, $second_encrypted_new)) {\n $this->has_error = false;\n return $data;\n }\n\n // Otherwise it has modefied\n $this->has_error = true;\n return false;\n }", "public function decrypt($data)\n {\n return $this->decryptionCipher()->decrypt($this->privateKey(), $data);\n }", "private function decrypt($data, $key) {\n\t\treturn Authenticator_Crypto::decrypt($data, $key);\n\t}", "function aes_decrypt($encrypted, $salt = null)\n{\n if (null === $salt) {\n if (!($salt = \\getenv('AES_SALT'))) {\n throw new \\Limepie\\Exception('Missing encryption salt.');\n }\n }\n\n $key = \\Limepie\\mysql_aes_key($salt);\n\n $cypher = 'aes-128-ecb';\n\n return \\openssl_decrypt($encrypted, $cypher, $key, \\OPENSSL_RAW_DATA);\n}", "function descifrar($datos, $llave) {\n $clave_cifrado = base64_decode($llave);\n // Para poder descifrar debemos separar los datos de nuestra cdena del IV, nuestro separador es (::)\n list($cifrado, $iv) = explode('::', base64_decode($datos), 2);\n //Por ultimo, se descifra con la llave y el IV obtenido\n return openssl_decrypt($cifrado, 'aes-256-cbc', $clave_cifrado, 0, $iv);\n}", "public function decryptData($data)\n {\n if ($this->keyType == self::TYPE_PUBLIC) {\n if (false === openssl_public_decrypt($data, $decrypted, $this->opensslResource, $this->padding)) {\n throw new DecryptionException($this->type, $this->getOpenSslErrorString());\n }\n } else {\n if (false === openssl_private_decrypt($data, $decrypted, $this->opensslResource, $this->padding)) {\n throw new DecryptionException($this->type, $this->getOpenSslErrorString());\n }\n }\n\n return $decrypted;\n }", "public static function decryptRJ256( $encrypted ) {\n $encrypted = str_replace( ' ', '+', $encrypted );\n\n //get all the bits\n $key = base64_decode( self::ENCRYPTION_KEY );\n $iv = base64_decode( self::SECRET_IV );\n $encrypted = base64_decode( $encrypted );\n\n $rtn = mcrypt_decrypt( MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_CBC, $iv );\n $rtn = self::unpad( $rtn );\n\n return ( $rtn );\n }", "protected function decrypt($data) {\n if ($this->hash_passwords) {\n return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($this->secret), base64_decode($data), MCRYPT_MODE_CBC, md5(md5($this->secret))), \"\\0\");\n } else {\n return $data;\n }\n }", "function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)\r\n {\r\n switch ($mode) {\r\n case CRYPT_RIJNDAEL_MODE_ECB:\r\n case CRYPT_RIJNDAEL_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\r\n }\r\n\r\n // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1), \r\n // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so\r\n // those are the names we'll use.\r\n $this->t3 = array(\r\n 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, \r\n 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, \r\n 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, \r\n 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, \r\n 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, \r\n 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, \r\n 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, \r\n 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, \r\n 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, \r\n 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, \r\n 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, \r\n 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, \r\n 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, \r\n 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, \r\n 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, \r\n 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, \r\n 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, \r\n 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, \r\n 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, \r\n 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, \r\n 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, \r\n 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, \r\n 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, \r\n 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, \r\n 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, \r\n 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, \r\n 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, \r\n 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, \r\n 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, \r\n 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, \r\n 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, \r\n 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C\r\n );\r\n\r\n $this->dt3 = array(\r\n 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, \r\n 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, \r\n 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, \r\n 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, \r\n 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, \r\n 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, \r\n 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, \r\n 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, \r\n 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, \r\n 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, \r\n 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, \r\n 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, \r\n 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, \r\n 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, \r\n 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, \r\n 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, \r\n 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, \r\n 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, \r\n 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, \r\n 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, \r\n 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, \r\n 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, \r\n 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, \r\n 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, \r\n 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, \r\n 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, \r\n 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, \r\n 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, \r\n 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, \r\n 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, \r\n 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, \r\n 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0\r\n );\r\n\r\n for ($i = 0; $i < 256; $i++) {\r\n $this->t2[$i << 8] = (($this->t3[$i] << 8) & 0xFFFFFF00) | (($this->t3[$i] >> 24) & 0x000000FF);\r\n $this->t1[$i << 16] = (($this->t3[$i] << 16) & 0xFFFF0000) | (($this->t3[$i] >> 16) & 0x0000FFFF);\r\n $this->t0[$i << 24] = (($this->t3[$i] << 24) & 0xFF000000) | (($this->t3[$i] >> 8) & 0x00FFFFFF);\r\n\r\n $this->dt2[$i << 8] = (($this->dt3[$i] << 8) & 0xFFFFFF00) | (($this->dt3[$i] >> 24) & 0x000000FF);\r\n $this->dt1[$i << 16] = (($this->dt3[$i] << 16) & 0xFFFF0000) | (($this->dt3[$i] >> 16) & 0x0000FFFF);\r\n $this->dt0[$i << 24] = (($this->dt3[$i] << 24) & 0xFF000000) | (($this->dt3[$i] >> 8) & 0x00FFFFFF);\r\n }\r\n }", "public function decrypt($data)\n {\n return Crypto::decrypt($data, $this->key);\n }", "private function decryptCipherTextEncryptionKey()\n {\n $result = $this->getAws()->createKms()->decrypt([\n 'CiphertextBlob' => base64_decode($this->getProtectedHeader(self::KEY_CIPHERTEXT_HEADER_NAME))\n ]);\n return $result['Plaintext'];\n }", "function decrypt($ciphertext)\n {\n $ciphertext = strtolower($ciphertext);\n $plaintext = \"\";\n \n for ( $i = 0; $i < strlen($ciphertext); $i++ )\n {\n $x = $this->alphabet->indexOf($ciphertext[$i]);\n $decodedIndex = mod(($x - $this->shift), $this->alphabet->sizeOf());\n $plaintext = $plaintext . ($this->alphabet->get($decodedIndex)[0]);\n }\n return $plaintext;\n }", "function decrypt($encrypted_string, $encryption_key) {\n\t\t$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n\t\t$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\t\t$decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n\t\treturn $decrypted_string;\n\t}", "public function testDecryptingTheSameDataTwice()\n {\n $randomData = random_bytes(8);\n $randomKey = random_bytes(32);\n\n $encryptedData = NativeRc4::encryptData($randomKey, $randomData);\n\n $this->assertEquals(\n NativeRc4::decryptData($randomKey, $encryptedData),\n NativeRc4::decryptData($randomKey, $encryptedData)\n );\n }", "public function decrypt($string)\n\t{\n\t\tglobal $mybb;\n\n\t\t$key = $mybb->config['pluginuploader_ftp_key'];\n\n\t\treturn rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), \"\\0\");\n\t}", "static function decrypt($key, $pt)\n {\n return self::doDecrypt($key, $pt);\n #return self::doDecrypt($key, base64_decode($pt));\n # Strangely enough but you cant call base64_encode/decode inside theses two functions\n # it just wont work, but it works when doing the same thing outside these functions...\n }", "public final function Decrypt($input, $key=null)\r\n\t\t{\r\n\t\t\tif (!$key)\r\n\t\t\t\t$key = $this->Key;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t$this->CheckMcrypt();\r\n\t\t\t$inputd = base64_decode($input);\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$td = mcrypt_module_open($this->CryptoAlgo, '', 'ecb', '');\r\n\t\t\t\t$key = substr($key, 0, mcrypt_enc_get_key_size($td));\r\n\t\t\t\t$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\r\n\t\t\t\tmcrypt_generic_init($td, $key, $iv);\r\n\t\t\t\t$retval = mdecrypt_generic($td, $inputd);\r\n\t\t\t\t\r\n\t\t\t\tmcrypt_generic_deinit($td);\r\n\t\t\t\tmcrypt_module_close($td);\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn trim($retval, \"\\x00..\\x1F\");\r\n\t\t}", "public function decrypt($data)\n\t{\n\t\t$key = openssl_pkey_get_details($this->_priKey);\n\t\tif ($key === FALSE) {\n\t\t\t$exErr = \"Error in pnRSA::decrypt()\\n\";\n\t\t\twhile ($err = openssl_error_string()) {\n\t\t\t\t$exErr .= $err . \"\\n\";\n\t\t\t}\n\t\t\tthrow new Exception($exErr);\t\t\t\n\t\t}\n\t\t$block_size = $key['bits'] / 8;\n\t\t$chunks = str_split($data, $block_size);\n\t\t$output = '';\n\t\tforeach ($chunks as $chunk) {\n\t\t\tif (!openssl_private_decrypt($chunk, $decrypted, $this->_priKey, OPENSSL_PKCS1_OAEP_PADDING)) {\n\t\t\t\t$exErr = \"Error in pnRSA::decrypt()\\n\";\n\t\t\t\twhile ($err = openssl_error_string()) {\n\t\t\t\t\t$exErr .= $err . \"\\n\";\n\t\t\t\t}\n\t\t\t\tthrow new Exception($exErr);\t\t\n\t\t\t}\n\t\t\t$output .= $decrypted;\n\t\t}\n\t\treturn $output;\n\t}", "function decrypt( $input,$securekey ) {\n\n \t\t// remove the first char which is @ to flag this is AES encrypted\n \t$input = substr($input,1);\n\n \t// HEX decoding\n \t$input = pack('H*', $input);\n\n \treturn mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $securekey, $input, MCRYPT_MODE_CBC, $securekey);\n }", "function ehash_decrypt($encrypted_string, $encryption_key) {\n \n\tif (empty($encrypted_string)) {\n return '';\n }\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $encrypted_string = base64_decode($encrypted_string);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n \n return $decrypted_string;\n}", "function md5_decrypt( $enc_text, $password, $iv_len = 16 )\n\t{\n \t$enc_text = base64_decode( $enc_text );\n \t$n = strlen( $enc_text );\n \t$i = $iv_len;\n \t$plain_text = '';\n \t$iv = substr( $password ^ substr( $enc_text, 0, $iv_len ), 0, 512 );\n \twhile ( $i < $n )\n \t{\n \t$block = substr( $enc_text, $i, 16 );\n \t$plain_text .= $block ^ pack( 'H*', md5( $iv ) );\n \t$iv = substr( $block . $iv, 0, 512 ) ^ $password;\n \t$i += 16;\n \t}\n \treturn preg_replace( '/\\\\x13\\\\x00*$/', '', $plain_text );\n\t}", "function decrypt($encrypted_string, $encryption_key) {\n $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n $decrypted_string = mcrypt_decrypt(MCRYPT_BLOWFISH, $encryption_key, $encrypted_string, MCRYPT_MODE_ECB, $iv);\n return $decrypted_string;\n }", "function decrypt($string) { \r\n\tglobal $key;\r\n\t$result = Cryptor::Decrypt($string,$key);\r\n\treturn $result;\r\n}", "function decrypt($string, $key)\n{ \n\t$result = '';\n\t$string = base64_decode($string);\n\tfor($i=0; $i<strlen($string); $i++)\n\t{\n\t\t$char = substr($string, $i, 1);\n\t\t$keychar = substr($key, ($i % strlen($key))-1, 1);\n\t\t$char = chr(ord($char)-ord($keychar));\n\t\t$result.=$char;\n\t}\n\treturn $result;\n}", "public function testDecrypt_des()\n\t{\n\t $this->Crypt_MCrypt->method = 'des';\n\t $encrypted = mcrypt_encrypt('des', 's3cret', \"a test string\", MCRYPT_MODE_ECB);\n\t\t$this->assertEquals(\"a test string\", $this->Crypt_MCrypt->decrypt($encrypted));\n\t}", "function decrypt_string($iv_with_string, $key=KEY) {\n $iv = substr($iv_with_string, 0, cipher_iv_size());\n $encrypted = substr($iv_with_string, cipher_iv_size());\n // Needs a key of length 16, 24, or 32\n $key = str_pad($key, 32, '*');\n\n // Decrypt\n return mcrypt_decrypt(CIPHER_TYPE, $key, $encrypted, CIPHER_MODE, $iv);\n }", "public function decrypt($encrypted_text, $key = '', $iv = '', $bit_check = 8, $cipher_type = MCRYPT_TRIPLEDES)\n {\n try {\n /* Ensure the key & IV is the same for both encrypt & decrypt. */\n if (!empty($encrypted_text)) {\n $cipher = mcrypt_module_open($cipher_type, '', 'cbc', '');\n\n mcrypt_generic_init($cipher, $key, $iv);\n $decrypted = mdecrypt_generic($cipher, base64_decode($encrypted_text));\n\n mcrypt_generic_deinit($cipher);\n $last_char = substr($decrypted, -1);\n\n for ($i = 0; $i < $bit_check; $i++) {\n if (chr($i) == $last_char) {\n $decrypted = substr($decrypted, 0, strlen($decrypted) - $i);\n break;\n }\n }\n\n mcrypt_module_close($cipher);\n\n return $decrypted;\n } else {\n return $encrypted_text;\n }\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "function cs_encrypt_decrypt($string)\r\n{\r\n\t//Function : encrypt/decrypt a string message v.1.0 without a known key\r\n\t//Author : Aitor Solozabal Merino (spain)\r\n\t//Email : [email protected]\r\n\t//Date : 01-04-2005\r\n $strlen = strlen($string);\r\n $strencrypted = '';\r\n for ($pos = 0; $pos < $strlen ; $pos++)\r\n {\r\n\t\t// long code of the function to explain the algoritm\r\n\t\t// this function can be tailored by the programmer modifyng the formula\r\n\t\t// to calculate the key to use for every character in the string.\r\n\t\t$usekey = (($strlen+$pos)+1); // (+5 or *3 or ^2)\r\n\t\t// after that we need a module division because can´t be greater than 255\r\n\t\t$usekey = (255+$usekey) % 255;\r\n\t\t$encryptbyte = substr($string, $pos, 1);\r\n\t\t$asciibyte = ord($encryptbyte);\r\n\t\t$xorbyte = $asciibyte ^ $usekey; // xor operation\r\n\t\t$encrypted = chr($xorbyte);\r\n\t\t$strencrypted .= $encrypted;\r\n\t\t \r\n\t\t//short code of the function once explained\r\n\t\t// $str_encrypted_message .= chr((ord(substr($str_message, $position, 1))) ^ ((255+(($len_str_message+$position)+1)) % 255));\r\n\t}\r\n\treturn $strencrypted;\r\n}", "public static function decryptString($key, $string)\n {\n if (strlen($key) < 4)\n {\n throw new \\Exception('Please provide a key that is more than 3 characters');\n }\n $ciphertext_dec = base64_decode($string);\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n $iv_dec = substr($ciphertext_dec, 0, $iv_size);\n $ciphertext_dec = substr($ciphertext_dec, $iv_size);\n $plaintext_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, self::pad_key($key),\n $ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);\n\n return $plaintext_dec;\n }", "function simple_decrypt($text, $salt = \"VUHuiU6b8jgieEG0p79Yx9T4G8Zqp880\") {\n return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));\n}", "public static function decrypt($v_text){\n\n\t\treturn mcrypt_decrypt(MCRYPT_BLOWFISH,Config::getVariable('blowfish_key'),$v_text,MCRYPT_MODE_CFB, CryptoUtil::$iv);\n\t\t\n\t}", "public static function do_mdecrypt($input, $key)\r\n {\r\n $iv_arr = array(0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef);\r\n\t\t$iv = self::toStr($iv_arr);\r\n $input = trim(chop(base64_decode($input)));\r\n $td = mcrypt_module_open('des', '', 'cbc', '');\r\n $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);\r\n mcrypt_generic_init($td, $key, $iv);\r\n $decrypted_data = mdecrypt_generic($td, $input);\r\n mcrypt_generic_deinit($td);\r\n mcrypt_module_close($td);\r\n return trim(chop($decrypted_data));\r\n }", "function aesdecrypt($encrypted_chaine)\n {\n $key_password = \"la clé\";\n $decrypted_chaine = openssl_decrypt($encrypted_chaine, \"AES-128-ECB\" ,$key_password);\n var_dump($encrypted_chaine);\n \n }", "function ciphertext_only($ciphertext)\n {\n \n for($i=0; $i < $this->alphabet->sizeOf(); $i++)\n {\n $cipher = new Caesar($i, $this->alphabet);\n echo $cipher->decrypt($ciphertext) . \"\\n\";\n }\n }", "function _encryptBlock($in)\n {\n $state = unpack('N*', $in);\n\n $sbox = $this->sbox;\n $w = $this->w;\n $t0 = $this->t0;\n $t1 = $this->t1;\n $t2 = $this->t2;\n $t3 = $this->t3;\n\n // addRoundKey\n $s0 = $state[1] ^ $w[4];\n $s1 = $state[2] ^ $w[5];\n $s2 = $state[3] ^ $w[6];\n $s3 = $state[4] ^ $w[7];\n\n // shiftRows + subWord + mixColumns + addRoundKey\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[8];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[9];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[10];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[11];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[12];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[13];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[14];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[15];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[16];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[17];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[18];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[19];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[20];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[21];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[22];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[23];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[24];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[25];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[26];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[27];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[28];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[29];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[30];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[31];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[32];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[33];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[34];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[35];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[36];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[37];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[38];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[39];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[40];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[41];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[42];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[43];\n\n switch ($this->Nr) {\n case 10:\n break;\n\n case 14:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[56];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[57];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[58];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[59];\n break;\n\n case 12:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n break;\n\n case 13:\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $s3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n\n $e0 = $t0[($s0 >> 24) & 0xff] ^ $t1[($s1 >> 16) & 0xff] ^ $t2[($s2 >> 8) & 0xff] ^ $t3[$s3 & 0xff] ^ $w[48];\n $e1 = $t0[($s1 >> 24) & 0xff] ^ $t1[($s2 >> 16) & 0xff] ^ $t2[($s3 >> 8) & 0xff] ^ $t3[$s0 & 0xff] ^ $w[49];\n $e2 = $t0[($s2 >> 24) & 0xff] ^ $t1[($s3 >> 16) & 0xff] ^ $t2[($s0 >> 8) & 0xff] ^ $t3[$s1 & 0xff] ^ $w[50];\n $e3 = $t0[($s3 >> 24) & 0xff] ^ $t1[($s0 >> 16) & 0xff] ^ $t2[($s1 >> 8) & 0xff] ^ $t3[$s2 & 0xff] ^ $w[51];\n\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[52];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[53];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[54];\n $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[55];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n break;\n\n default: // 11\n $s0 = $t0[($e0 >> 24) & 0xff] ^ $t1[($e1 >> 16) & 0xff] ^ $t2[($e2 >> 8) & 0xff] ^ $t3[$e3 & 0xff] ^ $w[44];\n $s1 = $t0[($e1 >> 24) & 0xff] ^ $t1[($e2 >> 16) & 0xff] ^ $t2[($e3 >> 8) & 0xff] ^ $t3[$e0 & 0xff] ^ $w[45];\n $s2 = $t0[($e2 >> 24) & 0xff] ^ $t1[($e3 >> 16) & 0xff] ^ $t2[($e0 >> 8) & 0xff] ^ $t3[$e1 & 0xff] ^ $w[46];\n $e3 = $t0[($e3 >> 24) & 0xff] ^ $t1[($e0 >> 16) & 0xff] ^ $t2[($e1 >> 8) & 0xff] ^ $t3[$e2 & 0xff] ^ $w[47];\n // Note: Here we skip $s3 but using $e3\n\n $e0 = $s0;\n $e1 = $s1;\n $e2 = $s2;\n // $e3 = $s3;\n }\n\n // subWord\n $e0 = $sbox[$e0 & 0xff] | ($sbox[($e0 >> 8) & 0xff] << 8) | ($sbox[($e0 >> 16) & 0xff] << 16) | ($sbox[($e0 >> 24) & 0xff] << 24);\n $e1 = $sbox[$e1 & 0xff] | ($sbox[($e1 >> 8) & 0xff] << 8) | ($sbox[($e1 >> 16) & 0xff] << 16) | ($sbox[($e1 >> 24) & 0xff] << 24);\n $e2 = $sbox[$e2 & 0xff] | ($sbox[($e2 >> 8) & 0xff] << 8) | ($sbox[($e2 >> 16) & 0xff] << 16) | ($sbox[($e2 >> 24) & 0xff] << 24);\n $e3 = $sbox[$e3 & 0xff] | ($sbox[($e3 >> 8) & 0xff] << 8) | ($sbox[($e3 >> 16) & 0xff] << 16) | ($sbox[($e3 >> 24) & 0xff] << 24);\n\n // shiftRows + addRoundKey\n return pack('N*',\n ($e0 & 0xFF000000) ^ ($e1 & 0x00FF0000) ^ ($e2 & 0x0000FF00) ^ ($e3 & 0x000000FF) ^ $w[0],\n ($e1 & 0xFF000000) ^ ($e2 & 0x00FF0000) ^ ($e3 & 0x0000FF00) ^ ($e0 & 0x000000FF) ^ $w[1],\n ($e2 & 0xFF000000) ^ ($e3 & 0x00FF0000) ^ ($e0 & 0x0000FF00) ^ ($e1 & 0x000000FF) ^ $w[2],\n ($e3 & 0xFF000000) ^ ($e0 & 0x00FF0000) ^ ($e1 & 0x0000FF00) ^ ($e2 & 0x000000FF) ^ $w[3]\n );\n }", "public function decrypt(string $data) : string|bool\n {\n $json = Jso::hay(base64_decode($data))->decode(true);\n\n if (! Jso::valid() || !$this->validate((array)$json)) {\n throw new DecrypterException('Could not validate the decrypted data pack');\n }\n\n $iv = base64_decode($json['iv']);\n $encrypted = base64_decode($json['data']);\n $decrypted = sodium_crypto_secretbox_open($encrypted, $iv, $this->appKey);\n\n if (! $decrypted) {\n throw new DecrypterException('Could not decrypt the requested data');\n }\n\n sodium_memzero($encrypted);\n return $decrypted;\n }", "public function decrypt(string $cipher, ?string $nonce = null, string $additionalData = null): string;", "public function decrypt($str, $key, $method = '') {\n if(trim($str)=='') {\n $return['decrypted'] = $str;\n return $return;\n }\n if(!is_string($str)) {\n // If input is array, check if its from the encrypt script if that works set new $str else trigger error\n if((is_array($str)) && (isset($str['encrypted']))) {\n $str = $str['encrypted'];\n } else {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid: \"'.$str.'\"';\n trigger_error($str, E_USER_NOTICE); \n return $return;\n }\n }\n $str = trim(stripslashes($str));\n if($str==\"\") {\n $return['decrypted'] = $str;\n return $return;\n }\n \n // If compress is active and if string start with the delimiter - decompress input\n if(($this->compress==true) && (($this->startsWith($str, $this->delimiter_gz)) && ($this->endsWith($str, $this->delimiter_gz)))) {\n $str = gzdecode(trim(utf8_decode($str),$this->delimiter_gz));\n }\n \n // Set cipher_method to AES-256-CBC as standard if none is present\n if($method == '') {\n $method = $this->cipher_method;\n }\n $rawencrypted = $str;\n \n // Clean input\n $str = str_replace(array($this->delimiter_character,$this->delimiter_breaks),array(' ',PHP_EOL),$str);\n \n // If string don't start and ends with the delimiters trigger error. If it does - clean string. Else trigger error.\n if((!$this->startsWith($str, $this->delimiter_characters)) || (!$this->endsWith($str, $this->delimiter_characters))) {\n $return['decrypted'] = trim($str);\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n } else if(($this->startsWith($str, $this->delimiter_characters)) && ($this->endsWith($str, $this->delimiter_characters))) {\n $str = trim(substr(substr($str,strlen($this->delimiter_characters)), 0, (0-strlen($this->delimiter_characters))));\n } else {\n $return['error'][] = $str = '#'.__LINE__.': String not valid';\n \n return $return;\n }\n\n // Generate retur string\n $return = array('decrypted' => '', 'encrypted' => trim($str), 'rawencrypted' => $rawencrypted, 'key' => $key, 'safekey' => '', 'algorithm' => $this->cipher_algorithm, 'method' => $method, 'iv' => '', 'base64_encode' => array(), 'error' => array());\n \n // String can't be empty\n if($str == '') {\n $return['error'][] = 'String empty';\n return $return;\n }\n \n // Key can't be empty\n if($key=='') {\n $return['error'][] = 'Key empty';\n trigger_error('Key can not be empty', E_USER_NOTICE); \n return $return;\n } else {\n $key = substr(hash($this->cipher_algorithm, $key, true), 0, 32);\n $return['safekey'] = bin2hex($key);\n }\n \n // Explode input\n $decrypts = explode(PHP_EOL, $return['encrypted']);\n \n // Create an IV and find the encrypted IV in input\n // An initialization vector (IV) is an arbitrary number that can be used along with a secret key for data encryption.\n $ivlen = openssl_cipher_iv_length($method);\n $iv = openssl_random_pseudo_bytes($ivlen);\n $ivlen = strlen(bin2hex($iv)); \n $iv = hex2bin($this->binaryToText(end($decrypts)));\n $return['iv'] = bin2hex($iv); \n \n // Remove IV from input\n array_pop($decrypts);\n\n // Find algorithm in input\n $algorithm = explode('_',$this->binaryToText(current($decrypts)));\n array_pop($algorithm);\n $algorithm = implode('_',$algorithm);\n unset($decrypts[0]);\n \n // Go through the decrypted data and decrypt each line.\n $return['base64_encode'] = $decrypts;\n foreach($return['base64_encode'] as $decrypting) {\n $return['decrypted'] .= $str = openssl_decrypt(base64_decode($this->binaryToText($decrypting)), $method, $key, OPENSSL_RAW_DATA, $iv);\n }\n $return['decrypted'] = stripslashes($return['decrypted']);\n \n return $return;\n }", "public function decrypt($data)\n {\n if (is_null($data)) {\n return $data;\n }\n\n $data = base64_decode($data);\n\n $data = $this->removeCipherNoise($data, $this->getKey());\n $init_size = openssl_cipher_iv_length($this->cipher);\n\n if ($init_size > strlen($data)) {\n return null;\n }\n\n $init_vect = substr($data, 0, $init_size);\n $data = substr($data, $init_size);\n return rtrim(\n \\openssl_decrypt(\n $data,\n $this->cipher,\n $this->getKey(),\n $this->encryptOptions,\n $init_vect\n ),\n \"\\0\"\n );\n }", "public static function decrypt( $payload, $cipherParams ) {\n $raw = defined( 'OPENSSL_RAW_DATA' ) ? OPENSSL_RAW_DATA : true;\n\n $ivLength = openssl_cipher_iv_length( $cipherParams->getAlgorithmString() );\n $iv = substr( $payload, 0, $ivLength );\n $ciphertext = substr( $payload, $ivLength );\n return openssl_decrypt( $ciphertext, $cipherParams->getAlgorithmString(), $cipherParams->key, $raw, $iv );\n }", "public static function decryptData($input, $key_seed)\n {\n $input = base64_decode($input);\n $key = substr(md5($key_seed), 0, 24);\n $text = mcrypt_decrypt(MCRYPT_TRIPLEDES, $key, $input, MCRYPT_MODE_ECB, '12345678');\n $block = mcrypt_get_block_size('tripledes', 'ecb');\n $packing = ord($text{strlen($text) - 1});\n if ($packing and ($packing < $block)) {\n for ($P = strlen($text) - 1; $P >= strlen($text) - $packing; $P--) {\n if (ord($text{$P}) != $packing) {\n $packing = 0;\n }\n }\n }\n $text = substr($text, 0, strlen($text) - $packing);\n return $text;\n }", "protected static function decryption($string){\n $key=hash('sha256', SECRET_KEY);\n $iv=substr(hash('sha256', SECRET_IV), 0, 16);\n $output=openssl_decrypt(base64_decode($string), METHOD, $key, 0, $iv);\n return $output;\n }", "function TOdecrypt($encrypted, $password, $salt='!kQm*fF3pXe1Kbm%9') {\r\n $key = hash('SHA256', $salt . $password, true);\r\n // Retrieve $iv which is the first 22 characters plus ==, base64_decoded.\r\n $iv = base64_decode(substr($encrypted, 0, 22) . '==');\r\n // Remove $iv from $encrypted.\r\n $encrypted = substr($encrypted, 22);\r\n // Decrypt the data. rtrim won't corrupt the data because the last 32 characters are the md5 hash; thus any \\0 character has to be padding.\r\n $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($encrypted), MCRYPT_MODE_CBC, $iv), \"\\0\\4\");\r\n // Retrieve $hash which is the last 32 characters of $decrypted.\r\n $hash = substr($decrypted, -32);\r\n // Remove the last 32 characters from $decrypted.\r\n $decrypted = substr($decrypted, 0, -32);\r\n // Integrity check. If this fails, either the data is corrupted, or the password/salt was incorrect.\r\n if (md5($decrypted) != $hash) return false;\r\n // Yay!\r\n return $decrypted;\r\n }", "public function decryptStream($data, $param = null);", "function decrypt($string, $key='humanbody_messages_2') {\r\n $result = '';\r\n $string = base64_decode($string);\r\n for($i=0; $i<strlen($string); $i++) {\r\n $char = substr($string, $i, 1);\r\n $keychar = substr($key, ($i % strlen($key))-1, 1);\r\n $char = chr(ord($char)-ord($keychar));\r\n $result.=$char;\r\n }\r\n return $result;\r\n }" ]
[ "0.6647247", "0.635637", "0.62690574", "0.6163886", "0.6163886", "0.6140285", "0.60755557", "0.60455614", "0.6024571", "0.6021471", "0.5962166", "0.59214777", "0.58563095", "0.58326864", "0.58195525", "0.5787621", "0.5781791", "0.5781791", "0.5702417", "0.57016265", "0.5700876", "0.5688779", "0.56864965", "0.5677796", "0.5676342", "0.5643911", "0.56126904", "0.5607434", "0.559919", "0.5580273", "0.557801", "0.55744267", "0.55636215", "0.55564266", "0.55479735", "0.5547676", "0.5545312", "0.55229294", "0.5508866", "0.54890734", "0.54871464", "0.54759705", "0.5456244", "0.54534185", "0.5441499", "0.54151183", "0.54089457", "0.5386863", "0.5384274", "0.5370687", "0.5368677", "0.5363864", "0.5357627", "0.5351745", "0.53425217", "0.53191185", "0.53055155", "0.53041375", "0.5283583", "0.52757233", "0.52733237", "0.52699", "0.52473766", "0.5247291", "0.52292645", "0.5196642", "0.5191236", "0.5177408", "0.5164536", "0.51442677", "0.513134", "0.5128722", "0.512245", "0.51124835", "0.5100083", "0.5097226", "0.509247", "0.5080475", "0.50802016", "0.50750613", "0.50749576", "0.50747174", "0.50720733", "0.50697947", "0.5065059", "0.504777", "0.50431824", "0.50389236", "0.50314504", "0.5028571", "0.5025451", "0.5025076", "0.5023869", "0.5012883", "0.4994039", "0.4992182", "0.49791127", "0.497387", "0.4966151", "0.49601373" ]
0.6739692
0
Treat consecutive "packets" as if they are a continuous buffer. The default behavior.
function enableContinuousBuffer() { parent::enableContinuousBuffer(); if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) { $this->enbuffer['enmcrypt_init'] = true; $this->debuffer['demcrypt_init'] = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = true;\r\n }", "public function startBuffering(): void {}", "public function startBuffering(): void {}", "public function buffered();", "private function readFrames() {\n\t\twhile (($type = $this->buffer->getByte()) !== 7) {\n\t\t\t$tick = $this->buffer->getInteger();\n\n\t\t\tif ($type == 3) {\n\t\t\t\t// No data\n\t\t\t\tcontinue;\n\t\t\t} else if ($type == 1 || $type == 2) {\n\t\t\t\t$this->buffer->skip(0x54);\n\t\t\t} else if ($type == 5) {\n\t\t\t\t$this->buffer->skip(0x4);\n\t\t\t}\n\n\t\t\t$this->buffer->skip($this->buffer->getInteger());\n\t\t}\n\t}", "function disableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = false;\r\n $this->encryptIV = $this->iv;\r\n $this->decryptIV = $this->iv;\r\n }", "public function startOutputBuffering() {}", "public function getBuffer($atOffset = true) {}", "public function testBufferPartial(): void\n {\n $items = new ArrayObject([1, 2, 3]);\n $iterator = new BufferedIterator($items);\n foreach ($iterator as $key => $value) {\n if ($key == 1) {\n break;\n }\n }\n $result = [];\n foreach ($iterator as $value) {\n $result[] = $value;\n }\n $this->assertEquals([1, 2, 3], $result);\n }", "public function getBuffer($atOffset = true);", "function testBackendReassembleSplitPackets() {\n $options = array(\n 'backend' => NULL,\n 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile.\n );\n $min = 1;\n $max = 4;\n $read_sizes_to_test = array(4096);\n if (in_array('--debug', $_SERVER['argv'])) {\n $read_sizes_to_test[] = 128;\n $read_sizes_to_test[] = 16;\n $max = 16;\n }\n foreach ($read_sizes_to_test as $read_size) {\n $log_message=\"\";\n for ($i = $min; $i <= $max; $i++) {\n $log_message .= \"X\";\n $php = \"\\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('log-message' => '$log_message', 'x' => 'y$read_size', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET', '#process-read-size' => $read_size)); return array_key_exists('object', \\$values) ? \\$values['object'] : 'no result';\";\n $this->drush('php-eval', array($php), $options);\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has 'x' but not 'data'\n $all_warnings=array();\n foreach ($parsed['log'] as $log) {\n if ($log['type'] == 'warning') {\n $all_warnings[] = $log['message'];\n }\n }\n $this->assertEquals(\"$log_message,done\", implode(',', $all_warnings), 'Log reconstruction with read_size ' . $read_size);\n $this->assertEquals(\"array (\n 'x' => 'y$read_size',\n)\", var_export($parsed['object'], TRUE));\n }\n }\n }", "public function isBuffered();", "protected function shift() {\r\n\t\tarray_shift($this->_streams);\r\n\t\t$this->_streamsCount--;\r\n\t}", "public function prependBuffer(EventBuffer $buf): bool {}", "static function send_buffer()\n {\n self::log_debug('Start sending buffer ...');\n\n $requests_sent = 0;\n $buffer_file = self::$log_dir . self::$log_file_buffer;\n $buffer_file_tmp = self::$log_dir . self::$log_file_buffer . '.' . rand(1, 100000) . '.tmp';\n\n try {\n\n if (!is_file($buffer_file)) {\n self::log_debug('Buffer file does not exists, nothing found to sent.');\n return false;\n }\n\n // take the current buffer and put it inside a unique tmp buffer\n rename($buffer_file, $buffer_file_tmp);\n\n // read and process the tmp buffer\n $fh = fopen($buffer_file_tmp, \"r\");\n if ($fh) {\n while (!feof($fh)) {\n $data_serialized = fgets($fh);\n\n if ($data_serialized == false) {\n continue;\n }\n\n $data = unserialize($data_serialized);\n \n if (self::send($data['e'], $data['m'], $data['d'])) {\n $requests_sent++;\n }\n }\n fclose($fh);\n }\n unlink($buffer_file_tmp);\n\n self::log_debug('Queue was sent successfully! Sent ' . $requests_sent . ' requests.');\n } catch (Exception $e) {\n self::log_error($e->getMessage());\n }\n }", "public function getBuffer() {}", "protected function split_packet($length,$packet, $user) {\n //add PartialPacket and calculate the new $length\n if ($user->handlingPartialPacket) {\n $packet = $user->partialBuffer . $packet;\n $user->handlingPartialPacket = false;\n $length=strlen($packet);\n }\n $fullpacket=$packet;\n $frame_pos=0;\n $frame_id=1;\n\n while($frame_pos<$length) {\n $headers = $this->extractHeaders($packet);\n $headers_size = $this->calcoffset($headers);\n $framesize=$headers['length']+$headers_size;\n \n //split frame from packet and process it\n $frame=substr($fullpacket,$frame_pos,$framesize);\n\n if (($message = $this->deframe($frame, $user,$headers)) !== FALSE) {\n if ($user->hasSentClose) {\n $this->disconnect($user->socket);\n } else {\n if ((preg_match('//u', $message)) || ($headers['opcode']==2)) {\n //$this->stdout(\"Text msg encoded UTF-8 or Binary msg\\n\".$message); \n $this->process($user, $message);\n } else {\n $this->stderr(\"not UTF-8\\n\");\n }\n }\n } \n //get the new position also modify packet data\n $frame_pos+=$framesize;\n $packet=substr($fullpacket,$frame_pos);\n $frame_id++;\n }\n }", "public function getBufferLength() {}", "protected function split_packet($length, $packet, $user) \n\t{\n\t\t//add PartialPacket and calculate the new $length\n\t\tif ( $user->handlingPartialPacket ) \n\t\t{\n\t\t\t$packet = $user->partialBuffer . $packet;\n\t\t\t$user->handlingPartialPacket = false;\n\n\t\t\t$length = strlen($packet);\n\t\t}\n\n\t\t$fullpacket = $packet;\n\t\t$frame_pos = 0;\n\t\t$frame_id = 1;\n\n\t\twhile( $frame_pos < $length ) \n\t\t{\n\t\t\t$headers = $this->extractHeaders($packet);\n\t\t\t$headers_size = $this->calcoffset($headers);\n\n\t\t\t$framesize = $headers['length'] + $headers_size;\n\n\t\t\t//split frame from packet and process it\n\t\t\t$frame = substr($fullpacket, $frame_pos, $framesize);\n\n\t\t\tif ( ($message = $this->deframe($frame, $user,$headers)) !== FALSE ) \n\t\t\t{\n\t\t\t\tif ( $user->hasSentClose ) \n\t\t\t\t\t$this->disconnect($user->socket);\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tif ( preg_match('//u', $message) ) \n\t\t\t\t\t\t$this->process($user, $message);\n\t\t\t\t\telse \n\t\t\t\t\t\t$this->stderr(\"not UTF-8\");\n\t\t\t\t}\n\t\t\t} \n\n\t\t//get the new position also modify packet data\n\t\t\t$frame_pos += $framesize;\n\t\t\t$packet = substr($fullpacket,$frame_pos);\n\t\t\t$frame_id++;\n\t\t}\n\t}", "public function isBuffered(): bool;", "public function receive();", "public function benchLpopConsecutive()\n {\n $messageList = [];\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $messageList[] = RedisEnvelope::jsonDeserialize($this->client->lpop($this->queueName));\n }\n }", "public function testBufferItems(): void\n {\n $items = new ArrayObject([\n 'a' => 1,\n 'b' => 2,\n 'c' => 3,\n ]);\n $iterator = new BufferedIterator($items);\n $expected = (array)$items;\n $this->assertSame($expected, $iterator->toArray());\n\n $items['c'] = 5;\n $buffered = $iterator->toArray();\n $this->assertSame($expected, $buffered);\n }", "protected function bufferedFetchOnce($bytes=4096)\n\t\t{\n\t\t\tif ($this->buffer === null)\n\t\t\t\t$this->send();\n\t\t\t$buflen = strlen($this->buffer);\n\t\t\tif ($bytes <= 0) {\n\t\t\t\tif ($bytes == 0)\n\t\t\t\t\treturn '';\n\t\t\t\telse\n\t\t\t\t\t$bytes = $buflen - $bytes; /* Negative: Read additional bytes rather than specified */\n\t\t\t}\n\t\t\tif ($buflen < $bytes && !$this->buffer_eof && !feof($this->socket)) {\n\t\t\t\tif ($this->requestDataTimeout !== false) {\n\t\t\t\t\t$read = array($this->socket);\n\t\t\t\t\t$write = NULL;\n\t\t\t\t\t$exc = NULL;\n\t\t\t\t\t$status = stream_select($read, $write, $exc, $this->requestDataTimeout);\n\t\t\t\t\tif ($status === 0)\n\t\t\t\t\t\tthrow new SERIA_TimeoutException(_t('Timeout on data read from remote host.'));\n\t\t\t\t\telse if (!$status)\n\t\t\t\t\t\tthrow new SERIA_Exception('stream_select failed.');\n\t\t\t\t}\n\t\t\t\t$data = fread($this->socket, $bytes - $buflen);\n\t\t\t\tif ($data === false)\n\t\t\t\t\tthrow new SERIA_Exception(_t('Error while reading from remote host.'));\n\t\t\t\t$len = strlen($data);\n\t\t\t\tSERIA_Base::debug('Buffer fill for socket '.$this->socket.': '.$len.' bytes.');\n\t\t\t\t$buflen += $len;\n\t\t\t\t$this->buffer .= $data;\n\t\t\t}\n\t\t\tif (!$this->buffer_eof && feof($this->socket)) {\n\t\t\t\tSERIA_Base::debug('End of file on socket '.$this->socket.': closing.');\n\t\t\t\t$this->buffer_eof = true;\n\t\t\t\tfclose($this->socket);\n\t\t\t\t$this->socket = null;\n\t\t\t\t$endMicrotime = microtime();\n\t\t\t\tlist($start_usec, $start_sec) = explode(' ', $this->currentRequest['startMicrotime']);\n\t\t\t\tlist($end_usec, $end_sec) = explode(' ', $endMicrotime);\n\t\t\t\t$time = (float) $end_usec - (float) $start_usec;\n\t\t\t\t$time = (float) $time + (float) ($end_sec - $start_sec);\n\t\t\t\t$metrics = array(\n\t\t\t\t\t'method' => $this->currentRequest['method'],\n\t\t\t\t\t'host' => $this->currentRequest['host'],\n\t\t\t\t\t'path' => $this->currentRequest['path'],\n\t\t\t\t\t'time' => $time\n\t\t\t\t);\n\t\t\t\t$a = self::METRIC_FETCH_TIME;\n\t\t\t\tSERIA_Hooks::dispatch(self::METRICS_HOOK, $a, $metrics);\n\t\t\t}\n\t\t\tif ($buflen <= $bytes)\n\t\t\t\treturn $this->buffer;\n\t\t\telse\n\t\t\t\treturn substr($this->buffer, 0, $bytes);\n\t\t}", "abstract public function receive();", "protected function _persistPackets()\n {\n if ($this->_repository->isLocked()) {\n $this->_repository->unLock();\n }\n $this->_repository->packets = $this->_packets;\n $this->_repository->lock();\n }", "private function initBufferFromNextChunk()\n {\n if ($this->chunkOffset === $this->numChunks - 1) {\n return false;\n }\n\n $this->bufferOffset = 0;\n $this->chunkOffset++;\n $this->chunksIterator->next();\n\n return $this->initBufferFromCurrentChunk();\n }", "public function onReadAvailable()\n\t{\n\t\t$s = @fread($this->stream, 0xffff);\n\n\t\tif ($s === false || @feof($this->stream)) {\n\t\t\t$this->close();\n\n\t\t} else {\n\t\t\t$this->readBuffer .= $s;\n\n\t\t\twhile (($l = strlen($this->readBuffer)) >= 8) {\n\t\t\t\t$frame = unpack(\"Cversion/Ctype/nrequestId/ncontentLength/CpaddingLength\", $this->readBuffer);\n\t\t\t\t$type = $frame[\"type\"];\n\t\t\t\t$requestId = $frame[\"requestId\"];\n\t\t\t\t$contentLength = $frame[\"contentLength\"];\n\t\t\t\t$paddingLength = $frame[\"paddingLength\"];\n\n\t\t\t\tif ($l < 8 + $contentLength + $paddingLength) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$this->contentBuffer = substr($this->readBuffer, 8, $contentLength);\n\t\t\t\t$this->readBuffer = substr($this->readBuffer, 8 + $contentLength + $paddingLength) ?: \"\";\n\n\t\t\t\tif ($frame[\"version\"] !== 1) {\n\t\t\t\t\t$this->handler->onError(\n\t\t\t\t\t\tnew ConnectionException(\"Protocol version mismatch. Expected 1, got {$frame[\"version\"]}.\"),\n\t\t\t\t\t\t$this\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($type === Constants::TYPE_PARAMS) {\n\t\t\t\t\t$this->onParamsFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDIN) {\n\t\t\t\t\t$this->onStdinFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_BEGIN_REQUEST) {\n\t\t\t\t\t$this->onBeginRequestFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_ABORT_REQUEST) {\n\t\t\t\t\t$this->onAbortRequestFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_GET_VALUES) {\n\t\t\t\t\tif ($requestId !== Constants::NULL_REQUEST_ID) {\n\t\t\t\t\t\t$this->closeWithError(\"Received frame GET-VALUES on non-null-request id channel.\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->onGetValuesFrame();\n\t\t\t\t\t}\n\n\t\t\t\t} elseif ($type === Constants::TYPE_END_REQUEST) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: END-REQUEST.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDOUT) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: STDOUT.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDERR) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: STDERR.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_DATA) {\n\t\t\t\t\t$this->onDataFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_GET_VALUES_RESULT) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: GET-VALUES-RESULT.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_UNKNOWN_TYPE) {\n\t\t\t\t\t$this->contentBuffer = \"\";\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->closeWithError(\"Unhandled request type #{$type}, closing connection.\");\n\t\t\t\t}\n\n\t\t\t\tif (!$this->closed && !empty($this->contentBuffer)) {\n\t\t\t\t\t$this->closeWithError(\"Content buffer hasn't been fully consumed.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function hasBuffer(){\n return $this->_has(9);\n }", "private function _setupBuffering()\n {\n // disable time limit\n @set_time_limit(0);\n \n // prevent buffering\n if (function_exists('apache_setenv')) {\n @apache_setenv('no-gzip', 1);\n }\n\n @ini_set('zlib.output_compression', 0);\n \n // turn on implicity flushing\n @ini_set('implicit_flush', true);\n while (@ob_get_level() !== 0) {\n @ob_end_flush();\n }\n\n @ob_implicit_flush(true);\n }", "private function readDataIntoBuffer()\n {\n $data = '';\n $read = [$this->socket];\n $write = $except = null;\n\n /* Note by DaveRandom:\n * This is a little odd. When I tested on Fedora, fread() was only returning\n * 1 byte at a time. Other systems (including another Fedora box) didn't do\n * this. This loop fixes the issue, and shouldn't negatively impact performance\n * too badly, as sane systems will only iterate once, all parsers are buffered.\n */\n do {\n $bytes = fread($this->socket, 8192);\n\n if ($bytes === false) {\n $this->log('Data read failed: ' . $this->getLastSocketError(), Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data read failed');\n\n $this->disconnect();\n return;\n }\n\n $data .= $bytes;\n } while (stream_select($read, $write, $except, 0));\n\n $this->log('Got data from socket: ' . $data, Loggable::LEVEL_DEBUG);\n $this->buffer->write($data);\n }", "function decode_packets($data)\n\t{\n\t\treturn $this->call('--list-packets', 'post', $data);\n\t}", "private function collectPoints($next)\n\t{\n\t\tarray_push($this->point_buffer, $next);\n\t}", "public function buffer_end_flush_all() {\n\t\t//if($this->get_setting('showHdrFtr') == 'FWD') {\n\t\t\t$levels = ob_get_level();\n\t\t\tfor ($i=0; $i<$levels; $i++){\n\t\t\t\t$obStatus = ob_get_status();\n\t\t\t\tif (!empty($obStatus['type']) && $obStatus['status']) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t//}\n\t}", "abstract function receive();", "protected abstract function receive();", "public function addBuffer(EventBuffer $buf): bool {}", "function cleanBufferOn()\n\t{\n\t\t$this->bCleanBuffer = true;\n\t}", "private function load_buffered()\n {\n }", "public function testEventDispatchWithBuffering() {\n\t\t$this->_useMock();\n\n\t\t$this->Js->TestJsEngine->bufferedMethods = array('event', 'sortables');\n\t\t$this->Js->TestJsEngine->expects($this->exactly(3))\n\t\t\t->method('event')\n\t\t\t->will($this->returnValue('This is an event call'));\n\n\t\t$this->Js->event('click', 'foo');\n\t\t$result = $this->Js->getBuffer();\n\t\t$this->assertEquals(1, count($result));\n\t\t$this->assertEquals('This is an event call', $result[0]);\n\n\t\t$result = $this->Js->event('click', 'foo', array('buffer' => false));\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertTrue(empty($buffer));\n\t\t$this->assertEquals('This is an event call', $result);\n\n\t\t$result = $this->Js->event('click', 'foo', false);\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertTrue(empty($buffer));\n\t\t$this->assertEquals('This is an event call', $result);\n\t}", "protected function tryParseCommands()\n {\n $result = [];\n\n for($dataLen = strlen($this->buffer); $dataLen >= 4;) {\n // reading length of received command\n $commandLenBytes = substr($this->buffer, 0, 4);\n $commandLen = intval(bin2hex($commandLenBytes), 16);\n if($dataLen < $commandLen+4) {\n // waiting more bytes to parse\n break;\n }\n $commandBytes = gzuncompress(substr($this->buffer, 4, $commandLen));\n $command = json_decode($commandBytes, true);\n $result[] = $command;\n // cut parsed bytes from buffer\n $this->buffer = substr($this->buffer, $commandLen + 4);\n $dataLen = strlen($this->buffer);\n }\n\n return $result;\n }", "public function bufferStart() {\n\t\tob_start( array( $this, 'obCallback' ) );\n\t}", "public function toBuffered(): IResultAdapter;", "public abstract function receive();", "public function stdin($buf) {\n\t\t$this->buf .= $buf;\n\n\t\tstart:\n\n\t\tif (strlen($this->buf) < 4) {\n\t\t\treturn; // not ready yet\n\t\t}\n\n\t\t$u = unpack('N', $this->buf);\n\t\t$size = $u[1];\n\n\t\tif (strlen($this->buf) < 4 + $size) {\n\t\t\treturn; // no ready yet;\n\t\t}\n\n\t\t$packet = binarySubstr($this->buf, 4, $size);\n\n\t\t$this->buf = binarySubstr($this->buf, 4 + $size);\n\n\t\t$this->onPacket(unserialize($packet));\n\n\t\tgoto start;\n\t}", "public static function resetBuffer()\r\n {\r\n while(@ob_end_clean());\r\n \r\n // create new empty buffer \r\n if (version_compare(PHP_VERSION, '5.4.0', '>=')) \r\n ob_start(null, 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);\r\n else \r\n ob_start(null, 0, false);\r\n }", "function next_mp3_frame($data, $index){\n\n // A - frame sync\n if( ord($data[$index]) !== 255) {\n trigger_error('Func: next_mp3_frame. A1 err: '.ord($data[0]).' U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n $b2 = ord($data[$index+1]);\n $check = 128+64+32;\n if( ($b2 & $check ) !== $check ) {\n trigger_error('Func: next_mp3_frame. A2 err: '.$b2.' U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // B\n $ver = ($b2 >> 3) & 3;\n\n switch($ver) {\n case 0:\n trigger_error('Func: next_mp3_frame. B err: ver: MPEG Version 2.5. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 1:\n trigger_error('Func: next_mp3_frame. B err: ver: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 2:\n trigger_error('Func: next_mp3_frame. B err: ver: MPEG Version 2 (ISO/IEC 13818-3). U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 3:\n break;\n default:\n trigger_error('Func: next_mp3_frame. B err: non ver type. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n }\n\n // C\n $lay = ($b2 >> 1) & 3;\n\n switch($lay) {\n case 0:\n trigger_error('Func: next_mp3_frame. C err: lay: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 1:\n break;\n case 2:\n trigger_error('Func: next_mp3_frame. C err: ver: Layer II. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 3:\n trigger_error('Func: next_mp3_frame. C err: ver: Layer I. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n default:\n trigger_error('Func: next_mp3_frame. C err: non lay type. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n }\n\n // D\n $prot = $b2 & 1;\n\n // E\n $b3 = ord($data[$index+2]);\n $bitRate = ($b3 >> 4) & 15;\n\n switch($bitRate) {\n case 1:\n $bitRate = 32000;\n break;\n case 2:\n $bitRate = 40000;\n break;\n case 3:\n $bitRate = 48000;\n break;\n case 4:\n $bitRate = 56000;\n break;\n case 5:\n $bitRate = 64000;\n break;\n case 6:\n $bitRate = 80000;\n break;\n case 7:\n $bitRate = 96000;\n break;\n case 8:\n $bitRate = 112000;\n break;\n case 9:\n $bitRate = 128000;\n break;\n case 10:\n $bitRate = 160000;\n break;\n case 11:\n $bitRate = 192000;\n break;\n case 12:\n $bitRate = 224000;\n break;\n case 13:\n $bitRate = 256000;\n break;\n case 14:\n $bitRate = 320000;\n break;\n case 15:\n trigger_error('Func: next_mp3_frame. E err: bitrate: bad. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n default:\n trigger_error('Func: next_mp3_frame. E err: bitrate: wrong. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // F\n $sampleRate = ($b3 >> 2) & 3;\n\n switch($sampleRate) {\n case 0:\n $sampleRate = 44100;\n break;\n case 1:\n $sampleRate = 48000;\n break;\n case 2:\n $sampleRate = 32000;\n break;\n case 3:\n trigger_error('Func: next_mp3_frame. F err: smpRate: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n default:\n trigger_error('Func: next_mp3_frame. F err: smpRate: wrong. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // G\n $padding = ($b3 >> 1) & 1;\n\n // H - private bit\n\n // I - Channel mode\n\n // J - mode extension (only if joint stereo)\n\n // K - copyright\n\n // L - original\n\n // M - emphasis\n\n // calculate length\n\n $frameLen = intval(144*$bitRate/$sampleRate + $padding);\n\n return $frameLen;\n}", "public function receive()\n\t{\n\t\t$payloads = parent::receive();\n\t\t\n\t\t// If the latest payload(s) are received, clear the buffer. We don't need that copy any more.\n\t\tif ($payloads)\n\t\t\t$this->received = array();\n\n\t\t// Return the latest received payloads\n\t\treturn $payloads;\n\t}", "public function stdin($buf) {\n\t\t$this->buf .= $buf;\n\n\t\tstart:\n\n\t\tif (strlen($this->buf) < 4) {\n\t\t\treturn; // not ready yet\n\t\t}\n\n\t\t$u = unpack('N', $this->buf);\n\t\t$size = $u[1];\n\n\t\tif (strlen($this->buf) < 4 + $size) {\n\t\t\treturn; // no ready yet;\n\t\t}\n\n\t\t$packet = binarySubstr($this->buf, 4, $size);\n\t\t$this->buf = binarySubstr($this->buf, 4 + $size);\n\t\t$this->onPacket(unserialize($packet));\n\n\t\tgoto start;\n\t}", "public function receiveData()\n {\n while (false !== ($data = socket_read($this->socket, 512))) {\n if ($data === '') {\n $this->reactor->removeReader($this->socket);\n \n call_user_func($this->callback, Response::fromString($this->buffer));\n return;\n }\n \n $this->buffer .= $data;\n }\n }", "public function getOutputBuffer()\n {\n }", "private function consume_buffer($bytes_to_consume){\n\t\t$consumed = substr($this->buffer, 0, $bytes_to_consume);\n\t\tforeach($this->captures as &$capture)\n\t\t\t$capture .= $consumed;\n\t\t\n\t\t$this->buffer = substr($this->buffer, $bytes_to_consume);\n\t}", "function nextOpenPacket($usedPackets){\n\t$packet = 1; \n\twhile (true){\n\t\t$columns = array('promoted', 'psets_id', 'round_id');\n\t\t$where = array(\"'1'\", \"'\" . $_SESSION['tournament'] . \"'\", \"'\" . strval($packet) . \"'\");\n\t\t\n\t\t$count = getNumOf('tossups', $columns, $where);\n\t\t$count = $count + getNumOf('bonuses', $columns, $where);\n\n\t\tif ($count == 0 and !in_array($packet, $usedPackets)){\n\t\t\treturn $packet;\n\t\t}\n\t\t\n\t\telse{\n\t\t\t$packet = $packet + 1;\n\t\t}\n\t}\n}", "public function getInputBuffer()\n {\n }", "public function onUdpPacket($pct) {}", "public static function add_buffering_hooks( $args = [] ) {}", "public function endOutputBufferingAndCleanPreviousOutput() {}", "public function dumpBuffer()\n {/*{{{*/\n $data = $this->_putbackBuffer;\n $colLimit = 15;\n $col = 0;\n $length = count($data);\n for ($i=0; $i < $length; $i++) {\n printf('%02X ', $data[1]);\n if ($col==$colLimit) {\n $col=0;\n print PHP_EOL;\n } else {\n $col++;\n }\n }\n print PHP_EOL;\n }", "protected function consumeBuffer($bytes)\n\t\t{\n\t\t\tSERIA_Base::debug('Consuming '.$bytes.' on socket '.$this->socket.'.');\n\t\t\t$buflen = strlen($this->buffer);\n\t\t\tif ($bytes < 0 || $bytes > $buflen)\n\t\t\t\tthrow new SERIA_Exception('Bad number of bytes to consume. (Run bufferedFetch first, do not consume more than read)');\n\t\t\tif ($bytes == $buflen) {\n\t\t\t\t/* The quickest case */\n\t\t\t\t$this->buffer = '';\n\t\t\t\treturn;\n\t\t\t} else if ($bytes == 0)\n\t\t\t\treturn;\n\t\t\telse\n\t\t\t\t$this->buffer = substr($this->buffer, $bytes);\n\t\t}", "public function shift()\n {\n array_shift($this->body);\n }", "public function testBufferIterations()\n {\n $resultSet = $this->getMockForAbstractClass(AbstractResultSet::class);\n $resultSet->initialize(new ArrayIterator([\n ['id' => 1, 'name' => 'one'],\n ['id' => 2, 'name' => 'two'],\n ['id' => 3, 'name' => 'three'],\n ]));\n $resultSet->buffer();\n\n $data = $resultSet->current();\n self::assertEquals(1, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(2, $data['id']);\n\n $resultSet->rewind();\n $data = $resultSet->current();\n self::assertEquals(1, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(2, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(3, $data['id']);\n }", "public function setPreBuffer($val)\n {\n $this->_propDict[\"preBuffer\"] = $val;\n return $this;\n }", "protected static function is_capturing() : bool {\n $buffers = ob_get_status(true);\n foreach ($buffers as $ob) {\n if ('core\\\\task\\\\logmanager::add_line' == $ob['name']) {\n return true;\n }\n }\n\n return false;\n }", "public function testEffectDispatchWithBuffering() {\n\t\t$this->_useMock();\n\t\t$this->Js->TestJsEngine->expects($this->exactly(4))\n\t\t\t->method('effect')\n\t\t\t->will($this->returnValue('I am not buffered.'));\n\n\t\t$result = $this->Js->effect('slideIn');\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertTrue(empty($buffer));\n\t\t$this->assertEquals('I am not buffered.', $result);\n\n\t\t$result = $this->Js->effect('slideIn', true);\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertNull($result);\n\t\t$this->assertEquals(1, count($buffer));\n\t\t$this->assertEquals('I am not buffered.', $buffer[0]);\n\n\t\t$result = $this->Js->effect('slideIn', array('speed' => 'slow'), true);\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertNull($result);\n\t\t$this->assertEquals(1, count($buffer));\n\t\t$this->assertEquals('I am not buffered.', $buffer[0]);\n\n\t\t$result = $this->Js->effect('slideIn', array('speed' => 'slow', 'buffer' => true));\n\t\t$buffer = $this->Js->getBuffer();\n\t\t$this->assertNull($result);\n\t\t$this->assertEquals(1, count($buffer));\n\t\t$this->assertEquals('I am not buffered.', $buffer[0]);\n\t}", "function readFrame ()\n {\n $start = microtime( true );\n $data = $buf = '';\n \n $rc = socket_recv($this->socket, $buf, 1, 0);\n // rc === 0: EOF / FIN received\n // rc === false: RST received / connection forcefully closed by remote side\n \n if ( $rc === 0 || $rc === false )\n {\n // EOF / FIN recvd\n $this->reconnect();\n return $this->readFrame();\n }\n \n // Read until end of frame (\\0)\n while ( ord($buf) != 0 )\n {\n $data .= $buf;\n \n $rc = socket_recv($this->socket, $buf, 1, 0);\n \n if ( $rc === false || $rc === 0 )\n {\n $this->reconnect();\n return $this->readFrame();\n }\n }\n \n // Verify next byte is \\n\n $rc = socket_recv($this->socket, $buf, 1, 0);\n if ( $rc === false || $rc === 0 || ord($buf) != 10 )\n {\n $this->reconnect();\n return $this->readFrame();\n }\n \n list ($header, $body) = explode(\"\\n\\n\", $data, 2);\n $header = explode(\"\\n\", $header);\n $headers = array();\n \n $command = NULL;\n foreach ( $header as $v )\n {\n if ( isset($command) )\n {\n list ($name, $value) = explode(':', $v, 2);\n $headers[$name] = trim($value);\n } else\n {\n $command = $v;\n }\n }\n \n $frame = new StompFrame($command, $headers, trim($body));\n if ( isset($frame->headers['amq-msg-type']) && $frame->headers['amq-msg-type'] == 'MapMessage' )\n {\n return new MapMessage($frame);\n } else {\n return $frame;\n }\n }", "public function getBuffer()\n {\n return $this->buffer;\n }", "public function getBuffer()\n {\n return $this->buffer;\n }", "public function _consumeFrame() {\n if (\\count($this->frames) == 0) return false;\n $frame = $this->frames[0];\n $this->frames = array_slice($this->frames, 1);\n return $frame;\n }", "public static function ALL_FRAMES()\n {\n return new ForceFlushMode(self::ALL_FRAMES);\n }", "public function toUnbuffered(): IResultAdapter;", "public function getPrevBlock(): BufferInterface;", "public function buffer(array $keys)\n {\n }", "public function testMultipleRewindBufferIterations()\n {\n $resultSet = $this->getMockForAbstractClass(AbstractResultSet::class);\n $result = new Result();\n $stub = $this->getMockBuilder(PDOStatement::class)->getMock();\n $data = new ArrayIterator([\n ['id' => 1, 'name' => 'one'],\n ['id' => 2, 'name' => 'two'],\n ['id' => 3, 'name' => 'three'],\n ]);\n assert($stub instanceof PDOStatement); // to suppress IDE type warnings\n $stub->expects($this->any())\n ->method('fetch')\n ->will($this->returnCallback(function () use ($data) {\n $r = $data->current();\n $data->next();\n return $r;\n }));\n $result->initialize($stub, null);\n $result->rewind();\n $result->rewind();\n $resultSet->initialize($result);\n $resultSet->buffer();\n $resultSet->rewind();\n $resultSet->rewind();\n\n $data = $resultSet->current();\n self::assertEquals(1, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(2, $data['id']);\n\n $resultSet->rewind();\n $resultSet->rewind();\n $data = $resultSet->current();\n self::assertEquals(1, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(2, $data['id']);\n $resultSet->next();\n $data = $resultSet->current();\n self::assertEquals(3, $data['id']);\n }", "public function writeBuffer(EventBuffer $buf): bool {}", "public function popRecordedEvents(): array\n {\n $pendingEvents = $this->recordedEvents;\n\n $this->recordedEvents = [];\n\n $mapMessage = function (Message $event): GenericEvent {\n if(! $event instanceof GenericEvent) {\n return GenericEvent::fromMessage($event);\n }\n\n return $event;\n };\n\n foreach ($pendingEvents as $i => $event) {\n $pendingEvents[$i] = $mapMessage($this->flavour->prepareNetworkTransmission($event));\n }\n\n return $pendingEvents;\n }", "public function readBuffer(EventBuffer $buf): bool {}", "public function drain(int $len): bool {}", "public function drain()\n {\n $data = $this->buffer;\n $this->buffer = '';\n\n return $data;\n }", "function removePreviousMessage()\n {\n\n $this->logDebug(\"Removing complete message from front of buffer.\");\n\n $removedSize = $this->ptr;\n \n $this->buffer = substr($this->buffer, $this->ptr);\n $this->bufferSize -= $removedSize;\n $this->ptr = 0;\n \n return $removedSize;\n }", "public function needsIncrementOffset();", "function cutMessageFromBuffer()\n {\n\n $this->logDebug(\"Cutting complete message from front of buffer.\");\n \n $removedSize = $this->ptr;\n \n $rawMessage = substr($this->buffer, 0, $this->ptr);\n $this->buffer = substr($this->buffer, $this->ptr);\n $this->bufferSize -= $removedSize;\n $this->ptr = 0;\n \n return $rawMessage;\n }", "public function getBufferWrites()\n {\n return $this->bufferWrites;\n }", "public function buffer()\n {\n if ($this->_disabled) {\n return;\n }\n\n if ($this->isTurbo()) {\n return;\n }\n\n ob_start();\n $this->output();\n $this->_html = ob_get_contents();\n ob_end_clean();\n }", "public function mapDataToBuffer(): self\n {\n // TODO: Implement mapDataToBuffer() method.\n return $this;\n }", "function disableContinuousBuffer()\n {\n parent::disableContinuousBuffer();\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) {\n mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv);\n mcrypt_generic_init($this->demcrypt, $this->key, $this->iv);\n }\n }", "public function reset()\n {\n $this->cbuff = [];\n }", "public function getDuplex() {}", "protected function _prepare()\n {\n $frac = microtime();\n $fracba = ($frac & 0xff000000) >> 24;\n $fracbb = ($frac & 0x00ff0000) >> 16;\n $fracbc = ($frac & 0x0000ff00) >> 8;\n $fracbd = ($frac & 0x000000ff);\n\n $sec = (time() + 2208988800);\n $secba = ($sec & 0xff000000) >> 24;\n $secbb = ($sec & 0x00ff0000) >> 16;\n $secbc = ($sec & 0x0000ff00) >> 8;\n $secbd = ($sec & 0x000000ff);\n\n // Flags\n $nul = chr(0x00);\n $nulbyte = $nul . $nul . $nul . $nul;\n $ntppacket = chr(0xd9) . $nul . chr(0x0a) . chr(0xfa);\n\n /*\n * Root delay\n *\n * Indicates the total roundtrip delay to the primary reference\n * source at the root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . $nul . chr(0x1c) . chr(0x9b);\n\n /*\n * Clock Dispersion\n *\n * Indicates the maximum error relative to the primary reference source at the\n * root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . chr(0x08) . chr(0xd7) . chr(0xff);\n\n /*\n * ReferenceClockID\n *\n * Identifying the particular reference clock\n */\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at the peer when its latest NTP message\n * was sent. Contanis an integer and a fractional part\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n /*\n * The local time, in timestamp format, at the peer. Contains an integer\n * and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * This is the local time, in timestamp format, when the latest NTP message from\n * the peer arrived. Contanis an integer and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at which the\n * NTP message departed the sender. Contanis an integer\n * and a fractional part.\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n return $ntppacket;\n }", "public function startBuffer(): void {\n\t\tob_start();\n\t}", "function openal_buffer_data($buffer, $format, $data, $freq)\n{\n}", "public function testHandleBatch()\n\t{\n\t\t$handler = new UdpHandler($this->testHost, $this->testPort, $this->testTimeout);\n\t\t$handler->setFactory($this->mockFactory);\n\n\t\t// Normal messages\n\t\t$batch1 = [\n\t\t\tnew CounterMetric('metric_name_batch1', 1),\n\t\t\tnew CounterMetric('metric_name_batch2', 2),\n\t\t\tnew CounterMetric('metric_name_batch3', 3),\n\t\t\tnew CounterMetric('metric_name_batch4', 4),\n\t\t];\n\n\t\t$expectedMessages = self::$formatter->formatBatch($batch1);\n\n\t\t$this->mockSocket->shouldReceive('write')->withArgs([join(\"\\n\", $expectedMessages)])->once();\n\t\t$handler->handleBatch($batch1);\n\t}", "public function eapolBuffer() { return $this->_m_eapolBuffer; }", "function obtenBuffer() {\n return $this->buffer;\n }", "public function bufferEnd() {\n\t\tob_end_flush();\n\t}", "function _shiftBoundaries($lines, &$changed, $other_changed)\n {\n }", "public function clear(): void\n {\n $this->bufferSize = 0;\n $this->buffer = array();\n }", "public function deQueue()\n {\n /*var_dump('#outgoing#');\n var_dump($this->outgoing);\n var_dump('#outgoing empty#'.$this->outgoing->isEmpty());\n var_dump('#incoming#');\n var_dump($this->incoming);\n var_dump('#incoming empty#'.$this->incoming->isEmpty());*/\n if($this->outgoing->isEmpty() && $this->incoming->isEmpty()){\n return self::createEmpty();\n }\n if($this->outgoing->isEmpty()){\n //var_dump('flip active');\n $fliped = $this->flip();\n //var_dump('#fliped#');\n //var_dump($fliped);\n $popFliped = $fliped->pop();\n //var_dump('#$popFliped#');\n //var_dump($popFliped);\n //var_dump(new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1));\n return new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1);\n }\n /*if($this->outgoing->isEmpty()){\n $fliped = $this->flip();\n $this->outgoing = $fliped;\n //var_dump('#fliped#');\n //var_dump($fliped);\n //$popFliped = $fliped->pop();\n $this->outgoing = $this->outgoing->pop();\n //var_dump('#$popFliped#');\n //var_dump($popFliped);\n //var_dump(new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1));\n return new self(ImmutableStack::createEmpty(),$this->outgoing,$this->size-1);\n }*/\n $pop = $this->outgoing->pop();\n\n return new self($this->incoming, $pop, $this->size-1);\n }", "private function clearBuffer() {\r\n\t\t$this->buffer = '';\r\n\t}", "private function getTransmission() {\n\t\t$this->inbound = fgets($this->socket, 1024);\n\t\t# Log the inbound message\n\t\tif($this->config['logging'] == 2) {\n\t\t\t$this->log(\"[RECV]: \".rtrim($this->inbound,\"\\r\\n\"));\n\t\t}\n\t}", "public function processLengths() {}" ]
[ "0.6038401", "0.5602343", "0.5602343", "0.54166293", "0.53583246", "0.53358763", "0.51099056", "0.50459874", "0.49316552", "0.493061", "0.4877891", "0.4867036", "0.47300482", "0.46822518", "0.45605114", "0.45447597", "0.45343298", "0.45327133", "0.45206144", "0.45147118", "0.44735518", "0.4454829", "0.4414212", "0.4374431", "0.43416193", "0.4300139", "0.42865756", "0.4275459", "0.4266129", "0.42223823", "0.42197996", "0.42167848", "0.42155463", "0.4208168", "0.42079937", "0.42069176", "0.42018634", "0.41777423", "0.41760895", "0.4175693", "0.41725546", "0.41613373", "0.41569364", "0.41397285", "0.41279945", "0.4124247", "0.411039", "0.41071662", "0.41028118", "0.4097629", "0.40885088", "0.40791935", "0.4039356", "0.4038883", "0.40315974", "0.4017589", "0.4012968", "0.40091872", "0.39928555", "0.39858866", "0.39803386", "0.39794284", "0.39793873", "0.39751127", "0.39633635", "0.39597297", "0.39597297", "0.39585084", "0.39564374", "0.395299", "0.3952439", "0.3934937", "0.39275786", "0.39251792", "0.3923682", "0.39165008", "0.39155805", "0.39101914", "0.39040643", "0.3900407", "0.38983342", "0.38967732", "0.38804954", "0.38769495", "0.3869083", "0.3868561", "0.385718", "0.3855608", "0.38503227", "0.38500324", "0.3847938", "0.38394773", "0.38301784", "0.38055524", "0.3804878", "0.37969515", "0.37903914", "0.37898353", "0.3779983", "0.37788916" ]
0.39331827
72
Treat consecutive packets as if they are a discontinuous buffer. The default behavior.
function disableContinuousBuffer() { parent::disableContinuousBuffer(); if (CRYPT_AES_MODE == CRYPT_AES_MODE_MCRYPT) { mcrypt_generic_init($this->enmcrypt, $this->key, $this->iv); mcrypt_generic_init($this->demcrypt, $this->key, $this->iv); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = false;\r\n $this->encryptIV = $this->iv;\r\n $this->decryptIV = $this->iv;\r\n }", "function enableContinuousBuffer()\r\n {\r\n $this->continuousBuffer = true;\r\n }", "private function readFrames() {\n\t\twhile (($type = $this->buffer->getByte()) !== 7) {\n\t\t\t$tick = $this->buffer->getInteger();\n\n\t\t\tif ($type == 3) {\n\t\t\t\t// No data\n\t\t\t\tcontinue;\n\t\t\t} else if ($type == 1 || $type == 2) {\n\t\t\t\t$this->buffer->skip(0x54);\n\t\t\t} else if ($type == 5) {\n\t\t\t\t$this->buffer->skip(0x4);\n\t\t\t}\n\n\t\t\t$this->buffer->skip($this->buffer->getInteger());\n\t\t}\n\t}", "function testBackendReassembleSplitPackets() {\n $options = array(\n 'backend' => NULL,\n 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile.\n );\n $min = 1;\n $max = 4;\n $read_sizes_to_test = array(4096);\n if (in_array('--debug', $_SERVER['argv'])) {\n $read_sizes_to_test[] = 128;\n $read_sizes_to_test[] = 16;\n $max = 16;\n }\n foreach ($read_sizes_to_test as $read_size) {\n $log_message=\"\";\n for ($i = $min; $i <= $max; $i++) {\n $log_message .= \"X\";\n $php = \"\\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('log-message' => '$log_message', 'x' => 'y$read_size', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET', '#process-read-size' => $read_size)); return array_key_exists('object', \\$values) ? \\$values['object'] : 'no result';\";\n $this->drush('php-eval', array($php), $options);\n $parsed = parse_backend_output($this->getOutput());\n // assert that $parsed has 'x' but not 'data'\n $all_warnings=array();\n foreach ($parsed['log'] as $log) {\n if ($log['type'] == 'warning') {\n $all_warnings[] = $log['message'];\n }\n }\n $this->assertEquals(\"$log_message,done\", implode(',', $all_warnings), 'Log reconstruction with read_size ' . $read_size);\n $this->assertEquals(\"array (\n 'x' => 'y$read_size',\n)\", var_export($parsed['object'], TRUE));\n }\n }\n }", "protected function split_packet($length,$packet, $user) {\n //add PartialPacket and calculate the new $length\n if ($user->handlingPartialPacket) {\n $packet = $user->partialBuffer . $packet;\n $user->handlingPartialPacket = false;\n $length=strlen($packet);\n }\n $fullpacket=$packet;\n $frame_pos=0;\n $frame_id=1;\n\n while($frame_pos<$length) {\n $headers = $this->extractHeaders($packet);\n $headers_size = $this->calcoffset($headers);\n $framesize=$headers['length']+$headers_size;\n \n //split frame from packet and process it\n $frame=substr($fullpacket,$frame_pos,$framesize);\n\n if (($message = $this->deframe($frame, $user,$headers)) !== FALSE) {\n if ($user->hasSentClose) {\n $this->disconnect($user->socket);\n } else {\n if ((preg_match('//u', $message)) || ($headers['opcode']==2)) {\n //$this->stdout(\"Text msg encoded UTF-8 or Binary msg\\n\".$message); \n $this->process($user, $message);\n } else {\n $this->stderr(\"not UTF-8\\n\");\n }\n }\n } \n //get the new position also modify packet data\n $frame_pos+=$framesize;\n $packet=substr($fullpacket,$frame_pos);\n $frame_id++;\n }\n }", "protected function split_packet($length, $packet, $user) \n\t{\n\t\t//add PartialPacket and calculate the new $length\n\t\tif ( $user->handlingPartialPacket ) \n\t\t{\n\t\t\t$packet = $user->partialBuffer . $packet;\n\t\t\t$user->handlingPartialPacket = false;\n\n\t\t\t$length = strlen($packet);\n\t\t}\n\n\t\t$fullpacket = $packet;\n\t\t$frame_pos = 0;\n\t\t$frame_id = 1;\n\n\t\twhile( $frame_pos < $length ) \n\t\t{\n\t\t\t$headers = $this->extractHeaders($packet);\n\t\t\t$headers_size = $this->calcoffset($headers);\n\n\t\t\t$framesize = $headers['length'] + $headers_size;\n\n\t\t\t//split frame from packet and process it\n\t\t\t$frame = substr($fullpacket, $frame_pos, $framesize);\n\n\t\t\tif ( ($message = $this->deframe($frame, $user,$headers)) !== FALSE ) \n\t\t\t{\n\t\t\t\tif ( $user->hasSentClose ) \n\t\t\t\t\t$this->disconnect($user->socket);\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tif ( preg_match('//u', $message) ) \n\t\t\t\t\t\t$this->process($user, $message);\n\t\t\t\t\telse \n\t\t\t\t\t\t$this->stderr(\"not UTF-8\");\n\t\t\t\t}\n\t\t\t} \n\n\t\t//get the new position also modify packet data\n\t\t\t$frame_pos += $framesize;\n\t\t\t$packet = substr($fullpacket,$frame_pos);\n\t\t\t$frame_id++;\n\t\t}\n\t}", "public function startBuffering(): void {}", "public function startBuffering(): void {}", "public function testBufferPartial(): void\n {\n $items = new ArrayObject([1, 2, 3]);\n $iterator = new BufferedIterator($items);\n foreach ($iterator as $key => $value) {\n if ($key == 1) {\n break;\n }\n }\n $result = [];\n foreach ($iterator as $value) {\n $result[] = $value;\n }\n $this->assertEquals([1, 2, 3], $result);\n }", "function decode_packets($data)\n\t{\n\t\treturn $this->call('--list-packets', 'post', $data);\n\t}", "public function getBuffer($atOffset = true) {}", "protected function shift() {\r\n\t\tarray_shift($this->_streams);\r\n\t\t$this->_streamsCount--;\r\n\t}", "public function getBuffer($atOffset = true);", "public function buffered();", "public function isBuffered();", "protected function _persistPackets()\n {\n if ($this->_repository->isLocked()) {\n $this->_repository->unLock();\n }\n $this->_repository->packets = $this->_packets;\n $this->_repository->lock();\n }", "public function deQueue()\n {\n /*var_dump('#outgoing#');\n var_dump($this->outgoing);\n var_dump('#outgoing empty#'.$this->outgoing->isEmpty());\n var_dump('#incoming#');\n var_dump($this->incoming);\n var_dump('#incoming empty#'.$this->incoming->isEmpty());*/\n if($this->outgoing->isEmpty() && $this->incoming->isEmpty()){\n return self::createEmpty();\n }\n if($this->outgoing->isEmpty()){\n //var_dump('flip active');\n $fliped = $this->flip();\n //var_dump('#fliped#');\n //var_dump($fliped);\n $popFliped = $fliped->pop();\n //var_dump('#$popFliped#');\n //var_dump($popFliped);\n //var_dump(new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1));\n return new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1);\n }\n /*if($this->outgoing->isEmpty()){\n $fliped = $this->flip();\n $this->outgoing = $fliped;\n //var_dump('#fliped#');\n //var_dump($fliped);\n //$popFliped = $fliped->pop();\n $this->outgoing = $this->outgoing->pop();\n //var_dump('#$popFliped#');\n //var_dump($popFliped);\n //var_dump(new self(ImmutableStack::createEmpty(),$popFliped,$this->size-1));\n return new self(ImmutableStack::createEmpty(),$this->outgoing,$this->size-1);\n }*/\n $pop = $this->outgoing->pop();\n\n return new self($this->incoming, $pop, $this->size-1);\n }", "public function unsetDelayCapture(): void\n {\n $this->delayCapture = [];\n }", "public function startOutputBuffering() {}", "public function onUdpPacket($pct) {}", "public function benchLpopConsecutive()\n {\n $messageList = [];\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $messageList[] = RedisEnvelope::jsonDeserialize($this->client->lpop($this->queueName));\n }\n }", "public function _consumeFrame() {\n if (\\count($this->frames) == 0) return false;\n $frame = $this->frames[0];\n $this->frames = array_slice($this->frames, 1);\n return $frame;\n }", "public function isBuffered(): bool;", "function next_mp3_frame($data, $index){\n\n // A - frame sync\n if( ord($data[$index]) !== 255) {\n trigger_error('Func: next_mp3_frame. A1 err: '.ord($data[0]).' U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n $b2 = ord($data[$index+1]);\n $check = 128+64+32;\n if( ($b2 & $check ) !== $check ) {\n trigger_error('Func: next_mp3_frame. A2 err: '.$b2.' U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // B\n $ver = ($b2 >> 3) & 3;\n\n switch($ver) {\n case 0:\n trigger_error('Func: next_mp3_frame. B err: ver: MPEG Version 2.5. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 1:\n trigger_error('Func: next_mp3_frame. B err: ver: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 2:\n trigger_error('Func: next_mp3_frame. B err: ver: MPEG Version 2 (ISO/IEC 13818-3). U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 3:\n break;\n default:\n trigger_error('Func: next_mp3_frame. B err: non ver type. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n }\n\n // C\n $lay = ($b2 >> 1) & 3;\n\n switch($lay) {\n case 0:\n trigger_error('Func: next_mp3_frame. C err: lay: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 1:\n break;\n case 2:\n trigger_error('Func: next_mp3_frame. C err: ver: Layer II. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n case 3:\n trigger_error('Func: next_mp3_frame. C err: ver: Layer I. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n default:\n trigger_error('Func: next_mp3_frame. C err: non lay type. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n break;\n }\n\n // D\n $prot = $b2 & 1;\n\n // E\n $b3 = ord($data[$index+2]);\n $bitRate = ($b3 >> 4) & 15;\n\n switch($bitRate) {\n case 1:\n $bitRate = 32000;\n break;\n case 2:\n $bitRate = 40000;\n break;\n case 3:\n $bitRate = 48000;\n break;\n case 4:\n $bitRate = 56000;\n break;\n case 5:\n $bitRate = 64000;\n break;\n case 6:\n $bitRate = 80000;\n break;\n case 7:\n $bitRate = 96000;\n break;\n case 8:\n $bitRate = 112000;\n break;\n case 9:\n $bitRate = 128000;\n break;\n case 10:\n $bitRate = 160000;\n break;\n case 11:\n $bitRate = 192000;\n break;\n case 12:\n $bitRate = 224000;\n break;\n case 13:\n $bitRate = 256000;\n break;\n case 14:\n $bitRate = 320000;\n break;\n case 15:\n trigger_error('Func: next_mp3_frame. E err: bitrate: bad. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n default:\n trigger_error('Func: next_mp3_frame. E err: bitrate: wrong. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // F\n $sampleRate = ($b3 >> 2) & 3;\n\n switch($sampleRate) {\n case 0:\n $sampleRate = 44100;\n break;\n case 1:\n $sampleRate = 48000;\n break;\n case 2:\n $sampleRate = 32000;\n break;\n case 3:\n trigger_error('Func: next_mp3_frame. F err: smpRate: reserved. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n default:\n trigger_error('Func: next_mp3_frame. F err: smpRate: wrong. U_ID: '.$_SESSION['user_id'], E_USER_ERROR);\n die();\n }\n\n // G\n $padding = ($b3 >> 1) & 1;\n\n // H - private bit\n\n // I - Channel mode\n\n // J - mode extension (only if joint stereo)\n\n // K - copyright\n\n // L - original\n\n // M - emphasis\n\n // calculate length\n\n $frameLen = intval(144*$bitRate/$sampleRate + $padding);\n\n return $frameLen;\n}", "public function prependBuffer(EventBuffer $buf): bool {}", "public function hasPacketsList()\n {\n return $this->packets !== null;\n }", "function nextOpenPacket($usedPackets){\n\t$packet = 1; \n\twhile (true){\n\t\t$columns = array('promoted', 'psets_id', 'round_id');\n\t\t$where = array(\"'1'\", \"'\" . $_SESSION['tournament'] . \"'\", \"'\" . strval($packet) . \"'\");\n\t\t\n\t\t$count = getNumOf('tossups', $columns, $where);\n\t\t$count = $count + getNumOf('bonuses', $columns, $where);\n\n\t\tif ($count == 0 and !in_array($packet, $usedPackets)){\n\t\t\treturn $packet;\n\t\t}\n\t\t\n\t\telse{\n\t\t\t$packet = $packet + 1;\n\t\t}\n\t}\n}", "public function gaps(): self\n {\n $sequence = new self();\n $interval = null;\n foreach ($this->sorted($this->sortByStartDate(...)) as $period) {\n if (null === $interval) {\n $interval = $period;\n continue;\n }\n\n if (!$interval->overlaps($period) && !$interval->meets($period)) {\n $sequence->push($interval->gap($period));\n }\n\n if (!$interval->contains($period)) {\n $interval = $period;\n }\n }\n\n return $sequence;\n }", "protected function _prepare()\n {\n $frac = microtime();\n $fracba = ($frac & 0xff000000) >> 24;\n $fracbb = ($frac & 0x00ff0000) >> 16;\n $fracbc = ($frac & 0x0000ff00) >> 8;\n $fracbd = ($frac & 0x000000ff);\n\n $sec = (time() + 2208988800);\n $secba = ($sec & 0xff000000) >> 24;\n $secbb = ($sec & 0x00ff0000) >> 16;\n $secbc = ($sec & 0x0000ff00) >> 8;\n $secbd = ($sec & 0x000000ff);\n\n // Flags\n $nul = chr(0x00);\n $nulbyte = $nul . $nul . $nul . $nul;\n $ntppacket = chr(0xd9) . $nul . chr(0x0a) . chr(0xfa);\n\n /*\n * Root delay\n *\n * Indicates the total roundtrip delay to the primary reference\n * source at the root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . $nul . chr(0x1c) . chr(0x9b);\n\n /*\n * Clock Dispersion\n *\n * Indicates the maximum error relative to the primary reference source at the\n * root of the synchronization subnet, in seconds\n */\n $ntppacket .= $nul . chr(0x08) . chr(0xd7) . chr(0xff);\n\n /*\n * ReferenceClockID\n *\n * Identifying the particular reference clock\n */\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at the peer when its latest NTP message\n * was sent. Contanis an integer and a fractional part\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n /*\n * The local time, in timestamp format, at the peer. Contains an integer\n * and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * This is the local time, in timestamp format, when the latest NTP message from\n * the peer arrived. Contanis an integer and a fractional part.\n */\n $ntppacket .= $nulbyte;\n $ntppacket .= $nulbyte;\n\n /*\n * The local time, in timestamp format, at which the\n * NTP message departed the sender. Contanis an integer\n * and a fractional part.\n */\n $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);\n $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);\n\n return $ntppacket;\n }", "function process_packet($packet)\n{\n //IP Header\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/nheader_checksum/Nsource_add/Ndest_add/';\n\n //Unpack the IP header\n $ip_header = unpack($ip_header_fmt , $packet);\n\n if($ip_header['protocol'] == '6')\n {\n print_tcp_packet($packet);\n }\n}", "public function popRecordedEvents(): array\n {\n $pendingEvents = $this->recordedEvents;\n\n $this->recordedEvents = [];\n\n $mapMessage = function (Message $event): GenericEvent {\n if(! $event instanceof GenericEvent) {\n return GenericEvent::fromMessage($event);\n }\n\n return $event;\n };\n\n foreach ($pendingEvents as $i => $event) {\n $pendingEvents[$i] = $mapMessage($this->flavour->prepareNetworkTransmission($event));\n }\n\n return $pendingEvents;\n }", "public function receive();", "public function hasBuffer(){\n return $this->_has(9);\n }", "function cleanBufferOn()\n\t{\n\t\t$this->bCleanBuffer = true;\n\t}", "public function getBufferLength() {}", "abstract public function receive();", "public function getPrevBlock(): BufferInterface;", "public function drain(int $len): bool {}", "private function initBufferFromNextChunk()\n {\n if ($this->chunkOffset === $this->numChunks - 1) {\n return false;\n }\n\n $this->bufferOffset = 0;\n $this->chunkOffset++;\n $this->chunksIterator->next();\n\n return $this->initBufferFromCurrentChunk();\n }", "protected function tryParseCommands()\n {\n $result = [];\n\n for($dataLen = strlen($this->buffer); $dataLen >= 4;) {\n // reading length of received command\n $commandLenBytes = substr($this->buffer, 0, 4);\n $commandLen = intval(bin2hex($commandLenBytes), 16);\n if($dataLen < $commandLen+4) {\n // waiting more bytes to parse\n break;\n }\n $commandBytes = gzuncompress(substr($this->buffer, 4, $commandLen));\n $command = json_decode($commandBytes, true);\n $result[] = $command;\n // cut parsed bytes from buffer\n $this->buffer = substr($this->buffer, $commandLen + 4);\n $dataLen = strlen($this->buffer);\n }\n\n return $result;\n }", "public function endOutputBufferingAndCleanPreviousOutput() {}", "public function processLengths() {}", "function remove_gaps()\n\t{\n\t\t$ret = false;\n\t\twhile($this->remove_first_gap() !== false)\n\t\t{\n\t\t\t$ret = true;\n\t\t}\n\t\treturn $ret;\n\t}", "public function testBufferItems(): void\n {\n $items = new ArrayObject([\n 'a' => 1,\n 'b' => 2,\n 'c' => 3,\n ]);\n $iterator = new BufferedIterator($items);\n $expected = (array)$items;\n $this->assertSame($expected, $iterator->toArray());\n\n $items['c'] = 5;\n $buffered = $iterator->toArray();\n $this->assertSame($expected, $buffered);\n }", "public function toUnbuffered(): IResultAdapter;", "public function getBuffer() {}", "public function bufferResults( $buffer = null ) {\n\t\tif ( is_null( $buffer ) ) {\n\t\t\treturn !(bool)( $this->mFlags & DBO_NOBUFFER );\n\t\t} else {\n\t\t\treturn !wfSetBit( $this->mFlags, DBO_NOBUFFER, !$buffer );\n\t\t}\n\t}", "public function discard($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n $this->buffer = \"\";\n $this->length = 0;\n return $this;\n\n } else {\n $this->buffer = substr($this->buffer, $n);\n $this->length -= $n;\n return $this;\n }\n }", "public static function ALL_FRAMES()\n {\n return new ForceFlushMode(self::ALL_FRAMES);\n }", "function packet2($packet, $currentPacket)\n{\n\tif ($packet >= $currentPacket) return \"initial\";\n\treturn \"none\";\n}", "protected abstract function receive();", "abstract function receive();", "public function receive()\n\t{\n\t\t$payloads = parent::receive();\n\t\t\n\t\t// If the latest payload(s) are received, clear the buffer. We don't need that copy any more.\n\t\tif ($payloads)\n\t\t\t$this->received = array();\n\n\t\t// Return the latest received payloads\n\t\treturn $payloads;\n\t}", "public function receiveData()\n {\n while (false !== ($data = socket_read($this->socket, 512))) {\n if ($data === '') {\n $this->reactor->removeReader($this->socket);\n \n call_user_func($this->callback, Response::fromString($this->buffer));\n return;\n }\n \n $this->buffer .= $data;\n }\n }", "public static function cleanOutputBuffers() {}", "public function reset()\n {\n $this->cbuff = [];\n }", "public function setDoNotScroll()\n {\n if (!in_array(24, $this->flagBits)) {\n $this->flagBits[] = 24;\n }\n return $this;\n }", "public function slice($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n return new Buffer($this->buffer);\n\n } else {\n return new Buffer(substr($this->buffer, 0, $n));\n }\n }", "public static function resetBuffer()\r\n {\r\n while(@ob_end_clean());\r\n \r\n // create new empty buffer \r\n if (version_compare(PHP_VERSION, '5.4.0', '>=')) \r\n ob_start(null, 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);\r\n else \r\n ob_start(null, 0, false);\r\n }", "public function consumeSlice($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n $buffer = $this->buffer;\n $this->buffer = \"\";\n $this->length = 0;\n return new Buffer($buffer);\n\n } else {\n $buffer = substr($this->buffer, 0, $n);\n $this->buffer = substr($this->buffer, $n);\n $this->length -= $n;\n return new Buffer($buffer);\n }\n }", "public function reset($pos = 0, $length = 200) {}", "public function reset($pos = 0, $length = 200) {}", "public function needsIncrementOffset();", "function _shiftBoundaries($lines, &$changed, $other_changed)\n {\n }", "public function getDuplex() {}", "private function readDataIntoBuffer()\n {\n $data = '';\n $read = [$this->socket];\n $write = $except = null;\n\n /* Note by DaveRandom:\n * This is a little odd. When I tested on Fedora, fread() was only returning\n * 1 byte at a time. Other systems (including another Fedora box) didn't do\n * this. This loop fixes the issue, and shouldn't negatively impact performance\n * too badly, as sane systems will only iterate once, all parsers are buffered.\n */\n do {\n $bytes = fread($this->socket, 8192);\n\n if ($bytes === false) {\n $this->log('Data read failed: ' . $this->getLastSocketError(), Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data read failed');\n\n $this->disconnect();\n return;\n }\n\n $data .= $bytes;\n } while (stream_select($read, $write, $except, 0));\n\n $this->log('Got data from socket: ' . $data, Loggable::LEVEL_DEBUG);\n $this->buffer->write($data);\n }", "function removePreviousMessage()\n {\n\n $this->logDebug(\"Removing complete message from front of buffer.\");\n\n $removedSize = $this->ptr;\n \n $this->buffer = substr($this->buffer, $this->ptr);\n $this->bufferSize -= $removedSize;\n $this->ptr = 0;\n \n return $removedSize;\n }", "function _PacketRead() {\n\t\t$retarray = array();\n\n\t\t//Fetch the packet size\n\t\twhile ($size = @fread($this->_Sock,4)) {\n\t\t\t$size = unpack('V1Size',$size);\n\t\t\t//Work around valve breaking the protocol\n\t\t\tif ($size[\"Size\"] > 4096) {\n\t\t\t\t//pad with 8 nulls\n\t\t\t\t$packet = \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\".fread($this->_Sock,4096);\n\t\t\t} else {\n\t\t\t\t//Read the packet back\n\t\t\t\t$packet = fread($this->_Sock, $size[\"Size\"]);\n\t\t\t}\n\n\t\t\tarray_push($retarray,unpack(\"V1ID/V1Response/a*S1/a*S2\",$packet));\n\t\t}\n\t\treturn $retarray;\n\t}", "public function testParseWithLookaheadRemovalTokens(): void\n {\n $this->assertSame(9, $this->parser->parse([Grammar::T_I, Grammar::T_X]));\n $this->assertSame(99, $this->parser->parse([Grammar::T_X, Grammar::T_C, Grammar::T_I, Grammar::T_X]));\n }", "abstract protected function ParsePacket( $packet );", "protected static function decode_chunked($data)\n {\n }", "private function collectPoints($next)\n\t{\n\t\tarray_push($this->point_buffer, $next);\n\t}", "public function stdin($buf) {\n\t\t$this->buf .= $buf;\n\n\t\tstart:\n\n\t\tif (strlen($this->buf) < 4) {\n\t\t\treturn; // not ready yet\n\t\t}\n\n\t\t$u = unpack('N', $this->buf);\n\t\t$size = $u[1];\n\n\t\tif (strlen($this->buf) < 4 + $size) {\n\t\t\treturn; // no ready yet;\n\t\t}\n\n\t\t$packet = binarySubstr($this->buf, 4, $size);\n\n\t\t$this->buf = binarySubstr($this->buf, 4 + $size);\n\n\t\t$this->onPacket(unserialize($packet));\n\n\t\tgoto start;\n\t}", "public function testBypassPipe(): void\n {\n $passable = '(0)';\n $container = new Container();\n $pipeline = new Pipeline($container);\n\n $result = $pipeline\n ->send($passable)\n ->through([\n PipeOne::class => 'a',\n BypassPipe::class => 'c',\n PipeTwo::class => 'b',\n ])\n ->via('handle')\n ->then(function ($passable) {\n return $passable . '(e)';\n })\n ->run();\n\n self::assertEquals('(0)(1a)(-1a)', $result);\n }", "private function handleStop(): void\n {\n for ($i = 0; $i < count($this->drivers); $i++) {\n for ($j = $i + 1; $j < count($this->drivers); $j++) {\n if ($this->drivers[$i]->getCurrentStop() === $this->drivers[$j]->getCurrentStop()) {\n $this->exchangeGossips($this->drivers[$i], $this->drivers[$j]);\n }\n }\n }\n }", "public function toBuffered(): IResultAdapter;", "public function skip($length) {}", "private function getSequence(): array\n {\n $ping = $this->results;\n\n $items_count = count($ping);\n\n // First remove items from final of the array\n for ($i = 6; $i > 0; $i--) {\n unset($ping[$items_count - $i]);\n }\n\n // Then remove first items\n unset($ping[1]);\n unset($ping[0]);\n\n $key = 0;\n\n $sequence = [];\n\n foreach ($ping as $row) {\n $sequence[$key] = $row;\n\n $key++;\n }\n\n return $sequence;\n }", "public function onRead() {\n\t\tstart:\n\t\tif ($this->type === 'udp') {\n\t\t\t$this->onUdpPacket($this->read($this->highMark));\n\t\t}\n\t\tif ($this->state === self::STATE_ROOT) {\n\t\t\tif (false === ($hdr = $this->readExact(2))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->pctSize = Binary::bytes2int($hdr, true);\n\t\t\t$this->setWatermark($this->pctSize);\n\t\t\t$this->state = self::STATE_PACKET;\n\t\t}\n\t\tif ($this->state === self::STATE_PACKET) {\n\t\t\tif (false === ($pct = $this->readExact($this->pctSize))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->state = self::STATE_ROOT;\n\t\t\t$this->setWatermark(2);\n\t\t\t$this->onUdpPacket($pct);\n\t\t}\n\t\tgoto start;\n\t}", "public function getMaxAllowedPacket()\n\t{\n\t\treturn PHP_INT_MAX;\n\t}", "function read_data_packet($socket, &$buffer) {\n\tread_from_socket($socket, $countSize, 1);\n\t// read data length\n\tread_from_socket($socket, $readCount, $countSize);\n\t$expectedReadCount = $readCount;\n\t// read data\n $readCount = read_from_socket($socket, $buffer, $readCount);\n\tif ($readCount == $expectedReadCount)\n\t return $readCount;\n\telse\n\t return FALSE;\n}", "function skipBytes($n);", "public abstract function receive();", "public function stdin($buf) {\n\t\t$this->buf .= $buf;\n\n\t\tstart:\n\n\t\tif (strlen($this->buf) < 4) {\n\t\t\treturn; // not ready yet\n\t\t}\n\n\t\t$u = unpack('N', $this->buf);\n\t\t$size = $u[1];\n\n\t\tif (strlen($this->buf) < 4 + $size) {\n\t\t\treturn; // no ready yet;\n\t\t}\n\n\t\t$packet = binarySubstr($this->buf, 4, $size);\n\t\t$this->buf = binarySubstr($this->buf, 4 + $size);\n\t\t$this->onPacket(unserialize($packet));\n\n\t\tgoto start;\n\t}", "public function do_not_track()\n\t{\n\t\tstatic $shifted;\n\t\tif ($shifted !== TRUE)\n\t\t{\n\t\t\tarray_shift($this->tracker);\n\t\t\t$shifted = TRUE;\n\t\t}\n\t\t$this->set_tracker_cookie();\n\t}", "public function splitBackwards(Period|Duration|DateInterval $duration): iterable\n {\n $endDate = $this->endDate;\n $duration = self::filterDuration($duration);\n do {\n $startDate = $endDate->sub($duration);\n if ($startDate < $this->startDate) {\n $startDate = $this->startDate;\n }\n yield new self($startDate, $endDate, $this->bounds);\n\n $endDate = $startDate;\n } while ($endDate > $this->startDate);\n }", "public function buffer_end_flush_all() {\n\t\t//if($this->get_setting('showHdrFtr') == 'FWD') {\n\t\t\t$levels = ob_get_level();\n\t\t\tfor ($i=0; $i<$levels; $i++){\n\t\t\t\t$obStatus = ob_get_status();\n\t\t\t\tif (!empty($obStatus['type']) && $obStatus['status']) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t//}\n\t}", "public function testIgnoredAgentSequence(): void\n {\n $agent = $this->agentFromConfigArray([\n ConfigKey::MONITORING_ENABLED => true,\n ConfigKey::LOG_LEVEL => LogLevel::DEBUG,\n ]);\n $agent->ignore();\n\n // Start a Parent Controller Span\n $agent->startSpan('Controller/Test');\n\n // Tag Whole Request\n $agent->tagRequest('uri', 'example.com/foo/bar.php');\n\n // Start a Child Span\n $span = $agent->startSpan('SQL/Query');\n\n $agent->changeRequestUri('new request URI');\n\n // Tag the span\n if ($span !== null) {\n $span->tag('sql.query', 'select * from foo');\n }\n\n // Finish Child Span\n $agent->stopSpan();\n\n // Stop Controller Span\n $agent->stopSpan();\n\n self::assertFalse($agent->send());\n\n self::assertTrue($this->logger->hasDebugThatContains('Not sending payload, request has been ignored'));\n }", "public function benchLpopInternal()\n {\n $messageList = $this->queue->consume(self::CONSUME_SIZE);\n }", "public function unsetEndedAt(): void\n {\n $this->endedAt = [];\n }", "function breakingRecords($score) {\n \n//the counter for broken records\n $posCount = 0;\n $negCount = 0;\n\t\n//Initialise the first record \n $posRec = $score[0];\n $negRec = $score[0];\n \n for ($i = 0; $i < sizeof($score); $i++) {\n\n if ($score[$i] > $posRec) {\n $posCount++;\n $posRec = $score[$i];\n \n } elseif ($score[$i] < $negRec) {\n $negCount++;\n $negRec = $score[$i];\n }\n } echo $posCount . \" \" . $negCount;\n}", "public function useArrayUnShift()\n {\n $this->push = false;\n return $this;\n }", "abstract function decode($socket, $data);", "public function discardBatch() {\n if (!$this->isBatch) {\n throw new JsonRpcException('Client is not in batch mode, start a batch operation by calling startBatch() first');\n }\n\n $batchRequests = $this->batchRequests;\n $this->batchRequests = [];\n $this->isBatch = false;\n\n return $batchRequests;\n }", "public function shift()\n {\n array_shift($this->body);\n }", "abstract protected function process(Telemetry\\Sensor\\SensorDataPacket &$oMutableData);", "public function testRejectDropStopWithError() {\n $count = 5;\n $this->produceMessages($count, \"test.ten\", \"Message is here!\");\n $output = $this->consumeMessages(\"test_ten\", $count);\n $this->assertTrue($this->has($output, \"Message is here!\"), $this->debug($output));\n\n $output = $this->consumeMessages(\"test_dlx\", $count);\n $this->assertNotFalse(strpos($output, \"Somethings wrong! Consuming has stopped! Here is why!?\"));\n $this->assertEquals(1, substr_count($output, \"Somethings wrong! Consuming has stopped! Here is why!?\"));\n }", "protected function bufferedFetchOnce($bytes=4096)\n\t\t{\n\t\t\tif ($this->buffer === null)\n\t\t\t\t$this->send();\n\t\t\t$buflen = strlen($this->buffer);\n\t\t\tif ($bytes <= 0) {\n\t\t\t\tif ($bytes == 0)\n\t\t\t\t\treturn '';\n\t\t\t\telse\n\t\t\t\t\t$bytes = $buflen - $bytes; /* Negative: Read additional bytes rather than specified */\n\t\t\t}\n\t\t\tif ($buflen < $bytes && !$this->buffer_eof && !feof($this->socket)) {\n\t\t\t\tif ($this->requestDataTimeout !== false) {\n\t\t\t\t\t$read = array($this->socket);\n\t\t\t\t\t$write = NULL;\n\t\t\t\t\t$exc = NULL;\n\t\t\t\t\t$status = stream_select($read, $write, $exc, $this->requestDataTimeout);\n\t\t\t\t\tif ($status === 0)\n\t\t\t\t\t\tthrow new SERIA_TimeoutException(_t('Timeout on data read from remote host.'));\n\t\t\t\t\telse if (!$status)\n\t\t\t\t\t\tthrow new SERIA_Exception('stream_select failed.');\n\t\t\t\t}\n\t\t\t\t$data = fread($this->socket, $bytes - $buflen);\n\t\t\t\tif ($data === false)\n\t\t\t\t\tthrow new SERIA_Exception(_t('Error while reading from remote host.'));\n\t\t\t\t$len = strlen($data);\n\t\t\t\tSERIA_Base::debug('Buffer fill for socket '.$this->socket.': '.$len.' bytes.');\n\t\t\t\t$buflen += $len;\n\t\t\t\t$this->buffer .= $data;\n\t\t\t}\n\t\t\tif (!$this->buffer_eof && feof($this->socket)) {\n\t\t\t\tSERIA_Base::debug('End of file on socket '.$this->socket.': closing.');\n\t\t\t\t$this->buffer_eof = true;\n\t\t\t\tfclose($this->socket);\n\t\t\t\t$this->socket = null;\n\t\t\t\t$endMicrotime = microtime();\n\t\t\t\tlist($start_usec, $start_sec) = explode(' ', $this->currentRequest['startMicrotime']);\n\t\t\t\tlist($end_usec, $end_sec) = explode(' ', $endMicrotime);\n\t\t\t\t$time = (float) $end_usec - (float) $start_usec;\n\t\t\t\t$time = (float) $time + (float) ($end_sec - $start_sec);\n\t\t\t\t$metrics = array(\n\t\t\t\t\t'method' => $this->currentRequest['method'],\n\t\t\t\t\t'host' => $this->currentRequest['host'],\n\t\t\t\t\t'path' => $this->currentRequest['path'],\n\t\t\t\t\t'time' => $time\n\t\t\t\t);\n\t\t\t\t$a = self::METRIC_FETCH_TIME;\n\t\t\t\tSERIA_Hooks::dispatch(self::METRICS_HOOK, $a, $metrics);\n\t\t\t}\n\t\t\tif ($buflen <= $bytes)\n\t\t\t\treturn $this->buffer;\n\t\t\telse\n\t\t\t\treturn substr($this->buffer, 0, $bytes);\n\t\t}", "public function onReadAvailable()\n\t{\n\t\t$s = @fread($this->stream, 0xffff);\n\n\t\tif ($s === false || @feof($this->stream)) {\n\t\t\t$this->close();\n\n\t\t} else {\n\t\t\t$this->readBuffer .= $s;\n\n\t\t\twhile (($l = strlen($this->readBuffer)) >= 8) {\n\t\t\t\t$frame = unpack(\"Cversion/Ctype/nrequestId/ncontentLength/CpaddingLength\", $this->readBuffer);\n\t\t\t\t$type = $frame[\"type\"];\n\t\t\t\t$requestId = $frame[\"requestId\"];\n\t\t\t\t$contentLength = $frame[\"contentLength\"];\n\t\t\t\t$paddingLength = $frame[\"paddingLength\"];\n\n\t\t\t\tif ($l < 8 + $contentLength + $paddingLength) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$this->contentBuffer = substr($this->readBuffer, 8, $contentLength);\n\t\t\t\t$this->readBuffer = substr($this->readBuffer, 8 + $contentLength + $paddingLength) ?: \"\";\n\n\t\t\t\tif ($frame[\"version\"] !== 1) {\n\t\t\t\t\t$this->handler->onError(\n\t\t\t\t\t\tnew ConnectionException(\"Protocol version mismatch. Expected 1, got {$frame[\"version\"]}.\"),\n\t\t\t\t\t\t$this\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($type === Constants::TYPE_PARAMS) {\n\t\t\t\t\t$this->onParamsFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDIN) {\n\t\t\t\t\t$this->onStdinFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_BEGIN_REQUEST) {\n\t\t\t\t\t$this->onBeginRequestFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_ABORT_REQUEST) {\n\t\t\t\t\t$this->onAbortRequestFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_GET_VALUES) {\n\t\t\t\t\tif ($requestId !== Constants::NULL_REQUEST_ID) {\n\t\t\t\t\t\t$this->closeWithError(\"Received frame GET-VALUES on non-null-request id channel.\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->onGetValuesFrame();\n\t\t\t\t\t}\n\n\t\t\t\t} elseif ($type === Constants::TYPE_END_REQUEST) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: END-REQUEST.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDOUT) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: STDOUT.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_STDERR) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: STDERR.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_DATA) {\n\t\t\t\t\t$this->onDataFrame($requestId);\n\n\t\t\t\t} elseif ($type === Constants::TYPE_GET_VALUES_RESULT) {\n\t\t\t\t\t$this->closeWithError(\"Received unexpected frame: GET-VALUES-RESULT.\");\n\n\t\t\t\t} elseif ($type === Constants::TYPE_UNKNOWN_TYPE) {\n\t\t\t\t\t$this->contentBuffer = \"\";\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->closeWithError(\"Unhandled request type #{$type}, closing connection.\");\n\t\t\t\t}\n\n\t\t\t\tif (!$this->closed && !empty($this->contentBuffer)) {\n\t\t\t\t\t$this->closeWithError(\"Content buffer hasn't been fully consumed.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function print_tcp_packet($packet)\n{\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/';\n\n $p = unpack($ip_header_fmt , $packet);\n $ip_len = ($p['ip_ver_len'] & 0x0F);\n\n if($ip_len == 5)\n {\n\n //IP Header format for unpack\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/'\n .'nip_checksum/'\n .'Nsource_add/'\n .'Ndest_add/';\n }\n else if ($ip_len == 6)\n {\n //IP Header format for unpack\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/'\n .'nip_checksum/'\n .'Nsource_add/'\n .'Ndest_add/'\n .'Noptions_padding/';\n }\n\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/';\n\n //total packet unpack format\n $total_packet = $ip_header_fmt.$tcp_header_fmt.'H*data';\n\n $p = unpack($total_packet , $packet);\n $tcp_header_len = ($p['offset_reserved'] >> 4);\n\n if($tcp_header_len == 5)\n {\n //TCP Header Format for unpack\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/'\n .'Ctcp_flags/'\n .'nwindow_size/'\n .'nchecksum/'\n .'nurgent_pointer/';\n }\n else if($tcp_header_len == 6)\n {\n //TCP Header Format for unpack\n $tcp_header_fmt = 'nsource_port/'\n .'ndest_port/'\n .'Nsequence_number/'\n .'Nacknowledgement_number/'\n .'Coffset_reserved/'\n .'Ctcp_flags/'\n .'nwindow_size/'\n .'nchecksum/'\n .'nurgent_pointer/'\n .'Ntcp_options_padding/';\n }\n\n //total packet unpack format\n $total_packet = $ip_header_fmt.$tcp_header_fmt.'H*data';\n\n //unpack the packet finally\n $packet = unpack($total_packet , $packet);\n\n //prepare the unpacked data\n $sniff = array(\n\n 'ip_header' => array(\n 'ip_ver' => ($packet['ip_ver_len'] >> 4) ,\n 'ip_len' => ($packet['ip_ver_len'] & 0x0F) ,\n 'tos' => $packet['tos'] ,\n 'tot_len' => $packet['tot_len'] ,\n 'identification' => $packet['identification'] ,\n 'frag_off' => $packet['frag_off'] ,\n 'ttl' => $packet['ttl'] ,\n 'protocol' => $packet['protocol'] ,\n 'checksum' => $packet['ip_checksum'] ,\n 'source_add' => long2ip($packet['source_add']) ,\n 'dest_add' => long2ip($packet['dest_add']) ,\n ) ,\n\n 'tcp_header' => array(\n 'source_port' => $packet['source_port'] ,\n 'dest_port' => $packet['dest_port'] ,\n 'sequence_number' => $packet['sequence_number'] ,\n 'acknowledgement_number' => $packet['acknowledgement_number'] ,\n 'tcp_header_length' => ($packet['offset_reserved'] >> 4) ,\n\n 'tcp_flags' => array(\n 'cwr' => (($packet['tcp_flags'] & 0x80) >> 7) ,\n 'ecn' => (($packet['tcp_flags'] & 0x40) >> 6) ,\n 'urgent' => (($packet['tcp_flags'] & 0x20) >> 5 ) ,\n 'ack' => (($packet['tcp_flags'] & 0x10) >>4) ,\n 'push' => (($packet['tcp_flags'] & 0x08)>>3) ,\n 'reset' => (($packet['tcp_flags'] & 0x04)>>2) ,\n 'syn' => (($packet['tcp_flags'] & 0x02)>>1) ,\n 'fin' => (($packet['tcp_flags'] & 0x01)) ,\n ) ,\n\n 'window_size' => $packet['window_size'] ,\n 'checksum' => $packet['checksum'] . ' [0x'.dechex($packet['checksum']).']',\n ) ,\n\n 'data' => hex_to_str($packet['data'])\n );\n\n //print the unpacked data\n print_r($sniff);\n}" ]
[ "0.5275221", "0.5238218", "0.5165273", "0.49168125", "0.466133", "0.46353117", "0.45889434", "0.45889434", "0.4530049", "0.45073107", "0.44879043", "0.4414328", "0.43742305", "0.43561366", "0.43261528", "0.42466792", "0.4161967", "0.41551846", "0.41472185", "0.41283947", "0.40154907", "0.4000935", "0.39914817", "0.39723364", "0.39523196", "0.39250982", "0.39054176", "0.38930747", "0.38873446", "0.38651925", "0.38498604", "0.38461795", "0.38303775", "0.38207585", "0.38206437", "0.38198477", "0.38037643", "0.38035953", "0.3803293", "0.38019666", "0.3794383", "0.37787807", "0.37753534", "0.3758006", "0.37493408", "0.37440294", "0.37368155", "0.3733658", "0.37298453", "0.37247607", "0.37150204", "0.3714862", "0.3685407", "0.36782244", "0.36714977", "0.36622858", "0.36453664", "0.3645027", "0.36429587", "0.3641873", "0.36413974", "0.36412907", "0.36406434", "0.36400104", "0.3637879", "0.36193648", "0.36184016", "0.3615565", "0.360577", "0.36055204", "0.36035442", "0.3596899", "0.35918394", "0.35883874", "0.35840854", "0.35790744", "0.35734937", "0.35723644", "0.35714135", "0.35680202", "0.35672015", "0.35668987", "0.35649815", "0.35619935", "0.35591242", "0.3555617", "0.35506457", "0.35494086", "0.35444117", "0.35427773", "0.35259774", "0.35238314", "0.3521072", "0.35192916", "0.35173553", "0.35156935", "0.35151976", "0.35145885", "0.3512518", "0.3511667" ]
0.37859413
41
ensures this controller and all corresponding routes are behind
function __construct(Request $request) { //the auth meaning login is required to access them $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function routeController()\n { }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function controller(){\n route('start')->onMessageText('/start');\n route('add')->onMessageText('/add');\n route('list')->onMessageText('/list');\n route('delete')->onMessageText('/delete');\n route('clear')->onMessageText('/clear');\n route('about')->onMessageText('/about');\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "public function routeStartup()\n {\n //...\n }", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::middleware(['nova', Authorize::class])\n ->namespace('Energon7\\MenuBuilder\\Http\\Controllers')\n ->prefix('nova-vendor/menu-builder')\n ->group(__DIR__.'/../routes/api.php');\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::middleware(['nova', Authorize::class])\n ->namespace(\"KosmosKosmos\\Rating\\Controllers\")\n ->prefix('nova-vendor/kosmoskosmos')\n ->group(__DIR__ . '/../routes/api.php');\n }", "public function frontControllerRoute()\n\t{\n\t\t#step 1\n\t\t#take current url and separate to controller, method and parameters\n\t\t$this->request = new CRequest($this->config['url_type']);\n\t\t$this->request->init($this->config['base_url'], $this->config['routing']);\n\t\t\n\t\t$controller \t= $this->request->controller;\n\t\t$method \t= $this->request->method;\n\t\t$args \t\t= $this->request->args;\n\t\n\t\t\n\t\t#step 2\n\t\t#Check if there is a method in the controller classs\n\t\t$controllerExists\t= isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled \t= false;\n\t\t$className \t= false;\n\t\t$classExists \t= false;\n\t\t\n\t\tif($controllerExists) {\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\t\t\n\t\tif($controllerExists && $controllerEnabled && $classExists)\n\t\t{\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')) \n\t\t\t{\n\t\t\t\t$formattedMethod = str_replace(array('_', '-'), '', $method);\n\t\t\t\tif($rc->hasMethod($formattedMethod)) \n\t\t\t\t{\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($formattedMethod);\n\t\t\t\t\tif($methodObj->isPublic()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $args);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller method not public.'); \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\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{ \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\t\t\n\t}", "public static function all()\n {\n Route::middleware(['supplies-chief'])->namespace('inventory\\adjustments')->group(function() {\n Route::prefix('inventory/adjustments')->group(function() {\n Route::get('/', 'AdjustmentsController@index');\n Route::post('receive/create',[\n\t\t 'as' => 'adjustment.receive.create',\n\t\t\t 'uses' => 'AdjustmentsController@receive'\n ]);\n Route::post('issue/create',[\n\t\t 'as' => 'adjustment.issue.create',\n\t\t\t 'uses' => 'AdjustmentsController@issue'\n\t\t ]);\n Route::get('receive/create','AdjustmentsController@create');\n Route::get('issue/create','AdjustmentsController@createIssue');\n\t\t Route::get('{id}', 'AdjustmentsController@show');\n\t\t //Route::get('reports{id}/print', 'DeliveryController@print');\n });\n });\n }", "protected function routes()\n\t{\n\t\tif ($this->app->routesAreCached()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tRoute::middleware(['nova', Authorize::class])\n\t\t\t->prefix('nova-vendor/nova-permissions')\n\t\t\t->group(__DIR__ . '/../routes/api.php');\n\t}", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::middleware(['nova', Authorize::class])\n ->prefix('nova-vendor/media-library')\n ->group(__DIR__.'/../routes/api.php');\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::middleware(['nova', Authorize::class])\n ->prefix('nova-vendor/surveyor-nova')\n ->group(__DIR__.'/../routes/api.php');\n }", "protected function routes()\n {\n if($this->app->routesAreCached()){\n return;\n }\n\n Route::middleware(['web' , 'can:Zoroaster-cache-card' , 'can:Zoroaster'])\n ->prefix('ZoroasterCacheCard')\n ->group(__DIR__ . '/../routes/web.php');\n }", "public function route()\n {\n $request = '';\n if (isset($_GET['q']))\n {\n $request = $_GET['q'];\n }\n \n $this->request = $request;\n $this->rebuildGet();\n \n //get controller\n $found = false;\n \n if ($request == '')\n {\n $request = 'index';\n }\n \n $segments = explode('/', $request);\n $dir = APP_PATH.'controllers/';\n foreach ($segments as $index => $segment)\n {\n $segment = str_replace('-', '_', $segment);\n if (file_exists($dir.$segment.'.php'))\n {\n //load controller\n $found = true;\n $this->params = array_slice($segments, $index+1);\n require($dir.$segment.'.php');\n break;\n }\n else\n {\n $dir .= $segment.'/';\n }\n }\n \n if (!$found)\n {\n //try index controller\n if (file_exists($dir.'index.php'))\n {\n //load controller\n $found = true;\n $this->params = array();\n require($dir.'index.php');\n }\n }\n \n if (!$found)\n {\n $this->notFound();\n }\n \n $this->completeRequest();\n }", "public function indexRoute()\n {\n }", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public function route() {\n\t\t$file = $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\tif(\\mfw\\helpers\\FileHelper::fileExists($file)) {\n\t\t\tinclude $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\t\t$controller = new $this->controller($this->controller, $this->app_directory);\n\t\t\tcall_user_func_array(array($controller, $this->method), $this->arguments);\n\t\t} else {\n\t\t\tif(defined('DOC_ROOT')) {\n\t\t\t\tinclude DOC_ROOT . '/404.php';\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"404 Page not found\");\n\t\t\t}\n\t\t}\n\t}", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "public function run()\n {\n $routeInfo = $this->foundRoute();\n\n if (isset($routeInfo['middleware'])) {\n $middleware = $this->gatherMiddlewareClassNames($routeInfo['middleware']);\n $this->runMiddleware($middleware);\n }\n $response = $this->callControllerAction($routeInfo);\n\n $this->sendRequest($this->response ?: $response);\n\n }", "function dispatch()\n {\n $app = $this->app;\n $db = $this->db;\n $user = $this->user;\n $this->setupControllerClasses('/Page/*.php', $app, $db, $user, 'SynchWeb\\\\Page\\\\');\n\n // add specific routes which break the old convention\n $app->group('/users', function () use ($app)\n {\n $app->container['userController'];\n });\n\n $app->group('/assign', function () use ($app)\n {\n $app->container['assignController'];\n });\n\n $this->app->notFound(function () use ($app)\n {\n $app->halt(404, json_encode(array('status' => 404, 'message' => 'not found')));\n });\n\n $app->run();\n }", "public function route() {\n\t\t// Start the profiler\n\t\tProfiler::register('Core', 'Router');\n\n\t\t// First, let's look at the URL the user supplied\n\t\t$requestUrl = array_values(array_filter(explode('/', Request::getUrl())));\n\t\t$requestRoute = null;\n\n\t\t// Loop over each route and test to see if they are valid\n\t\tforeach (self::$_routes as $route) {\n\t\t\tif ($this->routeTest($requestUrl, $route)) {\n\t\t\t\t$requestRoute = $route;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// We have completed the route matching\n\t\t// Finish the setup of the request object\n\t\tProfiler::register('Core', 'Request');\n\t\tif ($requestRoute) {\n\t\t\t$_GET['controller'] = $route->endpoint['controller'];\n\t\t\t$_GET['action'] = $route->endpoint['action'];\n\t\t\tRequest::setUrlFragments(str_replace($this->_routePath, '', Request::getUrl()));\n\t\t} else {\n\t\t\tRequest::setUrlFragments(Request::getUrl(), true);\n\t\t}\n\t\tProfiler::deregister('Core', 'Request');\n\n\t\t// Inform the event listener a request has been initialised\n\t\tEvent::trigger(\n\t\t\t'initRequest',\n\t\t\tarray(\n\t\t\t\t'controller' => Request::get('controller'),\n\t\t\t\t'action' => Request::get('action')\n\t\t\t)\n\t\t);\n\n\t\t// And stop the profiler\n\t\tProfiler::deregister('Core', 'Router');\n\t\tProfiler::deregister('Core', 'Front');\n\n\t\t// And dispatch\n\t\tDispatcher::loadController(\n\t\t\tRequest::get('controller'),\n\t\t\tRequest::get('action')\n\t\t);\n\t}", "public function router()\n\t{\n\t\t$this->getDomainName();\n\t\t$current_page = $this->getCurentPage();\t\n\t\tif($current_page){\n\t\t\t$this->getContent($current_page);\n\t\t}\n\t\t$this->initPageController($current_page);\n\t}", "public function bindRoutesToControllers()\n {\n $api = $this->app[\"controllers_factory\"];\n\n $api->get('/tests/{name}/{data_array}', \"schema.controller:getTests\");\n\n $this->app->mount('/', $api);\n }", "public static function performRouting(){\n // When patterns are defined, try to parse friendly URLs at first\n if(is_array(self::$urlPatterns)){\n if(self::performFriendlyRouting()){\n return;\n }\n }\n\n // Use standard routing method\n if(self::performStandardRouting()){\n return;\n }\n\n // Execute controller set as a fallback\n if(!self::executeController(self::$notFoundFallbackController)){\n die(\"Dispatcher: Failed to execute fallback controller\");\n }\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n if (config('admin-impersonate.enable_routes', true)) {\n Route::middleware(Arr::wrap(config('admin-impersonate.middleware.base')))\n ->prefix('admin-impersonate')\n ->name('nova.impersonate.')\n ->group(__DIR__.'/../routes/api.php');\n }\n }", "public function forAuthorization()\n {\n $this->router->group(['middleware' => 'web'], function ($router) {\n $router->post('/logout', [\n 'uses' => \"Auth\\LoginController@logout\",\n 'as' => 'logout',\n ]);\n $router->post('/change-password', [\n 'uses' => 'Auth\\ChangePasswordController@postChangePassword',\n 'as' => 'change-password',\n ]);\n $router->get('/change-password', [\n 'uses' => 'Auth\\ChangePasswordController@getChangePassword',\n 'as' => 'change-password',\n ]);\n });\n }", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function run(): void\n {\n $this->currentRoute = null;\n\n if (array_key_exists($currentRoute = $this->resolveRouterUri($this->currentUri), $this->routes[\"REDIRECT\"])) {\n $route = $this->routes[\"REDIRECT\"][$currentRoute];\n $redirectRoute = $this->getByName($route[\"redirect\"]);\n\n $this->redirectRoute(\n [$redirectRoute, $route],\n $route[\"permanent\"]\n );\n }\n\n $this->resolveRequestMethod();\n\n foreach ($this->routes[$this->requestMethod] as $route) {\n if (preg_match(\"~^\" . $route->getRoute() . \"$~\", $this->currentUri)) {\n $this->currentRoute = $route;\n }\n }\n\n $this->dispatchRoute();\n }", "protected function initializeController() {}", "public function controller()\n\t{\n\t\n\t}", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "protected function autoRegisterController()\n {\n $controllerInfo = $this->getController();\n if ($controllerInfo) {\n $uri = WingedLib::clearPath(static::$parentUri);\n $baseUri = '';\n if (!$uri) {\n $baseUri = './';\n } else {\n $uri = explode('/', $uri);\n if (isset($uri[0])) {\n $baseUri = './' . $uri[0] . '/';\n }\n if (isset($uri[1])) {\n $baseUri .= $uri[1] . '/';\n } else {\n $baseUri .= 'index/';\n }\n }\n if (!empty($controllerInfo['params'])) {\n foreach ($controllerInfo['params'] as $paramName => $optional) {\n if ($optional) {\n $baseUri .= '{$' . $paramName . '?}/';\n } else {\n $baseUri .= '{$' . $paramName . '}/';\n }\n }\n }\n Route::raw($baseUri, static::$controllerName . '@' . static::$controllerAction)->addResponseMiddleware(new ResponseMiddleware(function ($response) {\n if (is_array($response)) {\n /**\n * @var $this ResponseMiddleware\n */\n $self = &$this;\n if ($self->getRoute()->request()->isAcceptableType('application/json')) {\n $self->getRoute()->forceJson();\n } else if ($self->getRoute()->request()->isAcceptableType('application/xml')) {\n $self->getRoute()->forceXml();\n } else if ($self->getRoute()->request()->isAcceptableType('application/yaml')) {\n $self->getRoute()->forceYaml();\n }\n }\n }));\n }\n }", "public function run()\n {\n $uri = $this->getURI();\n\n // Check the availability of this request in the array of routes (routesOld.php)\n foreach ($this->routes as $uriPattern => $path) {\n\n // Compare $uriPattern and $uri\n if (preg_match(\"~$uriPattern~\", $uri)) {\n\n $internalRoute = preg_replace(\"~$uriPattern~\", $path, $uri);\n\n\n $segments = explode('/', $internalRoute);\n\n $controllerName = array_shift($segments) . 'Controller';\n $controllerName = ucfirst($controllerName);\n\n $action = array_shift($segments);\n $actionName = 'action' . ucfirst($action);\n\n $parameters = $segments;\n\n $controllerName = $this->controlNameSpace . $controllerName;\n $controllerObject = new $controllerName;\n\n return ['ref' => $controllerObject,\n 'actionName' => $actionName,\n 'args' => $parameters];\n\n }\n }\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n Route::namespace('Day4\\NovaForms\\Http\\Controllers')\n ->prefix('day4/nova-forms')\n ->group(__DIR__.'/../routes/api.php');\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }", "public function run()\n {\n Bouncer::allow('administrator')->everything();\n Bouncer::allow('shop-manager')->to('view', Order::class);\n Bouncer::allow('shop-manager')->to('view', Product::class);\n\n }", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "public function run()\n {\n $routes = new Routes($this->router);\n $routes->start();\n $this->router->start();\n }", "public function boot(): void\n {\n $this->configureRateLimiting();\n\n $this->routes(function () {\n Route::middleware('api')\n ->prefix('api')\n ->group(base_path('routes/api.php'));\n\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n });\n\n Route::bind('course', function($id) {\n /** @var User $user */\n $user = Auth::user();\n return $user->courses()->findOrFail($id);\n });\n Route::bind('category', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->categories()->findOrFail($id);\n });\n Route::bind('requirement', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->requirements()->findOrFail($id);\n });\n Route::bind('block', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->blocks()->findOrFail($id);\n });\n Route::bind('user', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->users()->findOrFail($id);\n });\n Route::bind('participant', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->participants()->findOrFail($id);\n });\n Route::bind('observation', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->observations()->findOrFail($id);\n });\n Route::bind('participantGroup', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->participantGroups()->findOrFail($id);\n });\n Route::bind('observationAssignment', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->observationAssignments()->findOrFail($id);\n });\n Route::bind('feedback_data', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->feedback_datas()\n ->with('feedbacks')\n ->with('feedbacks.participant')\n ->with('feedbacks.requirements')\n ->with('feedbacks.users')\n ->findOrFail($id);\n });\n Route::bind('feedback', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Participant $participant */\n $participant = $route->parameter('participant');\n return $participant->feedbacks()->findOrFail($id);\n });\n Route::bind('requirement_status', function($id, \\Illuminate\\Routing\\Route $route) {\n /** @var Course $course */\n $course = $route->parameter('course');\n return $course->requirement_statuses()->findOrFail($id);\n });\n\n parent::boot();\n }", "public function run ()\n\t\t{\n\t\t\t$uri = $this->getURI ();\n\t\t\t\n\t\t\tforeach ($this->routes as $uriPattern => $path) \n\t\t\t{\n\n\t\t\t\tif ( preg_match ( \"~$uriPattern~\", $uri) )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$internalRoute = preg_replace(\"~$uriPattern~\", $path, $uri);\n\n\t\t\t\t\t//Определяем контроллер, action(действие), параметры\n\t\t\t\t\t$segments = explode ( '/', $internalRoute );\n\n\t\t\t\t\t$controllerName = array_shift ( $segments ) . 'Controller';\n\t\t\t\t\t$controllerName = ucfirst ( $controllerName );\n\n\t\t\t\t\t$actionName = 'action' . ucfirst ( array_shift ( $segments ) );\n\n\t\t\t\t\t$parameters = $segments;\n\t\t\t\t\t\n\n\t\t\t\t\t$controllerFile = ROOT . '/controllers/' . \n\t\t\t\t\t\t$controllerName . '.php';\n\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists ( $controllerFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once ( $controllerFile );\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create new obj, that is call need method (that is action)\n\n\t\t\t\t\t$controllerObject = new $controllerName;\n\n\t\t\t\t\t// echo $controllerName.\" \".$actionName;\n\t\t\t\t\t/**\n\t\t\t\t\t * Calling need method ($actionName) a certain class ($contollerObject)\n\t\t\t\t\t * with given ($paramets) параметрами\n\t\t\t\t\t */\n\t\t\t\t\tif(method_exists($controllerObject, $actionName)) {\n\t\t\t\t\t\t$result = call_user_func_array (\n\t\t\t\t\t\t\t array ( $controllerObject, $actionName ), \n\t\t\t\t\t\t\t $parameters \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\trequire_once ROOT . '/views/error/error404.html';\n\t\t\t\t\t}\t\n\t\t\t\n\n\t\t\t\t\t//if method of controller is successeful, finish working router\n\t\t\t\t\tif ( $result != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t} \n\n\t\t\t}\n\n\t\t}", "public function run()\n {\n $this->executeStaticRoutes();\n $this->executeGroupRoutes();\n }", "protected function registerRouteBindings()\n {\n //\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "private function run()\n {\n $dispatcher = $this->getDispatcher(self::getConfigSection('routes'));\n\n $routeInfo = $dispatcher->dispatch(self::getRequest('method'), self::getRequest('path'));\n\n switch ($routeInfo[0]) {\n case \\FastRoute\\Dispatcher::NOT_FOUND:\n $this->errorNotFound();\n break;\n case \\FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $this->error405();\n break;\n case \\FastRoute\\Dispatcher::FOUND:\n $this->actionParams = $routeInfo[2];\n $handler = explode('.', $routeInfo[1]);\n $this->controllerName = 'app\\controllers\\\\' . ucfirst($handler[0]) . 'Controller';\n $controllerFile = ucfirst($handler[0]) . 'Controller.php';\n $this->actionName = 'action' . ucfirst($handler[1]);\n $this->actionSlug = $handler[0] . '.' . $handler[1];\n if (!file_exists(self::$request['root_path'] . '/app/controllers/' . $controllerFile) ||\n !method_exists($this->controllerName, $this->actionName)) {\n //there is not a controller file or action name == index\n if (App::getConfig('app.debug')) {\n echo 'There is not a controller file \"' . $controllerFile . '\" or action name == index';\n }\n $this->errorNotFound();\n }\n if (isset($handler[2])) {\n //part of hangler for checking permissions\n if ($handler[2] == 'auth') {\n //need login and not logged\n if (App::isGuest()) {\n $this->redirect(App::getConfig('app.login_url'));\n }\n } else {\n //check permission for $handler[2]\n $auth = self::getComponent('auth');\n $user = self::getUser();\n $checkUser = $user ? $auth->hasAccessTo($user->email, $handler[2]) : false;\n if (!$checkUser) {\n //user does not exists or user does not have a permission\n $this->error405();\n }\n }\n }\n break;\n }\n $this->startAction();\n }", "function _route()\n\t{\n\t\t// if the user login redirect to base\n\t\tif(\\lib\\permission::access('enter:another:session'))\n\t\t{\n\t\t\t// the admin can login by another session\n\t\t\t// never redirect to main\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent::if_login_not_route();\n\t\t}\n\n\t\t// check remeber me is set\n\t\t// if remeber me is set: login!\n\t\tparent::check_remember_me();\n\n\t\t// save all param-* | param_* in $_GET | $_POST\n\t\t$this->save_param();\n\n\t\tif(self::get_request_method() === 'get')\n\t\t{\n\t\t\t$this->get(false, 'enter')->ALL();\n\t\t}\n\t\telseif(self::get_request_method() === 'post')\n\t\t{\n\t\t\t$this->post('enter')->ALL();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::error_method('home');\n\t\t}\n\t}", "private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }", "public function run()\n {\n $this->router->listen();\n }", "public function resolve(): void\n {\n $path = $this->request->path();\n $method = $this->request->method();\n $handler = $this->routes[$method][$path] ?? false;\n\n if (!$handler) {\n $this->response->showNotFoundPage();\n return;\n }\n\n [$controller, $method] = $handler;\n\n (new $controller())->$method($this->request);\n }", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }", "public function run()\n {\n \t$router = Injector::call('\\Nanozen\\Providers\\CustomRouting\\CustomRoutingProvider');\n \t\n \t// Setting up the routes.\n\t\t$this->setupRoutes($router);\n\n // Invoking the router.\n $router->invoke();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "protected function routes()\n { \n Route::middleware([])\n ->prefix('api')\n ->namespace(__NAMESPACE__.'\\\\Http\\\\Controllers')\n ->name('sofre.api.')\n ->group(__DIR__.'/../routes/api.php');\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public function run(){\n $this->session->start();\n $this->request->prepareUrl();\n $this->file->require('App/index.php');\n list($controller,$method,$arguments) = $this->route->getProperRoute();\n }", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function Route() {\n\t\tif(isset($_GET['m']))\n\t\t\tif($_GET['m'] == 'ajax')\n\t\t\t\tinclude __SITE_PATH . '/controller/ajax_controller.class.php';\n\t\t// Load controller\n\t\t$controller_name = $this->getController();\n\t\t$this->loadController($controller_name);\n\t\t// Instantiate controller\n\t\t$class_name = $this->getControllerClassName($controller_name);\n\t\t$controller = new $class_name();\n\t\t// Is controller access restricted?\n\t\tif($controller->authNeeded() && !Session::isAuthenticated()) {\n\t\t\t// Route to login screen if there is no authed session\n\t\t\t$this->loadController(\"login\");\n\t\t\t$controller = new LoginController();\n\t\t}\n\t\t// Execute controller action\n\t\t$action = $this->getAction();\n\t\t$this->executeAction($controller, $action);\n\t}", "public function indexController()\n\t{\n\t\t$auth = new Authentification();\n\t}", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }" ]
[ "0.68514913", "0.65694004", "0.6508649", "0.64679736", "0.64679736", "0.6462121", "0.644508", "0.6424415", "0.64102674", "0.63995534", "0.6388593", "0.6287674", "0.6281324", "0.62795675", "0.6276876", "0.6263456", "0.6238969", "0.6162652", "0.6156628", "0.61524135", "0.6091652", "0.60670483", "0.60617983", "0.6044683", "0.6022996", "0.6015832", "0.6006977", "0.59943384", "0.5993684", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993614", "0.5993149", "0.5948187", "0.59419763", "0.5927389", "0.59247535", "0.58987224", "0.589669", "0.5896601", "0.5895465", "0.5892043", "0.5889669", "0.5861529", "0.5852713", "0.5851209", "0.58468133", "0.58357584", "0.5826929", "0.58164406", "0.58057576", "0.58015996", "0.5796723", "0.5785066", "0.5782298", "0.57794577", "0.5766647", "0.5766417", "0.5757291", "0.5752187", "0.57503045", "0.57482094", "0.57480955", "0.5739749", "0.57378334", "0.57262176", "0.57251436", "0.57161605", "0.5710837", "0.5701753", "0.569973", "0.5670671" ]
0.0
-1
Display a listing of the resource.
public function index() { //get all the woodlands and make them available to use in the view $woodlands = Woodland::all(); //return the admin woodlands view return view('/admin/woodlands/index', ['woodlands' => $woodlands]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { //returns the admin woodlands create view if the create controller //is activated return view('admin.woodlands.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { /*ensures that all data created by the user is stored in the woodland database*/ $woodland = Woodland::create($request->all()); return redirect('admin/woodlands'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { /*This shows the details of a woodland when selected and loads the show view if there is a woodland matching the selected woodland id*/ $woodland = Woodland::where('id', $id)->first(); if(!$woodland) { return redirect('/admin/woodlands'); } return view('/admin/woodlands/show')->withWoodland($woodland); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { /*allows the editing of a woodland database record if the woodland id exists. Loads the edit view*/ $woodland = Woodland::findOrFail($id); return view('admin.woodlands.edit', compact('woodland')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { /*allows the updating of the database record and returns the admin wooldnad view*/ $woodland = Woodland::findOrFail($id); $woodland->update($request->all()); return redirect('admin/woodlands'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { /*allows the deletion of a woodland record*/ $woodland = Woodland::find($id); $woodland->delete(); return redirect('admin/woodlands'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Events based on state
public function state($state = null) { $q = \App\Event::with('venue.city.states') ->whereHas('venue.city.states', function ($query) use ($state) { $query->where('abbr', strtoupper($state)); }); $q = $this->handleRequest($q); return $q->orderby('start_date', 'asc') ->paginate($this->paginate)->appends(request($this->params)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function stateChanged($event)\r\n {\r\n }", "public function onEvent();", "public function onEnterState() {\n\n }", "abstract public function setState() ;", "abstract public function states();", "abstract function HookEvents();", "public function event()\n {\n switch ($this->status_changed) {\n case \"in_progress\":\n return \"set to In Progress\";\n case \"completed\":\n return \"closed\";\n case \"submitted\":\n return \"reopened\";\n }\n }", "public static function events();", "private function _do_state(State $state = null) {\n\n if (method_exists($this, self::PFX_STATE . $state->event)) {\n\n log&&msg('found state EVENT, setting state to: ', $state);\n\n $response = call_user_func(array($this, self::PFX_STATE . $state->event), $state);\n\n if ($response !== false) {\n $response['event'] = $state->event;\n $response['address'] = $state->to_address();\n\n // this state becomes the new Active\n $state->activate();\n\n log&&msg('called STATE:', $state, 'RESPONSE is: ', $response);\n return $response;\n }\n }\n return false;\n }", "public function interact(State $state);", "abstract public function getState() ;", "public function getOnStateName() {}", "protected static function on_change_order_state($order)\n {\n \n }", "public function updateState($state);", "public static function __events () {\n \n }", "public function updateState(GenericEvent $event)\n {\n $unit = $this->getInventoryUnit($event);\n\n $transitionName = $event->getArgument('transition');\n\n $this->factory->get($unit, InventoryUnitTransitions::GRAPH)->apply($transitionName);\n $this->factory->get($unit, ShipmentItemTransitions::GRAPH)->apply($transitionName);\n }", "public function initChangeStateContent()\n {\n }", "public function state();", "abstract public function getEventName();", "public function event_joined()\r\n\t{\r\n\t\r\n\t}", "public function engine_state() {\r\n echo PHP_EOL;\r\n $this->action(\"checking engine\");\r\n if ($this->engine_on) {\r\n $this->action(\"engine is on! Don't forget to turn it off\");\r\n }\r\n else {\r\n $this->action(\"engine is off\");\r\n }\r\n }", "public function getActiveState();", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::fetch('app');\n $filter_order = $app->getUserStateFromRequest('Source.filter_order','filter_order','s.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Source.filter_order_Dir','filter_order_Dir','asc');\n\n //set states\n $this->state->set('Source.filter_order',$filter_order);\n $this->state->set('Source.filter_order_Dir',$filter_order_Dir);\n }", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState() {}", "public function getState() {}", "public function getState() {}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function setState($state) {}", "public function viewEvents();", "public function send_events()\n {\n }", "protected function _getState($name) {}", "public function fireStateChange($old_sate, $new_state) {\n\t\t$event = new BLW_PSP_StateChangeEvent($this->source);\n\t\t$event->setOldState($old_sate);\n\t\t$event->setNewState($new_state);\n\t\tforeach ($this->listeners as $listener) {\n\t\t\t$listener->perform($event);\n\t\t}\n\t}", "public function commitEvents();", "function stateMachine() {\n\t\tif ($_SESSION['order_condition'] == 'RW') {\n\t\t\tswitch($_SESSION['state']) {\n\t\t\t\tcase \"START\":\t\n\t\t\t\t\t$_SESSION['section_order'] = 1;\n\t\t\t\t\t$_SESSION['section_total'] = 27;\n\t\t\t\t\tstateTransition('pages/ethics.html', 'DEMOGRAPHICS');\n\t\t\t\t\t//stateTransition('pages/ethics.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DEMOGRAPHICS\":\n\t\t\t\t\tstateTransition('pages/demographics.html', 'INSTR_EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_SCRIPT\":\n\t\t\t\t\tstateTransition('pages/before_learn_letters.html', 'SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SCRIPT\":\n\t\t\t\t\tstateTransition('pages/learn_letters.html', 'INSTR_R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_R_TR1\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR1\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR1\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR1\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR2\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR2\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR2\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR2\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_EXPOSURE3');\n\t\t\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR3\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR3\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR3\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR3\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_R_TEST\":\n\t\t\t\t\tstateTransition('pages/before_reading_test.html', 'R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TEST\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TEST\":\n\t\t\t\t\tstateTransition('pages/before_writing_test.html', 'W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TEST\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'QUESTIONNAIRE');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"QUESTIONNAIRE\":\n\t\t\t\t\tstateTransition('pages/questionnaire.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"END\":\n\t\t\t\t\tstateTransition('pages/end.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tswitch($_SESSION['state']) {\n\t\t\t\tcase \"START\":\t\n\t\t\t\t\t$_SESSION['section_order'] = 1;\n\t\t\t\t\t$_SESSION['section_total'] = 27;\n\t\t\t\t\tstateTransition('pages/ethics.html', 'DEMOGRAPHICS');\n\t\t\t\t\t//stateTransition('pages/ethics.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DEMOGRAPHICS\":\n\t\t\t\t\tstateTransition('pages/demographics.html', 'INSTR_EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_SCRIPT\":\n\t\t\t\t\tstateTransition('pages/before_learn_letters.html', 'SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SCRIPT\":\n\t\t\t\t\tstateTransition('pages/learn_letters.html', 'INSTR_W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_W_TR1\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR1\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR1\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR1\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR2\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR2\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR2');\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase \"INSTR_R_TR2\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR2\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR3\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR3\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR3\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR3\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_W_TEST\":\n\t\t\t\t\tstateTransition('pages/before_writing_test.html', 'W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TEST\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TEST\":\n\t\t\t\t\tstateTransition('pages/before_reading_test.html', 'R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TEST\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'QUESTIONNAIRE');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase \"QUESTIONNAIRE\":\n\t\t\t\t\tstateTransition('pages/questionnaire.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"END\":\n\t\t\t\t\tstateTransition('pages/end.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\t// switch end\n\t\t}\t// condition end\n\t}", "public function __construct()\n {\n // default event state\n $this->set_state(self::STATE_INACTIVE);\n }", "abstract protected function handle($event);", "function __construct()\n\t{\n\t\t$this->events[\"AfterSuccessfulLogin\"]=true;\n\n\n\t\t$this->events[\"ModifyMenuItem\"]=true;\n\n\n//\tonscreen events\n\n\n\t\t$this->events[\"IsRecordEditable\"][\"demo_user\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indschedule\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"loans\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payroll\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltab\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"earningadjustment\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrollearnadj\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolldeductions\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrollstatutories\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltax\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payroll21\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leaves11\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leavesapp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indschedrange\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"empdtr\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefile\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolldiv\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leavesapp2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog1\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog3\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_user_open\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefileapp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefileapp2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_useremp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltab1\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indscheduleemp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_useractive\"] = true;\n\n\t\t}", "public function updatedStateEmployee(){\n $this->clearTime();\n }", "public static function onStateChanged(callable $invoker)\n {\n }", "public function getState()\n {\n }", "public function changeStatus()\n {\n }", "public function run()\n {\n $state = new State();\n $state->description = 'Em aberto';\n $state->save();\n\n $state = new State();\n $state->description = 'Finalizado';\n $state->save();\n\n $state = new State();\n $state->description = 'Cancelado';\n $state->save();\n\n $state = new State();\n $state->description = 'Inválido';\n $state->save();\n }", "public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "protected function _setState($name, $state) {}", "public function handleChangeStatus()\n\t{\n // TODO: nechat overenie na parmission listener\n\t\tif (!$this->user->isAllowed('position', 'changeStatus')) {\n\t\t\t$this->flashMessage(_('For this action you do not have enough privileges.'), 'danger');\n\t\t\t$this->redirect(':Admin:Dashboard:');\n\t\t}\n\n $this->positionStatusFilter->setEnabled(false);\n \n\t\t$this->repository->changeStatus(['id' => $this->id]);\n\n if ($this->isAjax()) {\n $this->redrawControl('positionStatus');\n } else {\n $this->redirect('this');\n }\n\t}", "public function on_change($new_value){\n $this->create_event(\n \"motion\",\n $new_value ? \"active\" : \"inactive\"\n );\n }", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function setState($state);", "public function state(){\n return $this->state;\n }", "public function getStateMessage();", "public function isValueChanged();", "function AutomatSwitchState() {\r\n\r\n // Store current state to statefrom field\r\n $query = \"update actsessions \";\r\n $query .= \"set statefrom=$this->AutomatState \";\r\n $query .= \"where seshid='$this->seshid'\";\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"AutomatSwitchState. query: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n $result=mysqli_query($this->linkid,$query);\r\n // query failed\r\n if (!$result) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=204;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n\r\n // Store new state to state field\r\n $query = \"update actsessions \";\r\n $query .= \"set state=$this->NewAutomatState \";\r\n $query .= \"where seshid='$this->seshid'\";\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"AutomatSwitchState. query: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n $result=mysqli_query($this->linkid,$query);\r\n // query failed\r\n if (!$result) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=204;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n\r\n }\r\n $this->PreviousAutomatState = $this->AutomatState;\r\n $this->AutomatState = $this->NewAutomatState;\r\n return;\r\n }", "public function getViewState() {}", "function event($event=null) {\n switch ($event) { \n case 'payreturn': // Order was successful...\n\t $this->handle_Transaction('success');\n\t\t\t\t\t $this->savelog(\"PAYPAL PAYMENT:SUCCESS!!!\");\n\t break;\n case 'paycancel' : //$this->savelog(\"PAYPAL PAYMENT:CANCELED\");\t\n\t \t $this->handle_Transaction('cancel');\n\t\t\t\t\t $this->savelog(\"PAYPAL PAYMENT:CANCELED!!!\");\n\t break;\n case 'payipn' : // Paypal is calling page for IPN validation...\t\n $this->paypal_ipn();\n\t\t if ($status==true)\n \t $this->savelog(\"PAYPAL PAYMENT:IPN IN PROCEESS!!!\");\t\t\n\t\t else\n\t\t $this->savelog(\"PAYPAL PAYMENT:IPN STATUS ERROR!!!\");\t\t\t\n\t break;\n\t\t\t\t\t \n default : \n\t case 'stutpay':\n\t case 'process': $this->savelog(\"PAYPAL PAYMENT:INITIALIZE!!!\");\n\t \n\t $this->p->add_field('address_override', '1');\n $cust_data = GetGlobal('controller')->calldpc_method(\"stutasks.get_customer_details use \".$this->transaction); \t\t\t\t\t \n\t\t\t\t\t $this->p->add_field('address1', $cust_data[4]);\n\t\t\t\t\t $this->p->add_field('address2', $cust_data[5]);\n\t\t\t\t\t $this->p->add_field('city', $cust_data[2]);\n\t\t\t\t\t //$this->p->add_field('country', 'EUR'); //must be country code\n\t\t\t\t\t $this->p->add_field('first_name', $cust_data[0]);\n\t\t\t\t\t $this->p->add_field('last_name', $cust_data[1]);\n\t\t\t\t\t $this->p->add_field('zip', $cust_data[6]);\n\t\t\t\t\t \n\t\t\t\t\t $this->p->add_field('charset', $this->mycharset);//choose based on site lang\n\t\t\t\t\t \n\t $this->p->add_field('currency_code', 'EUR');\n\t\t\t\t\t $this->p->add_field('invoice', $this->transaction );\n\t \t \n $this->p->add_field('business', $this->paypal_mail);//'YOUR PAYPAL (OR SANDBOX) EMAIL ADDRESS HERE!');\n $this->p->add_field('return', $this->this_script.'?t=payreturn&type=invoice&key='.GetReq('key').'&tid='.$this->transaction); //back to invoice view\n $this->p->add_field('cancel_return', $this->this_script.'?t=paycancel&type=invoice&key='.GetReq('key').'&tid='.$this->transaction); //back to invoice view\n $this->p->add_field('notify_url', $this->this_script.'?t=payipn&type=invoice&key='.GetReq('key').'&tid='.$this->transaction);\n \n $name = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_title use \".$this->transaction); \t \n $this->p->add_field('item_name', $name);\n \n $price = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_amount use \".$this->transaction);\n $this->p->add_field('amount', $price); \t\t\t\t\t \n\t\t\t\t\t \n $itemqty = GetGlobal('controller')->calldpc_method(\"stutasks.get_task_pay_qty use \".$this->transaction);\n $this->p->add_field('quantity', $itemqty); \t\t\t\t\t \n\t\t\t\t\t \n\t if ($price>0) {\t\n $this->p->submit_paypal_post(); // submit the fields to paypal\n\t\t\t\t\t die();\n\t }\n\t\t\t\t\t break;\t\t \n\t }\n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n $view = $this->app->input->get('view');\n\n //TODO add these limits to the switch statement to support multiple pages and layouts\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('People.filter_order','filter_order','p.last_name');\n $filter_order_Dir = $app->getUserStateFromRequest('People.filter_order_Dir','filter_order_Dir','asc');\n $people_filter = $app->getUserStateFromRequest('People.'.$view.'_name','name',null);\n\n //set states for reports\n $this->state->set('People.filter_order',$filter_order);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.'.$view.'_name',$people_filter);\n\n }", "public function DoEvent($nEvent) {}", "public function onIndexFirst(IStateEvent $event)\n\t{\n\t $event->getFlow()->set('name', 'first');\n\t}", "function MyEvents_Handle_Open()\n {\n $this->InscriptionsObj()->InitActions();\n\n echo\n $this->OpenEventsHtmlTable().\n \"\";\n }", "public function setState($state){\n $this->state=$state;\n }", "function eventclass_offeraride()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "function onEvent($element_id)\r\n\t{\r\n\t\t\r\n\t}", "private function welcome_states()\n {\n $this->gamestate->refresh();\n $this->data['round-number'] = $this->gamestate->get_round();\n $this->data['round-state'] = $this->gamestate->get_state();\n $this->data['round-countdown'] = $this->gamestate->get_countdown();\n $this->data['round-agent'] = $this->agent->is_registered() ? \"Registered\" : \"Not registered\";\n }", "public function handles_events()\n\t{\n\t\treturn false;\n\t}", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "function _event_change($act, $params)\n\t{\n\n\n\t\tswitch ($act)\n\t\t{\n\t\t\tcase 'del':\n\t\t\t{\n\t\t\t\t$where \t= $params[0];\n\t\t\t\tif (isset($where[$this->key]))\n\t\t\t\t{\n\t\t\t\t\t$id = $where[$this->key];\n\t\t\t\t\t// Xoa noi dung lang\n\t\t\t\t\tmodel('cat_content')->del($id);\n\n\t\t\t\t\t// Cap nhat lai cache\n\t\t\t\t\t// chu y du cat co su dung song ngu, do do phan add, edit dc goi truoc cat_content model update du lieu\n\t\t\t\t\t// do do ta phai goi update cache o trong Controller khi goi ham add,edit\n\n\t\t\t\t\t//$where \t= $params[0];\n\t\t\t\t\t//$id = $where[$this->key];\n\t\t\t\t\t/*$info =$this->get_info($id);\n\t\t\t\t\t// Cap nhat lai cache\n\t\t\t\t\t$this->cache_update($info->type);\n\t\t\t\t\t$this->cache_update('_all');*/\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t}", "public function getTargetStates();", "private function _initEvents()\n {\n $onOrder = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $sidx = $params['sidx'];\n\n switch (strtoupper($params['sord'])) {\n case 'DESC':\n $sord = Solarium_Query_Select::SORT_DESC;\n break;\n default:\n $sord = Solarium_Query_Select::SORT_ASC;\n break;\n }\n\n $query = $dataSource->getQuery();\n $query->clearSorts();\n $query->addSort($sidx, $sord);\n };\n\n $this->_onOrder = $onOrder;\n\n $onFilter = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $solariumQueryHelper = new Solarium_Query_Helper();\n $filters = json_decode($params['filters']);\n\n $query = $dataSource->getQuery();\n $queryString = '';\n\n foreach ($filters->rules as $field) {\n if ('' != $field->data) {\n $queryString .= $field->field . ':'\n . $solariumQueryHelper->escapeTerm($field->data) . ' AND ';\n }\n }\n\n if ('' != $queryString) {\n $queryString = substr($queryString, 0, strlen($queryString) - 4);\n $query->setQuery($queryString);\n }\n };\n\n $this->_onFilter = $onFilter;\n }", "function eventclass_program_billing()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public static function getResetStateEvents();", "function eventclass_slot()\n\t{\n\n//\tonscreen events\n\n\t}", "public function run()\n {\n $subjectStates = [\n [\n 'state' => 'Mandatory',\n 'description' => 'Must be taken by student to move onto next form',\n ],\n [\n 'state' => 'Optional',\n 'description' => 'Student can select this subject or an equivalent subject type',\n ]\n ];\n\n foreach ($subjectStates as $subjectState) {\n SubjectState::create($subjectState);\n };\n }", "private function dispatchStatusEvents(StatusChanged $event): void\n {\n $status = $event->getStatus();\n $eventNamesForStatus = $this->configProvider->getEventsForStatus((string)$status->getIdentifier());\n\n foreach ($eventNamesForStatus as $nextEventClassName) {\n try {\n $nextEvent = $this->eventCreator->createForTrackable($nextEventClassName, $event->getTrackable());\n\n $this->eventDispatcher->dispatch($nextEvent);\n } catch (TrackableEventCreationFailed $exception) {\n $this->logger->error(\n sprintf('Failed to dispatch event: `%s`. %s', $nextEventClassName, $exception->getMessage()),\n $exception->getTrace()\n );\n }\n }\n }", "public function stateUpdate(){\n return $this->update;\n }", "public function run() {\n foreach ($this->data as $key => $value) {\n State::create($value);\n }\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "public function stateTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken('get');\n\n\t\t// Incoming\n\t\t$id = Request::getInt('id', 0);\n\t\t$state = strtolower(Request::getWord('state', 'up'));\n\n\t\tif ($state != 'up' && $state != 'down')\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$row = new Middleware\\Location($id);\n\t\tif ($row->exists())\n\t\t{\n\t\t\t$row->set('state', $state);\n\t\t\tif (!$row->store())\n\t\t\t{\n\t\t\t\tApp::redirect(\n\t\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false),\n\t\t\t\t\tLang::txt('COM_TOOLS_ERROR_STATE_UPDATE_FAILED'),\n\t\t\t\t\t'error'\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t);\n\t}", "function setState($newState){\n $this->state = $newState;\n }", "protected function updateActivationStates() {\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_user_notification_event_to_user\n\t\t\tWHERE\t\teventID = ?\n\t\t\t\t\tAND userID = ?\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\tWCF::getDB()->beginTransaction();\n\t\t$enableEventIDs = array();\n\t\tforeach ($this->settings as $eventID => $settings) {\n\t\t\t$statement->execute(array(\n\t\t\t\t$eventID,\n\t\t\t\tWCF::getUser()->userID\n\t\t\t));\n\t\t\t\n\t\t\tif ($settings['enabled']) {\n\t\t\t\t$enableEventIDs[] = $eventID;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($enableEventIDs)) {\n\t\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_user_notification_event_to_user\n\t\t\t\t\t\t(eventID, userID)\n\t\t\t\tVALUES\t\t(?, ?)\";\n\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t\tforeach ($enableEventIDs as $eventID) {\n\t\t\t\t$statement->execute(array(\n\t\t\t\t\t$eventID,\n\t\t\t\t\tWCF::getUser()->userID\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tWCF::getDB()->commitTransaction();\n\t}", "public function validateEventState(string $state): void\n {\n if ($this->payload->object_attributes->state !== $state) {\n throw new Exception(\n \"Invalid state. Expected {$state} but found {$this->payload->object_attributes->state}\",\n 200\n );\n }\n }", "public function viewAllEvents();", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }" ]
[ "0.6769844", "0.6442808", "0.6389908", "0.60114294", "0.5905883", "0.5873452", "0.58672667", "0.5749822", "0.57391715", "0.5703815", "0.5696644", "0.56621796", "0.56332904", "0.5617514", "0.560276", "0.56009257", "0.55694604", "0.5569249", "0.55611193", "0.5545903", "0.55243623", "0.55190396", "0.549885", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5487369", "0.5487125", "0.54862475", "0.544321", "0.544321", "0.54360145", "0.54004264", "0.53945917", "0.5389943", "0.5365109", "0.53601354", "0.5355364", "0.5338765", "0.5331852", "0.52815014", "0.5266214", "0.52556306", "0.5249651", "0.5232693", "0.5215819", "0.51954156", "0.5172276", "0.5165482", "0.5165482", "0.5165482", "0.5165349", "0.516361", "0.51634854", "0.5162993", "0.516133", "0.51244783", "0.5123207", "0.51003426", "0.5094703", "0.50822407", "0.5070984", "0.5068936", "0.50644135", "0.50608504", "0.50567293", "0.5048866", "0.5047481", "0.5040791", "0.5035001", "0.5026762", "0.5024891", "0.5013103", "0.5005079", "0.4997547", "0.4996443", "0.49824122", "0.49718216", "0.49717364", "0.4967797", "0.4965381", "0.49589", "0.49546474", "0.49536735", "0.49430552", "0.49422222", "0.49381265", "0.49374318", "0.49368545", "0.49253714" ]
0.0
-1
Events based on type.
public function type($type = null) { $q = \App\Event::with('venue.city.states'); $q = $this->handleRequest($q); return $q->where('type', $type) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setEventType()\n {\n $this->_eventType = 12;\n }", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "function getType ()\n\t\t{\n\t\t\treturn \"Event\";\n\t\t}", "public function type_handler() {\r\n\t\t\r\n\t\t\t$this->next_step();\r\n\t\r\n\t}", "public function onTickettypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public static function TotTypeEvents($type){\r\n $type = self::$conn->real_escape_string($type);\r\n $query = \"SELECT id FROM tipoevento WHERE nome='$type'\";\r\n $result = self::$conn->query($query);\r\n if($result->num_rows != 1)\r\n return -1;\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n $type = $row[0];\r\n $query = \"SELECT count(*) FROM evento WHERE tipo='$type' AND blocked=FALSE\";\r\n\t\t$result = self::$conn->query($query); \r\n if($result){\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return (int)$row[0]; \r\n }\r\n return 0;\r\n }", "public function findByType($type){\r\n $stmt = $this->db->prepare(\"SELECT * FROM event WHERE type =?\");\r\n $stmt->execute(array($type));\r\n\r\n $events_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n $events = array();\r\n\r\n foreach($events_db as $event){\r\n array_push($events, new Event($event[\"id_event\"], $event[\"type\"], $event[\"name\"],$event[\"moment\"], $event[\"date\"],\r\n $event[\"guests\"], $event[\"children\"], $event[\"sweet_table\"], $event[\"observations\"],\r\n $event[\"restaurant\"], $event[\"phone\"],$event[\"price\"] ));\r\n }\r\n\r\n return $events;\r\n }", "function get_type_events()\n{\n return 'atu_events';\n}", "private function fireEvent($type, $parameters)\n\t{\n\t\tEvent::fire(\"orchestra.{$type}: users\", $parameters);\n\t\tEvent::fire(\"orchestra.{$type}: user.account\", $parameters);\n\t}", "private function _ratepayMassEvent($type)\n {\n $counter = 0;\n $msg = null;\n $error = null;\n foreach ($this->getRequest()->getParam('order_id') as $orderId) {\n $order = Mage::getModel('sales/order')->load($orderId);\n if ($this->_isEventPossible($type, $order)) {\n try {\n $this->_ratepayEvent($type, $order);\n $counter++;\n } catch (Exception $e) {\n $error .= $e->getMessage() . ' Order # ' . $order->getIncrementId() . '<br/>';\n } \n } else {\n $msg = Mage::helper('ratepaypayment')->__('The order with the number %s can not be '. $type . 'ed.<br/>', $order->getIncrementId());\n }\n }\n\n if (!empty($msg)) {\n Mage::getSingleton('adminhtml/session')->addNotice($msg);\n }\n \n if (!empty($error)) {\n Mage::getSingleton('adminhtml/session')->addError($error);\n }\n \n if ($counter > 0) {\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('ratepaypayment')->__('Total of %d record(s) were '. $type . 'ed.', $counter));\n }\n }", "public function trigger($type, $data){}", "public function setEvent($type, $data) {\n // $type is a string, and $data is an associative array.\n //\n // Enhancement idea: names of args\n $method = '/*method*/';\n $data = array(\"method\" => $method, \"args\" => func_get_args());\n array_push($this->__history, array(\"call\" => $data));\n }", "public function loadMultipleByEvent($event, $type = 'outgoing');", "public function getType() {\n\t\treturn $this->eventType;\n\t}", "public static function getAllEventsByType($type)\n {\n $db = new Database();\n // Create an admin DB connection to get data from Events_Details table\n $adminDB = $db->getAdminDBConnection();\n // Query database for eid and get all details\n $query = \"SELECT * FROM Event_Details WHERE Type='\" . $type . \"' AND status=1;\";\n // Prepare query statement\n $stmt = $adminDB->prepare($query);\n // Execute query\n $stmt->execute();\n // Fetch all rows as associative array\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n }", "public function eventsGetEventTypes()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/types';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Accept' => 'application/json',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'IdfyLib\\\\Models\\\\EventTypeInfo');\n }", "public function getEventType(): string;", "public function __construct(int $type)\n {\n $this->_eventType = $type;\n }", "public function add_event($type, $method_name)\n\t{\n\t\tif (!array_key_exists($type, $this->_events)) $this->_events[$type] = array();\n\t\t$this->_events[$type][] = $method_name;\n\t}", "abstract protected function listensTo($typeName);", "function vtlib_handler($modulename, $event_type) {\n\t\tif($event_type == 'module.postinstall') {\n\t\t\t// TODO Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, $modulename.'-', '0000001');\n\t\t} else if($event_type == 'module.disabled') {\n\t\t\t// TODO Handle actions when this module is disabled.\n\t\t} else if($event_type == 'module.enabled') {\n\t\t\t// TODO Handle actions when this module is enabled.\n\t\t} else if($event_type == 'module.preuninstall') {\n\t\t\t// TODO Handle actions when this module is about to be deleted.\n\t\t} else if($event_type == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($event_type == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t}\n\t}", "function setEventType() // OK\n {\n }", "private function logTypeChange( $params = array() ){\t\t\r\n\t\t// if new change have been detected, send a notification email\r\n\t\tif( $new_changes = $this->updateTypeChangeStorage($params) ){\r\n\t\t\t$this->sendNotificationEmailTypeChange(array(\r\n\t\t\t\t'type' => $params['type'],\r\n\t\t\t\t'changes' => $new_changes,\r\n\t\t\t));\r\n\t\t}\r\n\t}", "function vtlib_handler($modulename, $event_type) {\n\t\tglobal $adb;\n\t\trequire_once('include/events/include.inc');\n\t\tinclude_once('vtlib/Vtiger/Module.php');\n\t\t$em = new VTEventsManager($adb);\n\t\tif($event_type == 'module.postinstall') {\n\t\t\t// TODO Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, 'TIME-BILLING-', '000001');\n\t\t\t$em->registerHandler('corebos.filter.CalendarModule.save', 'modules/Timecontrol/TCCalendarHandler.php', 'TCCalendarHandler');\n\t\t\t$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');\n\t\t\tself::addTSRelations();\n\t\t} else if($event_type == 'module.disabled') {\n\t\t\t// TODO Handle actions when this module is disabled.\n\t\t} else if($event_type == 'module.enabled') {\n\t\t\t// TODO Handle actions when this module is enabled.\n\t\t} else if($event_type == 'module.preuninstall') {\n\t\t\t// TODO Handle actions when this module is about to be deleted.\n\t\t} else if($event_type == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($event_type == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t\t$adb->query(\"update vtiger_field SET typeofdata='D~M', uitype=5 WHERE tablename='vtiger_timecontrol' and columnname='date_start'\");\n\t\t\t$adb->query(\"update vtiger_field SET typeofdata='D~O', uitype=5 WHERE tablename='vtiger_timecontrol' and columnname='date_end'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, uitype=14 WHERE tablename='vtiger_timecontrol' and columnname='time_start'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, uitype=14 WHERE tablename='vtiger_timecontrol' and columnname='time_end'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, typeofdata='V~O' WHERE tablename='vtiger_timecontrol' and columnname='totaltime'\");\n\t\t\t$adb->query(\"ALTER TABLE vtiger_timecontrol ADD relatednum VARCHAR(255) NULL, ADD relatedname VARCHAR(255) NULL\");\n\t\t\t$adb->query(\"ALTER TABLE vtiger_timecontrol CHANGE invoiced invoiced VARCHAR(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0'\");\n\t\t\t$adb->query(\"UPDATE vtiger_timecontrol SET `invoiced`=0 WHERE invoiced!=1 or invoiced is null\");\n\t\t\t$em->registerHandler('corebos.filter.CalendarModule.save', 'modules/Timecontrol/TCCalendarHandler.php', 'TCCalendarHandler');\n\t\t\t$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');\n\t\t}\n\t}", "public function validateEventType(string $type): void\n {\n if ($this->payload->object_kind !== $type) {\n throw new Exception(\n \"Invalid event type. Expected {$type} but found {$this->payload->object_kind}\",\n 200\n );\n }\n }", "private function emitEvent($type, $notification)\n\t{\n\t\t$namespace = \\Config::get('notifications::config.package_prefix') . '.' . $type;\n\t\t\\Event::fire($namespace, array($notification));\n\t}", "function plugin_forum_admin_events($type, $parms)\n{\n\t//We currently only care about system cache, so just return if it's not\n\tif(!isset($parms['syscache']) || !$parms['syscache']) { return ''; }\n\tswitch($type)\n\t{\n\t\tcase 'cache_clear':\n\t\t\t$which = varset($parms['cachetag']);\n\t\t\tif('nomd5_classtree' == $which)\n\t\t\t{\n\t\t\t\treturn 'plugin_forum_admin_events_clear_moderators';\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "function callbackTypePressed($entry,$event) {\n \n \n $this->table->database->designer->activeColumn = &$this;\n \n $v = $entry->get_text();\n $w = $this->table->database->glade->get_widget('type_'.$v);\n \n $w->set_active(true);\n $this->table->database->designer->menu->popup(null, null, null, (int) $event->button, (int) $event->time);\n \n \n }", "static function getDefaultGLPIEvents($type) {\r\n $events = self::getDefaultEvents();\r\n return $events[$type]['glpi'];\r\n }", "public function onSessiontypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public static function events();", "abstract function HookEvents();", "public static function getEntityTypeEvents() {\n $event = ['onEntityTypeEvent', 100];\n $events[EntityTypeEvents::CREATE][] = $event;\n $events[EntityTypeEvents::UPDATE][] = $event;\n $events[EntityTypeEvents::DELETE][] = $event;\n return $events;\n }", "public function onEvent();", "public function run()\n {\n $eventTypes = config(\"sample.eventType\");\n $i = 1;\n \tforeach ($eventTypes as $value) {\n \t\tEventType::insert([\n\t \t\t'id' \t\t\t=> $i,\n\t 'name' \t\t\t=> $value['name'],\n\t 'created_by' \t=> 1,\n\t 'updated_by' \t=> 1,\n\t 'active' \t\t=> 1,\n \t]);\n \t$i++;\n \t}\n }", "protected function fireEvent($type, array $parameters = [])\n {\n Event::dispatch(\"orchestra.control.{$type}: roles\", $parameters);\n }", "private function display_stats_table($type)\n\t{\n\t\t$usages = [];\n\n\t\tforeach ($this->event_listing[$type] as $name => $count)\n\t\t{\n\t\t\t$usages[] = [$count, $name];\n\t\t}\n\n\t\t// Show the table\n\t\t$table_header = [$this->language->lang('CLI_EXTENSION_EVENTS_USAGES'), $this->language->lang('CLI_EXTENSION_EVENTS_NAME')];\n\t\t$this->render_table($table_header, $usages);\n\t}", "public function getType()\n {\n return $this->baseEvent->getType();\n }", "private function fire_event($type, $parameters)\n\t{\n\t\tEvent::fire(\"orchestra.{$type}: user.account\", $parameters);\n\t}", "function getAllEvents() {\n\n $this->events = $this->getEvents();\n //If plugin adds new events for an already defined type\n Plugin::doHook('item_get_events', $this);\n\n return $this->events;\n }", "public function track_event(string $event_type, $extra_info = [])\n {\n }", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function getEventType()\n {\n return $this->proxyBase->eventType;\n }", "private function _isEventPossible($type, $order)\n {\n if ($type == 'invoice') {\n return $order->canInvoice();\n } else if ($type == 'creditmemo') {\n return $order->canCreditmemo();\n } else if ($type == 'cancel') {\n return $order->canCancel();\n }\n \n return false;\n }", "abstract public function getEventName();", "public function send_events()\n {\n }", "public function onEntityTypeEvent(EntityTypeEvent $event, $event_name) {\n switch ($event_name) {\n case EntityTypeEvents::CREATE:\n $this->onEntityTypeCreate($event->getEntityType());\n break;\n\n case EntityTypeEvents::UPDATE:\n $this->onEntityTypeUpdate($event->getEntityType(), $event->getOriginal());\n break;\n\n case EntityTypeEvents::DELETE:\n $this->onEntityTypeDelete($event->getEntityType());\n break;\n }\n }", "protected function logForSeparateTypes( &$typeObject, &$levelObject, $typekey )\n {\n \n if ( $typekey === 'listing' ) {\n $this->getCategoryDetails( $typeObject, $levelObject );\n }\n elseif( $typekey === 'event' ){\n\n }\n elseif ( $typekey === 'article' ) {\n\n }\n elseif ( $typekey === 'banner' ) {\n\n }\n elseif ( $typekey === 'custominvoice' ) {\n // making sure custom invoice doesnt work\n unset( $this->payment_type_log );\n }\n }", "public function type() {\n return $this->hasOne(EventType::class, 'id', 'events_types_id');\n }", "public function vtlib_handler($modulename, $event_type) {\n\t\tif ($event_type == 'module.postinstall') {\n\t\t\t// Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, 'cbtr-', '0000001');\n\t\t\t$module = Vtiger_Module::getInstance($modulename);\n\t\t\t$field = Vtiger_Field::getInstance('translates', $module);\n\t\t\t$field->setRelatedModules(getAllowedPicklistModules(false));\n\t\t} elseif ($event_type == 'module.disabled') {\n\t\t\t// Handle actions when this module is disabled.\n\t\t} elseif ($event_type == 'module.enabled') {\n\t\t\t// Handle actions when this module is enabled.\n\t\t} elseif ($event_type == 'module.preuninstall') {\n\t\t\t// Handle actions when this module is about to be deleted.\n\t\t} elseif ($event_type == 'module.preupdate') {\n\t\t\t// Handle actions before this module is updated.\n\t\t} elseif ($event_type == 'module.postupdate') {\n\t\t\t// Handle actions after this module is updated.\n\t\t}\n\t}", "public static function getAllEventTypes()\n {\n return [\n 'complete' => 'complete',\n 'fail' => 'fail'\n ];\n }", "protected function traverseTypes(): void\n {\n if (isset($this->definition->tca['types']) && is_array($this->definition->tca['types'])) {\n foreach ($this->definition->tca['types'] as $type => $def) {\n $this->registerHandlerDefinitions($this->definition->tableName, $def);\n }\n }\n }", "public function addEventListener(string|bool $type, callable $callback) {\n\t\t$type = strtoupper($type);\n\n\t\t$this->eventCallbacks[$type][] = $callback;\n\t}", "public static function __events () {\n \n }", "public function __invoke(Request $request)\n {\n $event = $request->get('type');\n $fired_at = $request->get('fired_at'); // UTC timestamp string eg: \"2009-03-26 21:35:57\",\n $data = $request->get('data');\n\n switch ($event) {\n case 'subscribe':\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['ip_signup'] = \"10.20.10.30\"\n break;\n\n case 'unsub':\n case 'delete':\n //An unsubscribe event's action is either unsub or delete. The reason will be manual unless caused by a spam complaint, then it will be abuse.\n //$data['reason'] = \"manual\", // \"abuse\"\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['campaign_id'] = \"cb398d21d2\",\n break;\n\n\n case 'profile':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\"\n break;\n\n case 'upemail':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['new_id'] = \"51da8c3259\",\n //$data['new_email'] = \"[email protected]\",\n //$data['old_email'] = \"[email protected]\"\n break;\n\n case 'cleaned':\n //For cleaned emails, the reason will be hard (for hard bounces) or abuse.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['campaign_id'] = \"4fjk2ma9xd\",\n //$data['reason'] = \"hard\", // \"abuse\"\n //$data['email'] = \"[email protected]\"\n break;\n\n case 'campaign':\n // Campaign-Sent Emails\n //$data['id'] = \"5aa2102003\",\n //$data['subject'] = \"Test Campaign Subject\",\n //$data['status'] = \"sent\",\n //$data['reason'] = \"\",\n //$data['list_id'] = \"a6b5da1054\"\n break;\n }\n\n\n // Send a response, to acknowledge receipt, so it doesn't keep re-sending.\n return response('Success', 200);\n }", "public function fireFieldTypeEvents($trigger);", "public function unsetEventTypes(): void\n {\n $this->eventTypes = [];\n }", "public function getEventType() {\n $ret = '';\n switch($this->type) {\n case Event::TYPE_EVENT:\n $ret = 'Event';\n break;\n case Event::TYPE_FLAGSHIP:\n $ret = 'Flagship';\n break;\n case Event::TYPE_WORKSHOP:\n $ret = 'Workshop';\n break;\n case Event::TYPE_CELEBRITY_APPEARANCE:\n $ret = 'Celebrity Appearance';\n break;\n case Event::TYPE_GUEST_LECTURE:\n $ret = 'Guest Lecture';\n break;\n }\n\n return $ret;\n }", "function tipoSituacaoEvento($tipo){\n\t\t\t\tswitch($tipo){\n\t\t\t\t\t\n\t\t\t\tcase '1':\n\t\t\t\t\t$tipo\t= 'Solicitada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '2':\n\t\t\t\t\t$tipo\t= 'Autorizada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$tipo\t= 'Em Andamento';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$tipo\t= 'Concluida';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\treturn $tipo;\n}", "protected static function events()\n {\n foreach (self::fetch('app/events', false) as $file) {\n Bus::need($file);\n }\n //\n Event::register();\n }", "public static function add($type, $eventname, $callback){\n if(isset(self::$__events[$type])){\n if(!isset(self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])])){\n $count = 0;\n }else{\n $count = count(self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])]); \n }\n }else{\n $count = 0;\n }\n self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])][$count] = $callback; \n }", "public function notify($type): void {\n\t\tif (!$this->notify_user) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tswitch ($type) {\n\t\t\tcase 'replace':\n\t\t\t\telgg_register_success_message(elgg_echo('tag_tools:rule:notify:replace', [$this->from_tag, $this->to_tag]));\n\t\t\t\tbreak;\n\t\t\tcase 'delete':\n\t\t\t\telgg_register_success_message(elgg_echo('tag_tools:rule:notify:delete', [$this->from_tag]));\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function _get_event_type_name($event_type_id){\n switch ($event_type_id) {\n case Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW:\n $event_name = \"VIEW\";\n break;\n\n case Mage_Reports_Model_Event::EVENT_PRODUCT_SEND:\n $event_name = \"SEND\";\n break;\n\n case Mage_Reports_Model_Event::EVENT_PRODUCT_COMPARE:\n $event_name = \"COMPARE\";\n break;\n\n case Mage_Reports_Model_Event::EVENT_PRODUCT_TO_CART:\n $event_name = \"CART\";\n break;\n\n case Mage_Reports_Model_Event::EVENT_PRODUCT_TO_WISHLIST:\n $event_name = \"LIKE\";\n break;\n\n case Mage_Reports_Model_Event::EVENT_WISHLIST_SHARE:\n $event_name = \"SHARE\";\n break;\n \n default:\n $event_name = \"NOT_DEFINED\";\n break;\n }\n return $event_name;\n }", "static public function raise($type) {\n $otherParams = func_get_args();\n unset($otherParams[0]);\n $params[] = $request = Arta::$globals['request'];\n\n switch ($type) {\n\n case 'U':\n $title = 'Unauthorized User Handler';\n $factoryDef = Arta::$unauthorizedHandler;\n $params[] = $request->currentUrl();\n break;\n\n case 'I':\n $title = 'Illegal User Handler';\n $factoryDef = Arta::$illegalHandler;\n $params[] = $request->currentUrl();\n break;\n\n case 'X':\n $title = 'Exception Handler';\n $factoryDef = Arta::$exceptionHandler;\n break;\n\n case 'F':\n $title = 'No Factory Handler';\n $factoryDef = Arta::$nofactoryHandler;\n break;\n\n case 'N':\n $title = 'URL Not Found Handler';\n $factoryDef = Arta::$notfoundHandler;\n $params[] = $request->currentUrl();\n break;\n\n case 'A':\n $title = 'Not Ajax Request Handler';\n $factoryDef = Arta::$notajaxHandler;\n $params[] = $request->currentUrl();\n break;\n\n default:\n $title = null;\n $factoryDef = null;\n }\n\n if ($otherParams) {\n if (is_array($otherParams)) {\n $params = array_merge($params, $otherParams);\n } else {\n $params[] = $otherParams;\n }\n }\n /* load factory */\n if (!$factoryDef || count($factoryDef) != 4) {\n if (DEBUG) {\n Inspect::dumpException(new EventHandler(EventHandler::HANDLER_NOT_DEFINED, $title));\n }\n die;\n }\n list($facPath, $tplObjectName, $facClass, $facMethod) = $factoryDef;\n if (!file_exists($facPath)) {\n if (DEBUG) {\n Inspect::dumpException(new EventHandler(EventHandler::HANDLER_FILE_NOT_EXISTS, array($title, $facPath)));\n }\n die;\n }\n\n require_once 'Template.php';\n require_once 'Response.php';\n require_once 'Database.php';\n require_once $facPath;\n\n if (!$facClass) {\n if (!function_exists($facMethod)) {\n if (DEBUG) {\n Inspect::dumpException(\n new EventHandler(\n EventHandler::HANDLER_METHOD_NOT_EXISTS,\n array($title, $facPath, $facMethod)\n )\n );\n }\n die;\n }\n $params[] = $tplObjectName;\n call_user_func_array($facMethod, $params);\n die;\n }\n\n if (!class_exists($facClass)) {\n if (DEBUG) {\n Inspect::dumpException(\n new EventHandler(\n EventHandler::HANDLER_CLASS_NOT_EXISTS,\n array($title, $facPath, $facClass)\n )\n );\n }\n die;\n }\n\n Arta::$factory = $factory = new $facClass();\n if (!method_exists($factory, $facMethod)) {\n if (DEBUG) {\n Inspect::dumpException(\n new EventHandler(\n EventHandler::HANDLER_METHOD_NOT_EXISTS,\n array($title, $facPath, $facMethod)\n )\n );\n }\n die;\n }\n\n if (property_exists($factory, '__tpl')) {\n $factory->__tpl = $tplObjectName;\n }\n\n call_user_func_array(array(&$factory, $facMethod), $params);\n die;\n }", "private function _type_base_add_actions() {\n\t\t// Enable \"Links\" post type\n\t\t// add_filter( 'pre_option_link_manager_enabled', '__return_true' );\n\n\t\t// hook to create post_type\n\t\tadd_action( 'init', array( &$this, 'register_post_type' ) );\n\n\t\t// hook into save post to reset cache\n\t\tadd_action( 'save_post', array( &$this, 'reset_transient' ) );\n\n\t\t// featured image column action\n\t\t$this->_add_image_column_action();\n\t}", "public function get_events($user_id,$type){\n\t\t$this->db->select('*');\n\t\tif($type===\"restaurant\"){\n\t\t\t$this->db->where('restaurant_id',$user_id);\n\t\t}else{\n\t\t\t$this->db->where('server_id',$user_id);\n\t\t}\n\t\t$query = $this->db->get('calendar');\n\t\treturn $query->result();\n\t}", "public function postCreateEventType() {\n\t\t$validator = Validator::make(Input::all(), [\n\t\t\t'event_name'=> 'required|max:60',\n\t\t]);\n\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::route('admin-create-event-type')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput();\n\t\t} else {\n\t\t\t$event_display_name = Input::get('event_name');\n $event_name = strtolower(str_replace(' ', '_', $event_display_name));\n\n\t\t\t$event_type = EventType::create([\n\t\t\t\t'event_name' => $event_name,\n 'event_display_name' => $event_display_name\n\t\t\t]);\n\n\t\t\tif($event_type) {\n\t\t\t\treturn Redirect::route('admin-create-event-type')\n\t\t\t\t\t->with('success', 'Event type is created.');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('admin-create-event-type')\n\t\t\t\t\t->with('error', 'There was a problem. Try again');\n\t\t\t}\n\t\t}\n\t}", "public function events()\n\t{\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Weblog get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t='yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tcategory url titles?\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tdetect special cases\n\t\t//--------------------------------------------\n\n\t\tif ( ! $this->parent_method)\n\t\t{\n\t\t\t$this->parent_method = __FUNCTION__;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_days',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_weeks',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_months',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_years',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_offset',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'orderby',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'event_start_date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'sort',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'ASC'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// For the purposes of this method, if an event_id or event_name\n\t\t// has been specified, we want to ignore date range parameters.\n\t\t// -------------------------------------\n\t\t/*\n\t\tif ($this->P->value('event_id') !== FALSE OR $this->P->value('event_name') !== FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', FALSE);\n\t\t\t$this->P->set('date_range_end', FALSE);\n\t\t}\n\t\t*/\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching events');\n\n\t\t$ids = $this->data->fetch_event_ids($this->P);\n\n\t\t/*$category = FALSE;\n\n\t\tif (FALSE AND isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}\n\n\t\t$ids = $this->data->fetch_event_ids($this->P, $category);*/\n\n\t\t// -------------------------------------\n\t\t// No events?\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No events, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// We also need the \"parent\" entry id, if it hasn't been provided\n\t\t// -------------------------------------\n\n\t\tforeach ($ids as $k => $v)\n\t\t{\n\t\t\tif (! isset($ids[$v]))\n\t\t\t{\n\t\t\t\t$ids[$v] = $v;\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_event_ids' hook.\n\t\t// - Do something with the event IDs\n\n\t\tif (ee()->extensions->active_hook('calendar_events_event_ids') === TRUE)\n\t\t{\n\t\t\t$ids = ee()->extensions->call('calendar_events_event_ids', $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD . \"(.+?)\" .\n\t\t\t\t\t LD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD . \"(.+?)\" . LD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t$var_pairs = array(\n\t\t\t'occurrences',\n\t\t\t'exceptions',\n\t\t\t'rules'\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_pair as $name => $params)\n\t\t{\n\t\t\tif (in_array($name, $var_pairs))\n\t\t\t{\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[$name]['id'] = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($var_pairs as $pair)\n\t\t\t{\n\t\t\t\tif (strpos($name.' ', $pair) !== 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$new_name = $name.' id=\"\"';\n\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[] \t\t\t\t\t= ee()->TMPL->var_pair[$name];\n\t\t\t\tee()->TMPL->var_pair[$new_name]['id'] \t= '';\n\t\t\t\t// Leave the old name behind so we can pick it up later and use it\n\t\t\t\tee()->TMPL->var_pair[$pair] \t\t\t= $name;\n\n\t\t\t\tunset(ee()->TMPL->var_pair[$name]);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\t$var_dates = array(\n\t\t\t'event_start_date'\t=> FALSE,\n\t\t\t'event_start_time'\t=> FALSE,\n\t\t\t'event_end_date'\t=> FALSE,\n\t\t\t'event_end_time'\t=> FALSE,\n\t\t\t'event_first_date'\t=> FALSE,\n\t\t\t'event_last_date'\t=> FALSE,\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t{\n\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t{\n\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\thash fix for EE 2.8.2\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\tDue to the new conditionals parser\n\t\t\t\t\t//\teverything is just whack, so we have\n\t\t\t\t\t//\tto hash and replace formats because\n\t\t\t\t\t//\tEE is just barfing on it now :/.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//EE 2.9+ converting quotes and escaping on its conditional\n\t\t\t\t\t//tokenizer so we now have to match escaped quotes\n\t\t\t\t\t//This should be backward compatible.\n\t\t\t\t\tpreg_match(\"/format=(\\\\\\'|\\'|\\\\\\\"|\\\"])(.*)?\\\\1/i\", $k, $matches);\n\n\t\t\t\t\tif ( ! empty($matches))\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_k = $k;\n\t\t\t\t\t\t$k = str_replace($matches[0], md5($matches[0]), $k);\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace($old_k, $k, ee()->TMPL->tagdata);\n\n\t\t\t\t\t\t//EE 2.9's new conditional parser also screws with how\n\t\t\t\t\t\t//template variables were pulling out the formats for\n\t\t\t\t\t\t//us due to the quote conversion and escaping\n\t\t\t\t\t\t//so we are fixing it here with this since we are\n\t\t\t\t\t\t//capturing it ourselves and converting to hashes\n\t\t\t\t\t\t//anyway.\n\t\t\t\t\t\tif ($v == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$v = $matches[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$var_dates[$name][$k] = $v;\n\t\t\t\t\tee()->TMPL->var_single[$k] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel;\n\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] \t\t\t= implode('|', array_keys($ids));\n\n\t\t//if we have event names, lets set them for the URL title\n\t\tif ( ! in_array(ee()->TMPL->fetch_param('event_name'), array(FALSE, ''), TRUE))\n\t\t{\n\t\t\tee()->TMPL->tagparams['url_title'] = ee()->TMPL->fetch_param('event_name');\n\t\t}\n\n\t\tee()->TMPL->tagparams[$this->sc->channel] \t= CALENDAR_EVENTS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tee()->TMPL->var_single \t\t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_events_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_events_channel_query', $channel->query, $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Trim IDs and build events\n\t\t// -------------------------------------\n\n\t\t$new_ids = array();\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t}\n\n\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t// -------------------------------------\n\t\t// Turn these IDs into events\n\t\t// -------------------------------------\n\n\t\t$events = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching Calendar_event class');\n\n\t\tif ( ! class_exists('Calendar_event'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t}\n\n\t\t$calendars = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Creating events');\n\n\t\tforeach ($event_data as $k => $edata)\n\t\t{\n\t\t\t$start_ymd\t= ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') : '';\n\t\t\t$end_ymd\t= ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd');\n\n\t\t\t$temp\t\t= new Calendar_event($edata, $start_ymd, $end_ymd);\n\n\t\t\tif (! empty($temp->dates))\n\t\t\t{\n\t\t\t\t$temp->prepare_for_output();\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Eliminate times we don't care about\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('date_range_start', 'ymd') != '')\n\t\t\t\t{\n\t\t\t\t\tforeach ($temp->dates as $ymd => $times)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($times as $range => $data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($data['end_date']['ymd'].$data['end_date']['time'] <\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telseif ($data['date']['ymd'].$data['date']['time'] >\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (empty($temp->dates[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($temp->dates[$ymd]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Recheck to ensure our dates array isn't empty now\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t{\n\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No point in stressing ourselves out if $calendars is empty\n\t\t// -------------------------------------\n\n\t\tif (empty($calendars))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Fetch information about the calendars\n\t\t// -------------------------------------\n\n\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t// -------------------------------------\n\t\t// Prep variable aliases\n\t\t// -------------------------------------\n\n\t\t$variables = array(\n\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t'author'\t\t=> 'event_author',\n\t\t\t'status'\t\t=> 'event_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\n\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare to reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\t$calendar_orderby_params = array(\n\t\t\t'event_title',\n\t\t\t'event_start_date',\n\t\t\t'event_start_hour',\n\t\t\t'event_start_time',\n\t\t\t'occurrence_start_date'\n\t\t);\n\n\t\t$orders \t\t\t\t= explode('|', $this->P->value('orderby'));\n\t\t$sorts \t\t\t\t\t= explode('|', $this->P->value('sort'));\n\t\t$calendar_orders \t\t= array();\n\t\t$calendar_order_data \t= array();\n\n\t\tforeach ($orders as $k => $order)\n\t\t{\n\t\t\tif (in_array($order, $calendar_orderby_params))\n\t\t\t{\n\t\t\t\t$sort = (isset($sorts[$k])) ? $sorts[$k] : 'desc';\n\t\t\t\t$calendar_orders[$order] = $sort;\n\t\t\t\t$calendar_order_data[$order] = array();\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tremove non-existant entry ids first\n\t\t//--------------------------------------------\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\tif ( ! isset($events[$row['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tcalculate offset and event timeframe\n\t\t//\ttotal before we parse tags\n\t\t//--------------------------------------------\n\n\t\t$offset = ($this->P->value('event_offset') > 0) ? $this->P->value('event_offset') : 0;\n\n\t\t$this->event_timeframe_total = count($channel->query->result) - $offset;\n\n\t\t// -------------------------------------\n\t\t// Add variables to the query result\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding variables to channel query result');\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['screen_name'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['username'];\n\n\t\t\t$channel->query->result[$k]['event_timeframe_total'] = $this->event_timeframe_total;\n\n\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t// -------------------------------------\n\t\t\t// Alias\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($variables as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Event variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($events[$entry_id]->default_data as $key => $val)\n\t\t\t{\n\t\t\t\tif (! is_array($val))\n\t\t\t\t{\n\t\t\t\t\tif ($val === 'y' OR $val === 'n')\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = ($val == 'y') ? TRUE : 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$channel->query->result[$k]['event_'.$key] = $val;\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\tforeach ($val as $vkey => $vval)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($vval === 'y' OR $vval === 'n')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][\n\t\t\t\t\t\t\t\t'event_'.$key.'_'.$vkey\n\t\t\t\t\t\t\t] = ($vval == 'y') ? TRUE : FALSE;\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$channel->query->result[$k]['event_'.$key.'_'.$vkey] = $vval;\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// -------------------------------------\n\t\t\t// Prepare to orderby event_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_date']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_start_date'][$k] =\n\t\t\t\t\t$events[$entry_id]->default_data['start_date'] .\n\t\t\t\t\t$events[$entry_id]->default_data['start_time'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Prepare to orderby occurrence_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['occurrence_start_date']))\n\t\t\t{\n\t\t\t\t$date = reset(reset($events[$entry_id]->dates));\n\t\t\t\t$time = (isset($date['start_time'])) ? $date['start_time'] : $date['date']['time'];\n\t\t\t\t$date = $date['date']['ymd'];\n\t\t\t\t$calendar_order_data['occurrence_start_date'][$k] = $date.$time;\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start time\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_time']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = '0000';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = $events[$entry_id]->default_data['start_time'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start hour\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_hour']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] = '00';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] \t= substr($events[$entry_id]->default_data['start_time'], 0, 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by event title\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_title']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_title'][$k] = $channel->query->result[$k]['title'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrence variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_occurrence_total'] \t= count($events[$entry_id]->occurrences);\n\t\t\t$channel->query->result[$k]['event_has_occurrences'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_occurrence_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Exception variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_exception_total'] \t= count($events[$entry_id]->exceptions);\n\t\t\t$channel->query->result[$k]['event_has_exceptions'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_exception_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Rule variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_rule_total'] \t\t= count($events[$entry_id]->rules);\n\t\t\t$channel->query->result[$k]['event_has_rules'] \t\t\t= (\n\t\t\t\t$channel->query->result[$k]['event_rule_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t//-------------------------------------\n\t\t\t// Does the event end?\n\t\t\t// we have to check all rules to make sure\n\t\t\t// in case this is a complex rule\n\t\t\t//-------------------------------------\n\n\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = FALSE;\n\n\t\t\tif ($channel->query->result[$k]['event_recurs'] == 'y')\n\t\t\t{\n\t\t\t\tforeach ($events[$entry_id]->rules as $event_rule)\n\t\t\t\t{\n\t\t\t\t\tif ($event_rule['rule_type'] == '+' AND\n\t\t\t\t\t\t($event_rule['repeat_years'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_months'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_days'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_weeks'] != 0) AND\n\t\t\t\t\t\t$event_rule['last_date'] == 0 \tAND\n\t\t\t\t\t\t$event_rule['stop_after'] == 0\n\t\t\t\t\t )\n\t\t\t\t\t{\n\t\t\t\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*$never_ending = $channel->query->result[$k]['event_never_ends'] = (\n\t\t\t\t$channel->query->result[$k]['event_last_date'] == 0 AND\n\t\t\t\t$channel->query->result[$k]['event_recurs'] == 'y'\n\t\t\t);*/\n\n\t\t\t// -------------------------------------\n\t\t\t// Calendar variables\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendars[$events[$entry_id]->default_data['calendar_id']]))\n\t\t\t{\n\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (substr($key, 0, 9) != 'calendar_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = 'calendar_'.$key;\n\t\t\t\t\t}\n\n\t\t\t\t\t//add in calendar data\n\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\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//really?\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Date variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($var_dates as $name => $vals)\n\t\t\t{\n\t\t\t\t$which = '';\n\n\t\t\t\tif ($vals === FALSE)\n\t\t\t\t{\n\t\t\t\t\t$vals = array();\n\t\t\t\t}\n\n\t\t\t\tif ($name == 'event_last_date')\n\t\t\t\t{\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_last_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name == 'event_first_date')\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_first_date']\t= $channel->query->result[$k]['event_start_ymd'];\n\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_first_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$which\t= ($name == 'event_first_date' OR strpos($name, '_start_') !== FALSE) ? 'start' : 'end';\n\t\t\t\t$year\t= $events[$entry_id]->default_data[$which.'_year'];\n\t\t\t\t$month\t= $events[$entry_id]->default_data[$which.'_month'];\n\t\t\t\t$day\t= $events[$entry_id]->default_data[$which.'_day'];\n\n\t\t\t\t$time \t= $events[$entry_id]->default_data[$which.'_time'];\n\n\t\t\t\tif ($time == 0)\n\t\t\t\t{\n\t\t\t\t\tif ($which == 'start')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour \t= '00';\n\t\t\t\t\t\t$minute = '00';\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$hour\t= '23';\n\t\t\t\t\t\t$minute = '59';\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$minute = substr($time, -2, 2);\n\t\t\t\t\t$hour \t= substr($time, 0, strlen($time) - 2);\n\t\t\t\t}\n\n\t\t\t\t//year month and day are a tad fubar when\n\t\t\t\t//we are looking at a repeat occurence with an enddate\n\t\t\t\t//because the end time is indeed correct, but end date\n\t\t\t\t//is expected to be the end of all of the occurrences\n\t\t\t\t//however, if this is never ending, thats different\n\n\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\n\t\t\t\tif ( ! $never_ending AND\n\t\t\t\t\t $name = \"event_last_date\")\n\t\t\t\t{\n\t\t\t\t\t$real_end_date = ($channel->query->result[$k]['event_last_date'] != 0) ?\n\t\t\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_last_date'] :\n\t\t\t\t\t\t\t\t\t\t$events[$entry_id]->default_data['end_date']['ymd'];\n\n\n\t\t\t\t\t$end_time_year \t= substr($real_end_date, 0, 4);\n\t\t\t\t\t$end_time_month = substr($real_end_date, 4, 2);\n\t\t\t\t\t$end_time_day \t= substr($real_end_date, 6, 2);\n\n\t\t\t\t\t$this->CDT->change_datetime(\n\t\t\t\t\t\t$end_time_year,\n\t\t\t\t\t\t$end_time_month,\n\t\t\t\t\t\t$end_time_day,\n\t\t\t\t\t\t$hour,\n\t\t\t\t\t\t$minute\n\t\t\t\t\t);\n\n\t\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\t\t\t\t\t//special treatment on end dates of occurrences if its not infinite\n\t\t\t\t\tif ( ! $never_ending AND stristr($key, 'event_last_date'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$end_time_dta,\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t//else, parse as normal\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t/*\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\n\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t$format,\n\t\t\t\t\t\t'%'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Shorthand date/time variables\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($which)\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_hour']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_minute']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// The foreach may have emptied the query results\n\t\t// -------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n//ee()->TMPL->log_item('Calendar: Weblog query is empty, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\tunset($CDT);\n\n\t\t// -------------------------------------\n\t\t// Reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($calendar_order_data))\n\t\t{\n\t\t\tee()->TMPL->log_item('Calendar: Reordering');\n\n\t\t\t$args \t= array();\n\t\t\t$temps \t= array();\n\n\t\t\tforeach ($calendar_orders as $k => $v)\n\t\t\t{\n\t\t\t\t//add order array\n\t\t\t\t$args[] =& $calendar_order_data[$k];\n\n\t\t\t\t//constant for order type\n\n\t\t\t\t//contants cannot be passed by ref because its not a variable\n\t\t\t\t$temps[$k] = constant('SORT_'.strtoupper($v));\n\n\t\t\t\t$args[] =& $temps[$k];\n\t\t\t}\n\n\t\t\t//this will order the result\n\t\t\t$args[] =& $channel->query->result;\n\n\t\t\tcall_user_func_array('array_multisort', $args);\n\n\t\t\t//cleanup\n\t\t\tunset($args);\n\t\t\tunset($temps);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tpagination for the events tag\n\t\t//--------------------------------------------\n\t\t//\tany tags using this might have different needs\n\t\t//\tso we only want to paginate for original events\n\t\t//\ttag usage\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\t//$this->event_timeframe_total = count($channel->query->result);\n\n\t\tif ($this->parent_method === 'events' AND\n\t\t\t$this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> ee()->TMPL->tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_events_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_events_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//ee()->TMPL->tagdata\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Apply event_limit=\"\" parameter\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('event_limit'))\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset,\n\t\t\t\t$this->P->value('event_limit')\n\t\t\t);\n\t\t}\n\t\telse if ($offset > 0)\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\toffset too much? buh bye\n\t\t//--------------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t// \tWe will reassign the $channel->query->result with our\n\t\t// \treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t$occurrence_hash = '9b8b2cde1a14e29a8791ceccdaab6cf9d92b37a4';\n\n\t\t//we have to prevent occurrenct count from being borked\n\t\tee()->TMPL->tagdata = str_replace('occurrence_count', $occurrence_hash, ee()->TMPL->tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\t\t$channel->parse_channel_entries();\n\n\t\t$channel->return_data = str_replace($occurrence_hash, 'occurrence_count', $channel->return_data);\n\n\t\t// -------------------------------------\n\t\t// Parse Calendar variable pairs\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing variable pairs');\n\n\t\tforeach ($var_pairs as $var)\n\t\t{\n\t\t\tif (isset(ee()->TMPL->var_pair[$var]))\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Iterate through the events\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tforeach ($events as $k => $data)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Does this event have this var pair?\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif (strpos($channel->return_data, LD.$var.' ') !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$var_tag = (! is_array(ee()->TMPL->var_pair[$var])) ? ee()->TMPL->var_pair[$var] : $var;\n\n\t\t\t\t\t\tif (preg_match_all(\"/\".LD.$var_tag.' id=\"'.$k.'\"'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').$var.RD.'/s', $channel->return_data, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Iterate through the variables associated with this pair\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($matches[1] as $key => $match)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = \"prep_{$var}_output\";\n\t\t\t\t\t\t\t\t$match = $this->$method($match, $data, FALSE);\n\t\t\t\t\t\t\t\t$channel->return_data = str_replace($matches[0][$key], $match, $channel->return_data);\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\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t//$channel->add_pagination_data();\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via channel module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $this->parse_pagination($channel->return_data);\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t// -------------------------------------\n\t\t//\tlets reverse any unparsed items\n\t\t//\tin case someone is actually writing\n\t\t//\tout the phrase 'event_url_title'\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\t}", "protected function updateNotificationTypes() {\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_user_notification_event_notification_type\n\t\t\tWHERE\t\teventID = ?\n\t\t\t\t\tAND userID = ?\";\n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\tWCF::getDB()->beginTransaction();\n\t\t$notificationTypes = array();\n\t\tforeach ($this->settings as $eventID => $settings) {\n\t\t\t$statement->execute(array(\n\t\t\t\t$eventID,\n\t\t\t\tWCF::getUser()->userID\n\t\t\t));\n\t\t\t\n\t\t\tif ($settings['type']) {\n\t\t\t\t$notificationTypes[$eventID] = $settings['type'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($notificationTypes)) {\n\t\t\t$sql = \"INSERT INTO\twcf\".WCF_N.\"_user_notification_event_notification_type\n\t\t\t\t\t\t(userID, eventID, notificationTypeID)\n\t\t\t\tVALUES\t\t(?, ?, ?)\";\n\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t\tforeach ($notificationTypes as $eventID => $type) {\n\t\t\t\t$statement->execute(array(\n\t\t\t\t\tWCF::getUser()->userID,\n\t\t\t\t\t$eventID,\n\t\t\t\t\t$type\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tWCF::getDB()->commitTransaction();\n\t}", "public function get_event_types()\n {\n return array(0 => 'miscellaneous', 1 => 'appointment', 2 => 'holiday'\n ,3 => 'birthday', 4 => 'personal', 5 => 'education'\n ,6 => 'travel', 7 => 'anniversary', 8 => 'not in office'\n ,9 => 'sick day', 10 => 'meeting', 11 => 'vacation'\n ,12 => 'phone call', 13 => 'business'\n ,14 => 'non-working hours', 50 => 'special occasion'\n );\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "function bat_event_type_form($form, &$form_state, $event_type, $op = 'edit') {\n $form['#attributes']['class'][] = 'bat-management-form bat-event-type-form';\n\n if ($op == 'clone') {\n $event_type->label .= ' (cloned)';\n $event_type->type = '';\n }\n\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $event_type->label,\n '#description' => t('The human-readable name of this event type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n\n // Machine-readable type name.\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($event_type->type) ? $event_type->type : '',\n '#maxlength' => 32,\n '#machine_name' => array(\n 'exists' => 'bat_event_get_types',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this event type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n\n if ($op == 'add') {\n $form['fixed_event_states'] = array(\n '#type' => 'checkbox',\n '#title' => t('Fixed event states'),\n );\n }\n elseif ($op == 'edit') {\n $form['type']['#disabled'] = TRUE;\n }\n\n $form['event_granularity'] = array(\n '#type' => 'select',\n '#title' => t('Event Granularity'),\n '#options' => array('bat_daily' => t('Daily'), 'bat_hourly' => t('Hourly')),\n '#default_value' => isset($event_type->event_granularity) ? $event_type->event_granularity : 'bat_daily',\n );\n\n if (isset($event_type->is_new)) {\n // Check for available Target Entity types.\n $target_entity_types = module_invoke_all('bat_event_target_entity_types');\n if (count($target_entity_types) == 1) {\n // If there's only one target entity type, we simply store the value\n // without showing it to the user.\n $form['target_entity_type'] = array(\n '#type' => 'value',\n '#value' => $target_entity_types[0],\n );\n }\n else {\n // Build option list.\n $options = array();\n foreach ($target_entity_types as $target_entity_type) {\n $target_entity_info = entity_get_info($target_entity_type);\n $options[$target_entity_type] = $target_entity_info['label'];\n }\n $form['target_entity_type'] = array(\n '#type' => 'select',\n '#title' => t('Target Entity Type'),\n '#description' => t('Select the target entity type for this Event type. In most cases you will wish to leave this as \"Unit\".'),\n '#options' => $options,\n // Default to BAT Unit if available.\n '#default_value' => isset($target_entity_types['bat_unit']) ? 'bat_unit' : '',\n );\n }\n }\n\n if (!isset($event_type->is_new) && $event_type->fixed_event_states == 0) {\n $fields_options = array();\n\n $fields = field_info_instances('bat_event', $event_type->type);\n\n foreach ($fields as $field) {\n $fields_options[$field['field_name']] = $field['field_name'];\n }\n\n $form['events'] = array(\n '#type' => 'fieldset',\n '#group' => 'additional_settings',\n '#title' => t('Events'),\n '#tree' => TRUE,\n '#weight' => 80,\n );\n\n $form['events'][$event_type->type] = array(\n '#type' => 'select',\n '#title' => t('Select your default @event field', array('@event' => $event_type->label)),\n '#options' => $fields_options,\n '#default_value' => isset($event_type->default_event_value_field_ids[$event_type->type]) ? $event_type->default_event_value_field_ids[$event_type->type] : NULL,\n '#empty_option' => t('- Select a field -'),\n );\n }\n\n if (!isset($event_type->is_new)) {\n $fields_options = array();\n $fields = field_info_instances('bat_event', $event_type->type);\n\n foreach ($fields as $field) {\n $fields_options[$field['field_name']] = $field['field_name'];\n }\n\n $form['event_label'] = array(\n '#type' => 'fieldset',\n '#group' => 'additional_settings',\n '#title' => t('Label Source'),\n '#tree' => TRUE,\n '#weight' => 80,\n );\n\n $form['event_label']['default_event_label_field_name'] = array(\n '#type' => 'select',\n '#title' => t('Select your label field', array('@event' => $event_type->label)),\n '#default_value' => isset($event_type->default_event_label_field_name) ? $event_type->default_event_label_field_name : NULL,\n '#empty_option' => t('- Select a field -'),\n '#description' => t('If you select a field here, its value will be used as the label for your event. BAT will fall back to using the event state as the label if the field has no value.'),\n '#options' => $fields_options,\n );\n }\n\n $form['actions'] = array(\n '#type' => 'actions',\n '#tree' => FALSE,\n );\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save Event type'),\n '#weight' => 40,\n '#submit' => array('bat_event_type_form_submit'),\n );\n\n return $form;\n}", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "function testEditCalendarEventType()\n\t{\n\t\tedit_event_type($this->eventtype_id,\"test_event_type1\",'calendar/testtype1','');\n\t\t// Test the forum was actually created\n\t\t$this->assertTrue('test_event_type1'==get_translated_text($GLOBALS['SITE_DB']->query_value('calendar_types','t_title ',array('id'=>$this->eventtype_id))));\n\t}", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public function onFrame($data, $type) {\n\t\t$ws = $this;\n\t\t$req = json_decode($data, true);\n\t\tif ($req['type'] === 'subscribe') {\n\t\t\t$eventName = $req['event'];\n\t\t\t$this->appInstance->pubsub->sub($req['event'], $this, function ($data) use ($ws, $eventName) {\n\t\t\t\t$ws->sendObject(array(\n\t\t\t\t\t\t\t\t\t'type' => 'event',\n\t\t\t\t\t\t\t\t\t'event' => $eventName,\n\t\t\t\t\t\t\t\t\t'data' => $data,\n\t\t\t\t\t\t\t\t));\n\t\t\t});\n\t\t}\n\t}", "protected function setEvents()\n {\n foreach ($this->preloadList as $preload) {\n include_once XOOPS_ROOT_PATH . '/modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php';\n $class_name = ucfirst($preload['module'])\n . ($preload['file'] == 'preload' ? '' : ucfirst($preload['file']) )\n . 'Preload';\n if (!class_exists($class_name)) {\n continue;\n }\n $class_methods = get_class_methods($class_name);\n foreach ($class_methods as $method) {\n if (strpos($method, 'event') === 0) {\n $event_name = strtolower(str_replace('event', '', $method));\n $event= array($class_name, $method);\n $this->eventListeners[$event_name][] = $event;\n }\n }\n }\n }", "public function getSubscribedEvents();", "protected static function getEventData(array $events, $type, $action) {\n $events = static::filterEvents($events, $type, $action);\n $data = [];\n foreach ($events as $event) {\n $data[] = [\n 'event' => $event->event,\n 'selector' => $event->selector,\n ];\n }\n return $data;\n }", "function registerEvent($event_type, $callback_func) {\n\n\t\t// registers a new event ...\n\t\t$this->events[$event_type][] = $callback_func;\n\t}", "public function vtlib_handler($modulename, $event_type) {\n\t\tif ($event_type == 'module.postinstall') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$db->pquery(\n\t\t\t\t'INSERT INTO `berli_crmtogo_defaults` (`fetch_limit`, `crmtogo_lang`, `defaulttheme`, `crm_version`) VALUES (?, ?, ?, ?)',\n\t\t\t\tarray('99','en_us', 'b', '6.3')\n\t\t\t);\n\t\t\t$db->pquery(\n\t\t\t\t'INSERT INTO `berli_crmtogo_config` (`crmtogouser`, `navi_limit`, `theme_color`, `compact_cal`) VALUES (?, ?, ?, ?)',\n\t\t\t\tarray('1','25', 'b', '1')\n\t\t\t);\n\t\t\t$seq = 0;\n\t\t\t$supported_module = array(\n\t\t\t\t'Contacts','Accounts','Leads','cbCalendar','Potentials','HelpDesk','Vendors','Assets','Faq','Documents',\n\t\t\t\t'Quotes','SalesOrder','Invoice','Products','Project','ProjectMilestone','ProjectTask','Events'\n\t\t\t);\n\t\t\tforeach ($supported_module as $mdulename) {\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_modules` (`crmtogo_user`, `crmtogo_module`, `crmtogo_active`, `order_num`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('1',$mdulename, '1', $seq)\n\t\t\t\t);\n\t\t\t\t$seq = $seq + 1;\n\t\t\t}\n\t\t} elseif ($event_type == 'module.disabled') {\n\t\t\t// Handle actions when this module is disabled.\n\t\t} elseif ($event_type == 'module.enabled') {\n\t\t\t// Handle actions when this module is enabled.\n\t\t} elseif ($event_type == 'module.preuninstall') {\n\t\t\t// Handle actions when this module is about to be deleted.\n\t\t} elseif ($event_type == 'module.preupdate') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_defaults` (\n\t\t\t\t `fetch_limit` int(3) NOT NULL,\n\t\t\t\t `crmtogo_lang` varchar(5) NOT NULL,\n\t\t\t\t `defaulttheme` varchar(1) NOT NULL,\n\t\t\t\t `crm_version` varchar(5) NOT NULL\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_config` (\n\t\t\t\t `crmtogouser` int(19) NOT NULL,\n\t\t\t\t `navi_limit` int(3) NOT NULL,\n\t\t\t\t `theme_color` varchar(1) NOT NULL,\n\t\t\t\t `compact_cal` int(1) NOT NULL,\n\t\t\t\t PRIMARY KEY (`crmtogouser`),\n\t\t\t\t CONSTRAINT `fk_1_berli_crmtogo_config` FOREIGN KEY (`crmtogouser`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_modules` (\n\t\t\t\t `crmtogo_user` int(19) NOT NULL,\n\t\t\t\t `crmtogo_module` varchar(50) NOT NULL,\n\t\t\t\t `crmtogo_active` int(1) NOT NULL DEFAULT '1',\n\t\t\t\t `order_num` int(3) NOT NULL,\n\t\t\t\t CONSTRAINT `fk_1_berli_crmtogo_modules` FOREIGN KEY (`crmtogo_user`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t} elseif ($event_type == 'module.postupdate') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$res = $db->pquery(\"SELECT * FROM berli_crmtogo_config WHERE crmtogouser =?\", array('1'));\n\t\t\tif ($db->num_rows($res) ==0) {\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_defaults` (`fetch_limit`, `crmtogo_lang`, `defaulttheme`, `crm_version`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('99','en_us', 'b', '6.3')\n\t\t\t\t);\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_config` (`crmtogouser`, `navi_limit`, `theme_color`, `compact_cal`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('1','25', 'b', '1')\n\t\t\t\t);\n\t\t\t\t$seq = 0;\n\t\t\t\t$supported_module = array(\n\t\t\t\t\t'Contacts','Accounts','Leads','cbCalendar','Potentials','HelpDesk','Vendors','Assets','Faq','Documents',\n\t\t\t\t\t'Quotes','SalesOrder','Invoice','Products','Project','ProjectMilestone','ProjectTask'\n\t\t\t\t);\n\t\t\t\tforeach ($supported_module as $mdulename) {\n\t\t\t\t\t$db->pquery(\n\t\t\t\t\t\t'INSERT INTO `berli_crmtogo_modules` (`crmtogo_user`, `crmtogo_module`, `crmtogo_active`, `order_num`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\t\tarray('1', $mdulename, '1', $seq)\n\t\t\t\t\t);\n\t\t\t\t\t$seq = $seq + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function set_event_type($eventType, $secondaryType)\n{\n\n if ($eventType && $secondaryType) {\n // If both type and secondary type\n\n $secondaryType .= ', ' . $eventType;\n\n $types = explode(\", \", $secondaryType);\n\n } elseif ($eventType && !$secondaryType) {\n // If only type and no secondary type\n\n $types[] = $eventType;\n\n } else {\n // In case there is not type at all\n\n $types[] = 'Misc';\n }\n\n $finalTypes = array_unique($types);\n\n return implode(\",\", $finalTypes);\n\n}", "public function send($type, $data = null) {\n\t\tif ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) {\n\t\t\tthrow new BadMethodCallException('Type needs to be alphanumeric ('. $type .')');\n\t\t}\n\t\t$this->init();\n\t\tif (is_null($data)) {\n\t\t\t$data = $type;\n\t\t\t$type = null;\n\t\t}\n\t\tif ($this->fallback) {\n\t\t\t$response = '<script type=\"text/javascript\">window.parent.OC.EventSource.fallBackCallBack('\n\t\t\t\t. $this->fallBackId . ',\"' . $type . '\",' . OC_JSON::encode($data) . ')</script>' . PHP_EOL;\n\t\t\techo $response;\n\t\t} else {\n\t\t\tif ($type) {\n\t\t\t\techo 'event: ' . $type . PHP_EOL;\n\t\t\t}\n\t\t\techo 'data: ' . OC_JSON::encode($data) . PHP_EOL;\n\t\t}\n\t\techo PHP_EOL;\n\t\tflush();\n\t}", "public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}", "function handleEvent(EventContext $context)\n {\n $event_name = $context->getEventName();\n\n if ($event_name == \"manage_program_items\")\n {\n $this->handleManageProgramItems($context);\n }\n else if ($event_name == \"cancel_program_item_editor\")\n {\n $this->handleCancelProgramItemEditor($context);\n }\n else if ($event_name == \"cancel_program_item_selector\")\n {\n $this->handleCancelProgramItemSelector($context);\n }\n else if ($event_name == \"delete_program_items\")\n {\n $this->handleDeleteProgramItems($context);\n }\n else if ($event_name == \"delete_program_item\")\n {\n $this->handleDeleteProgramItem($context);\n }\n else if ($event_name == \"save_program_item\")\n {\n $this->handleSaveProgramItem($context);\n }\n else if ($event_name == \"refresh_program_item\")\n {\n $this->handleRefreshProgramItem($context);\n }\n else if ($event_name == \"edit_program_item\")\n {\n $this->handleEditProgramItem($context);\n }\n else if ($event_name == \"create_program_item\")\n {\n $this->handleCreateProgramItem($context);\n }\n else if ($event_name == \"cancel_related_person_editor\")\n {\n $this->handleCancelRelatedPersonEditor($context);\n }\n else if ($event_name == \"store_related_person\")\n {\n $this->handleStoreRelatedPerson($context);\n }\n else if ($event_name == \"create_related_person\")\n {\n $this->handleCreateRelatedPerson($context);\n }\n else if ($event_name == \"edit_related_person\")\n {\n $this->handleEditRelatedPerson($context);\n }\n else if ($event_name == \"delete_related_persons\")\n {\n $this->handleDeleteRelatedPersons($context);\n }\n else if ($event_name == \"delete_related_person\")\n {\n $this->handleDeleteRelatedPerson($context);\n }\n }", "public function add_actions() {\n\t\t\t$acf_types = acf_get_field_types();\n\t\t\t$filtered_types = apply_filters('acf_to_content/field_types', array());\n\t\t\t// active handlings\n\t\t\tglobal $acf_to_post_content;\n\t\t\t$active_handlers = $acf_to_post_content->get_active_handlings();\n\t\t\tforeach ($acf_types as $type => $settings) {\n\t\t\t\tif (isset($filtered_types[$type]) && \n\t\t\t\t\t\tin_array($filtered_types[$type]['handling'], $active_handlers)) {\n\t\t\t\t\t$function = $filtered_types[$type]['handling'];\n\t\t\t\t\tadd_action('acf/render_field_settings/type='.$type, array($this, $function), 1);\n\t\t\t\t} // end if isset type\n\t\t\t} // end foreach type\n\t\t}", "public function getEventType() {\n\t\treturn ($this->eventType);\n\t}", "public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }", "function customcats_events(&$modules)\n\t{\n\t\t$modules->register('category', $this, 'customcats_category');\n\t\t$modules->register('admin_tpl_layout_category', $this, 'admin_links');\n\n\t\t//no price\n\t\t$modules->register('admin_tpl_category_form', $this, 'category_form');\n\t\t$modules->register('category_add', $this, 'category_edit');\n\t\t$modules->register('category_edit', $this, 'category_edit');\n\t\t$modules->register('modify_listing', $this, 'listing_no_price');\n\t\t$modules->register('checkout_end', $this, 'listing_no_price');\n\t\t$modules->register('viewlisting_end', $this, 'viewlisting_end');\n\t\t$modules->register('search_end', $this, 'search_end');\n\t\t$modules->register('category_end', $this, 'search_end');\n\t}", "private function save_events_to_master_list($list, $type)\n\t{\n\t\tforeach ($list as $revision_event)\n\t\t{\n\t\t\tif (!array_key_exists($revision_event, $this->event_listing[$type]))\n\t\t\t{\n\t\t\t\t// Create counter if no key already exists\n\t\t\t\t$this->event_listing[$type][$revision_event] = 1;\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Increment counter because it does exist\n\t\t\t\t$this->event_listing[$type][$revision_event]++;\n\t\t\t}\n\t\t}\n\t}", "public function register($event_type, $options=array()) {\n\t\t$_this =& Activity::getInstance();\n\t\t$_this->_register($event_type, $options);\n\t}", "protected function _run_filters($type)\n {\n $filters = array_merge_recursive((new ApplicationController())->_filters(), $this->_filters());\n \n if (isset($filters[$type])) {\n /**\n * Here we have to filter duped methods. We can't use array_unique\n * because the the methods could be like ['method_name', 'only' => [ actions ... ]]\n * and that will generate \"Array to string conversion\" error.\n */\n $ran_methods = [];\n foreach ($filters[$type] as $params) {\n if (($method = $this->_can_run_filter_method($params, $type)) && !in_array($method, $ran_methods)) {\n $this->$method();\n $ran_methods[] = $method;\n }\n }\n }\n }", "public function findByEventType($type)\n {\n if (!isset($this->betTypes[$type])) {\n throw new UnsupportedEventType($type. ' not supported. Try '.implode(', ', array_keys($this->betTypes)));\n }\n\n return $this->betTypes[$type];\n }", "public function getModelEvents();", "protected function bootNicerEvents()\n {\n $class = get_called_class();\n\n if (isset(static::$eventsBooted[$class])) {\n return;\n }\n\n $radicals = ['creat', 'sav', 'updat', 'delet', 'fetch'];\n $hooks = ['before' => 'ing', 'after' => 'ed'];\n\n foreach ($radicals as $radical) {\n foreach ($hooks as $hook => $event) {\n\n $eventMethod = $radical . $event; // saving / saved\n $method = $hook . ucfirst($radical); // beforeSave / afterSave\n if ($radical != 'fetch') $method .= 'e';\n\n self::$eventMethod(function($model) use ($method) {\n $model->fireEvent('model.' . $method);\n\n if ($model->methodExists($method))\n return $model->$method();\n });\n }\n }\n\n /*\n * Hook to boot events\n */\n static::registerModelEvent('booted', function($model){\n $model->fireEvent('model.afterBoot');\n if ($model->methodExists('afterBoot'))\n return $model->afterBoot();\n });\n\n static::$eventsBooted[$class] = true;\n }", "public function index()\n {\n $typeevent = \\App\\TypeEvent::orderBy('created_at','DESC')->get();\n $user = Auth::User()->role;\n if($user=='Superadmin')\n return view('Types/typeevent',compact('typeevent'));\n if($user=='Admin')\n return view('Types/typeeventadm',compact('typeevent'));\n\n }", "private function _ratepayEvent($type, $order)\n {\n switch($type){\n case 'invoice':\n $invoice = $order->prepareInvoice();\n $invoice->register()->save();\n $order->setTotalInvoiced($order->getTotalInvoiced() + $invoice->getGrandTotal());\n $order->setBaseTotalInvoiced($order->getBaseTotalInvoiced() + $invoice->getBaseGrandTotal());\n $order->save();\n break;\n case 'creditmemo':\n $creditmemo = Mage::getModel('sales/service_order', $order)->prepareCreditmemo();\n $creditmemo->register()->save();\n $order->setTotalRefunded($order->getTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($order->getBaseTotalRefunded() + $creditmemo->getGrandTotal());\n $order->setBaseTotalRefunded($creditmemo->getGrandTotal());\n $order->save();\n break;\n case 'cancel':\n $order->cancel()->save();\n break;\n default:\n throw new Exception('Wrong operation!');\n }\n }", "public function run()\n {\n foreach (self::TYPES_DATA as $aType) {\n $this->createType($aType);\n }\n }", "public function getEventTypes()\n {\n return new EventTypes(array('order_name' => true));\n }", "public function save(Type $type) {\n $typeData = array(\n 'name_ET' => $type->getName()\n );\n\n if ($type->getNum()) {\n // The type has already been saved : update it\n $this->getDb()->update('eventtype', $typeData, array('num_ET' => $type->getNum()));\n } else {\n // The type has never been saved : insert it\n $this->getDb()->insert('eventtype', $typeData);\n // Get the id of the newly created type and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $type->setNum($id);\n }\n }" ]
[ "0.6686122", "0.65356505", "0.6291159", "0.6013523", "0.5955522", "0.5949073", "0.5948193", "0.5945075", "0.5943697", "0.59200454", "0.59026253", "0.58390546", "0.5829551", "0.5794107", "0.5778763", "0.5778671", "0.57662624", "0.5750676", "0.5746447", "0.56845444", "0.5677793", "0.5655243", "0.56508625", "0.56054944", "0.5593675", "0.5586201", "0.5552042", "0.5551476", "0.55471104", "0.5544823", "0.55408597", "0.5503958", "0.54661804", "0.5462719", "0.5433806", "0.5430683", "0.54296654", "0.53892344", "0.53874063", "0.53841084", "0.53572464", "0.5345949", "0.533731", "0.5327793", "0.5309696", "0.53060406", "0.5291467", "0.52888286", "0.5274138", "0.5252672", "0.52455497", "0.5244943", "0.5241255", "0.5234993", "0.5223544", "0.5217164", "0.5208806", "0.520017", "0.5170634", "0.51598483", "0.5134847", "0.51331073", "0.51317453", "0.513049", "0.51262575", "0.51229066", "0.512192", "0.5115452", "0.5113844", "0.51130015", "0.5109558", "0.5106518", "0.5091859", "0.5083645", "0.5080118", "0.50748014", "0.5063721", "0.5056785", "0.50529885", "0.5052085", "0.50433844", "0.50396436", "0.5028196", "0.50238967", "0.5019067", "0.5012385", "0.5008286", "0.5005959", "0.49965003", "0.49955186", "0.4994088", "0.4989588", "0.49846664", "0.49789336", "0.4972106", "0.49710956", "0.4962071", "0.49619177", "0.4961203", "0.49606937", "0.49581632" ]
0.0
-1
Events based on year.
public function year($year = null) { return \App\Event::with('venue.city.states') ->whereYear('start_date', $year) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "public function setYear($year);", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }", "public function getYear() {}", "public function modelYear();", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "public function getYearEraDayIndex($year);", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "public function setYear($year)\n {\n $this->year = $year;\n }", "public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function setYear($year) {\n $this->_year = $year;\n }", "public function __construct($year)\n {\n $this->year = $year;\n }", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }", "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function getMediaYears($date)\n{\n $sql = \"SELECT media_year,media_year_start,media_year_end from media_calendar where media_year <= YEAR('\" . $date . \"') GROUP by media_year ORDER BY media_year DESC\";\n $result = getResult($sql);\n return $result;\n}", "public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }", "public function testSportsDayBefore1996(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function disableYear() {\n\t\t$this->displayYear = false;\n\t}", "public function is_year()\n {\n }", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "protected function year(){\n return $this->now->format('Y');\n }", "public function getYear() : string;", "public function buildCalendar($month, $year);", "function get_entries_records_for_year($entries, $year, $boundle)\n{\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n $entries_records = [];\n if (isset($entries)) {\n foreach ($entries as $entry) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $boundle)\n ->fieldCondition('field_entry', 'target_id', $entry, '=')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n\n // Adding each records for an entry in the array of entry id.\n $entries_records[$entry] = $records_ids;\n }\n }\n }\n\n return $entries_records;\n}", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function showCurrentYearAction()\r\n {\r\n\t\t$startDate = date('Y-01-01');\r\n\t\t$endDate = date('Y-m-d');\r\n\t\t\r\n\t\t$period = ' - bieżący rok';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }", "public function testSportsDayBetween1996And2000(): void\n {\n $year = 1997;\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-10-10\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function get_year($year) {\n\t\t$start_time = 'first day of January ' . date( 'Y', strtotime($year) );\n\t\t$end_time = 'last day of December ' . date( 'Y', strtotime($year) );\n\t\n\t\treturn array(\n\t\t\t'start'\t\t\t=>\tdate('Y-m-d', strtotime($start_time)),\n\t\t\t'end'\t\t\t=>\tdate('Y-m-d', strtotime($end_time)),\n\t\t\t'start_time'\t\t=>\tstrtotime( $start_time ),\n\t\t\t'end_time'\t\t=>\tstrtotime( $end_time )\n\t\t);\n\t}", "public function getYear() {\n return $this->_year;\n }", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public function forYear($year)\n\t{\n\t\t/** @var Election[] $elections */\n\t\t$elections = $this->getMyRepository()->findAll();\n\n\t\tforeach ($elections as $election) {\n\t\t\tif (date('Y', $election->getDate()->getTimestamp()) == $year) {\n\t\t\t\treturn $election;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getMinYearBuilt();", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "public function getYear(){\n\t\treturn $this->_year;\n\t}", "function _buildKayinNewYear()\n {\n \n $this->_addHoliday(\n 'KayinNewYear',\n $this->_year . '-01-10',\n 'KayinNewYear Day'\n );\n }", "public function get_year_permastruct()\n {\n }", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "public function getTwoYearDates()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n\n return Holiday::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->orderBy('date', 'asc')\n ->paginate(25);\n }", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "function get_year_link($year)\n {\n }", "public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "function get_year()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"year\"];\n }", "function dayOfProgrammer($year) {\n if($year <1918 && $year%400!=0 && $year%100==0 ) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"254 days\"));\n return date_format($date,\"d.m.Y\"); \n } else if($year == 1918) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"268 days\"));\n return date_format($date,\"d.m.Y\");\n } else {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"255 days\"));\n return date_format($date,\"d.m.Y\");\n }\n}", "private function getSelectedYear() {\n\t\t$selectedYear = $this->request->query('selectedYear');\n\t\tif (is_null($selectedYear)) $selectedYear = $thisYear;\n\t\t$nextYear = $selectedYear+1;\n\t\treturn array($selectedYear, $nextYear);\n\t}", "public function __construct(Year $year)\n\t{\n\t\t$this->middleware('adminauth');\n\t\t$this->year = $year;\n\t}", "protected function getThisYearInterval(): array\n\t{\n\t\treturn [\n\t\t\tnew \\DateTime(date('Y-01-01', strtotime(date('Y-m-d')))),\n\t\t\tnew \\DateTime(date('Y-12-t', strtotime(date('Y-m-d'))))\n\t\t];\n\t}", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function getYearList() \n {\t\t\n $this->db->select(\"to_char(cm_date, 'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.calendar_main\");\n $this->db->where(\"to_char(cm_date, 'yyyy')::numeric >= to_char(current_date, 'yyyy')::numeric - 15\");\n $this->db->group_by(\"to_char(cm_date, 'YYYY')\");\n $this->db->order_by(\"to_char(cm_date, 'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function setYear($iyear)\n {\n $this->iyear = $iyear;\n }", "public static function from_year($year = null)\n {\n // create\n $class = __CLASS__;\n $object = new $class;\n\n // set vars\n if (!$year) $year = Date::forge()->format('%Y');\n $year = (int) $year;\n\n // set givens\n $object->year = 2007;\n $object->congress = 110;\n $object->session = 1;\n\n // loop thru years to target...\n while($object->year !== $year)\n {\n if($object->year < $year)\n {\n $object->year++;\n $object->session++;\n }\n elseif($object->year > $year)\n {\n $object->year--;\n $object->session--;\n }\n\n if($object->session === 3)\n {\n $object->congress++;\n $object->session = 1;\n }\n elseif($object->session === 0)\n {\n $object->congress--;\n $object->session = 2;\n }\n }\n\n // cleaup\n $object->year = $year;\n $object->calc_cycle();\n\n // return\n return $object;\n }", "public function index($year)\n\t{\n\t\t/**\n\t\t* get all places that have sowings in a specific year \n\t\t*/\n\t\t$places = Place :: whereHas('sowings', function($query) use ($year){\n\t\t\t$query->where('year','=',$year);\n\t\t})->get();\n\n\t\t$places->each(function($item) use($year){\n\t\t\t// var_dump($item);\n\t\t\t$item->sowings = $item->sowings->filter(function($item) use ($year){\n\t\t\t\treturn $item->year == $year;\n\t\t\t})->all();\n\t\t\t\n\t\t});\n\n\t\t$years = Sowing :: distinct('year')->pluck('year');\n\n\t\treturn view('sowings.index', compact('years','places'));\n\t}", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function getYear()\n {\n return $this->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function testYearOnlyDateWithParamFullYear()\n {\n $this->assertFalse(neatlinetime_convert_date('1066', 'full_year'));\n $result = neatlinetime_convert_single_date('1066', 'full_year');\n $this->assertContains('1066-01-01', $result[0]);\n $this->assertContains('1066-12-31', $result[1]);\n }", "public function getAllYears()\n\t{\n\t\treturn array_map(function ($election) {\n\t\t\t/** @var Election $election */\n\t\t\treturn date('Y', $election->getDate()->getTimestamp());\n\t\t}, $this->getAll());\n\t}", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "public function year()\n {\n return $this->belongsTo(Year::class);\n }", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "public function eventsUsingTableAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $events = $this->model->findEventsByYear((int) $year);\n $viewModel = new ViewModel(['events' => $events, 'year' => $year]);\n $viewModel->setTemplate('signups/index/events');\n return $viewModel;\n }", "function get_holidays($inc_year){\n\t//$year = date(\"Y\");\n\t$year = $inc_year;\n\n\t// $holidays[] = new Holiday(\"New Year's Day\", get_timestamp(\"$year-1-1\"));\n\t$holidays[] = new Holiday(\"Republic Day\", get_timestamp(\"$year-1-26\"));\n\t// $holidays[] = new Holiday(\"Labour Day\", ordinal_day(1, 'Mon', 3, $year));\n\t// $holidays[] = new Holiday(\"Anzac Day\", get_timestamp(\"$year-4-25\"));\n\t//$holidays[] = new Holiday(\"St. Patrick's Day\", get_timestamp(\"$year-3-17\"));\n\t// TODO: $holidays[] = new Holiday(\"Good Friday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Easter\", easter_date($year));\n\t// TODO: $holidays[] = new Holiday(\"Easter Monday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Foundation Day\", ordinal_day(1, 'Mon', 6, $year));\n\t// $holidays[] = new Holiday(\"Queen's Birthday\", ordinal_day(1, 'Mon', 10, $year));\n\t//$holidays[] = new Holiday(\"Memorial Day\", memorial_day($year));\n\t//$holidays[] = new Holiday(\"Mother's Day\", ordinal_day(2, 'Sun', 5, $year));\n\t//$holidays[] = new Holiday(\"Father's Day\", ordinal_day(3, 'Sun', 6, $year));\n\t//$holidays[] = new Holiday(\"Independence Day\", get_timestamp(\"$year-7-4\"));\n\t//$holidays[] = new Holiday(\"Labor Day\", ordinal_day(1, 'Mon', 9, $year));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"$year-12-25\"));\n\t$holidays[] = new Holiday(\"Dussera\", get_timestamp(\"2010-10-15\"));\n\t$holidays[] = new Holiday(\"Ugadi\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"kanada Rajyotshava\", get_timestamp(\"$year-11-1\"));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-04\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-05\"));\n\t// $holidays[] = new Holiday(\"Boxing Day\", get_timestamp(\"$year-12-26\"));\n\n\t$numHolidays = count($holidays) - 1;\n\t$out_array = array();\n\n\tfor ($i = 0; $i < $numHolidays; $i++){\n\t\t$out_array[] = $holidays[$i]->date;\n\t}\n\tunset($holidays);\n\treturn $out_array;\n}", "public function setYear(int $year)\n {\n $this->year = $year;\n\n return $this;\n }", "function GetYearList() {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year as year1,\n\t\t\t\t\t my_year as year2\n\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t where company_id = '$companyid'\n and emp_seq_no = '$emp_seqno'\n\t\t\t\t group by my_year\n\t\t\t\t order by my_year desc\n_YearHolidayList_;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}", "public function setYear($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function isYearException(int $year): void\n {\n if ($year < 1900) {\n throw new \\InvalidArgumentException;\n }\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "public static function createFromYear($year)\n {\n $startDate = new DateTimeImmutable(static::validateYear($year).'-01-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P1Y')));\n }", "public static function createFromYear($year)\n {\n $startDate = new DateTimeImmutable(static::validateYear($year).'-01-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P1Y')));\n }", "function GetYearHoliday($the_year = NULL, $cond_1, $cond_2) {\n\t\t$_where = empty($the_year) ? \"\" : \"and my_year = $the_year\";\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year,\n\t\t\t\t\t in_date,\n\t\t\t\t\t year_holidays,\n\t\t\t\t\t /*year_adjust_days,--HCP version v.1.0.5.4.1 no this filed*/\n\t\t\t\t\t nvl(already_rest_days,0) as already_rest_days,\n\t\t\t\t\t defered_year_days,\n\t\t\t\t\t defered_adjust_days,\n\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t nvl(already_rest_ddays,0) as already_rest_ddays,\n\t\t\t\t\t active_date,\n\t\t\t\t\t expired_date\n\t\t\t\t\tfrom (select A.*,rownum rn\n\t\t\t\t\t\t from (select my_year,\n\t\t\t\t\t\t\t\t\t\t in_date,\n\t\t\t\t\t\t\t\t\t year_holidays,\n\t\t\t\t\t\t\t\t\t already_rest_days,\n\t\t\t\t\t\t\t\t\t defered_year_days,\n\t\t\t\t\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t\t\t\t\t already_rest_ddays,\n\t\t\t\t\t\t\t\t\t active_date,\n\t\t\t\t\t\t\t\t\t expired_date\n\t\t\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t and emp_seq_no = '$emp_seqno'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t order by year_holidays desc) A\n\t\t\t\t\t\t\t\t where rownum <=$cond_2)\n\t\t\t\t\t\t\twhere rn >=$cond_1\n\t\t\t\t\t\t\torder by year_holidays desc\n_YearHolidayList_;\n\t\t// print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\n\t}", "public function scopeYear($query, $year)\n {\n return $query->whereYear('created_at', $year);\n }", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function findYearsByFilter($filter) {\n $filter2 = clone $filter;\n $filter2->year = null;\n $articles = $this->findByFilter($filter2);\n $yearArray = array();\n foreach($articles as $article) {\n $date = $article->getArticleDate();\n $year = $date->format('Y');\n if(!isset($yearArray[$year])) {\n $yearArray[$year] = array('count' => 0);\n }\n if(!isset($yearArray[$year]['value'])) {\n $yearFilter = clone $filter2;\n $yearFilter->year = $year;\n $yearArray[$year]['value'] = intval($year);\n $yearArray[$year]['searchFilter'] = $yearFilter;\n }\n $yearArray[$year]['count']++;\n }\n return $yearArray;\n }", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "private function visibleYears(int $year) : array\n {\n $yearsList = [];\n\n // Previous year\n if ($year > 2007) {\n $yearsList[] = $year - 1;\n }\n\n // Current year\n $yearsList[] = $year;\n\n // Next year\n if ($year <= (int)$this->today->format('Y')) {\n $yearsList[] = $year + 1;\n }\n\n return $yearsList;\n }", "public function findOneByYear(\\DateTime $date);", "function get_year_dates($year = null, $start_month = 12, $end_month = 11)\n{\n if (!isset($year)) {\n $year = date('Y');\n }\n $start_date = $year - 1 . '-' . $start_month . '-01';\n $end_date = $year . '-' . $end_month . '-30';\n return [\n 'start_date' => $start_date,\n 'end_date' => $end_date\n ];\n}", "function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "function kcsite_add_events_date_filter() {\n\n\tglobal $wpdb, $wp_locale;\n\n\t$months = $wpdb->get_results( $wpdb->prepare( \"\n\t\tSELECT DISTINCT YEAR( meta_value ) AS year, MONTH( meta_value ) AS month\n\t\tFROM $wpdb->postmeta\n\t\tWHERE meta_key = %s\n\t\tORDER BY meta_value ASC\n\t\", '_EventStartDate' ) );\n\n\t$month_count = count( $months );\n\n\tif ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )\n\t\treturn;\n\n\t$m = isset( $_GET['_EventStartDate'] ) ? (int) $_GET['_EventStartDate'] : 0;\n\t?>\n\n\t<select id=\"EventStartDate-filter\" name='_EventStartDate'>\n\t\t<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Pasirinkite renginio datą' ); ?></option>\n\t<?php\n\tforeach ( $months as $arc_row ) {\n\t\tif ( 0 == $arc_row->year )\n\t\t\tcontinue;\n\n\t\t$month = zeroise( $arc_row->month, 2 );\n\t\t$year = $arc_row->year;\n\n\t\tprintf( \"<option %s value='%s'>%s</option>\\n\",\n\t\t\tselected( $m, $year . $month, false ),\n\t\t\tesc_attr( $arc_row->year . $month ),\n\t\t\t/* translators: 1: month name, 2: 4-digit year */\n\t\t\tsprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )\n\t\t);\n\t}\n\t?>\n\t</select>\n\t<?php\n}", "private function setNagyboldogasszonyNapja(int $year)\n {\n return Carbon::create($year, 8, 15, 0, 0, 0);\n }", "public function getYear() : int\n {\n return $this->year;\n }", "public function setYear($year)\n {\n $ts = $this->timestamp;\n $result = mktime(\n date('H', $ts),\n date('i', $ts),\n date('s', $ts),\n date('n', $ts),\n date('j', $ts),\n $year\n );\n return new Date($result, $this->timezone);\n }", "public function GetAllFacturesVentesByYear() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n \n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n $filterYear = $_REQUEST['data'][\"filterYear\"];\n // Input validations\n if (!empty($idSociete) && !empty($filterYear)) {\n try {\n $sql = $this->db->prepare(\"SELECT idFacture,date as dateCre,total,YEAR(date) AS factYear FROM facturevente WHERE idEtat != 5 and YEAR(date) = :filterYear AND idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->bindParam('filterYear', $filterYear, PDO::PARAM_STR);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n \n }" ]
[ "0.74219996", "0.6665895", "0.6569918", "0.6506415", "0.6338728", "0.63292754", "0.6329065", "0.6326816", "0.6221842", "0.62181914", "0.61588883", "0.61142284", "0.60848945", "0.6035317", "0.60174537", "0.5999049", "0.5973074", "0.59514594", "0.59212697", "0.58924055", "0.5855674", "0.58350414", "0.5775432", "0.57717127", "0.57578975", "0.5733047", "0.57076865", "0.5662696", "0.56586957", "0.5639536", "0.563526", "0.5615605", "0.56034243", "0.5597021", "0.5569362", "0.5559739", "0.5555649", "0.5535233", "0.553429", "0.5529089", "0.5511466", "0.55082816", "0.5505422", "0.5496405", "0.5495337", "0.54849136", "0.54785025", "0.5478465", "0.5462236", "0.5451123", "0.54482406", "0.54194814", "0.54155", "0.54011226", "0.537095", "0.53662485", "0.53579205", "0.53533095", "0.53455514", "0.53411996", "0.53268987", "0.5322588", "0.53114533", "0.5310713", "0.53092426", "0.5307533", "0.5303178", "0.52951115", "0.52951115", "0.52946514", "0.5291601", "0.52884144", "0.52884144", "0.5281266", "0.52779216", "0.52764785", "0.5275529", "0.527516", "0.527227", "0.5266693", "0.5259314", "0.5257191", "0.5247933", "0.5247933", "0.5246593", "0.5244862", "0.5242389", "0.5233164", "0.5230242", "0.5227706", "0.5227442", "0.5221341", "0.5221332", "0.5218983", "0.5213295", "0.51992506", "0.5197935", "0.5197521", "0.5193965", "0.5189646" ]
0.72684336
1
Events based on year and state.
public function yearMonth($year = null, $month = null) { return \App\Event::with('venue.city.states') ->whereYear('start_date', $year) ->whereMonth('start_date', $month) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function yearTypeState($year = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function yearMonthState($year = null, $month = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "public function __construct($year)\n {\n $this->year = $year;\n }", "public function setYear($year);", "public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }", "public function getEvents(array $filters = array());", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "function _registration_open( $event_month, $event_year ){\n $open_month = ((floor(($event_month + 1) / 2) - 1) * 2) + (12 - floor(($event_month + 9) / 12) * 12);\n $open_year = $event_year + floor (($event_month + 9) / 12) - 1;\n $open_time = mktime( 0, 0, 0, $open_month, 1, $open_year);\n return $open_time < time();\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "public function setYear($year)\n {\n $this->year = $year;\n }", "private function parseEvent($str, $month, $year, $tzSrc, $tzDest) {\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML(\"<?xml encoding='UTF-8' ?>\" . $str);\n\t\t$event = array();\n\t\t$node = $html->getElementsByTagName(\"body\");\n\t\tforeach ($node as $body) {\n\t\t\tforeach ($body->childNodes as $node) {\n\t\t\t\t$_id = explode(\"_\", $node->getAttribute(\"id\"));\n\t\t\t\t$_id = $_id[0];\n\t\t\t\tforeach ($node->getElementsByTagName(\"div\") as $subnode) {\n\t\t\t\t\t$class = $subnode->getAttribute(\"class\");\n\t\t\t\t\tif ($class === \"eventDateBlock\") {\n\t\t\t\t\t\t// date\n\t\t\t\t\t\t$_date = explode(\" \", $subnode->firstChild->textContent);\n\t\t\t\t\t\t$_date = (strlen($_date[1]) === 1) ? \"0\" . $_date[1] : (string) $_date[1];\n\t\t\t\t\t\t$_date = \"$year-$month-\" . $_date;\n\t\t\t\t\t\t$_time = $subnode->childNodes->item(2)->textContent;\n\t\t\t\t\t} elseif ($class === \"playerAvatar\") {\n\t\t\t\t\t\t// url, images\n\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t$_url = $a->getAttribute(\"href\");\n\t\t\t\t\t\t$img = $a->firstChild;\n\t\t\t\t\t\t$_img_icon = $img->getAttribute(\"src\");\n\t\t\t\t\t\t// relocate onto a // aware domain, cdn.akamai.steamstatic.com → steamcdn-a.akamaihd.net\n\t\t\t\t\t\t$_img_icon = str_replace( \"http://cdn.akamai.steamstatic.com\", \"//steamcdn-a.akamaihd.net\", $_img_icon);\n\t\t\t\t\t\t$_appid = explode(\"/\", $_img_icon);\n\t\t\t\t\t\t$_appid = intval($_appid[count($_appid) - 2]);\n\t\t\t\t\t\tif ($_appid === 0) {\n\t\t\t\t\t\t\t$_img_header = \"\";\n\t\t\t\t\t\t\t$_img_header_small = \"\";\n\t\t\t\t\t\t\t$_img_capsule = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_img_header = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header.jpg\";\n\t\t\t\t\t\t\t$_img_header_small = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header_292x136.jpg\";\n\t\t\t\t\t\t\t$_img_capsule = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/capsule_sm_120.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($class === \"eventBlockTitle\") {\n\t\t\t\t\t\t$l = $subnode->childNodes;\n\t\t\t\t\t\tforeach ($l as $a) {\n\t\t\t\t\t\t\tif ($a->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tif ($a->tagName === \"a\") {\n\t\t\t\t\t\t\t\t\tif ($a->getAttribute(\"class\") === \"headlineLink\") {\n\t\t\t\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t\t\t\t\t$_title = $a->textContent;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// comment count\n\t\t\t\t\t\t\t\t\t\t$_comments = explode(\" \", $a->textContent);\n\t\t\t\t\t\t\t\t\t\t$_comments = intval($_comments[0]);\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\t\n\t\t$tempDate = new DateTime($_date . \" \" . $_time, $tzSrc);\n\t\t$tempDate->setTimeZone($tzDest);\n\n\t\t$event[\"id\"] = $_id;\n\t\t$event[\"url\"] = $_url;\n\t\t$event[\"title\"] = $_title;\n\t\t$event[\"comments\"] = $_comments;\n\t\t$event[\"date\"] = $tempDate->format(\"Y-m-d\");\n\t\t$event[\"time\"] = $tempDate->format(\"H:i\");\n\t\t$event[\"tz\"] = $tempDate->format(\"e\");\n\t\t$event[\"appid\"] = $_appid;\n\t\t$event[\"img_icon\"] = $_img_icon;\n\t\t$event[\"img_capsule\"] = $_img_capsule;\n\t\t$event[\"img_header\"] = $_img_header;\n\t\t$event[\"img_header_small\"] = $_img_header_small;\n\t\treturn $event;\n\t}", "public function setYear($year) {\n $this->_year = $year;\n }", "public function testSportsDayBefore1996(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "public function buildCalendar($month, $year);", "function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}", "function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "public static function stateChanged($event)\r\n {\r\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "function GetEvent($date, $id_country = 0, $id_region = 0, $id_city = 0, $type = 0, $my_events = false){\n\tglobal $lang, $config, $config_index, $smarty, $dbconn, $user;\n\n\t$filter = $table = \"\";\n\tif ($id_country)$filter .= \" AND a.id_country = \".$id_country;\n\tif ($id_region)\t$filter .= \" AND a.id_region = \".$id_region;\n\tif ($id_city)\t$filter .= \" AND a.id_city = \".$id_city;\n\tif ($type)\t\t$filter .= \" AND a.type = \".$type;\n\n\tif ($my_events) {\n\t\t$table = \", \".EVENT_USERS_TABLE.\" b \";\n\t\t$filter .= \" AND a.id = b.id_event AND b.id_user = \".$user[ AUTH_ID_USER ];\n\t}\n\n\t$strSQL = \"SELECT a.id, a.event_name, a.id_creator FROM \".EVENT_DESCR_TABLE.\" a\".$table.\"\n\t\tWHERE (\t(a.periodicity = 'none' AND DATE_FORMAT(a.start_date,'%Y-%m-%d') = DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'daily' AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'weekly' AND DAYOFWEEK(a.start_date) = DAYOFWEEK('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'monthly' AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'yearly' AND MONTH(a.start_date) = MONTH('\".$date.\"') AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\t)\".$filter;\n\t$rs = $dbconn->Execute($strSQL);\n\t$num_records = $rs->RowCount();\n\tif($num_records>0){\n\t\t$event[\"event_count\"] = $num_records;\n\t\t$i = 0;\n\t\twhile(!$rs->EOF){\n\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t$event[\"event\"][$i][\"id_event\"] = $row[\"id\"];\n\t\t\tif (strlen($row[\"event_name\"])<10) {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t} else {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes(substr($row[\"event_name\"],0,10).\"...\");\n\t\t\t}\n\t\t\t$event[\"event\"][$i][\"full_name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t$i++;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $event;\n\t} else {\n\t\treturn '';\n\t}\n}", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "public function getYearEraDayIndex($year);", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "public function modelYear();", "function show_calendar_events()\n\t{\n\t\t$stats_html = \"\";\n\t\t\n\t\tif ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )\n\t\t{\n\t\t\t$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );\n\t\t\n\t\t\t$day = $a[2];\n\t\t\t$month = $a[1];\n\t\t\t$year = $a[0];\n\t\t\t\n\t\t\t$birthstring = \"\";\n\t\t\t$count = 0;\n\t\t\t$users = array();\n\t\t\t\n\t\t\tif ( $this->ipsclass->vars['show_birthdays'] )\n\t\t\t{\n\t\t\t\tif ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->ipsclass->cache['birthdays'] as $u )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $u['bday_day'] == $day and $u['bday_month'] == $month )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( $day == 28 && $month == 2 && !date(\"L\") )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $u['bday_day'] == \"29\" and $u['bday_month'] == $month )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Spin and print...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tforeach ( $users as $user )\n\t\t\t\t{\n\t\t\t\t\t$birthstring .= \"<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>\";\n\t\t\t\t\t\n\t\t\t\t\tif ($user['bday_year'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$pyear = $year - $user['bday_year'];\n\t\t\t\t\t\t$birthstring .= \"(<b>$pyear</b>)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$birthstring .= $this->sep_char.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Fix up string...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$birthstring = preg_replace( \"/\".$this->sep_char.\"$/\", \"\", trim($birthstring) );\n\t\t\t\t\n\t\t\t\t$lang = $this->ipsclass->lang['no_birth_users'];\n\t\t\t\t\n\t\t\t\tif ($count > 0)\n\t\t\t\t{\n\t\t\t\t\t$lang = ($count > 1) ? $this->ipsclass->lang['birth_users'] : $this->ipsclass->lang['birth_user'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$count = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $this->ipsclass->vars['autohide_bday'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing the calendar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($this->ipsclass->vars['show_calendar'])\n\t\t{\n\t\t\t$this->ipsclass->vars['calendar_limit'] = intval($this->ipsclass->vars['calendar_limit']) < 2 ? 1 : intval($this->ipsclass->vars['calendar_limit']);\n\t\t\t\n\t\t\t$our_unix = gmmktime( 0, 0, 0, $month, $day, $year);\n\t\t\t$max_date = $our_unix + ($this->ipsclass->vars['calendar_limit'] * 86400);\n\t\t\t$events = array();\n\t\t\t$show_events = array();\n\t\t\t\n\t\t\tif( $this->ipsclass->member['org_perm_id'] )\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['org_perm_id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['g_perm_id'] ) );\n\t\t\t\t\n\t\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);\n\t\t\t\t\t\n\t\t\t\t\t$mgroup_others = explode( \",\", $this->ipsclass->member['mgroup_others'] );\n\t\t\t\t\t\n\t\t\t\t\tif( count($mgroup_others) )\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach( $mgroup_others as $mgroup )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $mgroup )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_permission_groups = array_merge( $member_permission_groups, explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->cache['group_cache'][$mgroup]['g_perm_id'] ) ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )\n\t\t\t{\n\t\t\t\tforeach( $this->ipsclass->cache['calendar'] as $u )\n\t\t\t\t{\n\t\t\t\t\t$set_offset = 0;\n\n\t\t\t\t\tif( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$u['_unix_from'] = $u['event_unix_from'] - $set_offset;\n\t\t\t\t\t$u['_unix_to'] = $u['event_unix_to'] - $set_offset;\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Private?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_private'] == 1 and $this->ipsclass->member['id'] != $u['event_member_id'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_perms'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($event_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $event_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got calendar perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['_perm_read'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$read_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($read_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $read_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// In range?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t\tif ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_to'] >= $our_unix AND $u['event_unix_from'] <= $max_date )\n\t\t\t\t\t\tOR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$u['event_activetime'] = $u['_unix_from'];\n\t\t\t\t\t\t$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t}\n\t\t\t\t\telseif( $u['event_recurring'] > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cust_range_s = $u['event_unix_from'];\n\n\t\t\t\t\t\twhile( $cust_range_s < $u['event_unix_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$u['event_activetime'] = $cust_range_s;\n\t\t\t\t\t\t\t\t$events[ str_pad( $cust_range_s.$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( $u['event_recurring'] == \"1\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 604800;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( $u['event_recurring'] == \"2\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 18144000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 31536000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tksort($events);\n\t\t\t\n\t\t\tforeach( $events as $event )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Recurring?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$c_time = '';\n\t\t\t\t$c_time = gmdate( 'j-F-y', $event['event_activetime'] );\n\t\t\t\t\n\t\t\t\t$show_events[] = \"<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>\".$event['event_title'].\"</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['calender_f_title'] = sprintf( $this->ipsclass->lang['calender_f_title'], $this->ipsclass->vars['calendar_limit'] );\n\t\t\t\n\t\t\tif ( count($show_events) > 0 )\n\t\t\t{\n\t\t\t\t$event_string = implode( $this->sep_char.' ', $show_events );\n\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! $this->ipsclass->vars['autohide_calendar'] )\n\t\t\t\t{\n\t\t\t\t\t$event_string = $this->ipsclass->lang['no_calendar_events'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $stats_html;\n\t\n\t}", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function eventsUsingTableAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $events = $this->model->findEventsByYear((int) $year);\n $viewModel = new ViewModel(['events' => $events, 'year' => $year]);\n $viewModel->setTemplate('signups/index/events');\n return $viewModel;\n }", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function index($year)\n\t{\n\t\t/**\n\t\t* get all places that have sowings in a specific year \n\t\t*/\n\t\t$places = Place :: whereHas('sowings', function($query) use ($year){\n\t\t\t$query->where('year','=',$year);\n\t\t})->get();\n\n\t\t$places->each(function($item) use($year){\n\t\t\t// var_dump($item);\n\t\t\t$item->sowings = $item->sowings->filter(function($item) use ($year){\n\t\t\t\treturn $item->year == $year;\n\t\t\t})->all();\n\t\t\t\n\t\t});\n\n\t\t$years = Sowing :: distinct('year')->pluck('year');\n\n\t\treturn view('sowings.index', compact('years','places'));\n\t}", "public function addYear(array &$form, FormStateInterface $form_state) {\n foreach ($form_state->getValues()['fieldset'] as $key => $val) {\n if ($form_state->getTriggeringElement()['#parents'][1] == $key) {\n $num_year = $form_state->get(\"fieldset_$key\") + 1;\n $form_state->set(\"fieldset_$key\", $num_year);\n $form_state->setRebuild();\n }\n else {\n $form_state->setRebuild();\n }\n }\n }", "function _buildKayinNewYear()\n {\n \n $this->_addHoliday(\n 'KayinNewYear',\n $this->_year . '-01-10',\n 'KayinNewYear Day'\n );\n }", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public function testSportsDayBetween1996And2000(): void\n {\n $year = 1997;\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-10-10\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "function get_holidays($inc_year){\n\t//$year = date(\"Y\");\n\t$year = $inc_year;\n\n\t// $holidays[] = new Holiday(\"New Year's Day\", get_timestamp(\"$year-1-1\"));\n\t$holidays[] = new Holiday(\"Republic Day\", get_timestamp(\"$year-1-26\"));\n\t// $holidays[] = new Holiday(\"Labour Day\", ordinal_day(1, 'Mon', 3, $year));\n\t// $holidays[] = new Holiday(\"Anzac Day\", get_timestamp(\"$year-4-25\"));\n\t//$holidays[] = new Holiday(\"St. Patrick's Day\", get_timestamp(\"$year-3-17\"));\n\t// TODO: $holidays[] = new Holiday(\"Good Friday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Easter\", easter_date($year));\n\t// TODO: $holidays[] = new Holiday(\"Easter Monday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Foundation Day\", ordinal_day(1, 'Mon', 6, $year));\n\t// $holidays[] = new Holiday(\"Queen's Birthday\", ordinal_day(1, 'Mon', 10, $year));\n\t//$holidays[] = new Holiday(\"Memorial Day\", memorial_day($year));\n\t//$holidays[] = new Holiday(\"Mother's Day\", ordinal_day(2, 'Sun', 5, $year));\n\t//$holidays[] = new Holiday(\"Father's Day\", ordinal_day(3, 'Sun', 6, $year));\n\t//$holidays[] = new Holiday(\"Independence Day\", get_timestamp(\"$year-7-4\"));\n\t//$holidays[] = new Holiday(\"Labor Day\", ordinal_day(1, 'Mon', 9, $year));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"$year-12-25\"));\n\t$holidays[] = new Holiday(\"Dussera\", get_timestamp(\"2010-10-15\"));\n\t$holidays[] = new Holiday(\"Ugadi\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"kanada Rajyotshava\", get_timestamp(\"$year-11-1\"));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-04\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-05\"));\n\t// $holidays[] = new Holiday(\"Boxing Day\", get_timestamp(\"$year-12-26\"));\n\n\t$numHolidays = count($holidays) - 1;\n\t$out_array = array();\n\n\tfor ($i = 0; $i < $numHolidays; $i++){\n\t\t$out_array[] = $holidays[$i]->date;\n\t}\n\tunset($holidays);\n\treturn $out_array;\n}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "public function getCityHolidays($year): array\n {\n return [\n\n $this->getEasterDate($year,'SEXTA_FEIRA_SANTA') => $this->createData('Paixão de Cristo'),\n $this->getEasterDate($year,'CORPUS_CHRISTI') => $this->createData('Corpus Christi'),\n\n '01-25' => $this->createData('Aniversário de São Paulo', null, [ self::CITY_CODE ]),\n '11-20' => $this->createData('Consciência Negra', null, [ self::CITY_CODE ]),\n ];\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function __construct($_title, $_year)\n {\n $this->title = $_title;\n $this->year = $_year;\n self::$counter++; // incremento il contatore ogni volta che agggiungo un'istanza \n }", "public function viewAllEvents();", "private function getEvents( $days , $filter = null , $startDate = null, $q = null, $city = null ){\n\t\t$events = array();\n\t\t$google_calendar_id = Yii::$app->params['google-calendar-id'];\n\t\t$google_api_key = Yii::$app->params['google-api-key'];\n\n\t\tif( is_null($startDate) )\n\t\t\t$startDate = new \\Datetime();\n\t\t$endPeriod = clone $startDate;\n\t\tif( $days < 84 )\n\t\t\t$movedays = $days;\n\t\telse{\n\t\t\t$movedays = 84;\n\t\t}\n\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t$format = 'Y-m-d';\n\t\tdo{\n\n\t\t\t$google_url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($google_calendar_id) . '/events?key=' . urlencode($google_api_key) . '&maxResults=2500&orderBy=startTime&singleEvents=true&timeMin=' . urlencode( $startDate->format($format) . 'T07:00:00+00:00') . '&timeMax=' . urlencode( $endPeriod->format($format) . 'T23:59:59+00:00' );\n\t\t\tif(isset($q)){\n\t\t\t\t$google_url.='&q='.urlencode($q);\n\t\t\t}\n\t\t\tif(isset($city) && !empty($city)){\n\t\t\t\t$google_url.='&sharedExtendedProperty=city%3D'.urlencode($city);\n\t\t\t}\n\t\t\t$json_array = $this->getFromApi( $google_url );\n\n\t\t\t$collected_events = $json_array['items'];\n\t\t\tif( !is_null($filter) ){\n\t\t\t\t$collected_events = $this->filterEvents( $filter , $collected_events );\n\t\t\t}\n\t\t\t$events = array_merge( $events , $collected_events );\n\n\t\t\t$startDate = $endPeriod;\n\t\t\t$endPeriod = clone $startDate;\n\t\t\tif( $days < 84 )\n\t\t\t\t$movedays = $days;\n\t\t\telse{\n\t\t\t\t$movedays = 84;\n\t\t\t}\n\t\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t\t$days-= 84;\n\t\t}while( $days > 0 );\n\n\t\treturn $events;\n\t}", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function Submissions_Latex_Event()\n {\n $event=$this->Event();\n $event=$this->EventsObj()->ApplyAllEnums($event,TRUE);\n $event=$this->EventsObj()->TrimLatexItem($event);\n\n return $event;\n }", "public function getEventByDate($year, $month, $day) {\n\t\tif (isset($this->events[$year][$month][$day]))\n\t\t\treturn $this->events[$year][$month][$day];\n\t\treturn FALSE;\n\t}", "public static function __events () {\n \n }", "public function getYear() {}", "public function __construct() {\n // Adding values to the variabels\n $this->currentYear = date(\"Y\");\n $this->offsetYear = 0;\n $this->multiplier = 1;\n }", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "public function state($state = null)\n {\n $q = \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n });\n $q = $this->handleRequest($q);\n\n return $q->orderby('start_date', 'asc')\n ->paginate($this->paginate)->appends(request($this->params));\n }", "public static function eventStatus()\n {\n return [\n 'abe' => 'Aberto',\n 'fec' => 'Fechado',\n 'can' => 'Cancelado'\n ];\n }", "public function get_test_scheduled_events()\n {\n }", "function show_next_calendar(){ \n \t\t\t$this->gen_contents['region_search'] \t= $_POST['region'];\n \t\t\t$this->gen_contents['subregion_search'] = $_POST['subregion'];\n $this->gen_contents['course_search'] = $_POST['course'];\n if($this->gen_contents['course_search']=='5'){\n $this->gen_contents['chp_search'] = $_POST['chp'];\n }\n $this->gen_contents[\"chp_list\"] = $this->config->item('chapter_list');\n $this->gen_contents[\"crse_color\"] = $this->config->item('course_color');\n \t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($_POST['timeid'],$_POST['course'],$_POST['region'],$_POST['subregion']));\n\t\t\t\n\t\t\t$this->load->view('user/career_event/schedule_calendar',$this->gen_contents);\n \t\t}", "public static function findForPersonYear($personId, $year)\n {\n $info = new PersonEventInfo();\n\n $info->person_id = $personId;\n $info->year = $year;\n\n $requireTraining = PersonPosition::findTrainingPositions($personId);\n $info->trainings = [];\n\n if ($requireTraining->isEmpty()) {\n $requireTraining = [Position::find(Position::TRAINING)];\n }\n\n foreach ($requireTraining as $position) {\n $info->trainings[] = Training::retrieveEducation($personId, $position, $year);\n }\n\n usort($info->trainings, function ($a, $b) {\n return strcmp($a->position_title, $b->position_title);\n });\n\n $radio = RadioEligible::findForPersonYear($personId, $year);\n $info->radio_info_available = setting('RadioInfoAvailable');\n $info->radio_max = $radio ? $radio->max_radios : 0;\n $info->radio_eligible = $info->radio_max > 0 ? true : false;\n\n $bmid = Bmid::findForPersonYear($personId, $year);\n if ($bmid) {\n $info->meals = $bmid->meals;\n $info->showers = $bmid->showers;\n } else {\n $info->meals = '';\n $info->showers = false;\n }\n\n if (current_year() == $year && !setting('MealInfoAvailable')) {\n $info->meals = 'no-info';\n }\n\n $ot = PersonOnlineTraining::findForPersonYear($personId, $year);\n\n if ($ot) {\n $info->online_training_passed = true;\n $info->online_training_date = (string)$ot->completed_at;\n } else {\n $info->online_training_passed = false;\n }\n\n $info->vehicles = Vehicle::findForPersonYear($personId, $year);\n $event = PersonEvent::findForPersonYear($personId, $year);\n\n if ($event) {\n $info->may_request_stickers = $event->may_request_stickers;\n $info->org_vehicle_insurance = $event->org_vehicle_insurance;\n $info->signed_motorpool_agreement = $event->signed_motorpool_agreement;\n } else {\n $info->may_request_stickers = false;\n $info->org_vehicle_insurance = false;\n $info->signed_motorpool_agreement = false;\n }\n return $info;\n }", "function filterprimary()\r\n\t{\t\r\n\t\t// make date and time variables\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t// take filter categories and do filtering\r\n\t\t$elements = json_decode( preg_replace('/[\\n\\r]+/', '\\n', JRequest::getVar( 'elements', '', 'post', 'string' ) ) );\r\n\t\t\r\n\t\t$categories = array();\r\n\t\tforeach($elements as $element)\r\n\t\t{\r\n\t\t\tif($element->checked && strpos ( $element->name , 'primary_cat_' ) !== false )\r\n\t\t\t{\r\n\t\t\t\t$categories[$element->name] = $element->value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$model->setState( 'filter_primary_categories', $categories );\r\n\t\t\r\n\t\t// order event instances by date and time\r\n\t\t$model->setState( 'order', 'tbl.eventinstance_date' );\r\n\t\t$model->setState( 'direction', 'ASC' );\r\n\t\t$query = $model->getQuery( );\r\n\t\t$query->order( 'tbl.eventinstance_start_time' );\r\n\t\t$model->setQuery( $query );\r\n\t\t\r\n\t\t// attach variables to the $vars object\r\n\t\t$vars->date = $date;\r\n\t\t$vars->items = $model->getList( );\r\n\t\t\r\n\t\t// echo output\r\n\t\t$html = $this->getLayout( 'default', $vars, 'three' ); \r\n\t\techo ( json_encode( array('msg'=>$html) ) );\r\n\t}", "public function index()\n {\n $filters = request()->only('date', 'region');\n\n $events = $this->event\n ->when(isset($filters['date']), function ($query) use ($filters) {\n return $query->whereDate('date', $filters['date']);\n })\n ->when(isset($filters['region']), function ($query) use ($filters) {\n return $query->where('place', 'LIKE', \"%{$filters['region']}%\");\n })\n ->paginate(10);\n\n return response()->json([\n 'error' => false,\n 'message' => '',\n 'data' => [\n 'current_page' => $events->currentPage(),\n 'last_page' => $events->lastPage(),\n 'per_page' => $events->perPage(),\n 'path' => $events->path(),\n 'data' => new EventCollection($events)\n ]\n ], 200);\n }", "public function viewEvents();", "public function getEvents();", "public function getEvents();", "public function get_cities_with_events($state = null)\n {\n if ($state):\n return $this->groupBy('slug')->where('state', $state)->get();\n else:\n return false;\n endif;\n }", "function holiday ($yr=0)\n\t{\n\t\tif ($yr==0) $yr = (int)date(\"Y\");\n\t\t$this->bjd = gregorian_to_jd(1,1,$yr);\n\t\t$this->ejd = gregorian_to_jd(12,31,$yr);\n\n\t\t//add holidays easily define in the gregorian calendar\n\t\t$this->holidays = Array(\n\t\t\t\"newyearseve\" => gregorian_to_jd(12,31,$yr),\n\t\t\t\"valentinesday\"=> gregorian_to_jd(2,14,$yr),\n\t\t\t\"presidentsday\" => nth_weekday_jd(3,dMONDAY,2,$yr),\n\t\t\t\"stpatricksday\" => gregorian_to_jd(3,17,$yr),\n\t\t\t\"aprilfoolsday\" => gregorian_to_jd(4,1,$yr),\n\t\t\t\"cincodemayo\" => gregorian_to_jd(5,5,$yr),\n\t\t\t\"mothersday\" => nth_weekday_jd(2,dSUNDAY,5,$yr),\n\t\t\t\"memorialday\" => $this->memorialDay($yr),\n\t\t\t\"fathersday\" => nth_weekday_jd(3,dSUNDAY,6,$yr),\n\t\t\t\"fourthofjuly\" => gregorian_to_jd(7,4,$yr),\n\t\t\t\"laborday\" => nth_weekday_jd(1,dMONDAY,9,$yr),\n\t\t\t\"columbusday\" => nth_weekday_jd(2,dMONDAY,10,$yr),\n\t\t\t\"halloween\" => gregorian_to_jd(10,31,$yr), \n\t\t\t\"thanksgiving\" => nth_weekday_jd(4, dTHURSDAY, 11,$yr),\n\t\t\t\"christmas\" => gregorian_to_jd(12,24,$yr),\n\t\t\t\"christmasday\" => gregorian_to_jd(12,25,$yr),\n\t\t\t\"mardigras\" => easter_jd($yr,-47),\n\t\t\t\"easter\" =>\teaster_jd($yr)\n\t\t);\n\t\t\t\n\t\tasort($this->holidays);\n\t}", "public static function scheduleSummaryForPersonYear($personId, $year)\n {\n $rows = self::findForQuery(['person_id' => $personId, 'year' => $year]);\n\n $eventDates = EventDate::findForYear($year);\n\n if (!$rows->isEmpty()) {\n PositionCredit::warmYearCache($year, array_unique($rows->pluck('position_id')->toArray()));\n }\n\n if (!$eventDates) {\n // No event dates - return everything as happening during the event\n $time = $rows->pluck('slot_duration')->sum();\n $credits = $rows->pluck('credits')->sum();\n\n return [\n 'pre_event_duration' => 0,\n 'pre_event_credits' => 0,\n 'event_duration' => $time,\n 'event_credits' => $credits,\n 'post_event_duration' => 0,\n 'post_event_credits' => 0,\n 'total_duration' => $time,\n 'total_credits' => $credits,\n 'other_duration' => 0,\n 'counted_duration' => 0,\n ];\n }\n\n $summary = new WorkSummary($eventDates->event_start->timestamp, $eventDates->event_end->timestamp, $year);\n\n foreach ($rows as $row) {\n $summary->computeTotals($row->position_id, $row->slot_begins_time, $row->slot_ends_time, $row->position_count_hours);\n }\n\n return [\n 'pre_event_duration' => $summary->pre_event_duration,\n 'pre_event_credits' => $summary->pre_event_credits,\n 'event_duration' => $summary->event_duration,\n 'event_credits' => $summary->event_credits,\n 'post_event_duration' => $summary->post_event_duration,\n 'post_event_credits' => $summary->post_event_credits,\n 'total_duration' => ($summary->pre_event_duration + $summary->event_duration + $summary->post_event_duration + $summary->other_duration),\n 'total_credits' => ($summary->pre_event_credits + $summary->event_credits + $summary->post_event_credits),\n 'other_duration' => $summary->other_duration,\n 'counted_duration' => ($summary->pre_event_duration + $summary->event_duration + $summary->post_event_duration),\n 'event_start' => (string)$eventDates->event_start,\n 'event_end' => (string)$eventDates->event_end,\n ];\n }", "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\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\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\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\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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 ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\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$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\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$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function onEvent();", "function _buildChristmas()\n {\n \n $this->_addHoliday(\n 'Christmas',\n $this->_year . '-12-25',\n 'Christmas Day'\n );\n \n }", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "public static function events();", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "public static function createOrUpdateEvent($event_id, $fest_type_id, $event_year, $begin_date, $finish_date)\n\t{\n\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\tif ($event_id == null) {\n\n\t\t\t$img_link = ImageModel::createImage();\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\t\t\t$sql = \"INSERT INTO events (fest_type_id, year, img_link, begin_date, finish_date, status_id) VALUES (:fest_type_id, :event_year, :img_link, :begin_date, :finish_date, :status_id)\";\n\t\t\t$query = $database->prepare($sql);\n\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':event_year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status));\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_CREATION_FAILED'));\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t//TODO rebuild update image system\n\t\t\t$img_link = ImageModel::createImage();//return 'hash_img' if new image upload and 'false' if image not upload \n\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\n\t\t\t//People Award\n\t\t\t//Right now I selecte Film-winner on update Festival action\n\t\t\t//may be it will be better something else, for example, cron-proccess or some button\n\t\t\tif ($event_status == 3) {\n\t\t\t\t// event status 3 - finished\n\t\t\t\t$film_id = FilmModel::getFilmWonPeopleAward($event_id);\n\n\t\t\t\t$sql00 = \"SELECT event_id FROM people_award WHERE event_id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql00);\n\t\t\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t\t\tif ($query->rowCount() != 1) {\n\t\t\t\t\t// fest was NOT be finished, never\n\t\t\t\t\t$sql0 = \"INSERT INTO people_award (event_id, film_id) VALUES (:event_id, :film_id)\";\n\t\t\t\t\t$query = $database->prepare($sql0);\n\t\t\t\t\t$query->execute(array(':event_id' => $event_id, ':film_id' => $film_id));\n\n\t\t\t\t} else {\n\t\t\t\t\t// fest was be reopen and finished, again\n\t\t\t\t\t// recalcute winner (but this func is need???)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//end People Award\n\n\n\t\t\tif($img_link != 'file didnt upload'){\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, img_link = :img_link, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\t\t\t} else {\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\n\t\t\t\t//cause if saved previosly information $query-rowCount() == 0\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_FILM_UPDATE_FAILED'));\n\t\t\treturn false;\n\t\t}\n\n\t}" ]
[ "0.7101401", "0.647072", "0.6299999", "0.62542504", "0.61698705", "0.57643974", "0.5705248", "0.565853", "0.56101394", "0.555892", "0.5545499", "0.54633147", "0.543884", "0.543602", "0.54078066", "0.5337899", "0.5320634", "0.52699256", "0.5231473", "0.52196115", "0.5213453", "0.51973486", "0.51843625", "0.51602334", "0.51525897", "0.51510656", "0.5135986", "0.51201415", "0.51014346", "0.50939065", "0.50646156", "0.50455767", "0.5044404", "0.5029554", "0.50289327", "0.50269675", "0.5012184", "0.5009792", "0.49800324", "0.49797755", "0.4963981", "0.4952776", "0.49444234", "0.49346888", "0.4933348", "0.49322972", "0.4925882", "0.49124014", "0.4898734", "0.4893456", "0.48929194", "0.48826003", "0.48740736", "0.48647672", "0.48643908", "0.4841659", "0.4839869", "0.48381922", "0.48378474", "0.4837829", "0.4819483", "0.4817648", "0.48173758", "0.481729", "0.48146167", "0.48088646", "0.48067376", "0.47922152", "0.47881004", "0.4787022", "0.47811115", "0.47724837", "0.47702566", "0.47687364", "0.47676983", "0.47609743", "0.47591484", "0.47559735", "0.4755078", "0.47549433", "0.4753897", "0.47498935", "0.4746415", "0.4728036", "0.47197118", "0.47186595", "0.47174808", "0.47174808", "0.47081268", "0.47038725", "0.47003764", "0.46972558", "0.46918863", "0.46889925", "0.468815", "0.46867758", "0.46832237", "0.46827486", "0.4679449", "0.46721792" ]
0.52273995
19
Events based on year and type.
public function yearType($year = null, $type = null) { return \App\Event::with('venue.city.states') ->whereYear('start_date', $year) ->where('type', $type) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "public function yearTypeState($year = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "function GetOvertimeYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_OvertimeYearList_\n select distinct substrb(my_day, 0,4) as year1,\n substrb(my_day, 0,4) as year2\n from ehr_overtime_v\n where company_id = '$companyid'\n $_where\n order by substrb(my_day,0,4) desc\n_OvertimeYearList_;\n return $this->DBConn->GetArray($sql_string);\n }", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "function GetLeaveYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<eof\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day, 'YYYY-MM-DD'), 0, 4) desc\neof;\n return $this->DBConn->GetArray($sql_string);\n }", "public function setYear($year);", "function GetEvent($date, $id_country = 0, $id_region = 0, $id_city = 0, $type = 0, $my_events = false){\n\tglobal $lang, $config, $config_index, $smarty, $dbconn, $user;\n\n\t$filter = $table = \"\";\n\tif ($id_country)$filter .= \" AND a.id_country = \".$id_country;\n\tif ($id_region)\t$filter .= \" AND a.id_region = \".$id_region;\n\tif ($id_city)\t$filter .= \" AND a.id_city = \".$id_city;\n\tif ($type)\t\t$filter .= \" AND a.type = \".$type;\n\n\tif ($my_events) {\n\t\t$table = \", \".EVENT_USERS_TABLE.\" b \";\n\t\t$filter .= \" AND a.id = b.id_event AND b.id_user = \".$user[ AUTH_ID_USER ];\n\t}\n\n\t$strSQL = \"SELECT a.id, a.event_name, a.id_creator FROM \".EVENT_DESCR_TABLE.\" a\".$table.\"\n\t\tWHERE (\t(a.periodicity = 'none' AND DATE_FORMAT(a.start_date,'%Y-%m-%d') = DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'daily' AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'weekly' AND DAYOFWEEK(a.start_date) = DAYOFWEEK('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'monthly' AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'yearly' AND MONTH(a.start_date) = MONTH('\".$date.\"') AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\t)\".$filter;\n\t$rs = $dbconn->Execute($strSQL);\n\t$num_records = $rs->RowCount();\n\tif($num_records>0){\n\t\t$event[\"event_count\"] = $num_records;\n\t\t$i = 0;\n\t\twhile(!$rs->EOF){\n\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t$event[\"event\"][$i][\"id_event\"] = $row[\"id\"];\n\t\t\tif (strlen($row[\"event_name\"])<10) {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t} else {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes(substr($row[\"event_name\"],0,10).\"...\");\n\t\t\t}\n\t\t\t$event[\"event\"][$i][\"full_name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t$i++;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $event;\n\t} else {\n\t\treturn '';\n\t}\n}", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function get_type_events()\n{\n return 'atu_events';\n}", "public function findByType($type){\r\n $stmt = $this->db->prepare(\"SELECT * FROM event WHERE type =?\");\r\n $stmt->execute(array($type));\r\n\r\n $events_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n $events = array();\r\n\r\n foreach($events_db as $event){\r\n array_push($events, new Event($event[\"id_event\"], $event[\"type\"], $event[\"name\"],$event[\"moment\"], $event[\"date\"],\r\n $event[\"guests\"], $event[\"children\"], $event[\"sweet_table\"], $event[\"observations\"],\r\n $event[\"restaurant\"], $event[\"phone\"],$event[\"price\"] ));\r\n }\r\n\r\n return $events;\r\n }", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function modelYear();", "function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "public function getEvents(array $filters = array());", "public function setYear($year)\n {\n $this->year = $year;\n }", "public function __construct($year)\n {\n $this->year = $year;\n }", "public function setYear($year) {\n $this->_year = $year;\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function getYearEraDayIndex($year);", "private function inclusionByYearByTypeEssai()\n {\n $em = $this->getDoctrine()->getManager();\n\n $inclusionByYearByTypeEssai = $em->getRepository(Inclusion::class)\n ->createQueryBuilder('i')\n ->select(' count(i) as nb, YEAR(i.datInc) AS year, e.typeEssai as type')\n ->join('i.essai', 'e')\n ->where('i.datInc IS NOT NULL')\n ->groupBy('year, type')\n ->orderBy('year')\n ->getQuery()\n ->getResult();\n\n $data = [];\n $years = [];\n $essais = [];\n foreach ($inclusionByYearByTypeEssai as $resp) {\n if (empty($data[$resp['year']][$resp['type']]))\n $data[$resp['year']][$resp['type']] = 0;\n $data[$resp['year']][$resp['type']] += $resp['nb'];\n $years[] = $resp['year'];\n $essais[] = $resp['type'];\n }\n $years = array_unique($years);\n $essais = array_unique($essais);\n sort($years);\n sort($essais);\n foreach ($data as $year => $v) {\n $total = 0;\n foreach ($v as $nb) {\n $total += $nb;\n }\n foreach ($v as $name => $nb) {\n $data[$year][$name] = $data[$year][$name] / $total * 100;\n }\n }\n\n $data_by_type = [];\n foreach ($years as $year) {\n foreach ($essais as $v) {\n if (empty($data[$year][$v]))\n $data_by_type[$v][] = 0;\n else\n $data_by_type[$v][] = $data[$year][$v];\n }\n }\n\n return [\"years\" => $years, \"data\" => $data_by_type];\n }", "public static function getAllEventsByType($type)\n {\n $db = new Database();\n // Create an admin DB connection to get data from Events_Details table\n $adminDB = $db->getAdminDBConnection();\n // Query database for eid and get all details\n $query = \"SELECT * FROM Event_Details WHERE Type='\" . $type . \"' AND status=1;\";\n // Prepare query statement\n $stmt = $adminDB->prepare($query);\n // Execute query\n $stmt->execute();\n // Fetch all rows as associative array\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n }", "public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "public function getDollsFiltered($year = '', $type = '')\n\t{\n\t\t$dolls = $this->doll->where(function($query) use ($type, $year) {\n\n\t\t\tif ( ($year) && ($year !== 'all') ){\n\t\t\t\t$query->where('release_year', $year);\n\t\t\t}\n\n\t\t\t$query->whereHas('dolltypes', function($q) use ($type) {\n\t\t\t\t$q->where('slug', $type);\n\t\t\t});\n\n\t\t})->get();\n\n\t\treturn $dolls;\n\t}", "public function __construct(int $type)\n {\n $this->_eventType = $type;\n }", "function get_year($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return 2003 Format\n return date(\"Y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='2'){\n // Return 03 format\n return date(\"y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function getYear() {}", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function is_year()\n {\n }", "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function get_entries_records_for_year($entries, $year, $boundle)\n{\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n $entries_records = [];\n if (isset($entries)) {\n foreach ($entries as $entry) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $boundle)\n ->fieldCondition('field_entry', 'target_id', $entry, '=')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n\n // Adding each records for an entry in the array of entry id.\n $entries_records[$entry] = $records_ids;\n }\n }\n }\n\n return $entries_records;\n}", "public function actionIndex()\n {\n $searchModel = new EventType();\n $collection = Yii::$app->mongodb->getCollection('eventType'); \n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $queryeventType = EventType::find()->all();\n \t\n \t$querytype_name = EventType::find();\n \t$querytype_name->where(['Calendar' => ['1','2','3','4']]);\n \t$querytype_name = $querytype_name->all(); \t\n \t\n \t$type_Name = $collection->distinct('Type_name');\n\n \n return $this->render('indexeventtype', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \t'valueeventType'=> $queryeventType,\n \t\n \t'type_Name'=> $type_Name,\n \t'querytype_name'=> $querytype_name,\n\n ]);\n }", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "public function eventsGetEventTypes()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/types';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Accept' => 'application/json',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'IdfyLib\\\\Models\\\\EventTypeInfo');\n }", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "public function eventsUsingTableAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $events = $this->model->findEventsByYear((int) $year);\n $viewModel = new ViewModel(['events' => $events, 'year' => $year]);\n $viewModel->setTemplate('signups/index/events');\n return $viewModel;\n }", "public function events()\n {\n $templateCalendarEvent = factory(TemplateCalendarEvent::class)->create();\n $calendarEvent = factory(CalendarEvent::class)->make();\n $calendarEvent->template()->associate($templateCalendarEvent);\n $calendarEvent->save();\n\n $this->assertInstanceOf(CalendarEvent::class, $templateCalendarEvent->events()->first());\n }", "public function handleBySpecificYear($request)\n {\n $generateSalaryReports = GenerateSalaryReportLogs::orderBy('id', 'desc')\n ->whereYear('created_at', $request->year)->get();\n\n foreach ($generateSalaryReports as $generateSalaryReport) {\n /* Salary Reports Data */\n $salaryReports = SalaryReport::whereIn('id', explode(' ', $generateSalaryReport->salaryReportIds))->get();\n\n /* Check */\n $this->checkStage2Confirm($generateSalaryReport, $salaryReports);\n }\n\n $response = array();\n $response['isFailed'] = false;\n $response['message'] = 'Success';\n $response['reports'] = fractal($generateSalaryReports, new PayrollGeneratedSalaryHistoryTransformer())->toArray()['data'];\n\n return response()->json($response, 200);\n }", "public function getStaffGroupInstructionTotalsByYear($yearType, $year, Staff $staff = null){\n \n switch($yearType){\n case 'academic':\n $startDate = new \\DateTime($year . \"-09-01\");\n $endDate = new \\DateTime(($year + 1) . \"-08-31\");\n break;\n case 'fiscal':\n $startDate = new \\DateTime($year . \"-07-01\");\n $endDate = new \\DateTime(($year + 1) . \"-06-30\");\n break;\n }\n\n // Uses Symfony's QUERY BUILDER\n $repo = $this->em->getRepository('AppBundle\\Entity\\GroupInstruction');\n $query = $repo->createQueryBuilder('i')\n ->select('count(i.id)')\n ->where('i.instructionDate >= :startDate AND i.instructionDate < :endDate')\n ->setParameter('startDate', $startDate)\n ->setParameter('endDate', $endDate)\n ;\n \n if($staff != null){ \n $query\n ->andWhere('i.librarian = :librarian')\n ->setParameter('librarian', $staff);\n }\n \n $result = $query->getQuery()->getSingleScalarResult();\n \n $result ? $return = $result : $return = 0;\n \n return $return;\n }", "public static function getEntityTypeEvents() {\n $event = ['onEntityTypeEvent', 100];\n $events[EntityTypeEvents::CREATE][] = $event;\n $events[EntityTypeEvents::UPDATE][] = $event;\n $events[EntityTypeEvents::DELETE][] = $event;\n return $events;\n }", "public function get_event_types()\n {\n return array(0 => 'miscellaneous', 1 => 'appointment', 2 => 'holiday'\n ,3 => 'birthday', 4 => 'personal', 5 => 'education'\n ,6 => 'travel', 7 => 'anniversary', 8 => 'not in office'\n ,9 => 'sick day', 10 => 'meeting', 11 => 'vacation'\n ,12 => 'phone call', 13 => 'business'\n ,14 => 'non-working hours', 50 => 'special occasion'\n );\n }", "function getDateforStdFilterBytype($type)\n\t{\n\t\t//$thisyear = date(\"Y\");\n\t\t$maxdate = \"2099-12-31\";\n\t\t$mindate = \"1900-01-01\";\n\t\t$datevalue = array();\n\n\t\tif($type == \"today\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"yesterday\" )\n\t\t{\n\t\t\t$yesterday = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"Y\")));\n\t\t\t$datevalue[0] = $yesterday;\n\t\t\t$datevalue[1] = $yesterday;\n\t\t}\n\t\telseif($type == \"tomorrow\" )\n\t\t{\n\t\t\t$tomorrow = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\")));\n\t\t\t$datevalue[0] = $tomorrow;\n\t\t\t$datevalue[1] = $tomorrow;\n\t\t}\n\t\telseif($type == \"thisweek\" )\n\t\t{\n\t\t\t$thisweek0 = date(\"Y-m-d\",strtotime(\"-1 week Sunday\"));\n\t\t\t$thisweek1 = date(\"Y-m-d\",strtotime(\"this Saturday\"));\n\t\t\t$datevalue[0] = $thisweek0;\n\t\t\t$datevalue[1] = $thisweek1;\n\t\t}\n\t\telseif($type == \"lastweek\" )\n\t\t{\n\t\t\t$lastweek0 = date(\"Y-m-d\",strtotime(\"-2 week Sunday\"));\n\t\t\t$lastweek1 = date(\"Y-m-d\",strtotime(\"-1 week Saturday\"));\n\t\t\t$datevalue[0] = $lastweek0;\n\t\t\t$datevalue[1] = $lastweek1;\n\t\t}\n\t\telseif($type == \"nextweek\" )\n\t\t{\n\t\t\t$nextweek0 = date(\"Y-m-d\",strtotime(\"this Sunday\"));\n\t\t $nextweek1 = date(\"Y-m-d\",strtotime(\"+1 week Saturday\"));\n\t\t\t$datevalue[0] = $nextweek0;\n\t\t\t$datevalue[1] = $nextweek1;\n\t\t}\n\t\telseif($type == \"thismonth\" )\n\t\t{\n\t\t\t$currentmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\"), \"01\", date(\"Y\")));\n\t\t\t$currentmonth1 = date(\"Y-m-t\");\n\t\t\t$datevalue[0] =$currentmonth0;\n\t\t\t$datevalue[1] = $currentmonth1;\n\t\t}\n\n\t\telseif($type == \"lastmonth\" )\n\t\t{\n\t\t\t$lastmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$lastmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $lastmonth0;\n\t\t\t$datevalue[1] = $lastmonth1;\n\t\t}\n\t\telseif($type == \"nextmonth\" )\n\t\t{\n\t\t\t$nextmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t $nextmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $nextmonth0;\n\t\t\t$datevalue[1] = $nextmonth1;\n\t\t}\n\t\telseif($type == \"next3days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next7days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next15days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$today;\n\t\t\t$datevalue[1] =$next30days;\n\t\t}\n\t\telseif($type == \"next60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next60days;\n\t\t}\n\t\telseif($type == \"next90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+89, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next90days;\n\t\t}\n\t\telseif($type == \"next180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next180days;\n\t\t}\n\t\telseif($type == \"before3days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-3, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before7days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-7, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before15days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-15, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before30days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-30, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$mindate;\n\t\t\t$datevalue[1] =$before30days;\n\t\t}\n\t\telseif($type == \"before60days\" )\n\t\t{\n\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-60, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before60days;\n\t\t}\n\t\telseif($type == \"before100days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-100, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before100days;\n\t\t}\n\t\telseif($type == \"before180days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-180, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before180days;\n\t\t}\n\t\telseif($type == \"after3days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after7days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after15days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$after30days;\n\t\t\t$datevalue[1] =$maxdate;\n\t\t}\n\t\telseif($type == \"after60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $after60days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after100days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+99, date(\"Y\")));\n\t\t\t$datevalue[0] = $after100days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $after180days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"last3days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-2, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last7days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-6, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last15days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-14, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-29, date(\"Y\")));\n\t\t\t$datevalue[0] = $last30days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last60days\" )\n\t\t{\n\t\t\t$last60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-59, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $last60days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telse if($type == \"last90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-89, date(\"Y\")));\n\t\t\t$datevalue[0] = $last90days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-179, date(\"Y\")));\n\t\t\t$datevalue[0] = $last180days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"thisfy\" )\n\t\t{\n\t\t\t$currentFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")));\n\t\t\t$currentFY1 = date(\"Y-m-t\",mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $currentFY0;\n\t\t\t$datevalue[1] = $currentFY1;\n\t\t}\n\t\telseif($type == \"prevfy\" )\n\t\t{\n\t\t\t$lastFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")-1));\n\t\t\t$lastFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")-1));\n\t\t\t$datevalue[0] = $lastFY0;\n\t\t\t$datevalue[1] = $lastFY1;\n\t\t}\n\t\telseif($type == \"nextfy\" )\n\t\t{\n\t\t\t$nextFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")+1));\n\t\t\t$nextFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")+1));\n\t\t\t$datevalue[0] = $nextFY0;\n\t\t\t$datevalue[1] = $nextFY1;\n\t\t}\n\t\telseif($type == \"nextfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n \t\t}else if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")+1));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")+1));\n \t\t}\n\t\t\t$datevalue[0] = $nFq;\n\t\t\t$datevalue[1] = $nFq1;\n\t\t}\n\t\telseif($type == \"prevfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")-1));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")-1));\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $pFq;\n\t\t\t$datevalue[1] = $pFq1;\n\t\t}\n\t\telseif($type == \"thisfq\")\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $cFq;\n\t\t\t$datevalue[1] = $cFq1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$datevalue[0] = \"\";\n\t\t\t$datevalue[1] = \"\";\n\t\t}\n\n\t\treturn $datevalue;\n\t}", "public function GetAllFacturesVentesByYear() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n \n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n $filterYear = $_REQUEST['data'][\"filterYear\"];\n // Input validations\n if (!empty($idSociete) && !empty($filterYear)) {\n try {\n $sql = $this->db->prepare(\"SELECT idFacture,date as dateCre,total,YEAR(date) AS factYear FROM facturevente WHERE idEtat != 5 and YEAR(date) = :filterYear AND idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->bindParam('filterYear', $filterYear, PDO::PARAM_STR);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n \n }", "function GetSalaryYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct yyyy as year1,\n yyyy as year2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by yyyy desc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "public function dataProvider_for_generateNextCalendarEvent()\n {\n return [\n [Carbon::parse('2017-08-10'), 4, RecurringFrequenceType::DAY, Carbon::parse('2017-08-14')],\n [Carbon::parse('2017-08-10'), 2, RecurringFrequenceType::WEEK, Carbon::parse('2017-08-24')],\n [Carbon::parse('2017-08-10'), 3, RecurringFrequenceType::MONTH, Carbon::parse('2017-11-10')],\n [Carbon::parse('2017-08-10'), 1, RecurringFrequenceType::YEAR, Carbon::parse('2018-08-10')],\n ];\n }", "function is_event_calendar_page() {\n\n\tif ( class_exists( 'TribeEvents' ) ) {\n\n\t\t$is_event_calendar = false; // Default is false so if everything falls through it returns that it is not an EC page\n\n\t\tif ( tribe_is_month() && ! is_tax() ) { // Month View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && ! is_tax() ) { // List View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && is_tax() ) { // List View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && ! is_tax() ) { // Week View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && is_tax() ) { // Week View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && ! is_tax() ) { // Day View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && is_tax() ) { // Day View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && ! is_tax() ) { // Map View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && is_tax() ) { // Map View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && ! is_tax() ) { // Photo View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && is_tax() ) { // Photo View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_events’ ) ) { // Single Events\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_venue’ ) ) { // Single Venues\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_organizer’ ) ) { // Single Organizers\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} else {\n\n\t\t}\n\n\t\treturn $is_event_calendar;\n\t}\n}", "public static function findForPersonYear($personId, $year)\n {\n $info = new PersonEventInfo();\n\n $info->person_id = $personId;\n $info->year = $year;\n\n $requireTraining = PersonPosition::findTrainingPositions($personId);\n $info->trainings = [];\n\n if ($requireTraining->isEmpty()) {\n $requireTraining = [Position::find(Position::TRAINING)];\n }\n\n foreach ($requireTraining as $position) {\n $info->trainings[] = Training::retrieveEducation($personId, $position, $year);\n }\n\n usort($info->trainings, function ($a, $b) {\n return strcmp($a->position_title, $b->position_title);\n });\n\n $radio = RadioEligible::findForPersonYear($personId, $year);\n $info->radio_info_available = setting('RadioInfoAvailable');\n $info->radio_max = $radio ? $radio->max_radios : 0;\n $info->radio_eligible = $info->radio_max > 0 ? true : false;\n\n $bmid = Bmid::findForPersonYear($personId, $year);\n if ($bmid) {\n $info->meals = $bmid->meals;\n $info->showers = $bmid->showers;\n } else {\n $info->meals = '';\n $info->showers = false;\n }\n\n if (current_year() == $year && !setting('MealInfoAvailable')) {\n $info->meals = 'no-info';\n }\n\n $ot = PersonOnlineTraining::findForPersonYear($personId, $year);\n\n if ($ot) {\n $info->online_training_passed = true;\n $info->online_training_date = (string)$ot->completed_at;\n } else {\n $info->online_training_passed = false;\n }\n\n $info->vehicles = Vehicle::findForPersonYear($personId, $year);\n $event = PersonEvent::findForPersonYear($personId, $year);\n\n if ($event) {\n $info->may_request_stickers = $event->may_request_stickers;\n $info->org_vehicle_insurance = $event->org_vehicle_insurance;\n $info->signed_motorpool_agreement = $event->signed_motorpool_agreement;\n } else {\n $info->may_request_stickers = false;\n $info->org_vehicle_insurance = false;\n $info->signed_motorpool_agreement = false;\n }\n return $info;\n }", "private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }", "private function getEvents($eventType, $raw = false)\n {\n $query = \"SELECT * FROM events WHERE game_id = ? AND event_type IN (:event_types)\";\n $result = $this->oDB->getAll($query, array($this->oData->getIdGames(), ':event_types' => $eventType));\n\n if ($raw) {\n return $result;\n }\n\n // group the response by event type and player number\n $events = array();\n foreach ((array)$result as $value) {\n $events[ $value['event_type'] ][ $value['player'] ][] = $value['event_value'];\n }\n\n return $events;\n }", "public static function createOrUpdateEvent($event_id, $fest_type_id, $event_year, $begin_date, $finish_date)\n\t{\n\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\tif ($event_id == null) {\n\n\t\t\t$img_link = ImageModel::createImage();\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\t\t\t$sql = \"INSERT INTO events (fest_type_id, year, img_link, begin_date, finish_date, status_id) VALUES (:fest_type_id, :event_year, :img_link, :begin_date, :finish_date, :status_id)\";\n\t\t\t$query = $database->prepare($sql);\n\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':event_year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status));\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_CREATION_FAILED'));\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t//TODO rebuild update image system\n\t\t\t$img_link = ImageModel::createImage();//return 'hash_img' if new image upload and 'false' if image not upload \n\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\n\t\t\t//People Award\n\t\t\t//Right now I selecte Film-winner on update Festival action\n\t\t\t//may be it will be better something else, for example, cron-proccess or some button\n\t\t\tif ($event_status == 3) {\n\t\t\t\t// event status 3 - finished\n\t\t\t\t$film_id = FilmModel::getFilmWonPeopleAward($event_id);\n\n\t\t\t\t$sql00 = \"SELECT event_id FROM people_award WHERE event_id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql00);\n\t\t\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t\t\tif ($query->rowCount() != 1) {\n\t\t\t\t\t// fest was NOT be finished, never\n\t\t\t\t\t$sql0 = \"INSERT INTO people_award (event_id, film_id) VALUES (:event_id, :film_id)\";\n\t\t\t\t\t$query = $database->prepare($sql0);\n\t\t\t\t\t$query->execute(array(':event_id' => $event_id, ':film_id' => $film_id));\n\n\t\t\t\t} else {\n\t\t\t\t\t// fest was be reopen and finished, again\n\t\t\t\t\t// recalcute winner (but this func is need???)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//end People Award\n\n\n\t\t\tif($img_link != 'file didnt upload'){\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, img_link = :img_link, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\t\t\t} else {\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\n\t\t\t\t//cause if saved previosly information $query-rowCount() == 0\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_FILM_UPDATE_FAILED'));\n\t\t\treturn false;\n\t\t}\n\n\t}", "protected function build_global_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 0 );\n $query='\n SELECT '.pwg_db_get_date_YYYYMM($this->date_field).' as period,\n COUNT(distinct id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY '.pwg_db_get_year($this->date_field).' DESC, '.pwg_db_get_month($this->date_field).' ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $y = substr($row['period'], 0, 4);\n $m = (int)substr($row['period'], 4, 2);\n if ( ! isset($items[$y]) )\n {\n $items[$y] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$y]['children'][$m] = $row['count'];\n $items[$y]['nb_images'] += $row['count'];\n }\n //echo ('<pre>'. var_export($items, true) . '</pre>');\n if (count($items)==1)\n {// only one year exists so bail out to year view\n list($y) = array_keys($items);\n $page['chronology_date'][CYEAR] = $y;\n return false;\n }\n\n global $lang;\n foreach ( $items as $year=>$year_data)\n {\n $chronology_date = array( $year );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $year_data['children'], false, false, $lang['month'] );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $year_data['nb_images'],\n 'HEAD_LABEL' => $year,\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function getEventTypes()\n {\n return new EventTypes(array('order_name' => true));\n }", "public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Array('custom' => array('label' => 'LBL_CUSTOM'),\n\t\t\t'prevfy' => array('label' => 'LBL_PREVIOUS_FY'),\n\t\t\t'thisfy' => array('label' => 'LBL_CURRENT_FY'),\n\t\t\t'nextfy' => array('label' => 'LBL_NEXT_FY'),\n\t\t\t'prevfq' => array('label' => 'LBL_PREVIOUS_FQ'),\n\t\t\t'thisfq' => array('label' => 'LBL_CURRENT_FQ'),\n\t\t\t'nextfq' => array('label' => 'LBL_NEXT_FQ'),\n\t\t\t'yesterday' => array('label' => 'LBL_YESTERDAY'),\n\t\t\t'today' => array('label' => 'LBL_TODAY'),\n\t\t\t'tomorrow' => array('label' => 'LBL_TOMORROW'),\n\t\t\t'lastweek' => array('label' => 'LBL_LAST_WEEK'),\n\t\t\t'thisweek' => array('label' => 'LBL_CURRENT_WEEK'),\n\t\t\t'nextweek' => array('label' => 'LBL_NEXT_WEEK'),\n\t\t\t'lastmonth' => array('label' => 'LBL_LAST_MONTH'),\n\t\t\t'thismonth' => array('label' => 'LBL_CURRENT_MONTH'),\n\t\t\t'nextmonth' => array('label' => 'LBL_NEXT_MONTH'),\n\t\t\t'last7days' => array('label' => 'LBL_LAST_7_DAYS'),\n\t\t\t'last15days' => array('label' => 'LBL_LAST_15_DAYS'),\n\t\t\t'last30days' => array('label' => 'LBL_LAST_30_DAYS'),\n\t\t\t'last60days' => array('label' => 'LBL_LAST_60_DAYS'),\n\t\t\t'last90days' => array('label' => 'LBL_LAST_90_DAYS'),\n\t\t\t'last120days' => array('label' => 'LBL_LAST_120_DAYS'),\n\t\t\t'next15days' => array('label' => 'LBL_NEXT_15_DAYS'),\n\t\t\t'next30days' => array('label' => 'LBL_NEXT_30_DAYS'),\n\t\t\t'next60days' => array('label' => 'LBL_NEXT_60_DAYS'),\n\t\t\t'next90days' => array('label' => 'LBL_NEXT_90_DAYS'),\n\t\t\t'next120days' => array('label' => 'LBL_NEXT_120_DAYS')\n\t\t);\n\t\tforeach ($dateFilters as $filterType => $filterDetails) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "public function getYearPrice($id ,$type)\n {\n $r = $this->preFind($id);\n $date = Carbon::now()->subYear($type)->toDateString();\n return $r->price()->where([['month' , '>=' , $date]])->orderBy(\"month\",\"asc\")->groupBy(\"month\")->get();\n }", "public function findYearsByFilter($filter) {\n $filter2 = clone $filter;\n $filter2->year = null;\n $articles = $this->findByFilter($filter2);\n $yearArray = array();\n foreach($articles as $article) {\n $date = $article->getArticleDate();\n $year = $date->format('Y');\n if(!isset($yearArray[$year])) {\n $yearArray[$year] = array('count' => 0);\n }\n if(!isset($yearArray[$year]['value'])) {\n $yearFilter = clone $filter2;\n $yearFilter->year = $year;\n $yearArray[$year]['value'] = intval($year);\n $yearArray[$year]['searchFilter'] = $yearFilter;\n }\n $yearArray[$year]['count']++;\n }\n return $yearArray;\n }", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "public function buildCalendar($month, $year);", "public function get_events($user_id,$type){\n\t\t$this->db->select('*');\n\t\tif($type===\"restaurant\"){\n\t\t\t$this->db->where('restaurant_id',$user_id);\n\t\t}else{\n\t\t\t$this->db->where('server_id',$user_id);\n\t\t}\n\t\t$query = $this->db->get('calendar');\n\t\treturn $query->result();\n\t}", "public static function getUserEventList($event_type,$id)\n\t{\n\t\t// Page My Event is Own Event\n\t\t\n\t\t$limit = 100;\n\t\t$page = 1;\n\t\t\n\t\tif($page==\"\") $page = 1;\n\t\t\n\t\t$date_now = date(\"Y-m-d\");\n\t\t$result = CommonFunction::resultPaging(\n\t\t\t\t\t\t$page, $limit, EventModel::where('userId', '=', $id)->count(),\n\t\t\t\t\t\tEventModel::where(\"status\",\"=\",$event_type)->\n\t\t\t\t\t\twhere(\"endDate\",\">=\",$date_now)->where('userId', '=', $id)->take($limit)->skip(($page-1)*$limit)->get(array('id', 'name','description', 'avenueName','avanueAddress','latitude','longitude','coverImage','facebook','twitter','line','website','host','categoryId','status','private','share','userId','startDate','endDate','time','startTime','endTime'))\n\t\t\t\t\t);\n\n\n\t\treturn $result;\n\n\t}", "public function Season($type = 'new', $data = array()){\n\t\t$this->tableName = DBConf::$season;\n\t\tparent::__construct($type, $data);\n\t}", "function isDateType($type)\n{\n return($type == \"date\" or $type == \"year\" or isTimeType($type));\n}", "public function get_year($year) {\n\t\t$start_time = 'first day of January ' . date( 'Y', strtotime($year) );\n\t\t$end_time = 'last day of December ' . date( 'Y', strtotime($year) );\n\t\n\t\treturn array(\n\t\t\t'start'\t\t\t=>\tdate('Y-m-d', strtotime($start_time)),\n\t\t\t'end'\t\t\t=>\tdate('Y-m-d', strtotime($end_time)),\n\t\t\t'start_time'\t\t=>\tstrtotime( $start_time ),\n\t\t\t'end_time'\t\t=>\tstrtotime( $end_time )\n\t\t);\n\t}", "public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "public function testCreatePayrollCalendar()\n {\n }", "function getSupportedFilters() {\n return array('event' => array(\n 'event_type_id' => array(\n 'form_field_name' => 'event_type_id',\n 'operator' => 'IN',\n ))\n );\n }", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public function getEvents();", "public function getEvents();", "public function testSportsDayBetween1996And2000(): void\n {\n $year = 1997;\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-10-10\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function dataProvider_for_createCalendarEvent()\n {\n return [\n 'not_recurring' => [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-25 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-25 12:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => false,\n 'is_public' => true,\n ],\n ],\n 'recurring' => [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-25 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-25 12:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => true,\n 'frequence_number_of_recurring' => 1,\n 'frequence_type_of_recurring' => RecurringFrequenceType::WEEK,\n 'is_public' => true,\n ],\n ],\n ];\n }", "public function getClasses() {\n if(!property_exists($this->data, 'classes')) $this->loadClasses();\n require_once(\"Event.php\");\n $classes = array();\n foreach($this->data->classes as $class) {\n $class->type = \"LESSON\";\n $class->period = $class->classPeriod;\n unset($class->classPeriod);\n $classes[] = new Event($this->fenixEdu, $class);\n }\n return $classes;\n }" ]
[ "0.63551474", "0.62904876", "0.5912423", "0.5691518", "0.5691501", "0.568324", "0.5666671", "0.553759", "0.5514216", "0.54915285", "0.548499", "0.5466888", "0.5386", "0.53832567", "0.5322952", "0.5302939", "0.52908856", "0.52804863", "0.5268569", "0.5262207", "0.5241857", "0.5220283", "0.5208844", "0.5188831", "0.51827824", "0.5179531", "0.51722777", "0.5167439", "0.5153137", "0.51388097", "0.51346725", "0.5128662", "0.5095762", "0.50928986", "0.50903654", "0.508272", "0.5050944", "0.5048386", "0.5044981", "0.5035644", "0.5018652", "0.5010663", "0.49938422", "0.49634472", "0.49611914", "0.49547276", "0.49527794", "0.49473393", "0.4932951", "0.49311605", "0.49078473", "0.48909193", "0.4885377", "0.4882475", "0.48694867", "0.48639515", "0.48608217", "0.4850976", "0.48397133", "0.4837216", "0.48371664", "0.48360232", "0.48243266", "0.4813886", "0.47964585", "0.479562", "0.4785714", "0.47816026", "0.47719112", "0.4765672", "0.47569993", "0.47440425", "0.4741718", "0.47375867", "0.47313818", "0.4731164", "0.47286716", "0.47162133", "0.47159863", "0.47157055", "0.4704127", "0.46958202", "0.46865007", "0.46863315", "0.4680547", "0.46758163", "0.46747655", "0.46737787", "0.46720847", "0.46638837", "0.4655689", "0.46554595", "0.46547636", "0.46471152", "0.4644456", "0.46398482", "0.46398482", "0.46385795", "0.46377635", "0.4635875" ]
0.7334864
0
Events based on year and state.
public function yearState($year = null, $state = null) { return \App\Event::with('venue.city.states') ->whereHas('venue.city.states', function ($query) use ($state) { $query->where('abbr', strtoupper($state)); }) ->whereYear('start_date', $year) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function yearTypeState($year = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function yearMonthState($year = null, $month = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "public function __construct($year)\n {\n $this->year = $year;\n }", "public function setYear($year);", "public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }", "public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }", "public function getEvents(array $filters = array());", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "function _registration_open( $event_month, $event_year ){\n $open_month = ((floor(($event_month + 1) / 2) - 1) * 2) + (12 - floor(($event_month + 9) / 12) * 12);\n $open_year = $event_year + floor (($event_month + 9) / 12) - 1;\n $open_time = mktime( 0, 0, 0, $open_month, 1, $open_year);\n return $open_time < time();\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "public function setYear($year)\n {\n $this->year = $year;\n }", "private function parseEvent($str, $month, $year, $tzSrc, $tzDest) {\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML(\"<?xml encoding='UTF-8' ?>\" . $str);\n\t\t$event = array();\n\t\t$node = $html->getElementsByTagName(\"body\");\n\t\tforeach ($node as $body) {\n\t\t\tforeach ($body->childNodes as $node) {\n\t\t\t\t$_id = explode(\"_\", $node->getAttribute(\"id\"));\n\t\t\t\t$_id = $_id[0];\n\t\t\t\tforeach ($node->getElementsByTagName(\"div\") as $subnode) {\n\t\t\t\t\t$class = $subnode->getAttribute(\"class\");\n\t\t\t\t\tif ($class === \"eventDateBlock\") {\n\t\t\t\t\t\t// date\n\t\t\t\t\t\t$_date = explode(\" \", $subnode->firstChild->textContent);\n\t\t\t\t\t\t$_date = (strlen($_date[1]) === 1) ? \"0\" . $_date[1] : (string) $_date[1];\n\t\t\t\t\t\t$_date = \"$year-$month-\" . $_date;\n\t\t\t\t\t\t$_time = $subnode->childNodes->item(2)->textContent;\n\t\t\t\t\t} elseif ($class === \"playerAvatar\") {\n\t\t\t\t\t\t// url, images\n\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t$_url = $a->getAttribute(\"href\");\n\t\t\t\t\t\t$img = $a->firstChild;\n\t\t\t\t\t\t$_img_icon = $img->getAttribute(\"src\");\n\t\t\t\t\t\t// relocate onto a // aware domain, cdn.akamai.steamstatic.com → steamcdn-a.akamaihd.net\n\t\t\t\t\t\t$_img_icon = str_replace( \"http://cdn.akamai.steamstatic.com\", \"//steamcdn-a.akamaihd.net\", $_img_icon);\n\t\t\t\t\t\t$_appid = explode(\"/\", $_img_icon);\n\t\t\t\t\t\t$_appid = intval($_appid[count($_appid) - 2]);\n\t\t\t\t\t\tif ($_appid === 0) {\n\t\t\t\t\t\t\t$_img_header = \"\";\n\t\t\t\t\t\t\t$_img_header_small = \"\";\n\t\t\t\t\t\t\t$_img_capsule = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_img_header = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header.jpg\";\n\t\t\t\t\t\t\t$_img_header_small = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header_292x136.jpg\";\n\t\t\t\t\t\t\t$_img_capsule = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/capsule_sm_120.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($class === \"eventBlockTitle\") {\n\t\t\t\t\t\t$l = $subnode->childNodes;\n\t\t\t\t\t\tforeach ($l as $a) {\n\t\t\t\t\t\t\tif ($a->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tif ($a->tagName === \"a\") {\n\t\t\t\t\t\t\t\t\tif ($a->getAttribute(\"class\") === \"headlineLink\") {\n\t\t\t\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t\t\t\t\t$_title = $a->textContent;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// comment count\n\t\t\t\t\t\t\t\t\t\t$_comments = explode(\" \", $a->textContent);\n\t\t\t\t\t\t\t\t\t\t$_comments = intval($_comments[0]);\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\t\n\t\t$tempDate = new DateTime($_date . \" \" . $_time, $tzSrc);\n\t\t$tempDate->setTimeZone($tzDest);\n\n\t\t$event[\"id\"] = $_id;\n\t\t$event[\"url\"] = $_url;\n\t\t$event[\"title\"] = $_title;\n\t\t$event[\"comments\"] = $_comments;\n\t\t$event[\"date\"] = $tempDate->format(\"Y-m-d\");\n\t\t$event[\"time\"] = $tempDate->format(\"H:i\");\n\t\t$event[\"tz\"] = $tempDate->format(\"e\");\n\t\t$event[\"appid\"] = $_appid;\n\t\t$event[\"img_icon\"] = $_img_icon;\n\t\t$event[\"img_capsule\"] = $_img_capsule;\n\t\t$event[\"img_header\"] = $_img_header;\n\t\t$event[\"img_header_small\"] = $_img_header_small;\n\t\treturn $event;\n\t}", "public function setYear($year) {\n $this->_year = $year;\n }", "public function testSportsDayBefore1996(): void\n {\n $this->assertNotHoliday(\n self::REGION,\n self::HOLIDAY,\n $this->generateRandomYear(1000, self::ESTABLISHMENT_YEAR - 1)\n );\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "public function buildCalendar($month, $year);", "function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}", "function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "public static function stateChanged($event)\r\n {\r\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "function GetEvent($date, $id_country = 0, $id_region = 0, $id_city = 0, $type = 0, $my_events = false){\n\tglobal $lang, $config, $config_index, $smarty, $dbconn, $user;\n\n\t$filter = $table = \"\";\n\tif ($id_country)$filter .= \" AND a.id_country = \".$id_country;\n\tif ($id_region)\t$filter .= \" AND a.id_region = \".$id_region;\n\tif ($id_city)\t$filter .= \" AND a.id_city = \".$id_city;\n\tif ($type)\t\t$filter .= \" AND a.type = \".$type;\n\n\tif ($my_events) {\n\t\t$table = \", \".EVENT_USERS_TABLE.\" b \";\n\t\t$filter .= \" AND a.id = b.id_event AND b.id_user = \".$user[ AUTH_ID_USER ];\n\t}\n\n\t$strSQL = \"SELECT a.id, a.event_name, a.id_creator FROM \".EVENT_DESCR_TABLE.\" a\".$table.\"\n\t\tWHERE (\t(a.periodicity = 'none' AND DATE_FORMAT(a.start_date,'%Y-%m-%d') = DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'daily' AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'weekly' AND DAYOFWEEK(a.start_date) = DAYOFWEEK('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'monthly' AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'yearly' AND MONTH(a.start_date) = MONTH('\".$date.\"') AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\t)\".$filter;\n\t$rs = $dbconn->Execute($strSQL);\n\t$num_records = $rs->RowCount();\n\tif($num_records>0){\n\t\t$event[\"event_count\"] = $num_records;\n\t\t$i = 0;\n\t\twhile(!$rs->EOF){\n\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t$event[\"event\"][$i][\"id_event\"] = $row[\"id\"];\n\t\t\tif (strlen($row[\"event_name\"])<10) {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t} else {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes(substr($row[\"event_name\"],0,10).\"...\");\n\t\t\t}\n\t\t\t$event[\"event\"][$i][\"full_name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t$i++;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $event;\n\t} else {\n\t\treturn '';\n\t}\n}", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "public function getYearEraDayIndex($year);", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "public function modelYear();", "function show_calendar_events()\n\t{\n\t\t$stats_html = \"\";\n\t\t\n\t\tif ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )\n\t\t{\n\t\t\t$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );\n\t\t\n\t\t\t$day = $a[2];\n\t\t\t$month = $a[1];\n\t\t\t$year = $a[0];\n\t\t\t\n\t\t\t$birthstring = \"\";\n\t\t\t$count = 0;\n\t\t\t$users = array();\n\t\t\t\n\t\t\tif ( $this->ipsclass->vars['show_birthdays'] )\n\t\t\t{\n\t\t\t\tif ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->ipsclass->cache['birthdays'] as $u )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $u['bday_day'] == $day and $u['bday_month'] == $month )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( $day == 28 && $month == 2 && !date(\"L\") )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $u['bday_day'] == \"29\" and $u['bday_month'] == $month )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Spin and print...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tforeach ( $users as $user )\n\t\t\t\t{\n\t\t\t\t\t$birthstring .= \"<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>\";\n\t\t\t\t\t\n\t\t\t\t\tif ($user['bday_year'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$pyear = $year - $user['bday_year'];\n\t\t\t\t\t\t$birthstring .= \"(<b>$pyear</b>)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$birthstring .= $this->sep_char.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Fix up string...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$birthstring = preg_replace( \"/\".$this->sep_char.\"$/\", \"\", trim($birthstring) );\n\t\t\t\t\n\t\t\t\t$lang = $this->ipsclass->lang['no_birth_users'];\n\t\t\t\t\n\t\t\t\tif ($count > 0)\n\t\t\t\t{\n\t\t\t\t\t$lang = ($count > 1) ? $this->ipsclass->lang['birth_users'] : $this->ipsclass->lang['birth_user'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$count = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $this->ipsclass->vars['autohide_bday'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing the calendar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($this->ipsclass->vars['show_calendar'])\n\t\t{\n\t\t\t$this->ipsclass->vars['calendar_limit'] = intval($this->ipsclass->vars['calendar_limit']) < 2 ? 1 : intval($this->ipsclass->vars['calendar_limit']);\n\t\t\t\n\t\t\t$our_unix = gmmktime( 0, 0, 0, $month, $day, $year);\n\t\t\t$max_date = $our_unix + ($this->ipsclass->vars['calendar_limit'] * 86400);\n\t\t\t$events = array();\n\t\t\t$show_events = array();\n\t\t\t\n\t\t\tif( $this->ipsclass->member['org_perm_id'] )\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['org_perm_id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['g_perm_id'] ) );\n\t\t\t\t\n\t\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);\n\t\t\t\t\t\n\t\t\t\t\t$mgroup_others = explode( \",\", $this->ipsclass->member['mgroup_others'] );\n\t\t\t\t\t\n\t\t\t\t\tif( count($mgroup_others) )\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach( $mgroup_others as $mgroup )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $mgroup )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_permission_groups = array_merge( $member_permission_groups, explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->cache['group_cache'][$mgroup]['g_perm_id'] ) ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )\n\t\t\t{\n\t\t\t\tforeach( $this->ipsclass->cache['calendar'] as $u )\n\t\t\t\t{\n\t\t\t\t\t$set_offset = 0;\n\n\t\t\t\t\tif( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$u['_unix_from'] = $u['event_unix_from'] - $set_offset;\n\t\t\t\t\t$u['_unix_to'] = $u['event_unix_to'] - $set_offset;\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Private?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_private'] == 1 and $this->ipsclass->member['id'] != $u['event_member_id'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_perms'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($event_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $event_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got calendar perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['_perm_read'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$read_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($read_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $read_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// In range?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t\tif ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_to'] >= $our_unix AND $u['event_unix_from'] <= $max_date )\n\t\t\t\t\t\tOR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$u['event_activetime'] = $u['_unix_from'];\n\t\t\t\t\t\t$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t}\n\t\t\t\t\telseif( $u['event_recurring'] > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cust_range_s = $u['event_unix_from'];\n\n\t\t\t\t\t\twhile( $cust_range_s < $u['event_unix_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$u['event_activetime'] = $cust_range_s;\n\t\t\t\t\t\t\t\t$events[ str_pad( $cust_range_s.$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( $u['event_recurring'] == \"1\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 604800;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( $u['event_recurring'] == \"2\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 18144000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 31536000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tksort($events);\n\t\t\t\n\t\t\tforeach( $events as $event )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Recurring?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$c_time = '';\n\t\t\t\t$c_time = gmdate( 'j-F-y', $event['event_activetime'] );\n\t\t\t\t\n\t\t\t\t$show_events[] = \"<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>\".$event['event_title'].\"</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['calender_f_title'] = sprintf( $this->ipsclass->lang['calender_f_title'], $this->ipsclass->vars['calendar_limit'] );\n\t\t\t\n\t\t\tif ( count($show_events) > 0 )\n\t\t\t{\n\t\t\t\t$event_string = implode( $this->sep_char.' ', $show_events );\n\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! $this->ipsclass->vars['autohide_calendar'] )\n\t\t\t\t{\n\t\t\t\t\t$event_string = $this->ipsclass->lang['no_calendar_events'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $stats_html;\n\t\n\t}", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function eventsUsingTableAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $events = $this->model->findEventsByYear((int) $year);\n $viewModel = new ViewModel(['events' => $events, 'year' => $year]);\n $viewModel->setTemplate('signups/index/events');\n return $viewModel;\n }", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function index($year)\n\t{\n\t\t/**\n\t\t* get all places that have sowings in a specific year \n\t\t*/\n\t\t$places = Place :: whereHas('sowings', function($query) use ($year){\n\t\t\t$query->where('year','=',$year);\n\t\t})->get();\n\n\t\t$places->each(function($item) use($year){\n\t\t\t// var_dump($item);\n\t\t\t$item->sowings = $item->sowings->filter(function($item) use ($year){\n\t\t\t\treturn $item->year == $year;\n\t\t\t})->all();\n\t\t\t\n\t\t});\n\n\t\t$years = Sowing :: distinct('year')->pluck('year');\n\n\t\treturn view('sowings.index', compact('years','places'));\n\t}", "public function addYear(array &$form, FormStateInterface $form_state) {\n foreach ($form_state->getValues()['fieldset'] as $key => $val) {\n if ($form_state->getTriggeringElement()['#parents'][1] == $key) {\n $num_year = $form_state->get(\"fieldset_$key\") + 1;\n $form_state->set(\"fieldset_$key\", $num_year);\n $form_state->setRebuild();\n }\n else {\n $form_state->setRebuild();\n }\n }\n }", "function _buildKayinNewYear()\n {\n \n $this->_addHoliday(\n 'KayinNewYear',\n $this->_year . '-01-10',\n 'KayinNewYear Day'\n );\n }", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public function testSportsDayBetween1996And2000(): void\n {\n $year = 1997;\n $this->assertHoliday(\n self::REGION,\n self::HOLIDAY,\n $year,\n new \\DateTime(\"{$year}-10-10\", new \\DateTimeZone(self::TIMEZONE))\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "function get_holidays($inc_year){\n\t//$year = date(\"Y\");\n\t$year = $inc_year;\n\n\t// $holidays[] = new Holiday(\"New Year's Day\", get_timestamp(\"$year-1-1\"));\n\t$holidays[] = new Holiday(\"Republic Day\", get_timestamp(\"$year-1-26\"));\n\t// $holidays[] = new Holiday(\"Labour Day\", ordinal_day(1, 'Mon', 3, $year));\n\t// $holidays[] = new Holiday(\"Anzac Day\", get_timestamp(\"$year-4-25\"));\n\t//$holidays[] = new Holiday(\"St. Patrick's Day\", get_timestamp(\"$year-3-17\"));\n\t// TODO: $holidays[] = new Holiday(\"Good Friday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Easter\", easter_date($year));\n\t// TODO: $holidays[] = new Holiday(\"Easter Monday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Foundation Day\", ordinal_day(1, 'Mon', 6, $year));\n\t// $holidays[] = new Holiday(\"Queen's Birthday\", ordinal_day(1, 'Mon', 10, $year));\n\t//$holidays[] = new Holiday(\"Memorial Day\", memorial_day($year));\n\t//$holidays[] = new Holiday(\"Mother's Day\", ordinal_day(2, 'Sun', 5, $year));\n\t//$holidays[] = new Holiday(\"Father's Day\", ordinal_day(3, 'Sun', 6, $year));\n\t//$holidays[] = new Holiday(\"Independence Day\", get_timestamp(\"$year-7-4\"));\n\t//$holidays[] = new Holiday(\"Labor Day\", ordinal_day(1, 'Mon', 9, $year));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"$year-12-25\"));\n\t$holidays[] = new Holiday(\"Dussera\", get_timestamp(\"2010-10-15\"));\n\t$holidays[] = new Holiday(\"Ugadi\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"kanada Rajyotshava\", get_timestamp(\"$year-11-1\"));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-04\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-05\"));\n\t// $holidays[] = new Holiday(\"Boxing Day\", get_timestamp(\"$year-12-26\"));\n\n\t$numHolidays = count($holidays) - 1;\n\t$out_array = array();\n\n\tfor ($i = 0; $i < $numHolidays; $i++){\n\t\t$out_array[] = $holidays[$i]->date;\n\t}\n\tunset($holidays);\n\treturn $out_array;\n}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "public function getCityHolidays($year): array\n {\n return [\n\n $this->getEasterDate($year,'SEXTA_FEIRA_SANTA') => $this->createData('Paixão de Cristo'),\n $this->getEasterDate($year,'CORPUS_CHRISTI') => $this->createData('Corpus Christi'),\n\n '01-25' => $this->createData('Aniversário de São Paulo', null, [ self::CITY_CODE ]),\n '11-20' => $this->createData('Consciência Negra', null, [ self::CITY_CODE ]),\n ];\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function __construct($_title, $_year)\n {\n $this->title = $_title;\n $this->year = $_year;\n self::$counter++; // incremento il contatore ogni volta che agggiungo un'istanza \n }", "public function viewAllEvents();", "private function getEvents( $days , $filter = null , $startDate = null, $q = null, $city = null ){\n\t\t$events = array();\n\t\t$google_calendar_id = Yii::$app->params['google-calendar-id'];\n\t\t$google_api_key = Yii::$app->params['google-api-key'];\n\n\t\tif( is_null($startDate) )\n\t\t\t$startDate = new \\Datetime();\n\t\t$endPeriod = clone $startDate;\n\t\tif( $days < 84 )\n\t\t\t$movedays = $days;\n\t\telse{\n\t\t\t$movedays = 84;\n\t\t}\n\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t$format = 'Y-m-d';\n\t\tdo{\n\n\t\t\t$google_url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($google_calendar_id) . '/events?key=' . urlencode($google_api_key) . '&maxResults=2500&orderBy=startTime&singleEvents=true&timeMin=' . urlencode( $startDate->format($format) . 'T07:00:00+00:00') . '&timeMax=' . urlencode( $endPeriod->format($format) . 'T23:59:59+00:00' );\n\t\t\tif(isset($q)){\n\t\t\t\t$google_url.='&q='.urlencode($q);\n\t\t\t}\n\t\t\tif(isset($city) && !empty($city)){\n\t\t\t\t$google_url.='&sharedExtendedProperty=city%3D'.urlencode($city);\n\t\t\t}\n\t\t\t$json_array = $this->getFromApi( $google_url );\n\n\t\t\t$collected_events = $json_array['items'];\n\t\t\tif( !is_null($filter) ){\n\t\t\t\t$collected_events = $this->filterEvents( $filter , $collected_events );\n\t\t\t}\n\t\t\t$events = array_merge( $events , $collected_events );\n\n\t\t\t$startDate = $endPeriod;\n\t\t\t$endPeriod = clone $startDate;\n\t\t\tif( $days < 84 )\n\t\t\t\t$movedays = $days;\n\t\t\telse{\n\t\t\t\t$movedays = 84;\n\t\t\t}\n\t\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t\t$days-= 84;\n\t\t}while( $days > 0 );\n\n\t\treturn $events;\n\t}", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function Submissions_Latex_Event()\n {\n $event=$this->Event();\n $event=$this->EventsObj()->ApplyAllEnums($event,TRUE);\n $event=$this->EventsObj()->TrimLatexItem($event);\n\n return $event;\n }", "public function getEventByDate($year, $month, $day) {\n\t\tif (isset($this->events[$year][$month][$day]))\n\t\t\treturn $this->events[$year][$month][$day];\n\t\treturn FALSE;\n\t}", "public static function __events () {\n \n }", "public function getYear() {}", "public function __construct() {\n // Adding values to the variabels\n $this->currentYear = date(\"Y\");\n $this->offsetYear = 0;\n $this->multiplier = 1;\n }", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "public function state($state = null)\n {\n $q = \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n });\n $q = $this->handleRequest($q);\n\n return $q->orderby('start_date', 'asc')\n ->paginate($this->paginate)->appends(request($this->params));\n }", "public static function eventStatus()\n {\n return [\n 'abe' => 'Aberto',\n 'fec' => 'Fechado',\n 'can' => 'Cancelado'\n ];\n }", "public function get_test_scheduled_events()\n {\n }", "function show_next_calendar(){ \n \t\t\t$this->gen_contents['region_search'] \t= $_POST['region'];\n \t\t\t$this->gen_contents['subregion_search'] = $_POST['subregion'];\n $this->gen_contents['course_search'] = $_POST['course'];\n if($this->gen_contents['course_search']=='5'){\n $this->gen_contents['chp_search'] = $_POST['chp'];\n }\n $this->gen_contents[\"chp_list\"] = $this->config->item('chapter_list');\n $this->gen_contents[\"crse_color\"] = $this->config->item('course_color');\n \t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($_POST['timeid'],$_POST['course'],$_POST['region'],$_POST['subregion']));\n\t\t\t\n\t\t\t$this->load->view('user/career_event/schedule_calendar',$this->gen_contents);\n \t\t}", "public static function findForPersonYear($personId, $year)\n {\n $info = new PersonEventInfo();\n\n $info->person_id = $personId;\n $info->year = $year;\n\n $requireTraining = PersonPosition::findTrainingPositions($personId);\n $info->trainings = [];\n\n if ($requireTraining->isEmpty()) {\n $requireTraining = [Position::find(Position::TRAINING)];\n }\n\n foreach ($requireTraining as $position) {\n $info->trainings[] = Training::retrieveEducation($personId, $position, $year);\n }\n\n usort($info->trainings, function ($a, $b) {\n return strcmp($a->position_title, $b->position_title);\n });\n\n $radio = RadioEligible::findForPersonYear($personId, $year);\n $info->radio_info_available = setting('RadioInfoAvailable');\n $info->radio_max = $radio ? $radio->max_radios : 0;\n $info->radio_eligible = $info->radio_max > 0 ? true : false;\n\n $bmid = Bmid::findForPersonYear($personId, $year);\n if ($bmid) {\n $info->meals = $bmid->meals;\n $info->showers = $bmid->showers;\n } else {\n $info->meals = '';\n $info->showers = false;\n }\n\n if (current_year() == $year && !setting('MealInfoAvailable')) {\n $info->meals = 'no-info';\n }\n\n $ot = PersonOnlineTraining::findForPersonYear($personId, $year);\n\n if ($ot) {\n $info->online_training_passed = true;\n $info->online_training_date = (string)$ot->completed_at;\n } else {\n $info->online_training_passed = false;\n }\n\n $info->vehicles = Vehicle::findForPersonYear($personId, $year);\n $event = PersonEvent::findForPersonYear($personId, $year);\n\n if ($event) {\n $info->may_request_stickers = $event->may_request_stickers;\n $info->org_vehicle_insurance = $event->org_vehicle_insurance;\n $info->signed_motorpool_agreement = $event->signed_motorpool_agreement;\n } else {\n $info->may_request_stickers = false;\n $info->org_vehicle_insurance = false;\n $info->signed_motorpool_agreement = false;\n }\n return $info;\n }", "function filterprimary()\r\n\t{\t\r\n\t\t// make date and time variables\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t// take filter categories and do filtering\r\n\t\t$elements = json_decode( preg_replace('/[\\n\\r]+/', '\\n', JRequest::getVar( 'elements', '', 'post', 'string' ) ) );\r\n\t\t\r\n\t\t$categories = array();\r\n\t\tforeach($elements as $element)\r\n\t\t{\r\n\t\t\tif($element->checked && strpos ( $element->name , 'primary_cat_' ) !== false )\r\n\t\t\t{\r\n\t\t\t\t$categories[$element->name] = $element->value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$model->setState( 'filter_primary_categories', $categories );\r\n\t\t\r\n\t\t// order event instances by date and time\r\n\t\t$model->setState( 'order', 'tbl.eventinstance_date' );\r\n\t\t$model->setState( 'direction', 'ASC' );\r\n\t\t$query = $model->getQuery( );\r\n\t\t$query->order( 'tbl.eventinstance_start_time' );\r\n\t\t$model->setQuery( $query );\r\n\t\t\r\n\t\t// attach variables to the $vars object\r\n\t\t$vars->date = $date;\r\n\t\t$vars->items = $model->getList( );\r\n\t\t\r\n\t\t// echo output\r\n\t\t$html = $this->getLayout( 'default', $vars, 'three' ); \r\n\t\techo ( json_encode( array('msg'=>$html) ) );\r\n\t}", "public function index()\n {\n $filters = request()->only('date', 'region');\n\n $events = $this->event\n ->when(isset($filters['date']), function ($query) use ($filters) {\n return $query->whereDate('date', $filters['date']);\n })\n ->when(isset($filters['region']), function ($query) use ($filters) {\n return $query->where('place', 'LIKE', \"%{$filters['region']}%\");\n })\n ->paginate(10);\n\n return response()->json([\n 'error' => false,\n 'message' => '',\n 'data' => [\n 'current_page' => $events->currentPage(),\n 'last_page' => $events->lastPage(),\n 'per_page' => $events->perPage(),\n 'path' => $events->path(),\n 'data' => new EventCollection($events)\n ]\n ], 200);\n }", "public function viewEvents();", "public function getEvents();", "public function getEvents();", "public function get_cities_with_events($state = null)\n {\n if ($state):\n return $this->groupBy('slug')->where('state', $state)->get();\n else:\n return false;\n endif;\n }", "function holiday ($yr=0)\n\t{\n\t\tif ($yr==0) $yr = (int)date(\"Y\");\n\t\t$this->bjd = gregorian_to_jd(1,1,$yr);\n\t\t$this->ejd = gregorian_to_jd(12,31,$yr);\n\n\t\t//add holidays easily define in the gregorian calendar\n\t\t$this->holidays = Array(\n\t\t\t\"newyearseve\" => gregorian_to_jd(12,31,$yr),\n\t\t\t\"valentinesday\"=> gregorian_to_jd(2,14,$yr),\n\t\t\t\"presidentsday\" => nth_weekday_jd(3,dMONDAY,2,$yr),\n\t\t\t\"stpatricksday\" => gregorian_to_jd(3,17,$yr),\n\t\t\t\"aprilfoolsday\" => gregorian_to_jd(4,1,$yr),\n\t\t\t\"cincodemayo\" => gregorian_to_jd(5,5,$yr),\n\t\t\t\"mothersday\" => nth_weekday_jd(2,dSUNDAY,5,$yr),\n\t\t\t\"memorialday\" => $this->memorialDay($yr),\n\t\t\t\"fathersday\" => nth_weekday_jd(3,dSUNDAY,6,$yr),\n\t\t\t\"fourthofjuly\" => gregorian_to_jd(7,4,$yr),\n\t\t\t\"laborday\" => nth_weekday_jd(1,dMONDAY,9,$yr),\n\t\t\t\"columbusday\" => nth_weekday_jd(2,dMONDAY,10,$yr),\n\t\t\t\"halloween\" => gregorian_to_jd(10,31,$yr), \n\t\t\t\"thanksgiving\" => nth_weekday_jd(4, dTHURSDAY, 11,$yr),\n\t\t\t\"christmas\" => gregorian_to_jd(12,24,$yr),\n\t\t\t\"christmasday\" => gregorian_to_jd(12,25,$yr),\n\t\t\t\"mardigras\" => easter_jd($yr,-47),\n\t\t\t\"easter\" =>\teaster_jd($yr)\n\t\t);\n\t\t\t\n\t\tasort($this->holidays);\n\t}", "public static function scheduleSummaryForPersonYear($personId, $year)\n {\n $rows = self::findForQuery(['person_id' => $personId, 'year' => $year]);\n\n $eventDates = EventDate::findForYear($year);\n\n if (!$rows->isEmpty()) {\n PositionCredit::warmYearCache($year, array_unique($rows->pluck('position_id')->toArray()));\n }\n\n if (!$eventDates) {\n // No event dates - return everything as happening during the event\n $time = $rows->pluck('slot_duration')->sum();\n $credits = $rows->pluck('credits')->sum();\n\n return [\n 'pre_event_duration' => 0,\n 'pre_event_credits' => 0,\n 'event_duration' => $time,\n 'event_credits' => $credits,\n 'post_event_duration' => 0,\n 'post_event_credits' => 0,\n 'total_duration' => $time,\n 'total_credits' => $credits,\n 'other_duration' => 0,\n 'counted_duration' => 0,\n ];\n }\n\n $summary = new WorkSummary($eventDates->event_start->timestamp, $eventDates->event_end->timestamp, $year);\n\n foreach ($rows as $row) {\n $summary->computeTotals($row->position_id, $row->slot_begins_time, $row->slot_ends_time, $row->position_count_hours);\n }\n\n return [\n 'pre_event_duration' => $summary->pre_event_duration,\n 'pre_event_credits' => $summary->pre_event_credits,\n 'event_duration' => $summary->event_duration,\n 'event_credits' => $summary->event_credits,\n 'post_event_duration' => $summary->post_event_duration,\n 'post_event_credits' => $summary->post_event_credits,\n 'total_duration' => ($summary->pre_event_duration + $summary->event_duration + $summary->post_event_duration + $summary->other_duration),\n 'total_credits' => ($summary->pre_event_credits + $summary->event_credits + $summary->post_event_credits),\n 'other_duration' => $summary->other_duration,\n 'counted_duration' => ($summary->pre_event_duration + $summary->event_duration + $summary->post_event_duration),\n 'event_start' => (string)$eventDates->event_start,\n 'event_end' => (string)$eventDates->event_end,\n ];\n }", "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\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\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\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\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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 ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\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$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\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$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function onEvent();", "function _buildChristmas()\n {\n \n $this->_addHoliday(\n 'Christmas',\n $this->_year . '-12-25',\n 'Christmas Day'\n );\n \n }", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "public static function events();", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "public static function createOrUpdateEvent($event_id, $fest_type_id, $event_year, $begin_date, $finish_date)\n\t{\n\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\tif ($event_id == null) {\n\n\t\t\t$img_link = ImageModel::createImage();\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\t\t\t$sql = \"INSERT INTO events (fest_type_id, year, img_link, begin_date, finish_date, status_id) VALUES (:fest_type_id, :event_year, :img_link, :begin_date, :finish_date, :status_id)\";\n\t\t\t$query = $database->prepare($sql);\n\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':event_year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status));\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_CREATION_FAILED'));\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t//TODO rebuild update image system\n\t\t\t$img_link = ImageModel::createImage();//return 'hash_img' if new image upload and 'false' if image not upload \n\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\n\t\t\t//People Award\n\t\t\t//Right now I selecte Film-winner on update Festival action\n\t\t\t//may be it will be better something else, for example, cron-proccess or some button\n\t\t\tif ($event_status == 3) {\n\t\t\t\t// event status 3 - finished\n\t\t\t\t$film_id = FilmModel::getFilmWonPeopleAward($event_id);\n\n\t\t\t\t$sql00 = \"SELECT event_id FROM people_award WHERE event_id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql00);\n\t\t\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t\t\tif ($query->rowCount() != 1) {\n\t\t\t\t\t// fest was NOT be finished, never\n\t\t\t\t\t$sql0 = \"INSERT INTO people_award (event_id, film_id) VALUES (:event_id, :film_id)\";\n\t\t\t\t\t$query = $database->prepare($sql0);\n\t\t\t\t\t$query->execute(array(':event_id' => $event_id, ':film_id' => $film_id));\n\n\t\t\t\t} else {\n\t\t\t\t\t// fest was be reopen and finished, again\n\t\t\t\t\t// recalcute winner (but this func is need???)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//end People Award\n\n\n\t\t\tif($img_link != 'file didnt upload'){\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, img_link = :img_link, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\t\t\t} else {\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\n\t\t\t\t//cause if saved previosly information $query-rowCount() == 0\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_FILM_UPDATE_FAILED'));\n\t\t\treturn false;\n\t\t}\n\n\t}" ]
[ "0.647072", "0.6299999", "0.62542504", "0.61698705", "0.57643974", "0.5705248", "0.565853", "0.56101394", "0.555892", "0.5545499", "0.54633147", "0.543884", "0.543602", "0.54078066", "0.5337899", "0.5320634", "0.52699256", "0.5231473", "0.52273995", "0.52196115", "0.5213453", "0.51973486", "0.51843625", "0.51602334", "0.51525897", "0.51510656", "0.5135986", "0.51201415", "0.51014346", "0.50939065", "0.50646156", "0.50455767", "0.5044404", "0.5029554", "0.50289327", "0.50269675", "0.5012184", "0.5009792", "0.49800324", "0.49797755", "0.4963981", "0.4952776", "0.49444234", "0.49346888", "0.4933348", "0.49322972", "0.4925882", "0.49124014", "0.4898734", "0.4893456", "0.48929194", "0.48826003", "0.48740736", "0.48647672", "0.48643908", "0.4841659", "0.4839869", "0.48381922", "0.48378474", "0.4837829", "0.4819483", "0.4817648", "0.48173758", "0.481729", "0.48146167", "0.48088646", "0.48067376", "0.47922152", "0.47881004", "0.4787022", "0.47811115", "0.47724837", "0.47702566", "0.47687364", "0.47676983", "0.47609743", "0.47591484", "0.47559735", "0.4755078", "0.47549433", "0.4753897", "0.47498935", "0.4746415", "0.4728036", "0.47197118", "0.47186595", "0.47174808", "0.47174808", "0.47081268", "0.47038725", "0.47003764", "0.46972558", "0.46918863", "0.46889925", "0.468815", "0.46867758", "0.46832237", "0.46827486", "0.4679449", "0.46721792" ]
0.7101401
0
Events based on type and year.
public function yearTypeState($year = null, $type = null, $state = null) { return \App\Event::with('venue.city.states') ->whereHas('venue.city.states', function ($query) use ($state) { $query->where('abbr', strtoupper($state)); }) ->whereYear('start_date', $year) ->where('type', $type) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function get_type_events()\n{\n return 'atu_events';\n}", "public function findByType($type){\r\n $stmt = $this->db->prepare(\"SELECT * FROM event WHERE type =?\");\r\n $stmt->execute(array($type));\r\n\r\n $events_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n $events = array();\r\n\r\n foreach($events_db as $event){\r\n array_push($events, new Event($event[\"id_event\"], $event[\"type\"], $event[\"name\"],$event[\"moment\"], $event[\"date\"],\r\n $event[\"guests\"], $event[\"children\"], $event[\"sweet_table\"], $event[\"observations\"],\r\n $event[\"restaurant\"], $event[\"phone\"],$event[\"price\"] ));\r\n }\r\n\r\n return $events;\r\n }", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "function GetEvent($date, $id_country = 0, $id_region = 0, $id_city = 0, $type = 0, $my_events = false){\n\tglobal $lang, $config, $config_index, $smarty, $dbconn, $user;\n\n\t$filter = $table = \"\";\n\tif ($id_country)$filter .= \" AND a.id_country = \".$id_country;\n\tif ($id_region)\t$filter .= \" AND a.id_region = \".$id_region;\n\tif ($id_city)\t$filter .= \" AND a.id_city = \".$id_city;\n\tif ($type)\t\t$filter .= \" AND a.type = \".$type;\n\n\tif ($my_events) {\n\t\t$table = \", \".EVENT_USERS_TABLE.\" b \";\n\t\t$filter .= \" AND a.id = b.id_event AND b.id_user = \".$user[ AUTH_ID_USER ];\n\t}\n\n\t$strSQL = \"SELECT a.id, a.event_name, a.id_creator FROM \".EVENT_DESCR_TABLE.\" a\".$table.\"\n\t\tWHERE (\t(a.periodicity = 'none' AND DATE_FORMAT(a.start_date,'%Y-%m-%d') = DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'daily' AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'weekly' AND DAYOFWEEK(a.start_date) = DAYOFWEEK('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'monthly' AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'yearly' AND MONTH(a.start_date) = MONTH('\".$date.\"') AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\t)\".$filter;\n\t$rs = $dbconn->Execute($strSQL);\n\t$num_records = $rs->RowCount();\n\tif($num_records>0){\n\t\t$event[\"event_count\"] = $num_records;\n\t\t$i = 0;\n\t\twhile(!$rs->EOF){\n\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t$event[\"event\"][$i][\"id_event\"] = $row[\"id\"];\n\t\t\tif (strlen($row[\"event_name\"])<10) {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t} else {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes(substr($row[\"event_name\"],0,10).\"...\");\n\t\t\t}\n\t\t\t$event[\"event\"][$i][\"full_name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t$i++;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $event;\n\t} else {\n\t\treturn '';\n\t}\n}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function GetOvertimeYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_OvertimeYearList_\n select distinct substrb(my_day, 0,4) as year1,\n substrb(my_day, 0,4) as year2\n from ehr_overtime_v\n where company_id = '$companyid'\n $_where\n order by substrb(my_day,0,4) desc\n_OvertimeYearList_;\n return $this->DBConn->GetArray($sql_string);\n }", "public function getEvents(array $filters = array());", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "public static function getAllEventsByType($type)\n {\n $db = new Database();\n // Create an admin DB connection to get data from Events_Details table\n $adminDB = $db->getAdminDBConnection();\n // Query database for eid and get all details\n $query = \"SELECT * FROM Event_Details WHERE Type='\" . $type . \"' AND status=1;\";\n // Prepare query statement\n $stmt = $adminDB->prepare($query);\n // Execute query\n $stmt->execute();\n // Fetch all rows as associative array\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n }", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}", "function GetLeaveYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<eof\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day, 'YYYY-MM-DD'), 0, 4) desc\neof;\n return $this->DBConn->GetArray($sql_string);\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "public function __construct(int $type)\n {\n $this->_eventType = $type;\n }", "public function eventsGetEventTypes()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/types';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Accept' => 'application/json',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'IdfyLib\\\\Models\\\\EventTypeInfo');\n }", "public function setYear($year);", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function actionIndex()\n {\n $searchModel = new EventType();\n $collection = Yii::$app->mongodb->getCollection('eventType'); \n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $queryeventType = EventType::find()->all();\n \t\n \t$querytype_name = EventType::find();\n \t$querytype_name->where(['Calendar' => ['1','2','3','4']]);\n \t$querytype_name = $querytype_name->all(); \t\n \t\n \t$type_Name = $collection->distinct('Type_name');\n\n \n return $this->render('indexeventtype', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \t'valueeventType'=> $queryeventType,\n \t\n \t'type_Name'=> $type_Name,\n \t'querytype_name'=> $querytype_name,\n\n ]);\n }", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function get_event_types()\n {\n return array(0 => 'miscellaneous', 1 => 'appointment', 2 => 'holiday'\n ,3 => 'birthday', 4 => 'personal', 5 => 'education'\n ,6 => 'travel', 7 => 'anniversary', 8 => 'not in office'\n ,9 => 'sick day', 10 => 'meeting', 11 => 'vacation'\n ,12 => 'phone call', 13 => 'business'\n ,14 => 'non-working hours', 50 => 'special occasion'\n );\n }", "public static function getEntityTypeEvents() {\n $event = ['onEntityTypeEvent', 100];\n $events[EntityTypeEvents::CREATE][] = $event;\n $events[EntityTypeEvents::UPDATE][] = $event;\n $events[EntityTypeEvents::DELETE][] = $event;\n return $events;\n }", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "public function events()\n {\n $templateCalendarEvent = factory(TemplateCalendarEvent::class)->create();\n $calendarEvent = factory(CalendarEvent::class)->make();\n $calendarEvent->template()->associate($templateCalendarEvent);\n $calendarEvent->save();\n\n $this->assertInstanceOf(CalendarEvent::class, $templateCalendarEvent->events()->first());\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "public function getDollsFiltered($year = '', $type = '')\n\t{\n\t\t$dolls = $this->doll->where(function($query) use ($type, $year) {\n\n\t\t\tif ( ($year) && ($year !== 'all') ){\n\t\t\t\t$query->where('release_year', $year);\n\t\t\t}\n\n\t\t\t$query->whereHas('dolltypes', function($q) use ($type) {\n\t\t\t\t$q->where('slug', $type);\n\t\t\t});\n\n\t\t})->get();\n\n\t\treturn $dolls;\n\t}", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function loadMultipleByEvent($event, $type = 'outgoing');", "public function __construct($year)\n {\n $this->year = $year;\n }", "private function getEvents($eventType, $raw = false)\n {\n $query = \"SELECT * FROM events WHERE game_id = ? AND event_type IN (:event_types)\";\n $result = $this->oDB->getAll($query, array($this->oData->getIdGames(), ':event_types' => $eventType));\n\n if ($raw) {\n return $result;\n }\n\n // group the response by event type and player number\n $events = array();\n foreach ((array)$result as $value) {\n $events[ $value['event_type'] ][ $value['player'] ][] = $value['event_value'];\n }\n\n return $events;\n }", "public function setYear($year)\n {\n $this->year = $year;\n }", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "function is_event_calendar_page() {\n\n\tif ( class_exists( 'TribeEvents' ) ) {\n\n\t\t$is_event_calendar = false; // Default is false so if everything falls through it returns that it is not an EC page\n\n\t\tif ( tribe_is_month() && ! is_tax() ) { // Month View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && ! is_tax() ) { // List View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && is_tax() ) { // List View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && ! is_tax() ) { // Week View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && is_tax() ) { // Week View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && ! is_tax() ) { // Day View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && is_tax() ) { // Day View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && ! is_tax() ) { // Map View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && is_tax() ) { // Map View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && ! is_tax() ) { // Photo View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && is_tax() ) { // Photo View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_events’ ) ) { // Single Events\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_venue’ ) ) { // Single Venues\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_organizer’ ) ) { // Single Organizers\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} else {\n\n\t\t}\n\n\t\treturn $is_event_calendar;\n\t}\n}", "public function modelYear();", "public function eventsUsingTableAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $events = $this->model->findEventsByYear((int) $year);\n $viewModel = new ViewModel(['events' => $events, 'year' => $year]);\n $viewModel->setTemplate('signups/index/events');\n return $viewModel;\n }", "public function getEventTypes()\n {\n return new EventTypes(array('order_name' => true));\n }", "public static function getUserEventList($event_type,$id)\n\t{\n\t\t// Page My Event is Own Event\n\t\t\n\t\t$limit = 100;\n\t\t$page = 1;\n\t\t\n\t\tif($page==\"\") $page = 1;\n\t\t\n\t\t$date_now = date(\"Y-m-d\");\n\t\t$result = CommonFunction::resultPaging(\n\t\t\t\t\t\t$page, $limit, EventModel::where('userId', '=', $id)->count(),\n\t\t\t\t\t\tEventModel::where(\"status\",\"=\",$event_type)->\n\t\t\t\t\t\twhere(\"endDate\",\">=\",$date_now)->where('userId', '=', $id)->take($limit)->skip(($page-1)*$limit)->get(array('id', 'name','description', 'avenueName','avanueAddress','latitude','longitude','coverImage','facebook','twitter','line','website','host','categoryId','status','private','share','userId','startDate','endDate','time','startTime','endTime'))\n\t\t\t\t\t);\n\n\n\t\treturn $result;\n\n\t}", "public function getEvents();", "public function getEvents();", "public static function getAllEventTypes()\n {\n return [\n 'complete' => 'complete',\n 'fail' => 'fail'\n ];\n }", "public function setYear($year) {\n $this->_year = $year;\n }", "private function inclusionByYearByTypeEssai()\n {\n $em = $this->getDoctrine()->getManager();\n\n $inclusionByYearByTypeEssai = $em->getRepository(Inclusion::class)\n ->createQueryBuilder('i')\n ->select(' count(i) as nb, YEAR(i.datInc) AS year, e.typeEssai as type')\n ->join('i.essai', 'e')\n ->where('i.datInc IS NOT NULL')\n ->groupBy('year, type')\n ->orderBy('year')\n ->getQuery()\n ->getResult();\n\n $data = [];\n $years = [];\n $essais = [];\n foreach ($inclusionByYearByTypeEssai as $resp) {\n if (empty($data[$resp['year']][$resp['type']]))\n $data[$resp['year']][$resp['type']] = 0;\n $data[$resp['year']][$resp['type']] += $resp['nb'];\n $years[] = $resp['year'];\n $essais[] = $resp['type'];\n }\n $years = array_unique($years);\n $essais = array_unique($essais);\n sort($years);\n sort($essais);\n foreach ($data as $year => $v) {\n $total = 0;\n foreach ($v as $nb) {\n $total += $nb;\n }\n foreach ($v as $name => $nb) {\n $data[$year][$name] = $data[$year][$name] / $total * 100;\n }\n }\n\n $data_by_type = [];\n foreach ($years as $year) {\n foreach ($essais as $v) {\n if (empty($data[$year][$v]))\n $data_by_type[$v][] = 0;\n else\n $data_by_type[$v][] = $data[$year][$v];\n }\n }\n\n return [\"years\" => $years, \"data\" => $data_by_type];\n }", "public function events()\n\t{\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Weblog get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t='yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tcategory url titles?\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tdetect special cases\n\t\t//--------------------------------------------\n\n\t\tif ( ! $this->parent_method)\n\t\t{\n\t\t\t$this->parent_method = __FUNCTION__;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_days',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_weeks',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_months',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_years',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_offset',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'orderby',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'event_start_date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'sort',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'ASC'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// For the purposes of this method, if an event_id or event_name\n\t\t// has been specified, we want to ignore date range parameters.\n\t\t// -------------------------------------\n\t\t/*\n\t\tif ($this->P->value('event_id') !== FALSE OR $this->P->value('event_name') !== FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', FALSE);\n\t\t\t$this->P->set('date_range_end', FALSE);\n\t\t}\n\t\t*/\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching events');\n\n\t\t$ids = $this->data->fetch_event_ids($this->P);\n\n\t\t/*$category = FALSE;\n\n\t\tif (FALSE AND isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}\n\n\t\t$ids = $this->data->fetch_event_ids($this->P, $category);*/\n\n\t\t// -------------------------------------\n\t\t// No events?\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No events, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// We also need the \"parent\" entry id, if it hasn't been provided\n\t\t// -------------------------------------\n\n\t\tforeach ($ids as $k => $v)\n\t\t{\n\t\t\tif (! isset($ids[$v]))\n\t\t\t{\n\t\t\t\t$ids[$v] = $v;\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_event_ids' hook.\n\t\t// - Do something with the event IDs\n\n\t\tif (ee()->extensions->active_hook('calendar_events_event_ids') === TRUE)\n\t\t{\n\t\t\t$ids = ee()->extensions->call('calendar_events_event_ids', $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD . \"(.+?)\" .\n\t\t\t\t\t LD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD . \"(.+?)\" . LD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t$var_pairs = array(\n\t\t\t'occurrences',\n\t\t\t'exceptions',\n\t\t\t'rules'\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_pair as $name => $params)\n\t\t{\n\t\t\tif (in_array($name, $var_pairs))\n\t\t\t{\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[$name]['id'] = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($var_pairs as $pair)\n\t\t\t{\n\t\t\t\tif (strpos($name.' ', $pair) !== 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$new_name = $name.' id=\"\"';\n\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[] \t\t\t\t\t= ee()->TMPL->var_pair[$name];\n\t\t\t\tee()->TMPL->var_pair[$new_name]['id'] \t= '';\n\t\t\t\t// Leave the old name behind so we can pick it up later and use it\n\t\t\t\tee()->TMPL->var_pair[$pair] \t\t\t= $name;\n\n\t\t\t\tunset(ee()->TMPL->var_pair[$name]);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\t$var_dates = array(\n\t\t\t'event_start_date'\t=> FALSE,\n\t\t\t'event_start_time'\t=> FALSE,\n\t\t\t'event_end_date'\t=> FALSE,\n\t\t\t'event_end_time'\t=> FALSE,\n\t\t\t'event_first_date'\t=> FALSE,\n\t\t\t'event_last_date'\t=> FALSE,\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t{\n\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t{\n\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\thash fix for EE 2.8.2\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\tDue to the new conditionals parser\n\t\t\t\t\t//\teverything is just whack, so we have\n\t\t\t\t\t//\tto hash and replace formats because\n\t\t\t\t\t//\tEE is just barfing on it now :/.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//EE 2.9+ converting quotes and escaping on its conditional\n\t\t\t\t\t//tokenizer so we now have to match escaped quotes\n\t\t\t\t\t//This should be backward compatible.\n\t\t\t\t\tpreg_match(\"/format=(\\\\\\'|\\'|\\\\\\\"|\\\"])(.*)?\\\\1/i\", $k, $matches);\n\n\t\t\t\t\tif ( ! empty($matches))\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_k = $k;\n\t\t\t\t\t\t$k = str_replace($matches[0], md5($matches[0]), $k);\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace($old_k, $k, ee()->TMPL->tagdata);\n\n\t\t\t\t\t\t//EE 2.9's new conditional parser also screws with how\n\t\t\t\t\t\t//template variables were pulling out the formats for\n\t\t\t\t\t\t//us due to the quote conversion and escaping\n\t\t\t\t\t\t//so we are fixing it here with this since we are\n\t\t\t\t\t\t//capturing it ourselves and converting to hashes\n\t\t\t\t\t\t//anyway.\n\t\t\t\t\t\tif ($v == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$v = $matches[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$var_dates[$name][$k] = $v;\n\t\t\t\t\tee()->TMPL->var_single[$k] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel;\n\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] \t\t\t= implode('|', array_keys($ids));\n\n\t\t//if we have event names, lets set them for the URL title\n\t\tif ( ! in_array(ee()->TMPL->fetch_param('event_name'), array(FALSE, ''), TRUE))\n\t\t{\n\t\t\tee()->TMPL->tagparams['url_title'] = ee()->TMPL->fetch_param('event_name');\n\t\t}\n\n\t\tee()->TMPL->tagparams[$this->sc->channel] \t= CALENDAR_EVENTS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tee()->TMPL->var_single \t\t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_events_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_events_channel_query', $channel->query, $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Trim IDs and build events\n\t\t// -------------------------------------\n\n\t\t$new_ids = array();\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t}\n\n\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t// -------------------------------------\n\t\t// Turn these IDs into events\n\t\t// -------------------------------------\n\n\t\t$events = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching Calendar_event class');\n\n\t\tif ( ! class_exists('Calendar_event'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t}\n\n\t\t$calendars = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Creating events');\n\n\t\tforeach ($event_data as $k => $edata)\n\t\t{\n\t\t\t$start_ymd\t= ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') : '';\n\t\t\t$end_ymd\t= ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd');\n\n\t\t\t$temp\t\t= new Calendar_event($edata, $start_ymd, $end_ymd);\n\n\t\t\tif (! empty($temp->dates))\n\t\t\t{\n\t\t\t\t$temp->prepare_for_output();\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Eliminate times we don't care about\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('date_range_start', 'ymd') != '')\n\t\t\t\t{\n\t\t\t\t\tforeach ($temp->dates as $ymd => $times)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($times as $range => $data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($data['end_date']['ymd'].$data['end_date']['time'] <\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telseif ($data['date']['ymd'].$data['date']['time'] >\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (empty($temp->dates[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($temp->dates[$ymd]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Recheck to ensure our dates array isn't empty now\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t{\n\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No point in stressing ourselves out if $calendars is empty\n\t\t// -------------------------------------\n\n\t\tif (empty($calendars))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Fetch information about the calendars\n\t\t// -------------------------------------\n\n\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t// -------------------------------------\n\t\t// Prep variable aliases\n\t\t// -------------------------------------\n\n\t\t$variables = array(\n\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t'author'\t\t=> 'event_author',\n\t\t\t'status'\t\t=> 'event_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\n\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare to reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\t$calendar_orderby_params = array(\n\t\t\t'event_title',\n\t\t\t'event_start_date',\n\t\t\t'event_start_hour',\n\t\t\t'event_start_time',\n\t\t\t'occurrence_start_date'\n\t\t);\n\n\t\t$orders \t\t\t\t= explode('|', $this->P->value('orderby'));\n\t\t$sorts \t\t\t\t\t= explode('|', $this->P->value('sort'));\n\t\t$calendar_orders \t\t= array();\n\t\t$calendar_order_data \t= array();\n\n\t\tforeach ($orders as $k => $order)\n\t\t{\n\t\t\tif (in_array($order, $calendar_orderby_params))\n\t\t\t{\n\t\t\t\t$sort = (isset($sorts[$k])) ? $sorts[$k] : 'desc';\n\t\t\t\t$calendar_orders[$order] = $sort;\n\t\t\t\t$calendar_order_data[$order] = array();\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tremove non-existant entry ids first\n\t\t//--------------------------------------------\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\tif ( ! isset($events[$row['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tcalculate offset and event timeframe\n\t\t//\ttotal before we parse tags\n\t\t//--------------------------------------------\n\n\t\t$offset = ($this->P->value('event_offset') > 0) ? $this->P->value('event_offset') : 0;\n\n\t\t$this->event_timeframe_total = count($channel->query->result) - $offset;\n\n\t\t// -------------------------------------\n\t\t// Add variables to the query result\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding variables to channel query result');\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['screen_name'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['username'];\n\n\t\t\t$channel->query->result[$k]['event_timeframe_total'] = $this->event_timeframe_total;\n\n\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t// -------------------------------------\n\t\t\t// Alias\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($variables as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Event variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($events[$entry_id]->default_data as $key => $val)\n\t\t\t{\n\t\t\t\tif (! is_array($val))\n\t\t\t\t{\n\t\t\t\t\tif ($val === 'y' OR $val === 'n')\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = ($val == 'y') ? TRUE : 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$channel->query->result[$k]['event_'.$key] = $val;\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\tforeach ($val as $vkey => $vval)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($vval === 'y' OR $vval === 'n')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][\n\t\t\t\t\t\t\t\t'event_'.$key.'_'.$vkey\n\t\t\t\t\t\t\t] = ($vval == 'y') ? TRUE : FALSE;\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$channel->query->result[$k]['event_'.$key.'_'.$vkey] = $vval;\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// -------------------------------------\n\t\t\t// Prepare to orderby event_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_date']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_start_date'][$k] =\n\t\t\t\t\t$events[$entry_id]->default_data['start_date'] .\n\t\t\t\t\t$events[$entry_id]->default_data['start_time'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Prepare to orderby occurrence_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['occurrence_start_date']))\n\t\t\t{\n\t\t\t\t$date = reset(reset($events[$entry_id]->dates));\n\t\t\t\t$time = (isset($date['start_time'])) ? $date['start_time'] : $date['date']['time'];\n\t\t\t\t$date = $date['date']['ymd'];\n\t\t\t\t$calendar_order_data['occurrence_start_date'][$k] = $date.$time;\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start time\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_time']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = '0000';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = $events[$entry_id]->default_data['start_time'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start hour\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_hour']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] = '00';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] \t= substr($events[$entry_id]->default_data['start_time'], 0, 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by event title\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_title']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_title'][$k] = $channel->query->result[$k]['title'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrence variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_occurrence_total'] \t= count($events[$entry_id]->occurrences);\n\t\t\t$channel->query->result[$k]['event_has_occurrences'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_occurrence_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Exception variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_exception_total'] \t= count($events[$entry_id]->exceptions);\n\t\t\t$channel->query->result[$k]['event_has_exceptions'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_exception_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Rule variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_rule_total'] \t\t= count($events[$entry_id]->rules);\n\t\t\t$channel->query->result[$k]['event_has_rules'] \t\t\t= (\n\t\t\t\t$channel->query->result[$k]['event_rule_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t//-------------------------------------\n\t\t\t// Does the event end?\n\t\t\t// we have to check all rules to make sure\n\t\t\t// in case this is a complex rule\n\t\t\t//-------------------------------------\n\n\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = FALSE;\n\n\t\t\tif ($channel->query->result[$k]['event_recurs'] == 'y')\n\t\t\t{\n\t\t\t\tforeach ($events[$entry_id]->rules as $event_rule)\n\t\t\t\t{\n\t\t\t\t\tif ($event_rule['rule_type'] == '+' AND\n\t\t\t\t\t\t($event_rule['repeat_years'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_months'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_days'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_weeks'] != 0) AND\n\t\t\t\t\t\t$event_rule['last_date'] == 0 \tAND\n\t\t\t\t\t\t$event_rule['stop_after'] == 0\n\t\t\t\t\t )\n\t\t\t\t\t{\n\t\t\t\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*$never_ending = $channel->query->result[$k]['event_never_ends'] = (\n\t\t\t\t$channel->query->result[$k]['event_last_date'] == 0 AND\n\t\t\t\t$channel->query->result[$k]['event_recurs'] == 'y'\n\t\t\t);*/\n\n\t\t\t// -------------------------------------\n\t\t\t// Calendar variables\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendars[$events[$entry_id]->default_data['calendar_id']]))\n\t\t\t{\n\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (substr($key, 0, 9) != 'calendar_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = 'calendar_'.$key;\n\t\t\t\t\t}\n\n\t\t\t\t\t//add in calendar data\n\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\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//really?\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Date variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($var_dates as $name => $vals)\n\t\t\t{\n\t\t\t\t$which = '';\n\n\t\t\t\tif ($vals === FALSE)\n\t\t\t\t{\n\t\t\t\t\t$vals = array();\n\t\t\t\t}\n\n\t\t\t\tif ($name == 'event_last_date')\n\t\t\t\t{\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_last_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name == 'event_first_date')\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_first_date']\t= $channel->query->result[$k]['event_start_ymd'];\n\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_first_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$which\t= ($name == 'event_first_date' OR strpos($name, '_start_') !== FALSE) ? 'start' : 'end';\n\t\t\t\t$year\t= $events[$entry_id]->default_data[$which.'_year'];\n\t\t\t\t$month\t= $events[$entry_id]->default_data[$which.'_month'];\n\t\t\t\t$day\t= $events[$entry_id]->default_data[$which.'_day'];\n\n\t\t\t\t$time \t= $events[$entry_id]->default_data[$which.'_time'];\n\n\t\t\t\tif ($time == 0)\n\t\t\t\t{\n\t\t\t\t\tif ($which == 'start')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour \t= '00';\n\t\t\t\t\t\t$minute = '00';\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$hour\t= '23';\n\t\t\t\t\t\t$minute = '59';\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$minute = substr($time, -2, 2);\n\t\t\t\t\t$hour \t= substr($time, 0, strlen($time) - 2);\n\t\t\t\t}\n\n\t\t\t\t//year month and day are a tad fubar when\n\t\t\t\t//we are looking at a repeat occurence with an enddate\n\t\t\t\t//because the end time is indeed correct, but end date\n\t\t\t\t//is expected to be the end of all of the occurrences\n\t\t\t\t//however, if this is never ending, thats different\n\n\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\n\t\t\t\tif ( ! $never_ending AND\n\t\t\t\t\t $name = \"event_last_date\")\n\t\t\t\t{\n\t\t\t\t\t$real_end_date = ($channel->query->result[$k]['event_last_date'] != 0) ?\n\t\t\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_last_date'] :\n\t\t\t\t\t\t\t\t\t\t$events[$entry_id]->default_data['end_date']['ymd'];\n\n\n\t\t\t\t\t$end_time_year \t= substr($real_end_date, 0, 4);\n\t\t\t\t\t$end_time_month = substr($real_end_date, 4, 2);\n\t\t\t\t\t$end_time_day \t= substr($real_end_date, 6, 2);\n\n\t\t\t\t\t$this->CDT->change_datetime(\n\t\t\t\t\t\t$end_time_year,\n\t\t\t\t\t\t$end_time_month,\n\t\t\t\t\t\t$end_time_day,\n\t\t\t\t\t\t$hour,\n\t\t\t\t\t\t$minute\n\t\t\t\t\t);\n\n\t\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\t\t\t\t\t//special treatment on end dates of occurrences if its not infinite\n\t\t\t\t\tif ( ! $never_ending AND stristr($key, 'event_last_date'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$end_time_dta,\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t//else, parse as normal\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t/*\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\n\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t$format,\n\t\t\t\t\t\t'%'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Shorthand date/time variables\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($which)\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_hour']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_minute']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// The foreach may have emptied the query results\n\t\t// -------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n//ee()->TMPL->log_item('Calendar: Weblog query is empty, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\tunset($CDT);\n\n\t\t// -------------------------------------\n\t\t// Reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($calendar_order_data))\n\t\t{\n\t\t\tee()->TMPL->log_item('Calendar: Reordering');\n\n\t\t\t$args \t= array();\n\t\t\t$temps \t= array();\n\n\t\t\tforeach ($calendar_orders as $k => $v)\n\t\t\t{\n\t\t\t\t//add order array\n\t\t\t\t$args[] =& $calendar_order_data[$k];\n\n\t\t\t\t//constant for order type\n\n\t\t\t\t//contants cannot be passed by ref because its not a variable\n\t\t\t\t$temps[$k] = constant('SORT_'.strtoupper($v));\n\n\t\t\t\t$args[] =& $temps[$k];\n\t\t\t}\n\n\t\t\t//this will order the result\n\t\t\t$args[] =& $channel->query->result;\n\n\t\t\tcall_user_func_array('array_multisort', $args);\n\n\t\t\t//cleanup\n\t\t\tunset($args);\n\t\t\tunset($temps);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tpagination for the events tag\n\t\t//--------------------------------------------\n\t\t//\tany tags using this might have different needs\n\t\t//\tso we only want to paginate for original events\n\t\t//\ttag usage\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\t//$this->event_timeframe_total = count($channel->query->result);\n\n\t\tif ($this->parent_method === 'events' AND\n\t\t\t$this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> ee()->TMPL->tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_events_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_events_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//ee()->TMPL->tagdata\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Apply event_limit=\"\" parameter\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('event_limit'))\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset,\n\t\t\t\t$this->P->value('event_limit')\n\t\t\t);\n\t\t}\n\t\telse if ($offset > 0)\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\toffset too much? buh bye\n\t\t//--------------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t// \tWe will reassign the $channel->query->result with our\n\t\t// \treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t$occurrence_hash = '9b8b2cde1a14e29a8791ceccdaab6cf9d92b37a4';\n\n\t\t//we have to prevent occurrenct count from being borked\n\t\tee()->TMPL->tagdata = str_replace('occurrence_count', $occurrence_hash, ee()->TMPL->tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\t\t$channel->parse_channel_entries();\n\n\t\t$channel->return_data = str_replace($occurrence_hash, 'occurrence_count', $channel->return_data);\n\n\t\t// -------------------------------------\n\t\t// Parse Calendar variable pairs\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing variable pairs');\n\n\t\tforeach ($var_pairs as $var)\n\t\t{\n\t\t\tif (isset(ee()->TMPL->var_pair[$var]))\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Iterate through the events\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tforeach ($events as $k => $data)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Does this event have this var pair?\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif (strpos($channel->return_data, LD.$var.' ') !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$var_tag = (! is_array(ee()->TMPL->var_pair[$var])) ? ee()->TMPL->var_pair[$var] : $var;\n\n\t\t\t\t\t\tif (preg_match_all(\"/\".LD.$var_tag.' id=\"'.$k.'\"'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').$var.RD.'/s', $channel->return_data, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Iterate through the variables associated with this pair\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($matches[1] as $key => $match)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = \"prep_{$var}_output\";\n\t\t\t\t\t\t\t\t$match = $this->$method($match, $data, FALSE);\n\t\t\t\t\t\t\t\t$channel->return_data = str_replace($matches[0][$key], $match, $channel->return_data);\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\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t//$channel->add_pagination_data();\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via channel module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $this->parse_pagination($channel->return_data);\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t// -------------------------------------\n\t\t//\tlets reverse any unparsed items\n\t\t//\tin case someone is actually writing\n\t\t//\tout the phrase 'event_url_title'\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\t}", "public function indexEvents(array $events, array $context = []): void;", "public static function events();", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "public static function findForPersonYear($personId, $year)\n {\n $info = new PersonEventInfo();\n\n $info->person_id = $personId;\n $info->year = $year;\n\n $requireTraining = PersonPosition::findTrainingPositions($personId);\n $info->trainings = [];\n\n if ($requireTraining->isEmpty()) {\n $requireTraining = [Position::find(Position::TRAINING)];\n }\n\n foreach ($requireTraining as $position) {\n $info->trainings[] = Training::retrieveEducation($personId, $position, $year);\n }\n\n usort($info->trainings, function ($a, $b) {\n return strcmp($a->position_title, $b->position_title);\n });\n\n $radio = RadioEligible::findForPersonYear($personId, $year);\n $info->radio_info_available = setting('RadioInfoAvailable');\n $info->radio_max = $radio ? $radio->max_radios : 0;\n $info->radio_eligible = $info->radio_max > 0 ? true : false;\n\n $bmid = Bmid::findForPersonYear($personId, $year);\n if ($bmid) {\n $info->meals = $bmid->meals;\n $info->showers = $bmid->showers;\n } else {\n $info->meals = '';\n $info->showers = false;\n }\n\n if (current_year() == $year && !setting('MealInfoAvailable')) {\n $info->meals = 'no-info';\n }\n\n $ot = PersonOnlineTraining::findForPersonYear($personId, $year);\n\n if ($ot) {\n $info->online_training_passed = true;\n $info->online_training_date = (string)$ot->completed_at;\n } else {\n $info->online_training_passed = false;\n }\n\n $info->vehicles = Vehicle::findForPersonYear($personId, $year);\n $event = PersonEvent::findForPersonYear($personId, $year);\n\n if ($event) {\n $info->may_request_stickers = $event->may_request_stickers;\n $info->org_vehicle_insurance = $event->org_vehicle_insurance;\n $info->signed_motorpool_agreement = $event->signed_motorpool_agreement;\n } else {\n $info->may_request_stickers = false;\n $info->org_vehicle_insurance = false;\n $info->signed_motorpool_agreement = false;\n }\n return $info;\n }", "public function getEventType(): string;", "public function getYearEraDayIndex($year);", "private function filterEvents( $filter_string , $events ){\n\t\t$filters = explode(',' , $filter_string );\n\n\t\t$events_filtered = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['original']))\n\t\t\t\t$event_text = $event['original'];\n\t\t\telse\n\t\t\t\t$event_text = $event['summary'];\n\t\t\t$fits = FALSE;\n\t\t\tforeach( $filters as $filter ){\n\t\t\t\t$filter_without_semicolons = str_replace([' :',':'], '', $filter );\n\n\t\t\t\tif(stristr($event_text,$filter) || stristr(str_replace(' :',':',$event_text), $filter) || strtolower(substr(trim($event_text), 0, strlen($filter_without_semicolons))) === strtolower($filter_without_semicolons) ){\n\t\t\t\t\t// stripping the category from the title\n\t\t\t\t\t$prefixes = [ $filter , str_replace(':',' :',$filter) ];\n\t\t\t\t\tforeach($prefixes as $prefix){\n\t\t\t\t\t\tif (substr(strtolower($event_text), 0, strlen($prefix)) == strtolower($prefix)) {\n \t\t\t\t\t\t// $event_text = substr($event_text, strlen($prefix));\n \t\t\t\t\t\t// $event['category'] = str_replace(':','',strtolower($prefix));\n \t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// echo 'fits filter '.$filter.'<br>';\n\t\t\t\t\t// $event['summary'] = $event_text;\n\t\t\t\t\t$fits = TRUE;\n\t\t\t\t\t$analyse_summary = Event::filterType($event_text);\n\t\t\t\t\t$event['original'] = $event_text;\n\t\t\t\t\t$event['summary'] = $analyse_summary['summary'];\n\t\t\t\t\t$event['city'] = isset($analyse_summary['city'])?$analyse_summary['city']:'';\n\t\t\t\t\t$event['category'] = isset($analyse_summary['type'])?$analyse_summary['type']:'';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Adding some info to help\n\t\t\tif(!isset($event['start']['dateTime']) && isset($event['start']['date'])){\n\t\t\t\t$event['start']['dateTime'] = $event['start']['date'];\n\t\t\t}\n\t\t\t$datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t$event['start']['weekday'] = $datetime->format('N');\n\n\t\t\t// Adding the picture\n\t\t\t// $creator_email = isset($event['creator']['email'])?$event['creator']['email']:null;\n\t\t\t$organizer_id = isset($event['extendedProperties']['shared']['organizer_id'])?$event['extendedProperties']['shared']['organizer_id']:null;\n\t\t\t\n\t\t\tif(!is_null($organizer_id) && !isset($event['school'])){\n\t\t\t\t\n\t\t\t\t$school = School::findOne($organizer_id);\n\n\t\t\t\tif($school){\n\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t$event['school'] = array();\n\t\t\t\t\t$event['school']['picture'] = $school->getPictureUrl();\n\t\t\t\t\t$event['school']['thumb'] = $school->getThumbUrl();\n\t\t\t\t\t$event['school']['name'] = $school->name;\n\t\t\t\t\tif(isset($school->website))\n\t\t\t\t\t\t$event['school']['url'] = $school->website;\n\t\t\t\t\telse if(isset($school->facebook))\n\t\t\t\t\t\t$event['school']['url'] = $school->facebook;\n\t\t\t\t\tif($school->email){\n\t\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t}\n\t\t\t\t\tif($school->active == false){\n\t\t\t\t\t\t$fits = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($event['extendedProperties']['shared']['disabled']) && $event['extendedProperties']['shared']['disabled'] == 1){\n\t\t\t\t$fits = FALSE;\n\t\t\t}\n\t\t\tif( $fits == TRUE ){\n\t\t\t\t$events_filtered[$event['id']] = $event;\n\t\t\t}\n\n\t\t}\n\t\treturn $events_filtered;\n\t}", "public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }", "public static function createOrUpdateEvent($event_id, $fest_type_id, $event_year, $begin_date, $finish_date)\n\t{\n\n\t\t$database = DatabaseFactory::getFactory()->getConnection();\n\n\t\tif ($event_id == null) {\n\n\t\t\t$img_link = ImageModel::createImage();\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\t\t\t$sql = \"INSERT INTO events (fest_type_id, year, img_link, begin_date, finish_date, status_id) VALUES (:fest_type_id, :event_year, :img_link, :begin_date, :finish_date, :status_id)\";\n\t\t\t$query = $database->prepare($sql);\n\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':event_year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status));\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_CREATION_FAILED'));\n\t\t\treturn false;\n\n\t\t} else {\n\n\t\t\t//TODO rebuild update image system\n\t\t\t$img_link = ImageModel::createImage();//return 'hash_img' if new image upload and 'false' if image not upload \n\n\t\t\t$event_status = EventModel::SetEventStatus($begin_date, $finish_date);\n\n\n\t\t\t//People Award\n\t\t\t//Right now I selecte Film-winner on update Festival action\n\t\t\t//may be it will be better something else, for example, cron-proccess or some button\n\t\t\tif ($event_status == 3) {\n\t\t\t\t// event status 3 - finished\n\t\t\t\t$film_id = FilmModel::getFilmWonPeopleAward($event_id);\n\n\t\t\t\t$sql00 = \"SELECT event_id FROM people_award WHERE event_id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql00);\n\t\t\t\t$query->execute(array(':event_id' => $event_id));\n\n\t\t\t\tif ($query->rowCount() != 1) {\n\t\t\t\t\t// fest was NOT be finished, never\n\t\t\t\t\t$sql0 = \"INSERT INTO people_award (event_id, film_id) VALUES (:event_id, :film_id)\";\n\t\t\t\t\t$query = $database->prepare($sql0);\n\t\t\t\t\t$query->execute(array(':event_id' => $event_id, ':film_id' => $film_id));\n\n\t\t\t\t} else {\n\t\t\t\t\t// fest was be reopen and finished, again\n\t\t\t\t\t// recalcute winner (but this func is need???)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//end People Award\n\n\n\t\t\tif($img_link != 'file didnt upload'){\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, img_link = :img_link, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':img_link' => $img_link, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\t\t\t} else {\n\t\t\t\t$sql = \"UPDATE events SET fest_type_id = :fest_type_id, year = :year, begin_date = :begin_date, finish_date = :finish_date, status_id = :status_id WHERE id = :event_id\";\n\t\t\t\t$query = $database->prepare($sql);\n\t\t\t\t$query->execute(array(':fest_type_id' => $fest_type_id, ':year' => $event_year, ':begin_date' => $begin_date, ':finish_date' => $finish_date, ':status_id' => $event_status, ':event_id' => $event_id));\n\n\t\t\t\t//cause if saved previosly information $query-rowCount() == 0\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($query->rowCount() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tSession::add('feedback_negative', Text::get('FEEDBACK_FILM_UPDATE_FAILED'));\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function getEventList($community_id = NULL, $event_type = NULL, $page = NULL) {\n\n $this->autoRender = FALSE;\n\n $limit = 3; //Pagination limit\n $user = $this->Auth->user();\n\n $user_status = $this->CommunityMember->getCommunityMemberStatus($user['id'], $community_id);\n /*switch ($event_type) {\n case Event::UPCOMING_COMMUNITY_EVENTS:\n $this->Community->virtualFields = array(\n 'user_type' => 'CommunityMember.user_type'\n );\n $this->Paginator->settings = array(\n 'joins' => array(\n array(\n 'table' => 'community_members',\n 'alias' => 'CommunityMember',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'Event.community_id = CommunityMember.community_id',\n 'Event.created_by = CommunityMember.user_id'\n )\n )\n ),\n 'limit' => $limit,\n 'conditions' => array(\n 'Event.community_id' => $community_id,\n 'Event.start_date >=' => Date::getCurrentDateTime()\n ),\n 'fields' => array('Event.*', 'Community.*', 'CommunityMember.*'),\n 'order' => array('Community.user_type' => 'desc'),\n 'group' => array('Event.id')\n );\n break;\n case Event::PAST_COMMUNITY_EVENTS:\n $this->Paginator->settings = array(\n 'joins' => array(\n array(\n 'table' => 'community_members',\n 'alias' => 'CommunityMember',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'Event.community_id = CommunityMember.community_id',\n 'Event.created_by = CommunityMember.user_id'\n )\n )\n ),\n 'limit' => $limit,\n 'conditions' => array(\n 'Event.community_id' => $community_id,\n 'Event.end_date <' => Date::getCurrentDateTime()\n ),\n 'fields' => array('Event.*', 'Community.*', 'CommunityMember.*'),\n 'order' => array('Community.user_type' => 'desc'),\n 'group' => array('Event.id')\n );\n break;\n }*/\n \n $this->Paginator->settings = array(\n 'joins' => array(\n array(\n 'table' => 'community_members',\n 'alias' => 'CommunityMember',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'Event.community_id = CommunityMember.community_id',\n 'Event.created_by = CommunityMember.user_id'\n )\n )\n ),\n 'limit' => $limit,\n 'conditions' => array(\n 'Event.community_id' => $community_id\n ),\n 'fields' => array('Event.*', 'Community.*', 'CommunityMember.*'),\n 'order' => array('Event.end_date' => 'desc'),\n 'group' => array('Event.id')\n );\n\n $events = $this->paginate('Event');\n $paginate = $this->params['paging']['Event'];\n\n $timezone = $this->Auth->user('timezone');\n\n $now = date(\"Y-m-d H:i:s\");\n\n $user_communities = $this->CommunityMember->find('list', array(\n 'conditions' => array(\n 'CommunityMember.user_id' => $user['id'],\n 'CommunityMember.status' => CommunityMember::STATUS_APPROVED\n ),\n 'fields' => array('CommunityMember.community_id'),\n ));\n\n $eventIds = $this->EventMember->getEventIds($user['id']); //User's Event ids\n\n foreach ($eventIds as $eventId) {\n\n $status = $this->EventMember->getStatus($eventId, $user['id']); //Status of event associated with user\n\n switch ($status) {\n case '0':\n $pendingEventIds[] = $eventId; //Events that are pending invitation\n break;\n case '1':\n $goingEventIds[] = $eventId;\n $attendingEventIds[] = $eventId;\n break;\n case '2':\n $notAttendingEventIds[] = $eventId;\n break;\n case '3':\n $maybeEventIds[] = $eventId;\n $attendingEventIds[] = $eventId; //Events that user is attending to\n break;\n }\n }\n\n\n $this->set(compact('events', 'event_type', 'community_id', 'timezone', 'user_status', 'now', 'user_communities', 'goingEventIds', 'notAttendingEventIds', 'maybeEventIds', 'user'));\n\n $this->layout = 'ajax';\n $View = new View($this, FALSE);\n $response['htm_content'] = $View->element('Event.events_row');\n $response['paginator'] = $paginate;\n echo json_encode($response);\n }", "function testEditCalendarEventType()\n\t{\n\t\tedit_event_type($this->eventtype_id,\"test_event_type1\",'calendar/testtype1','');\n\t\t// Test the forum was actually created\n\t\t$this->assertTrue('test_event_type1'==get_translated_text($GLOBALS['SITE_DB']->query_value('calendar_types','t_title ',array('id'=>$this->eventtype_id))));\n\t}", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "function setEventType() // OK\n {\n }", "function getSupportedFilters() {\n return array('event' => array(\n 'event_type_id' => array(\n 'form_field_name' => 'event_type_id',\n 'operator' => 'IN',\n ))\n );\n }", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "function getAllEvents() {\n\n $this->events = $this->getEvents();\n //If plugin adds new events for an already defined type\n Plugin::doHook('item_get_events', $this);\n\n return $this->events;\n }", "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function get_events($user_id,$type){\n\t\t$this->db->select('*');\n\t\tif($type===\"restaurant\"){\n\t\t\t$this->db->where('restaurant_id',$user_id);\n\t\t}else{\n\t\t\t$this->db->where('server_id',$user_id);\n\t\t}\n\t\t$query = $this->db->get('calendar');\n\t\treturn $query->result();\n\t}", "public function events()\n {\n $config = SchoolYearConfig::where('is_active', 1)->first();\n\n $events = Update::where('school_year', $config->school_year)->get();\n return view('welcome')->with('events', $events);\n }", "public static function TotTypeEvents($type){\r\n $type = self::$conn->real_escape_string($type);\r\n $query = \"SELECT id FROM tipoevento WHERE nome='$type'\";\r\n $result = self::$conn->query($query);\r\n if($result->num_rows != 1)\r\n return -1;\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n $type = $row[0];\r\n $query = \"SELECT count(*) FROM evento WHERE tipo='$type' AND blocked=FALSE\";\r\n\t\t$result = self::$conn->query($query); \r\n if($result){\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return (int)$row[0]; \r\n }\r\n return 0;\r\n }", "public function dataProvider_for_generateNextCalendarEvent()\n {\n return [\n [Carbon::parse('2017-08-10'), 4, RecurringFrequenceType::DAY, Carbon::parse('2017-08-14')],\n [Carbon::parse('2017-08-10'), 2, RecurringFrequenceType::WEEK, Carbon::parse('2017-08-24')],\n [Carbon::parse('2017-08-10'), 3, RecurringFrequenceType::MONTH, Carbon::parse('2017-11-10')],\n [Carbon::parse('2017-08-10'), 1, RecurringFrequenceType::YEAR, Carbon::parse('2018-08-10')],\n ];\n }", "function getDateforStdFilterBytype($type)\n\t{\n\t\t//$thisyear = date(\"Y\");\n\t\t$maxdate = \"2099-12-31\";\n\t\t$mindate = \"1900-01-01\";\n\t\t$datevalue = array();\n\n\t\tif($type == \"today\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"yesterday\" )\n\t\t{\n\t\t\t$yesterday = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-1, date(\"Y\")));\n\t\t\t$datevalue[0] = $yesterday;\n\t\t\t$datevalue[1] = $yesterday;\n\t\t}\n\t\telseif($type == \"tomorrow\" )\n\t\t{\n\t\t\t$tomorrow = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\")));\n\t\t\t$datevalue[0] = $tomorrow;\n\t\t\t$datevalue[1] = $tomorrow;\n\t\t}\n\t\telseif($type == \"thisweek\" )\n\t\t{\n\t\t\t$thisweek0 = date(\"Y-m-d\",strtotime(\"-1 week Sunday\"));\n\t\t\t$thisweek1 = date(\"Y-m-d\",strtotime(\"this Saturday\"));\n\t\t\t$datevalue[0] = $thisweek0;\n\t\t\t$datevalue[1] = $thisweek1;\n\t\t}\n\t\telseif($type == \"lastweek\" )\n\t\t{\n\t\t\t$lastweek0 = date(\"Y-m-d\",strtotime(\"-2 week Sunday\"));\n\t\t\t$lastweek1 = date(\"Y-m-d\",strtotime(\"-1 week Saturday\"));\n\t\t\t$datevalue[0] = $lastweek0;\n\t\t\t$datevalue[1] = $lastweek1;\n\t\t}\n\t\telseif($type == \"nextweek\" )\n\t\t{\n\t\t\t$nextweek0 = date(\"Y-m-d\",strtotime(\"this Sunday\"));\n\t\t $nextweek1 = date(\"Y-m-d\",strtotime(\"+1 week Saturday\"));\n\t\t\t$datevalue[0] = $nextweek0;\n\t\t\t$datevalue[1] = $nextweek1;\n\t\t}\n\t\telseif($type == \"thismonth\" )\n\t\t{\n\t\t\t$currentmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\"), \"01\", date(\"Y\")));\n\t\t\t$currentmonth1 = date(\"Y-m-t\");\n\t\t\t$datevalue[0] =$currentmonth0;\n\t\t\t$datevalue[1] = $currentmonth1;\n\t\t}\n\n\t\telseif($type == \"lastmonth\" )\n\t\t{\n\t\t\t$lastmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$lastmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")-1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $lastmonth0;\n\t\t\t$datevalue[1] = $lastmonth1;\n\t\t}\n\t\telseif($type == \"nextmonth\" )\n\t\t{\n\t\t\t$nextmonth0 = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t $nextmonth1 = date(\"Y-m-t\", mktime(0, 0, 0, date(\"m\")+1, \"01\", date(\"Y\")));\n\t\t\t$datevalue[0] = $nextmonth0;\n\t\t\t$datevalue[1] = $nextmonth1;\n\t\t}\n\t\telseif($type == \"next3days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next7days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next15days\" )\n\t\t{\n\t\t\t$next7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next7days;\n\t\t}\n\t\telseif($type == \"next30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$today;\n\t\t\t$datevalue[1] =$next30days;\n\t\t}\n\t\telseif($type == \"next60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next60days;\n\t\t}\n\t\telseif($type == \"next90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+89, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next90days;\n\t\t}\n\t\telseif($type == \"next180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$next180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $today;\n\t\t\t$datevalue[1] = $next180days;\n\t\t}\n\t\telseif($type == \"before3days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-3, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before7days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-7, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before15days\" )\n\t\t{\n\t\t\t$before7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-15, date(\"Y\")));\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before7days;\n\t\t}\n\t\telseif($type == \"before30days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-30, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$mindate;\n\t\t\t$datevalue[1] =$before30days;\n\t\t}\n\t\telseif($type == \"before60days\" )\n\t\t{\n\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-60, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before60days;\n\t\t}\n\t\telseif($type == \"before100days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-100, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before100days;\n\t\t}\n\t\telseif($type == \"before180days\" )\n\t\t{\n\t\t\t//$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$before180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-180, date(\"Y\")));\n\t\t\t$datevalue[0] = $mindate;\n\t\t\t$datevalue[1] = $before180days;\n\t\t}\n\t\telseif($type == \"after3days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+2, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after7days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+6, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after15days\" )\n\t\t{\n\t\t\t$after7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+14, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $after7days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+29, date(\"Y\")));\n\n\t\t\t$datevalue[0] =$after30days;\n\t\t\t$datevalue[1] =$maxdate;\n\t\t}\n\t\telseif($type == \"after60days\" )\n\t\t{\n\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+59, date(\"Y\")));\n\t\t\t$datevalue[0] = $after60days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after100days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after100days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+99, date(\"Y\")));\n\t\t\t$datevalue[0] = $after100days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"after180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$after180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")+179, date(\"Y\")));\n\t\t\t$datevalue[0] = $after180days;\n\t\t\t$datevalue[1] = $maxdate;\n\t\t}\n\t\telseif($type == \"last3days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-2, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last7days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-6, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last15days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last7days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-14, date(\"Y\")));\n\t\t\t$datevalue[0] = $last7days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last30days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last30days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-29, date(\"Y\")));\n\t\t\t$datevalue[0] = $last30days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last60days\" )\n\t\t{\n\t\t\t$last60days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-59, date(\"Y\")));\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $last60days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telse if($type == \"last90days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last90days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-89, date(\"Y\")));\n\t\t\t$datevalue[0] = $last90days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"last180days\" )\n\t\t{\n\t\t\t$today = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\")));\n\t\t\t$last180days = date(\"Y-m-d\",mktime(0, 0, 0, date(\"m\") , date(\"d\")-179, date(\"Y\")));\n\t\t\t$datevalue[0] = $last180days;\n\t\t\t$datevalue[1] = $today;\n\t\t}\n\t\telseif($type == \"thisfy\" )\n\t\t{\n\t\t\t$currentFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")));\n\t\t\t$currentFY1 = date(\"Y-m-t\",mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")));\n\t\t\t$datevalue[0] = $currentFY0;\n\t\t\t$datevalue[1] = $currentFY1;\n\t\t}\n\t\telseif($type == \"prevfy\" )\n\t\t{\n\t\t\t$lastFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")-1));\n\t\t\t$lastFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")-1));\n\t\t\t$datevalue[0] = $lastFY0;\n\t\t\t$datevalue[1] = $lastFY1;\n\t\t}\n\t\telseif($type == \"nextfy\" )\n\t\t{\n\t\t\t$nextFY0 = date(\"Y-m-d\",mktime(0, 0, 0, \"01\", \"01\", date(\"Y\")+1));\n\t\t\t$nextFY1 = date(\"Y-m-t\", mktime(0, 0, 0, \"12\", date(\"d\"), date(\"Y\")+1));\n\t\t\t$datevalue[0] = $nextFY0;\n\t\t\t$datevalue[1] = $nextFY1;\n\t\t}\n\t\telseif($type == \"nextfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n \t\t}else if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$nFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")+1));\n\t\t\t\t$nFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")+1));\n \t\t}\n\t\t\t$datevalue[0] = $nFq;\n\t\t\t$datevalue[1] = $nFq1;\n\t\t}\n\t\telseif($type == \"prevfq\" )\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")-1));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")-1));\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$pFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$pFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $pFq;\n\t\t\t$datevalue[1] = $pFq1;\n\t\t}\n\t\telseif($type == \"thisfq\")\n\t\t{\n\t\t\tif(date(\"m\") <= 3)\n\t\t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"01\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"03\",\"31\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 3 and date(\"m\") <= 6)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"04\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"06\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse if(date(\"m\") > 6 and date(\"m\") <= 9)\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"07\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"09\",\"30\",date(\"Y\")));\n\n \t\t}\n\t\t\telse\n \t\t{\n\t\t\t\t$cFq = date(\"Y-m-d\",mktime(0, 0, 0, \"10\",\"01\",date(\"Y\")));\n\t\t\t\t$cFq1 = date(\"Y-m-d\",mktime(0, 0, 0, \"12\",\"31\",date(\"Y\")));\n \t\t}\n\t\t\t$datevalue[0] = $cFq;\n\t\t\t$datevalue[1] = $cFq1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$datevalue[0] = \"\";\n\t\t\t$datevalue[1] = \"\";\n\t\t}\n\n\t\treturn $datevalue;\n\t}", "protected function build_global_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 0 );\n $query='\n SELECT '.pwg_db_get_date_YYYYMM($this->date_field).' as period,\n COUNT(distinct id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY '.pwg_db_get_year($this->date_field).' DESC, '.pwg_db_get_month($this->date_field).' ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $y = substr($row['period'], 0, 4);\n $m = (int)substr($row['period'], 4, 2);\n if ( ! isset($items[$y]) )\n {\n $items[$y] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$y]['children'][$m] = $row['count'];\n $items[$y]['nb_images'] += $row['count'];\n }\n //echo ('<pre>'. var_export($items, true) . '</pre>');\n if (count($items)==1)\n {// only one year exists so bail out to year view\n list($y) = array_keys($items);\n $page['chronology_date'][CYEAR] = $y;\n return false;\n }\n\n global $lang;\n foreach ( $items as $year=>$year_data)\n {\n $chronology_date = array( $year );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $year_data['children'], false, false, $lang['month'] );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $year_data['nb_images'],\n 'HEAD_LABEL' => $year,\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "public function enableYear() {\n\t\t$this->displayYear = true;\n\t}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public static function getDateFilterTypes()\n\t{\n\t\t$dateFilters = Array('custom' => array('label' => 'LBL_CUSTOM'),\n\t\t\t'prevfy' => array('label' => 'LBL_PREVIOUS_FY'),\n\t\t\t'thisfy' => array('label' => 'LBL_CURRENT_FY'),\n\t\t\t'nextfy' => array('label' => 'LBL_NEXT_FY'),\n\t\t\t'prevfq' => array('label' => 'LBL_PREVIOUS_FQ'),\n\t\t\t'thisfq' => array('label' => 'LBL_CURRENT_FQ'),\n\t\t\t'nextfq' => array('label' => 'LBL_NEXT_FQ'),\n\t\t\t'yesterday' => array('label' => 'LBL_YESTERDAY'),\n\t\t\t'today' => array('label' => 'LBL_TODAY'),\n\t\t\t'tomorrow' => array('label' => 'LBL_TOMORROW'),\n\t\t\t'lastweek' => array('label' => 'LBL_LAST_WEEK'),\n\t\t\t'thisweek' => array('label' => 'LBL_CURRENT_WEEK'),\n\t\t\t'nextweek' => array('label' => 'LBL_NEXT_WEEK'),\n\t\t\t'lastmonth' => array('label' => 'LBL_LAST_MONTH'),\n\t\t\t'thismonth' => array('label' => 'LBL_CURRENT_MONTH'),\n\t\t\t'nextmonth' => array('label' => 'LBL_NEXT_MONTH'),\n\t\t\t'last7days' => array('label' => 'LBL_LAST_7_DAYS'),\n\t\t\t'last15days' => array('label' => 'LBL_LAST_15_DAYS'),\n\t\t\t'last30days' => array('label' => 'LBL_LAST_30_DAYS'),\n\t\t\t'last60days' => array('label' => 'LBL_LAST_60_DAYS'),\n\t\t\t'last90days' => array('label' => 'LBL_LAST_90_DAYS'),\n\t\t\t'last120days' => array('label' => 'LBL_LAST_120_DAYS'),\n\t\t\t'next15days' => array('label' => 'LBL_NEXT_15_DAYS'),\n\t\t\t'next30days' => array('label' => 'LBL_NEXT_30_DAYS'),\n\t\t\t'next60days' => array('label' => 'LBL_NEXT_60_DAYS'),\n\t\t\t'next90days' => array('label' => 'LBL_NEXT_90_DAYS'),\n\t\t\t'next120days' => array('label' => 'LBL_NEXT_120_DAYS')\n\t\t);\n\t\tforeach ($dateFilters as $filterType => $filterDetails) {\n\t\t\t$dateValues = \\DateTimeRange::getDateRangeByType($filterType);\n\t\t\t$dateFilters[$filterType]['startdate'] = $dateValues[0];\n\t\t\t$dateFilters[$filterType]['enddate'] = $dateValues[1];\n\t\t}\n\t\treturn $dateFilters;\n\t}", "public function onGetFeedDataFilter($buffer) {\nglobal $_LW;\nstatic $event_types;\nif (!empty($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'])) { // if there is an event type map\n\tif (!empty($buffer) && @$buffer['type']=='ical' && strpos(@$buffer['url'], $_LW->CONFIG['LIVE_URL'].'/ems/')!==false && !empty($buffer['items']['default'])) { // if the feed is an EMS ICAL feed with items\n\t\tif ($this->initEMS()) { // if EMS loaded\n\t\t\tif (!isset($this->client->event_types)) { // get the EMS event types\n\t\t\t\t$this->client->getEventTypes($_LW->REGISTERED_APPS['ems']['custom']['username'], $_LW->REGISTERED_APPS['ems']['custom']['password']);\n\t\t\t};\n\t\t\tif (!isset($event_types)) { // get the LiveWhale event types\n\t\t\t\t$event_types=[];\n\t\t\t\tforeach($_LW->dbo->query('select', 'id, title', 'livewhale_events_categories', false, 'title ASC')->run() as $event_type) {\n\t\t\t\t\t$event_types[$event_type['id']]=$_LW->setFormatClean($event_type['title']);\n\t\t\t\t};\n\t\t\t};\n\t\t\tforeach($buffer['items']['default'] as $key=>$val) { // for each feed item\n\t\t\t\tif (!empty($val['categories']) || !empty($val['unknown_categories'])) { // if there are categories or unknown categories\n\t\t\t\t\tif (!empty($val['categories'])) { // if there are categories\n\t\t\t\t\t\tforeach($val['categories'] as $key2=>$val2) { // for each category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t\tif (!empty($val['unknown_categories'])) { // if there are unknown categories\n\t\t\t\t\t\tforeach($val['unknown_categories'] as $key2=>$val2) { // for each unknown category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the unknown category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\tif (!is_array($buffer['items']['default'][$key]['categories'])) { // ensure that there is an array of known categories\n\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories']=[];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tunset($buffer['items']['default'][$key]['unknown_categories'][$key2]); // remove the unknown category\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};\n};\nreturn $buffer;\n}", "function getType ()\n\t\t{\n\t\t\treturn \"Event\";\n\t\t}", "public function getClasses() {\n if(!property_exists($this->data, 'classes')) $this->loadClasses();\n require_once(\"Event.php\");\n $classes = array();\n foreach($this->data->classes as $class) {\n $class->type = \"LESSON\";\n $class->period = $class->classPeriod;\n unset($class->classPeriod);\n $classes[] = new Event($this->fenixEdu, $class);\n }\n return $classes;\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function get_entries_records_for_year($entries, $year, $boundle)\n{\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n $entries_records = [];\n if (isset($entries)) {\n foreach ($entries as $entry) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $boundle)\n ->fieldCondition('field_entry', 'target_id', $entry, '=')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n\n // Adding each records for an entry in the array of entry id.\n $entries_records[$entry] = $records_ids;\n }\n }\n }\n\n return $entries_records;\n}", "static function getDefaultGLPIEvents($type) {\r\n $events = self::getDefaultEvents();\r\n return $events[$type]['glpi'];\r\n }", "function obj_do_cx_events_list_filter( $events ) {\n\t$months = evt_helper_get_year_months( $events );\n $types = evt_helper_get_event_types( $events );\n $search_term = evt_helper_get_search_term();\n $reset_display = 'none';\n if ('' !== $search_term ) {\n $reset_display = 'block';\n }\n\t?>\n\t<div class=\"event-list-filter__wrap\">\n <!-- <div class=\"event-search-form-wrap\">\n <form method=\"get\" action=\"/events/\">\n <div class=\"event-search-form-inner\">\n <input type=\"search\" value=\"<?php echo $search_term; ?>\" name=\"evtq\" placeholder=\"Search\" class=\"input-search\" />\n <button class=\"btn-search\">\n <i class=\"fa fa-search\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </form>\n </div> -->\n <div class=\"select-wrap\">\n\t\t\t<select name=\"event-list__month\" id=\"event-list__month\">\n\t\t\t\t<option value=\"all\">When</option>\n\t\t\t\t<?php foreach ( $months as $abbr => $month ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $abbr; ?>\"><?php echo $month; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class=\"select-wrap\">\n\t\t\t<select name=\"event-list__type\" id=\"event-list__type\">\n\t\t\t\t<option value=\"all\">Type</option>\n\t\t\t\t<?php foreach ( $types as $abbr => $type ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $abbr; ?>\"><?php echo $type; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</div>\n\t\t<div class=\"filter-reset\" style=\"display:<?php echo $reset_display; ?>\">Reset</div>\n </div>\n <span style=\"display: none;\" class=\"no-events-shown-message grande-text\">No results seem to match your search. Adjust the filters to see what other events may be relevant for you.</span>\n\t<?php\n}", "public function run()\n {\n $modalities = [\n 'Enduro',\n 'XCO',\n 'XC',\n 'Down Hill',\n 'Dirt',\n 'BMX',\n 'Bicicross',\n 'Contra Relógio',\n 'Speed',\n 'Infantil'\n ];\n\n\n foreach ($modalities as $modality) {\n EventModality::create(['name' => $modality]);\n }\n }", "public static function __events () {\n \n }", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "public function index(Request $request)\n {\n if (Auth::user() == null) {\n $organizerSelector = \"1=1\";\n } else {\n $organizerSelector = Auth::user()->organizerId() != null ? \"organizers.id = \" . Auth::user()->organizerId() : \"1=1\";\n }\n $selector = $request->query('type_id') != null ? \"events.type_id = \" . $request->query('type_id') : \"1=1\";\n $provinceSelector = $request->query('province') != null ? \"events.province = '\" . $request->query('province') . \"'\" : \"1=1\";\n $citySelector = $request->query('city') != null && strlen($request->query('city')) != 0 ? \"events.city = '\" . $request->query('city') . \"'\" : \"1=1\";\n\n $events = Event::selectRaw('events.*, organizers.name AS organizer_name, event_types.name AS type_name')\n ->join('organizers', 'events.organizer_id', 'organizers.id')\n ->join('event_types', 'event_types.id', 'events.type_id')\n ->whereRaw($selector)\n ->whereRaw($citySelector)\n ->whereRaw($provinceSelector)\n ->whereRaw($organizerSelector)\n ->paginate(10);\n\n $eventTypes = EventType::all();\n $provinces = array_keys(Location::LOCATION);\n\n $types = EventType::all();\n\n $organizer = Organizer::where('id', 1)->first();\n return view('events', compact('events', 'organizer', 'types', 'eventTypes', 'provinces'));\n }", "public function GetAllFacturesVentesByYear() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n \n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n $filterYear = $_REQUEST['data'][\"filterYear\"];\n // Input validations\n if (!empty($idSociete) && !empty($filterYear)) {\n try {\n $sql = $this->db->prepare(\"SELECT idFacture,date as dateCre,total,YEAR(date) AS factYear FROM facturevente WHERE idEtat != 5 and YEAR(date) = :filterYear AND idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->bindParam('filterYear', $filterYear, PDO::PARAM_STR);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n \n }", "public function viewAllEvents();" ]
[ "0.72472", "0.61797494", "0.57372206", "0.5721232", "0.56760633", "0.55220526", "0.5474397", "0.5470561", "0.5463023", "0.54596037", "0.5456593", "0.54556906", "0.5452347", "0.5411459", "0.54016584", "0.5346318", "0.53227204", "0.527593", "0.52508044", "0.5244296", "0.5229964", "0.52291036", "0.52233714", "0.5222594", "0.5201391", "0.51920927", "0.51919186", "0.51809245", "0.5145569", "0.5083263", "0.505722", "0.5031766", "0.5031327", "0.50139976", "0.50069034", "0.49906942", "0.49880004", "0.49659163", "0.4957431", "0.49461395", "0.49459863", "0.49275073", "0.4888229", "0.48870286", "0.48740864", "0.48525015", "0.48495114", "0.4846265", "0.48442787", "0.4834255", "0.4833088", "0.48322204", "0.48311788", "0.48302382", "0.48302382", "0.48211405", "0.4817231", "0.48086545", "0.4799016", "0.4792047", "0.47851428", "0.478487", "0.47839686", "0.47833374", "0.47805235", "0.47774425", "0.47745332", "0.47622904", "0.4759843", "0.47559592", "0.4755013", "0.47538865", "0.47477496", "0.4747492", "0.47472283", "0.47456226", "0.47453612", "0.47360784", "0.4733713", "0.47301748", "0.4730153", "0.47295314", "0.47208107", "0.4717638", "0.4714262", "0.47005385", "0.47000614", "0.4694099", "0.46920046", "0.4684579", "0.4684157", "0.4679736", "0.46795094", "0.46777388", "0.46732357", "0.46716064", "0.46692768", "0.46659076", "0.46652347", "0.46609128" ]
0.622572
1
Events based on year, month, and state.
public function yearMonthState($year = null, $month = null, $state = null) { return \App\Event::with('venue.city.states') ->whereHas('venue.city.states', function ($query) use ($state) { $query->where('abbr', strtoupper($state)); }) ->whereYear('start_date', $year) ->whereMonth('start_date', $month) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function buildCalendar($month, $year);", "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function _registration_open( $event_month, $event_year ){\n $open_month = ((floor(($event_month + 1) / 2) - 1) * 2) + (12 - floor(($event_month + 9) / 12) * 12);\n $open_year = $event_year + floor (($event_month + 9) / 12) - 1;\n $open_time = mktime( 0, 0, 0, $open_month, 1, $open_year);\n return $open_time < time();\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function actionMonthData()\n {\n $this->requireAjaxRequest();\n $this->requirePostRequest();\n\n $dateRangeStart = craft()->request->getPost('dateRangeStart');\n $dateRangeEnd = craft()->request->getPost('dateRangeEnd');\n $calendars = craft()->request->getPost('calendars', null);\n $nonEditable = craft()->request->getPost('nonEditable');\n $locale = craft()->request->getPost('locale', null);\n\n $criteria = array(\n 'dateRangeStart' => $dateRangeStart,\n 'dateRangeEnd' => $dateRangeEnd,\n );\n\n $calendarIds = null;\n if ($calendars) {\n if ($calendars !== '*') {\n $criteria['calendarId'] = explode(',', $calendars);\n }\n } else if (null !== $calendars) {\n $criteria['calendarId'] = -1;\n }\n\n /** @var Calendar_EventsService $eventsService */\n $eventsService = craft()->calendar_events;\n\n if (craft()->isLocalized()) {\n $criteria['locale'] = $locale ?: craft()->language;\n }\n\n // Check settings if disabled events should be shown\n\n /** @var Calendar_SettingsService $settings */\n $settings = craft()->calendar_settings;\n if ($settings->showDisabledEvents()) {\n $criteria['status'] = null;\n }\n\n $eventList = $eventsService->getEventList($criteria);\n $simpleEvents = $eventList->getEventsAsSimpleObject();\n\n if ($nonEditable) {\n foreach ($simpleEvents as $event) {\n $event->editable = false;\n }\n }\n\n $this->returnJson($simpleEvents);\n }", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "function getEvents(){\n \n $query = \"SELECT *\n FROM \" . $this->table_name . \"\n WHERE \n MONTH(date) = MONTH(NOW()) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 0, 12, MONTH(NOW()) - 1) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 13, 1, MONTH(NOW()) + 1) \n ORDER BY date DESC\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n \n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function month()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array('categories', 'category_fields', 'custom_fields', 'member_data', 'pagination', 'trackbacks');\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'enable',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'allowed_values' => $disable\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'first_day_of_week',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'start_date_segment',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 3\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\tif ($this->P->value('start_date_segment') AND ee()->uri->segment($this->P->value('start_date_segment')) AND strstr(ee()->uri->segment($this->P->value('start_date_segment')), '-'))\n\t\t\t{\n\t\t\t\tlist($year, $month) = explode('-', ee()->uri->segment($this->P->value('start_date_segment')));\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($year, $month, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start', 'day') != 1)\n\t\t{\n\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->P->value('date_range_start', 'year'), $this->P->value('date_range_start', 'month'), 1);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day($this->CDT->days_in_month($this->P->value('date_range_start', 'month'), $this->P->value('date_range_start', 'year')) - 1));\n\t\t$this->P->set('pad_short_weeks', TRUE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\t'EVENTS_PLACEHOLDER',\n\t\t\t\t\t\t'{/',\n\t\t\t\t\t\t'{',\n\t\t\t\t\t\t'}'\n\t\t\t\t\t\t);\n\t\t$replace = array(\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\tLD.T_SLASH,\n\t\t\t\t\t\t\tLD,\n\t\t\t\t\t\t\tRD\n\t\t\t\t\t\t\t);\n\t\tee()->TMPL->tagdata = str_replace($find, $replace, $this->view('month.html', array(), TRUE, $this->sc->addon_theme_path.'templates/month.html'));\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_month'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_month'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day_of_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day_of_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "function getMonthlyEventData($month, $session=7) {\n //Check month format\n $isValidMonth = date_create_from_format(\"m\", $month);\n if(!$isValidMonth) {\n //TODO Add any more validations that may be required\n // createFromFormat returns false if the format is invalid or month is invalid\n echo \"Please enter a valid month as an int. Cannot proceed due to invalid month error\";\n } else if(!is_numeric($session) && ($session>0 && $session<8)){\n //$session is not valid\n echo \"Please enter a valid session as an int with value between 1 and 7 inclusive. Cannot proceed due to invalid session error\";\n }else {\n $monthUrl = sprintf(self::$monthEventUrl, $session, $month);\n return parent::convert($monthUrl,3);\n }\n }", "public function yearTypeState($year = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "public static function month_calendar($day, $month, $year) {\r\n global $langDay_of_weekNames, $langMonthNames, $langToday, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n //Handle leap year\r\n $numberofdays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {\r\n $numberofdays[2] = 29;\r\n }\r\n\r\n $eventlist = Calendar_Events::get_calendar_events(\"month\", \"$year-$month-$day\");\r\n\r\n $events = array();\r\n if ($eventlist) {\r\n foreach ($eventlist as $event) {\r\n $eventday = new DateTime($event->startdate);\r\n $eventday = $eventday->format('j');\r\n if (!array_key_exists($eventday,$events)) {\r\n $events[$eventday] = array();\r\n }\r\n array_push($events[$eventday], $event);\r\n }\r\n }\r\n\r\n //Get the first day of the month\r\n $dayone = getdate(mktime(0, 0, 0, $month, 1, $year));\r\n //Start the week on monday\r\n $startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;\r\n\r\n $backward = array('month'=>$month == 1 ? 12 : $month - 1, 'year' => $month == 1 ? $year - 1 : $year);\r\n $foreward = array('month'=>$month == 12 ? 1 : $month + 1, 'year' => $month == 12 ? $year + 1 : $year);\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.':&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= '<table width=100% class=\"title1\">';\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"250\"><a href=\"#\" onclick=\"show_month(1,'.$backward['month'].','.$backward['year'].'); return false;\">&laquo;</a></td>';\r\n $calendar_content .= \"<td class='center'><b>{$langMonthNames['long'][$month-1]} $year</b></td>\";\r\n $calendar_content .= '<td width=\"250\" class=\"right\"><a href=\"#\" onclick=\"show_month(1,'.$foreward['month'].','.$foreward['year'].'); return false;\">&raquo;</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table><br />\";\r\n $calendar_content .= \"<table class='table-default'><tr class='list-header'>\";\r\n for ($ii = 1; $ii < 8; $ii++) {\r\n $calendar_content .= \"<th class='text-center'>\" . $langDay_of_weekNames['long'][$ii % 7] . \"</th>\";\r\n }\r\n $calendar_content .= \"</tr>\";\r\n $curday = -1;\r\n $today = getdate();\r\n\r\n while ($curday <= $numberofdays[$month]) {\r\n $calendar_content .= \"<tr>\";\r\n\r\n for ($ii = 0; $ii < 7; $ii++) {\r\n if (($curday == -1) && ($ii == $startdayofweek)) {\r\n $curday = 1;\r\n }\r\n if (($curday > 0) && ($curday <= $numberofdays[$month])) {\r\n $bgcolor = $ii < 5 ? \"class='alert alert-danger'\" : \"class='odd'\";\r\n $dayheader = \"$curday\";\r\n $class_style = \"class=odd\";\r\n if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {\r\n $dayheader = \"<b>$curday</b> <small>($langToday)</small>\";\r\n $class_style = \"class='today'\";\r\n }\r\n $calendar_content .= \"<td height=50 width=14% valign=top $class_style><b>$dayheader</b>\";\r\n $thisDayItems = \"\";\r\n if (array_key_exists($curday, $events)) {\r\n foreach ($events[$curday] as $ev) {\r\n $thisDayItems .= Calendar_Events::month_calendar_item($ev, Calendar_Events::$calsettings->{$ev->event_group.\"_color\"});\r\n }\r\n $calendar_content .= \"$thisDayItems</td>\";\r\n }\r\n $curday++;\r\n } else {\r\n $calendar_content .= \"<td width=14%>&nbsp;</td>\";\r\n }\r\n }\r\n $calendar_content .= \"</tr>\";\r\n }\r\n $calendar_content .= \"</table>\";\r\n\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n\r\n /*************************************** Bootstrap calendar ******************************************************/\r\n\r\n $calendar_content .= '<div id=\"bootstrapcalendar\"></div>';\r\n\r\n return $calendar_content;\r\n }", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public static function stateChanged($event)\r\n {\r\n }", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public function getEventByDate($year, $month, $day) {\n\t\tif (isset($this->events[$year][$month][$day]))\n\t\t\treturn $this->events[$year][$month][$day];\n\t\treturn FALSE;\n\t}", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "private function parseEvent($str, $month, $year, $tzSrc, $tzDest) {\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML(\"<?xml encoding='UTF-8' ?>\" . $str);\n\t\t$event = array();\n\t\t$node = $html->getElementsByTagName(\"body\");\n\t\tforeach ($node as $body) {\n\t\t\tforeach ($body->childNodes as $node) {\n\t\t\t\t$_id = explode(\"_\", $node->getAttribute(\"id\"));\n\t\t\t\t$_id = $_id[0];\n\t\t\t\tforeach ($node->getElementsByTagName(\"div\") as $subnode) {\n\t\t\t\t\t$class = $subnode->getAttribute(\"class\");\n\t\t\t\t\tif ($class === \"eventDateBlock\") {\n\t\t\t\t\t\t// date\n\t\t\t\t\t\t$_date = explode(\" \", $subnode->firstChild->textContent);\n\t\t\t\t\t\t$_date = (strlen($_date[1]) === 1) ? \"0\" . $_date[1] : (string) $_date[1];\n\t\t\t\t\t\t$_date = \"$year-$month-\" . $_date;\n\t\t\t\t\t\t$_time = $subnode->childNodes->item(2)->textContent;\n\t\t\t\t\t} elseif ($class === \"playerAvatar\") {\n\t\t\t\t\t\t// url, images\n\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t$_url = $a->getAttribute(\"href\");\n\t\t\t\t\t\t$img = $a->firstChild;\n\t\t\t\t\t\t$_img_icon = $img->getAttribute(\"src\");\n\t\t\t\t\t\t// relocate onto a // aware domain, cdn.akamai.steamstatic.com → steamcdn-a.akamaihd.net\n\t\t\t\t\t\t$_img_icon = str_replace( \"http://cdn.akamai.steamstatic.com\", \"//steamcdn-a.akamaihd.net\", $_img_icon);\n\t\t\t\t\t\t$_appid = explode(\"/\", $_img_icon);\n\t\t\t\t\t\t$_appid = intval($_appid[count($_appid) - 2]);\n\t\t\t\t\t\tif ($_appid === 0) {\n\t\t\t\t\t\t\t$_img_header = \"\";\n\t\t\t\t\t\t\t$_img_header_small = \"\";\n\t\t\t\t\t\t\t$_img_capsule = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_img_header = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header.jpg\";\n\t\t\t\t\t\t\t$_img_header_small = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header_292x136.jpg\";\n\t\t\t\t\t\t\t$_img_capsule = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/capsule_sm_120.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($class === \"eventBlockTitle\") {\n\t\t\t\t\t\t$l = $subnode->childNodes;\n\t\t\t\t\t\tforeach ($l as $a) {\n\t\t\t\t\t\t\tif ($a->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tif ($a->tagName === \"a\") {\n\t\t\t\t\t\t\t\t\tif ($a->getAttribute(\"class\") === \"headlineLink\") {\n\t\t\t\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t\t\t\t\t$_title = $a->textContent;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// comment count\n\t\t\t\t\t\t\t\t\t\t$_comments = explode(\" \", $a->textContent);\n\t\t\t\t\t\t\t\t\t\t$_comments = intval($_comments[0]);\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\t\n\t\t$tempDate = new DateTime($_date . \" \" . $_time, $tzSrc);\n\t\t$tempDate->setTimeZone($tzDest);\n\n\t\t$event[\"id\"] = $_id;\n\t\t$event[\"url\"] = $_url;\n\t\t$event[\"title\"] = $_title;\n\t\t$event[\"comments\"] = $_comments;\n\t\t$event[\"date\"] = $tempDate->format(\"Y-m-d\");\n\t\t$event[\"time\"] = $tempDate->format(\"H:i\");\n\t\t$event[\"tz\"] = $tempDate->format(\"e\");\n\t\t$event[\"appid\"] = $_appid;\n\t\t$event[\"img_icon\"] = $_img_icon;\n\t\t$event[\"img_capsule\"] = $_img_capsule;\n\t\t$event[\"img_header\"] = $_img_header;\n\t\t$event[\"img_header_small\"] = $_img_header_small;\n\t\treturn $event;\n\t}", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "function draw_calendar($month,$year,$events = array()){\n\t\t$dayofweek = array('<td class=\"calendar-header\">Sunday</td>',\n\t\t'<td class=\"calendar-header\">Monday</td>',\n\t\t'<td class=\"calendar-header\">Tuesday</td>',\n\t\t'<td class=\"calendar-header\">Wednesday</td>',\n\t\t'<td class=\"calendar-header\">Thursday</td>',\n\t\t'<td class=\"calendar-header\">Friday</td>',\n\t\t'<td class=\"calendar-header\">Saturday</td>');\n\t\t\n\t\t/* draw table\n\t\t\t- fill top row with array using implode */\n\t\t$calendar = '<table class=\"calendar\"><tr class=\"calendar-row\">'.implode($dayofweek).'</tr>';\n\t\t\n\t\t// mktime(hour,minute,second,month,day,year);\n\t\t// figures out the which day of the week 1st is based on provided $month and $year\n\t\t$startDay = date('w',mktime(0,0,0,$month,1,$year)); // return days of the week\n\t\t$days = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n\t\t$daysFilled;\n\t\t$counter = 0;\n\t\n\t\t/* row 2 */\n\t\t$calendar.= '<tr class=\"calendar-row\">';\n\t\n\t\t/* print \"blank\" days until the first of the month */\n\t\tfor($i = 0; $i < $startDay; $i++){\n\t\t\t$calendar.= '<td class=\"calendar-empty\"> </td>';\n\t\t\t$daysFilled++;\n\t\t}\n\t\n\t\t/* for loop to add days */\n\t\tfor($i = 1; $i <= $days; $i++):\n\t\t\t$calendar.= '<td class=\"calendar-day\"><div style=\"position:relative;height:100px;\"><div class=\"date\">'.$i.'</div>';\n\t\t\t\n\t\t\tif ($i < 10){\n\t\t\t\t$i = \"0\".$i;\n\t\t\t}\n\t\t\t\n\t\t\t// input event into calendar\n\t\t\t$eventDay = $year.'-'.$month.'-'.$i;\n\t\t\t\tif(isset($events[$eventDay])) { // if there are events on $eventDay\n\t\t\t\t\tforeach($events[$eventDay] as $eventid) { // for each event, add to calendar\n\t\t\t\t\t\t$mysql = new mysql();\n\t\t\t\t\t\t$tripdetail = $mysql->get_specifictrip($eventid);\n\t\t\t\t\t\t$calendar.= '<div class=\"event\"';\n\t\t\t\t\t\tif($tripdetail[approval]==0){\n\t\t\t\t\t\t\t$calendar.=' style=\"color:#FF6666;\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($tripdetail[approval]==-1){\n\t\t\t\t\t\t\t$calendar.=' style=\"color:#6666E0; text-decoration:line-through;\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$calendar.='><a style=\"text-decoration:none; color:inherit;\" href=\"?page=detail2&trip='.$tripdetail[eventid].'\"';\n\t\t\t\t\t\t$calendar.='>'.$tripdetail[destination].'</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$calendar.='</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t$calendar.= '<p> </p><p> </p></div></td>';\n\t\t\t\t}\n\n\t\t\tif($startDay == 6){ // if the month starts on Saturday, end current row\n\t\t\t\t$calendar.= '</tr>';\n\t\t\t\tif(($counter+1) != $days){ // if there are still days left to fill, new row\n\t\t\t\t\t$calendar.= '<tr class=\"calendar-row\">';\n\t\t\t\t}\n\t\t\t\t$startDay = -1;\n\t\t\t\t$daysFilled = 0;\n\t\t\t}\n\t\t\t$daysFilled++;\n\t\t\t$startDay++;\n\t\t\t$counter++;\n\t\tendfor;\n\t\n\t\t// finish filling in the rest of the days with blanks\n\t\tif($daysFilled < 8 && $daysFilled !=1):\n\t\t\tfor($x = 1; $x <= (8 - $daysFilled); $x++):\n\t\t\t\t$calendar.= '<td class=\"calendar-empty\"> </td>';\n\t\t\tendfor;\n\t\tendif;\n\t\n\t\t// end row, table\n\t\t$calendar.= '</tr></table>';\n\t\t\n\t\t\n\t\t// return HTML code for calendar\n\t\treturn $calendar;\n\t}", "public function archive()\n\t{\n\t\t// --------------------------------------\n\t\t// Prep no_results to avoid conflicts\n\t\t// --------------------------------------\n\n\t\t$this->_prep_no_results();\n\n\t\t// --------------------------------------\n\t\t// Get the events\n\t\t// --------------------------------------\n\n\t\tif ( ! ($events = $this->_get_event_entries()))\n\t\t{\n\t\t\t$this->_log('No events found, returning no results');\n\t\t\treturn $this->EE->TMPL->no_results();\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Loop through events and add them to the months array\n\t\t// --------------------------------------\n\n\t\t$months = array();\n\n\t\tforeach ($events AS $event)\n\t\t{\n\t\t\t// Create Low Date objects from each date\n\t\t\t$start = new Low_date($event['start_date']);\n\t\t\t$end = new Low_date($event['end_date']);\n\n\t\t\t// Set both dates to the first of the month\n\t\t\t// and return the month url: YYYY-MM\n\t\t\t$start_month = $start->first_of_month()->month_url();\n\t\t\t$end_month = $end->first_of_month()->month_url();\n\n\t\t\t// If event starts and ends in the same month,\n\t\t\t// simply add it to the months array\n\t\t\tif ($start_month == $end_month)\n\t\t\t{\n\t\t\t\t$months[$start_month][] = $event['entry_id'];\n\t\t\t}\n\t\t\t// Or else add each spanning month to the months array\n\t\t\telse\n\t\t\t{\n\t\t\t\t// To do this, increase the start date by a month\n\t\t\t\t// until it exceeds the end month\n\t\t\t\twhile ($start->month_url() <= $end_month)\n\t\t\t\t{\n\t\t\t\t\t$months[$start->month_url()][] = $event['entry_id'];\n\t\t\t\t\t$start->add('month');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Sort the array by month\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('sort', 'asc') == 'asc')\n\t\t{\n\t\t\tksort($months);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tkrsort($months);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Create data array based on month\n\t\t// --------------------------------------\n\n\t\t$data = array();\n\n\t\tforeach ($months AS $month => $rows)\n\t\t{\n\t\t\t// Initiate new row for data\n\t\t\t$row = array(\n\t\t\t\t'month_url' => $month,\n\t\t\t\t'events_in_month' => count($rows)\n\t\t\t);\n\n\t\t\t// Create new date for this month\n\t\t\t$date = new Low_Date($month);\n\n\t\t\t// Add each possible format to this row\n\t\t\tforeach ($this->formats AS $fmt => $key)\n\t\t\t{\n\t\t\t\t$row[$key] = $date->ee_format($fmt);\n\t\t\t}\n\n\t\t\t// Then add the row to the data array\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\treturn $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $data);\n\n\t}", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "function InterpretCalendarFunctions(){\n //clean our inputs\n $this->CleanInputs();\n if(array_key_exists('presentmonth',$this->arrPOST) && array_key_exists('monthaction',$this->arrPOST)){\n //we're changing the month\n if($this->arrPOST['monthaction'] == 'next'){\n if($this->arrPOST['presentmonth'] == 12){\n $this->intMonth = 1;\n $this->intYear = ($this->arrPOST['presentyear'] + 1);\n }\n else\n $this->intMonth = ($this->arrPOST['presentmonth'] + 1);\n }\n else if($this->arrPOST['monthaction'] == 'previous'){\n if($this->arrPOST['presentmonth'] == 1){\n $this->intMonth = 12;\n $this->intYear = ($this->arrPOST['presentyear'] - 1);\n }\n else\n $this->intMonth = ($this->arrPOST['presentmonth'] - 1);\n }\n else{\n //load our previous values\n if((int)$this->arrPOST['presentmonth'] > 0)\n $this->intMonth = ($this->arrPOST['presentmonth']);\n if((int)$this->arrPOST['presentyear'] > 0)\n $this->intYear = ($this->arrPOST['presentyear']);\n }\n }\n else{//make our defaults\n if($this->intMonth === 0)\n $this->intMonth = date('m') ;\n if($this->intDay === 0)\n $this->intDay = date('j') ;\n }\n //execute our calendar actions\n if(array_key_exists('calendaraction',$this->arrPOST)){\n $arrCalendarData = json_decode($this->arrPOST['actiondata'],TRUE);\n //clean up our data\n $arrCalendarData = $this->CleanActionData($arrCalendarData);\n //execute\n if($this->arrPOST['calendaraction'] == 'comparedates'){\n $this->CompareDates($arrCalendarData);\n }\n if($this->arrPOST['calendaraction'] == 'adddates'){\n $this->AddSelectedDates($arrCalendarData);\n }\n if($this->arrPOST['calendaraction'] == 'nowtillthen'){\n $this->GetTheTillNow($arrCalendarData);\n }\n }\n }", "public static function __events () {\n \n }", "function __construct(vevent $event, $from_date, $to_date)\r\n {\r\n //$this_day = date('d', $from_date);\r\n //$this_month = date('m', $from_date);\r\n //$this_year = date('Y', $from_date);\r\n\r\n //For the list view\r\n $date = getdate();\r\n $date_unixtime = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);\r\n // TODO: List view needs to start today, not on the last selected date.\r\n// \t$from_date = ($date_unixtime + $to_date) / 2;\r\n \t$this_day = date('d', $from_date);\r\n $this_month = date('m', $from_date);\r\n $this_year = date('Y', $from_date);\r\n// \t$this_day = $date['mday'];\r\n// \t$this_month = $date['mon'];\r\n// \t$this_year = $date['year'];\r\n\r\n $start_month = $date['mon'] - 1;\r\n $start_year = $date['year'];\r\n $end_month = $this_month + 1;\r\n $end_year = $this_year;\r\n\r\n\r\n if ($this_month == 1)\r\n {\r\n $start_month = 12;\r\n $start_year --;\r\n }\r\n if ($this_month == 12)\r\n {\r\n $end_month = 1;\r\n $end_year ++;\r\n }\r\n\r\n $this->event = $event;\r\n $this->view_start = mktime(0, 0, 0, $start_month, 1, $start_year);\r\n $this->view_end = mktime(0, 0, 0, $end_month, 31, $end_year);\r\n\r\n if ($this->debug)\r\n {\r\n echo '<hr />';\r\n echo '<b>ICAL RECURRENCE</b>';\r\n echo '<hr />';\r\n echo '<table class=\"data_table\">';\r\n echo '<thead>';\r\n echo '<tr><th>Variable</td><th>Value</td>';\r\n echo '</thead>';\r\n echo '<tbody>';\r\n echo '<tr><td>Title</td><td>' . $this->event->summary['value'] . '</td>';\r\n echo '<tr><td>View begin</td><td>' . $this->view_start . ' (' . date('r', $this->view_start) . ')</td>';\r\n echo '<tr><td>View end</td><td>' . $this->view_end . ' (' . date('r', $this->view_end) . ')</td>';\r\n // echo '<tr><td>Event</td><td>';\r\n // echo '<pre>';\r\n // echo print_r($this->event, true);\r\n // echo '</pre>';\r\n // echo '</td>';\r\n // echo '</tr>';\r\n echo '</tbody>';\r\n echo '</table>';\r\n }\r\n }", "public function scopeEventsOfMonth(Builder $query, int $year, int $month) : Builder\n {\n return $query->whereMonth('starts_at', '=', $month)\n ->whereYear('starts_at', '=', $year)\n ->orderBy('starts_at', 'DESC');\n }", "public function getEvents($period='month', $filters=array())\n\t{\n\t\t$gid = (isset($filters['gid'])) ? intval($filters['gid']) : 0;\n\n\t\t// Build the query\n\t\tswitch ($period)\n\t\t{\n\t\t\tcase 'month':\n\t\t\t\t$select_date = $filters['select_date'];\n\t\t\t\t$select_date_fin = $filters['select_date_fin'];\n\n\t\t\t\t$sql = \"SELECT $this->_tbl.*\n\t\t\t\t\tFROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id\n\t\t\t\t\tAND (\n\t\t\t\t\t(\n\t\t\t\t\t\t\t(publish_up >= \" . $this->_db->quote($select_date . '%') . \" AND publish_up <= \" . $this->_db->quote($select_date_fin . '%') . \" AND publish_down IS NOT NULL AND publish_down != '0000-00-00 00:00:00')\n\t\t\t\t\t\tOR (publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down >= \" . $this->_db->quote($select_date . '%') . \" AND publish_down <= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($select_date . '%') . \" AND publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down <= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t\tOR (publish_up <= \" . $this->_db->quote($select_date . '%') . \" AND publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down >= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t)\n\t\t\t\t\tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . intval($filters['category']) . \")\" : \")\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\n\t\t\tcase 'year':\n\t\t\t\t$year = $filters['year'];\n\n\t\t\t\t// $sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t// \tWHERE $this->_tbl.catid = b.id\n\t\t\t\t// \tAND publish_up LIKE \" . $this->_db->quote($year . '%') . \" AND (publish_down >= \" . $this->_db->quote($year . '%') . \" OR publish_down = '0000-00-00 00:00:00' OR publish_down IS NULL)\n\t\t\t\t// \tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t// Change made by Archie to prevent wrong formatting of year\n\t\t\t\t$sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id\n\t\t\t\t\tAND publish_up LIKE \" . $this->_db->quote($year . '%') . \" AND (publish_down >= \" . $this->_db->quote($year . '-01-01 00:00:00') . \" OR publish_down = '0000-00-00 00:00:00' OR publish_down IS NULL)\n\t\t\t\t\tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . intval($filters['category']) : \"\";\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\t\t//$sql .= \" LIMIT \".$filters['start'].\", \".$filters['limit'];\n\t\t\tbreak;\n\n\t\t\tcase 'week':\n\t\t\t\t$startdate = $filters['startdate'];\n\t\t\t\t$enddate = $filters['enddate'];\n\n\t\t\t\t$sql = \"SELECT * FROM $this->_tbl\n\t\t\t\t\tWHERE ((publish_up >= \" . $this->_db->quote($startdate . '%') . \" AND publish_up <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($startdate . '%') . \" AND publish_down <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($startdate . '%') . \" AND publish_down <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($enddate . '%') . \" AND publish_up <= \" . $this->_db->quote($startdate . '%') . \"))\n\t\t\t\t\tAND state = '1'\";\n\n\t\t\t\t\t//did we pass in a scope filter\n\t\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//did we pass in a scope id filter\n\t\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql .= \"ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\n\t\t\tcase 'day':\n\t\t\t\t$select_date = $filters['select_date'];\n\t\t\t\t$select_date_fin = $filters['select_date_fin'];\n\n\t\t\t\t$sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id AND\n\t\t\t\t\t\t((publish_up >= \" . $this->_db->quote($select_date) . \" AND publish_up <= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($select_date) . \" AND publish_down <= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_up <= \" . $this->_db->quote($select_date) . \" AND publish_down >= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($select_date) . \" AND publish_down <= \" . $this->_db->quote($select_date_fin) . \"))\";\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . $filters['category'] : \"\";\n\t\t\t\t$sql .= \" AND $this->_tbl.state = '1'\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\t\t}\n\n\t\tif (isset($filters['limit']))\n\t\t{\n\t\t\tif (isset($filters['start']))\n\t\t\t{\n\t\t\t\t$sql .= \" LIMIT \" . $filters['start'] . \",\" . $filters['limit'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql .= \" LIMIT \" . $filters['limit'];\n\t\t\t}\n\t\t}\n\n\t\t$this->_db->setQuery($sql);\n\t\treturn $this->_db->loadObjectList();\n\t}", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function initEvent()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "public static function get_events_by_month($date, $limit = NULL, $offset = NULL)\n\t{\n\t\t//$month = ($month % 12 != -1) ? $month % 12 : 12;\n\t\n\t\t//$date = mktime(12, 0, 0, $month, 1, date('Y') + $year);\n\n\t\t$query = Jelly::select('event')\n\t\t ->where('status', '=', 'active')\n\t\t ->where('deleted', '=', NULL)\n\t\t ->where(DB::expr('MONTH(start_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(start_date)'), '=', date('Y', $date))\n\t\t ->or_where(DB::expr('MONTH(end_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(end_date)'), '=', date('Y', $date))\n\t\t ->order_by('start_date', 'ASC');\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\tif ($offset)\n\t\t{\n\t\t\t$query->offset($offset);\n\t\t}\t\t\n\t\n\t\treturn $query->execute();\n\t}", "function get_squarecandy_events_year_nav() {\n\tif ( wp_date( 'Y' ) === get_transient( 'squarecandy_events_year_archive_update' ) ) {\n\t\treturn false;\n\t}\n\n\t// needs updating\n\tupdate_squarecandy_archive_year_list();\n\n}", "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "public function get_calendar_data_spec(){\r\n\r\n if (Go_to::is_on_page(\"edit_calendar\")){\r\n \r\n $this->active_month = $_GET['month'];\r\n $this->active_year = $_GET['year']; \r\n \r\n \r\n }\r\n if (Go_to::is_on_page(\"calendar_submit\")){\r\n \r\n $this->active_month = $_SESSION['active_month'];\r\n $this->active_year = $_SESSION['active_year']; \r\n// echo \"MIJESECCCCCC \" . $this->active_month; \r\n \r\n }\r\n \r\n \r\n if (Go_to::is_on_page(\"print_calendar\")){\r\n $room_id = $_POST['room_id'];\r\n \r\n }\r\n \r\n \r\n }", "function submitted_events_calendar($submission) {\n\tif (submitted_events_starts_with ( $submission->brunelgroup, 'Joint' )) {\n\t\treturn array (\n\t\t\t\t23,\n\t\t\t\t24 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '20' )) {\n\t\treturn array (\n\t\t\t\t23 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '40' )) {\n\t\treturn array (\n\t\t\t\t24 \n\t\t);\n\t} else {\n\t\treturn array ();\n\t}\n}", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "public function get_test_scheduled_events()\n {\n }", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "public function viewEvents();", "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\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\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\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\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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 ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\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$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\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$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "public function viewAllEvents();", "function __construct($month)\n\t{\n\t\tforeach ($month as $date)\n\t\t{\n\t\t\t\n\t\t\t$this->schema[$date][0] = ShiftFactory::createShift($date , 0);\n\t\t\t$this->schema[$date][1] = ShiftFactory::createShift($date , 1);\n\t\t\t$this->schema[$date][2] = ShiftFactory::createShift($date , 2);\n\t\t\t$this->schema[$date][3] = ShiftFactory::createShift($date , 3);\n\t\t\t\n\t\t}\n\t}", "function filterprimary()\r\n\t{\t\r\n\t\t// make date and time variables\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t// take filter categories and do filtering\r\n\t\t$elements = json_decode( preg_replace('/[\\n\\r]+/', '\\n', JRequest::getVar( 'elements', '', 'post', 'string' ) ) );\r\n\t\t\r\n\t\t$categories = array();\r\n\t\tforeach($elements as $element)\r\n\t\t{\r\n\t\t\tif($element->checked && strpos ( $element->name , 'primary_cat_' ) !== false )\r\n\t\t\t{\r\n\t\t\t\t$categories[$element->name] = $element->value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$model->setState( 'filter_primary_categories', $categories );\r\n\t\t\r\n\t\t// order event instances by date and time\r\n\t\t$model->setState( 'order', 'tbl.eventinstance_date' );\r\n\t\t$model->setState( 'direction', 'ASC' );\r\n\t\t$query = $model->getQuery( );\r\n\t\t$query->order( 'tbl.eventinstance_start_time' );\r\n\t\t$model->setQuery( $query );\r\n\t\t\r\n\t\t// attach variables to the $vars object\r\n\t\t$vars->date = $date;\r\n\t\t$vars->items = $model->getList( );\r\n\t\t\r\n\t\t// echo output\r\n\t\t$html = $this->getLayout( 'default', $vars, 'three' ); \r\n\t\techo ( json_encode( array('msg'=>$html) ) );\r\n\t}", "public static function events();", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "function expDateCallback()\n {\n $months = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');\n $years = array('2012','2013','2014','2015','2016','2017','2018');\n \n if (in_array($_POST['exp_mon'], $months) && in_array($_POST['exp_yr'], $years)) {\n return true;\n }\n return false;\n }", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function month_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_start',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date',\n\t\t\t\t'default'\t=> 'year-01-01'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'date_range_end',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t=> 'limit',\n\t\t\t\t'required'\t=> FALSE,\n\t\t\t\t'type'\t\t=> 'integer',\n\t\t\t\t'default'\t=> 12\n\t\t\t)\n\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set(\n\t\t\t\t'date_range_end',\n\t\t\t\t$this->CDT->add_month($this->P->value('limit'))\n\t\t\t);\n\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = (\n\t\t\t$this->P->value('date_range_end', 'ymd') >\n\t\t\t\t$this->P->value('date_range_start', 'ymd')\n\t\t) ? 1 : -1;\n\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo\n\t\t{\n\t\t\t$vars['conditional']\t= array(\n\t\t\t\t'is_current_month'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t),\n\t\t\t\t'is_not_current_month'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year'] AND\n\t\t\t\t\t$this->CDT->month == $today['month']\n\t\t\t\t) ? FALSE : TRUE,\n\t\t\t\t'is_current_year'\t\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? TRUE : FALSE,\n\t\t\t\t'is_not_current_year'\t=>\t(\n\t\t\t\t\t$this->CDT->year == $today['year']\n\t\t\t\t) ? FALSE : TRUE\n\t\t\t);\n\n\t\t\t$vars['single']\t= array(\n\t\t\t\t'year'\t=> $this->CDT->year,\n\t\t\t\t'month'\t=> $this->CDT->month\n\t\t\t);\n\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'month'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_month($dir);\n\t\t\t$count++;\n\t\t}\n\t\twhile (\n\t\t\t$count < $this->P->value('limit') AND\n\t\t\t$this->CDT->ymd < $this->P->value('date_range_end', 'ymd')\n\t\t);\n\n\t\treturn $output;\n\t}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function onEvent();", "protected function addDaysForMonth(string $month, int $year, Event $event)\n {\n // we need this to have a date where time is set to 00:00:00\n $day = $this->dateTimeUtility->convert('today');\n $lastDayOfMonth = $this->dateTimeUtility->convert('today');\n $lastDayOfMonth->modify('last day of ' . $month . ' ' . (string)$year . ' 23:59:59');\n $dateToStartCalculatingFrom = $this->getDateToStartCalculatingFrom($event); // prevent from calling it multiple times in foreach\n $dateToStopCalculatingTo = $this->getDateToStopCalculatingTo($event); // prevent from calling it multiple times in foreach\n\n foreach ($event->getXth() as $xthIndex => $xth) {\n foreach ($event->getWeekday() as $weekdayIndex => $weekday) {\n if ($xth && $weekday) {\n // example: 'second wednesday of March 2013'\n $modifyString = $xthIndex . ' ' . $weekdayIndex . ' of ' . $month . ' ' . $year;\n $day->modify($modifyString);\n if ($day >= $dateToStartCalculatingFrom && $day < $lastDayOfMonth && $day <= $dateToStopCalculatingTo) {\n $this->addDayToStorage($day);\n }\n }\n }\n }\n }", "public function getEvents(array $filters = array());", "public function run()\n {\n $events = [\n [\n 'title' => 'Reuniao 01',\n 'start' => '2021-07-01',\n 'end' => '2021-07-03',\n ],\n [\n 'title' => 'Reuniao 02',\n 'start' => '2021-07-07',\n 'end' => '2021-07-010',\n ]\n ];\n }", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "public function __construct() {\r\n $this->setMode(self::$modeMonth);\r\n }", "private function make_calendar($year, $month){\n\t\t$first_of_month = gmmktime(0,0,0,$month,1,$year);\n\t\t#remember that mktime will automatically correct if invalid dates are entered\n\t\t# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998\n\t\t# this provides a built in \"rounding\" feature to generate_calendar()\n\t\n\t\t$day_names = array(); #generate all the day names according to the current locale\n\t\tfor($n=0,$t=(3+$this->firstDay)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday\n\t\t\t$day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name\n\t\n\t\tlist($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));\n\t\t$weekday = ($weekday + 7 - $this->firstDay) % 7; #adjust for $firstDay\n\t\t$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; #note that some locales don't capitalize month and day names\n\t\n\t\t#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03\n\t\t@list($p, $pl) = each($this->canonicals); @list($n, $nl) = each($this->canonicals); #previous and next links, if applicable\n\t\tif($p) $p = '<span class=\"calendar-prev\">'.($pl ? '<a href=\"'.htmlspecialchars($pl).'\">'.$p.'</a>' : $p).'</span>&nbsp;';\n\t\tif($n) $n = '&nbsp;<span class=\"calendar-next\">'.($nl ? '<a href=\"'.htmlspecialchars($nl).'\">'.$n.'</a>' : $n).'</span>';\n\t\t$calendar = '<table class=\"calendar\">'.\"\\n\".\n\t\t\t'<caption class=\"calendar-month\">'.$p.($this->monthLink ? '<a href=\"'.htmlspecialchars($this->monthLink).'\">'.$title.'</a>' : $title).$n.\"</caption>\\n<tr>\";\n\t\n\t\tif($this->dayNameLength){ #if the day names should be shown ($day_name_length > 0)\n\t\t\t#if day_name_length is >3, the full name of the day will be printed\n\t\t\tforeach($day_names as $d)\n\t\t\t\t$calendar .= '<th abbr=\"'.htmlentities($d).'\">'.htmlentities($this->dayNameLength < 4 ? substr($d,0,$this->dayNameLength) : $d).'</th>';\n\t\t\t$calendar .= \"</tr>\\n<tr>\";\n\t\t}\n\t\n\t\tif($weekday > 0) $calendar .= '<td colspan=\"'.$weekday.'\">&nbsp;</td>'; #initial 'empty' days\n\t\tfor($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){\n\t\t\tif($weekday == 7){\n\t\t\t\t$weekday = 0; #start a new week\n\t\t\t\t$calendar .= \"</tr>\\n<tr>\";\n\t\t\t}\n\t\t\tif(isset($this->days[$day]) and is_array($this->days[$day])){\n\t\t\t\t@list($link, $classes, $content) = $this->days[$day];\n\t\t\t\tif(is_null($content)) $content = $day;\n\t\t\t\t$calendar .= '<td'.($classes ? ' class=\"'.htmlspecialchars($classes).'\">' : '>').\n\t\t\t\t\t($link ? '<a href=\"'.htmlspecialchars($link).'\">'.$content.'</a>' : $content).'</td>';\n\t\t\t}\n\t\t\telse $calendar .= \"<td>$day</td>\";\n\t\t}\n\t\tif($weekday != 7) $calendar .= '<td colspan=\"'.(7-$weekday).'\">&nbsp;</td>'; #remaining \"empty\" days\n\t\n\t\treturn $calendar.\"</tr>\\n</table>\\n\";\n\t}", "public function __construct()\n {\n $timeStamp = time();\n $month = date('n', $timeStamp);\n $year = date('Y', $timeStamp);\n $this->calendarMonth = new CalendarMonth($month, $year);\n }", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "public function handleStoreDate($yearFrom,$monthFrom,$yearTo,$monthTo)\r\n {\r\n $session = $this->session->getSection('map');\r\n \r\n $session->dateFrom = array('Year'=>$yearFrom,'Month'=>$monthFrom);\r\n $session->dateTo = array('Year'=>$yearTo,'Month'=>$monthTo);\r\n \r\n $this->terminate();\r\n }", "public function buildMonth()\n\t{\n\t\t$this->orderedDays = $this->getDaysInOrder();\n\t\t\n\t\t$this->monthName = $this->months[ ltrim( $this->month, '0') ];\n\t\t\n\t\t// start of whichever month we are building\n\t\t$start_of_month = getdate( mktime(12, 0, 0, $this->month, 1, $this->year ) );\n\t\t\n\t\t$first_day_of_month = $start_of_month['wday'];\n\t\t\n\t\t$days = $this->startDay - $first_day_of_month;\n\t\t\n\t\tif( $days > 1 )\n\t\t{\n\t\t\t// get an offset\n\t\t\t$days -= 7;\n\t\t\t\n\t\t}\n\n\t\t$num_days = $this->daysInMonth($this->month, $this->year);\n\t\t// 42 iterations\n\t\t$start = 0;\n\t\t$cal_dates = array();\n\t\t$cal_dates_style = array();\n\t\t$cal_events = array();\n\t\twhile( $start < 42 )\n\t\t{\n\t\t\t// off set dates\n\t\t\tif( $days < 0 )\n\t\t\t{\n\t\t\t\t$cal_dates[] = '';\n\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t$cal_dates_data[] = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $days < $num_days )\n\t\t\t\t{\n\t\t\t\t\t// real days\n\t\t\t\t\t$cal_dates[] = $days+1;\n\t\t\t\t\tif( in_array( $days+1, $this->daysWithEvents ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = 'has-events';\n\t\t\t\t\t\t$cal_dates_data[] = $this->data[ $days+1 ];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$cal_dates_style[] = '';\n\t\t\t\t\t\t$cal_dates_data[] = '';\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// surplus\n\t\t\t\t\t$cal_dates[] = '';\n\t\t\t\t\t$cal_dates_style[] = 'calendar-empty';\n\t\t\t\t\t$cal_dates_data[] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// increment and loop\n\t\t\t$start++;\n\t\t\t$days++;\n\t\t}\n\t\t\n\t\t// done\n\t\t$this->dates = $cal_dates;\n\t\t$this->dateStyles = $cal_dates_style;\n\t\t$this->dateData = $cal_dates_data;\n\t}", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "function show_calendar_events()\n\t{\n\t\t$stats_html = \"\";\n\t\t\n\t\tif ($this->ipsclass->vars['show_birthdays'] or $this->ipsclass->vars['show_calendar'] )\n\t\t{\n\t\t\t$a = explode( ',', gmdate( 'Y,n,j,G,i,s', time() + $this->ipsclass->get_time_offset() ) );\n\t\t\n\t\t\t$day = $a[2];\n\t\t\t$month = $a[1];\n\t\t\t$year = $a[0];\n\t\t\t\n\t\t\t$birthstring = \"\";\n\t\t\t$count = 0;\n\t\t\t$users = array();\n\t\t\t\n\t\t\tif ( $this->ipsclass->vars['show_birthdays'] )\n\t\t\t{\n\t\t\t\tif ( is_array($this->ipsclass->cache['birthdays']) AND count( $this->ipsclass->cache['birthdays'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $this->ipsclass->cache['birthdays'] as $u )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $u['bday_day'] == $day and $u['bday_month'] == $month )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( $day == 28 && $month == 2 && !date(\"L\") )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $u['bday_day'] == \"29\" and $u['bday_month'] == $month )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$users[] = $u;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Spin and print...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\tforeach ( $users as $user )\n\t\t\t\t{\n\t\t\t\t\t$birthstring .= \"<a href='{$this->ipsclass->base_url}showuser={$user['id']}'>{$user['members_display_name']}</a>\";\n\t\t\t\t\t\n\t\t\t\t\tif ($user['bday_year'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$pyear = $year - $user['bday_year'];\n\t\t\t\t\t\t$birthstring .= \"(<b>$pyear</b>)\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$birthstring .= $this->sep_char.\"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Fix up string...\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$birthstring = preg_replace( \"/\".$this->sep_char.\"$/\", \"\", trim($birthstring) );\n\t\t\t\t\n\t\t\t\t$lang = $this->ipsclass->lang['no_birth_users'];\n\t\t\t\t\n\t\t\t\tif ($count > 0)\n\t\t\t\t{\n\t\t\t\t\t$lang = ($count > 1) ? $this->ipsclass->lang['birth_users'] : $this->ipsclass->lang['birth_user'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$count = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $this->ipsclass->vars['autohide_bday'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->birthdays( $birthstring, $count, $lang );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Are we viewing the calendar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($this->ipsclass->vars['show_calendar'])\n\t\t{\n\t\t\t$this->ipsclass->vars['calendar_limit'] = intval($this->ipsclass->vars['calendar_limit']) < 2 ? 1 : intval($this->ipsclass->vars['calendar_limit']);\n\t\t\t\n\t\t\t$our_unix = gmmktime( 0, 0, 0, $month, $day, $year);\n\t\t\t$max_date = $our_unix + ($this->ipsclass->vars['calendar_limit'] * 86400);\n\t\t\t$events = array();\n\t\t\t$show_events = array();\n\t\t\t\n\t\t\tif( $this->ipsclass->member['org_perm_id'] )\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['org_perm_id'] ) );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member_permission_groups = explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->member['g_perm_id'] ) );\n\t\t\t\t\n\t\t\t\tif( isset($this->ipsclass->member['mgroup_others']) AND $this->ipsclass->member['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->member['mgroup_others'] = $this->ipsclass->clean_perm_string($this->ipsclass->member['mgroup_others']);\n\t\t\t\t\t\n\t\t\t\t\t$mgroup_others = explode( \",\", $this->ipsclass->member['mgroup_others'] );\n\t\t\t\t\t\n\t\t\t\t\tif( count($mgroup_others) )\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach( $mgroup_others as $mgroup )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $mgroup )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_permission_groups = array_merge( $member_permission_groups, explode( \",\", $this->ipsclass->clean_perm_string( $this->ipsclass->cache['group_cache'][$mgroup]['g_perm_id'] ) ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_array($this->ipsclass->cache['calendar']) AND count( $this->ipsclass->cache['calendar'] ) )\n\t\t\t{\n\t\t\t\tforeach( $this->ipsclass->cache['calendar'] as $u )\n\t\t\t\t{\n\t\t\t\t\t$set_offset = 0;\n\n\t\t\t\t\tif( $u['event_timeset'] && !($u['event_recurring'] == 0 AND $u['event_unix_to']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$set_offset = isset($this->ipsclass->member['time_offset']) ? $this->ipsclass->member['time_offset'] * 3600 : 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$u['_unix_from'] = $u['event_unix_from'] - $set_offset;\n\t\t\t\t\t$u['_unix_to'] = $u['event_unix_to'] - $set_offset;\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Private?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_private'] == 1 and $this->ipsclass->member['id'] != $u['event_member_id'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['event_perms'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['event_perms'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($event_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $event_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Got calendar perms?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\n\t\t\t\t\tif ( $u['_perm_read'] != \"*\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$read_perms = explode( \",\", $this->ipsclass->clean_perm_string( $u['_perm_read'] ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$check = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( count($read_perms) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach( $read_perms as $mgroup_perm )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( in_array( $mgroup_perm, $member_permission_groups ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$check = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( !$check )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// In range?\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t\tif ( $u['event_recurring'] == 0 AND ( ( $u['event_unix_to'] >= $our_unix AND $u['event_unix_from'] <= $max_date )\n\t\t\t\t\t\tOR ( $u['event_unix_to'] == 0 AND $u['event_unix_from'] >= $our_unix AND $u['event_unix_from'] <= $max_date ) ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$u['event_activetime'] = $u['_unix_from'];\n\t\t\t\t\t\t$events[ str_pad( $u['event_unix_from'].$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t}\n\t\t\t\t\telseif( $u['event_recurring'] > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$cust_range_s = $u['event_unix_from'];\n\n\t\t\t\t\t\twhile( $cust_range_s < $u['event_unix_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( $cust_range_s >= $our_unix AND $cust_range_s <= $max_date )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$u['event_activetime'] = $cust_range_s;\n\t\t\t\t\t\t\t\t$events[ str_pad( $cust_range_s.$u['event_id'], 15, \"0\" ) ] = $u;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( $u['event_recurring'] == \"1\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 604800;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ( $u['event_recurring'] == \"2\" )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 18144000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cust_range_s += 31536000;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tksort($events);\n\t\t\t\n\t\t\tforeach( $events as $event )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Recurring?\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$c_time = '';\n\t\t\t\t$c_time = gmdate( 'j-F-y', $event['event_activetime'] );\n\t\t\t\t\n\t\t\t\t$show_events[] = \"<a href='{$this->ipsclass->base_url}act=calendar&amp;code=showevent&amp;calendar_id={$event['event_calendar_id']}&amp;event_id={$event['event_id']}' title='$c_time'>\".$event['event_title'].\"</a>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->lang['calender_f_title'] = sprintf( $this->ipsclass->lang['calender_f_title'], $this->ipsclass->vars['calendar_limit'] );\n\t\t\t\n\t\t\tif ( count($show_events) > 0 )\n\t\t\t{\n\t\t\t\t$event_string = implode( $this->sep_char.' ', $show_events );\n\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! $this->ipsclass->vars['autohide_calendar'] )\n\t\t\t\t{\n\t\t\t\t\t$event_string = $this->ipsclass->lang['no_calendar_events'];\n\t\t\t\t\t$stats_html .= $this->ipsclass->compiled_templates['skin_boards']->calendar_events( $event_string );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $stats_html;\n\t\n\t}", "public function actionApi($month = null, $year = null, $all = false){\n\t\treturn $this->_apiEvents(self::ALL_FILTER, $month, $year, $all);\n\t}", "function eventclass_program_billing()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function index()\n {\n $banner = array(\n 'title' => 'All Events',\n 'subtitle' => 'See what is going on our world.',\n );\n\n $today = Carbon::today()->toDateString();\n $events = Event::whereDate('event_date', '>=', $today)\n ->orderBy('event_date', 'asc');\n\n // Filter by url param\n if ($month = request('month')) {\n $events->whereMonth('event_date', Carbon::parse($month)->month);\n }\n\n if ($year = request('year')) {\n $events->whereYear('event_date', $year);\n }\n\n $events = $events->paginate(5);\n\n // Temporary\n $archives = Event::selectRaw('year(event_date) year, monthname(event_date) month, count(*) published')\n ->whereDate('event_date', '>=', $today)\n ->groupBy('year', 'month')\n ->orderByRaw('min(event_date) asc')\n ->get()\n ->toArray();\n\n return view('events.index', compact('banner','events', 'archives'));\n }", "public function getEvents();", "public function getEvents();", "public static function eventStatus()\n {\n return [\n 'abe' => 'Aberto',\n 'fec' => 'Fechado',\n 'can' => 'Cancelado'\n ];\n }", "public static function get_current_course_events($scope = \"month\", $startdate = null, $enddate = null) {\r\n\r\n global $course_id, $uid;\r\n // form date range condition\r\n $dateconditions = array(\"month\" => \"date_format(?t\".',\"%Y-%m\") = date_format(start,\"%Y-%m\")',\r\n \"week\" => \"YEARWEEK(?t,1) = YEARWEEK(start,1)\",\r\n \"day\" => \"date_format(?t\".',\"%Y-%m-%d\") = date_format(start,\"%Y-%m-%d\")');\r\n if (!is_null($startdate) && !is_null($enddate)) {\r\n $datecond = \" AND start >= ?t AND start <= ?t\";\r\n }\r\n elseif (!is_null($startdate)) {\r\n $datecond = \" AND \";\r\n $datecond .= (array_key_exists($scope, $dateconditions))? $dateconditions[$scope]: $dateconditions['month'];\r\n }\r\n else{\r\n $datecond = \"\";\r\n }\r\n $student_groups = array_map(function ($item) {\r\n return $item->group_id;\r\n }, Database::get()->queryArray('SELECT group_id\r\n FROM group_members, `group`\r\n WHERE group_id = `group`.id AND course_id = ?d AND user_id = ?d', $course_id, $uid));\r\n if (count($student_groups)) {\r\n $group_sql_template = 'OR group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n $group_sql_template2 = 'AND group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n } else {\r\n $group_sql_template = '';\r\n $group_sql_template2 = '';\r\n }\r\n // retrieve events from various tables according to user preferences on what type of events to show\r\n $q = '';\r\n $q_args = array();\r\n $q_args_templ = array($course_id);\r\n if (!is_null($startdate)) {\r\n $q_args_templ[] = $startdate;\r\n }\r\n if (!is_null($enddate)) {\r\n $q_args_templ[] = $enddate;\r\n }\r\n\r\n // agenda\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ag.start', $datecond);\r\n $q .= \"SELECT ag.id, ag.title, ag.start, date_format(ag.start, '%Y-%m-%d') startdate, ag.duration, date_format(addtime(ag.start, time(ag.duration)), '%Y-%m-%d %H:%i') `end`, content, 'course' event_group, 'event-info' class, 'agenda' event_type, c.code course \"\r\n . \"FROM agenda ag JOIN course c ON ag.course_id=c.id \"\r\n . \"WHERE ag.course_id =?d AND ag.visible = 1 \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n // big blue button\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'tc.start_date', $datecond);\r\n $q .= \"SELECT tc.id, tc.title, tc.start_date start, date_format(tc.start_date, '%Y-%m-%d') startdate, '00:00' duration, \"\r\n . \"date_format(addtime(tc.start_date, time('00:00:01')), '%Y-%m-%d %H:%i') `end`, tc.description content, 'course' event_group, 'event-info' class, 'teleconference' event_type, c.code course \"\r\n . \"FROM tc_session tc JOIN course c ON tc.course_id=c.id \"\r\n . \"WHERE tc.course_id =?d AND tc.active = '1' \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n\r\n // assignments\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ass.deadline', $datecond);\r\n $q .= \"SELECT ass.id, ass.title, ass.deadline start, date_format(ass.deadline, '%Y-%m-%d') startdate, '00:00' duration, date_format(addtime(ass.deadline, time('00:00:01')), '%Y-%m-%d %H:%i') `end`, concat(ass.description, '\\n', '(deadline: ', deadline, ')') content, 'deadline' event_group, 'event-important' class, 'assignment' event_type, c.code course \"\r\n . \"FROM assignment ass JOIN course c ON ass.course_id=c.id LEFT JOIN assignment_to_specific ass_sp ON ass.id=ass_sp.assignment_id \"\r\n . \"WHERE ass.course_id =?d AND ass.active = 1 \"\r\n . $dc .\r\n \"AND (assign_to_specific = 0 OR\r\n ass.id IN\r\n (SELECT assignment_id FROM assignment_to_specific WHERE user_id = ?d\r\n UNION\r\n SELECT assignment_id FROM assignment_to_specific\r\n WHERE group_id != 0 $group_sql_template2)\r\n )\";\r\n $q_args = array_merge($q_args, $q_args_templ, array($uid), $student_groups);\r\n\r\n // exercises\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ex.end_date', $datecond);\r\n $q .= \"SELECT ex.id, ex.title, ex.end_date start, date_format(ex.end_date, '%Y-%m-%d') startdate, '00:00' duration, date_format(addtime(ex.end_date, time('00:00:01')), '%Y-%m-%d %H:%i') `end`, concat(ex.description, '\\n', '(deadline: ', ex.end_date, ')') content, 'deadline' event_group, 'event-important' class, 'exercise' event_type, c.code course \"\r\n . \"FROM exercise ex JOIN course c ON ex.course_id=c.id LEFT JOIN exercise_to_specific ex_sp ON ex.id = ex_sp.exercise_id \"\r\n . \"WHERE ex.course_id = ?d AND ex.active = 1 \"\r\n . $dc\r\n . \"AND (assign_to_specific = 0 OR ex_sp.user_id = ?d $group_sql_template) \";\r\n $q_args = array_merge($q_args, $q_args_templ, array($uid), $student_groups);\r\n\r\n // requests\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'rfd.data', $datecond);\r\n $q .= \"SELECT req.id, concat(?s, req.title), concat(rfd.data, ' 08:00:00') start, rfd.data startdate, '00:00' duration, concat(rfd.data, ' 08:00:01') `end`, concat(req.description, '\\n', '(deadline: ', rfd.data, ')') content, 'course' event_group, 'event-info' class, 'request' event_type, c.code course \"\r\n . \"FROM request req JOIN course c ON req.course_id = c.id\r\n JOIN request_field_data rfd ON rfd.request_id = req.id\r\n JOIN request_field rf ON rf.id = rfd.field_id\r\n LEFT JOIN request_watcher rw ON req.id = rw.request_id\r\n WHERE req.course_id = ?d AND req.state NOT IN (?d, ?d)\r\n AND (req.creator_id = ?d OR rw.user_id = ?d) \"\r\n . $dc;\r\n $q_args = array_merge($q_args, [trans('langSingleRequest') . ': ', $course_id,\r\n REQUEST_STATE_LOCKED, REQUEST_STATE_CLOSED, $uid], $q_args_templ);\r\n\r\n if (empty($q))\r\n {\r\n return null;\r\n }\r\n $q .= \" ORDER BY start, event_type\";\r\n\r\n return Database::get()->queryArray($q, $q_args);\r\n\r\n\r\n }", "public function getMonthEvent(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t// sorts the events by number of votes\n\t\t$voteCount = array_column($events, 'vote_count');\n\t\tarray_multisort($voteCount, SORT_DESC, $events);\n\n\t\t// returns the event which have the most vote\n\t\treturn array_shift($events);\n\t}", "function drawCalendar($month, $year) {\n $first = mktime(0,0,0,$month,1,$year); // timestamp for first of the month\n $offset = date('w', $first); // what day of the week we start counting on\n $daysInMonth = date('t', $first);\n $monthName = date('F', $first);\n $weekDays = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');\n $eventDays = getEventDays($month, $year);\n \n // Start drawing calendar\n $out = \"<table id=\\\"myCalendar\\\">\\n\";\n $out .= \"<tr><th colspan=\\\"3\\\">$monthName $year</th></tr>\\n\";\n $out .= \"<tr>\";\n foreach ($weekDays as $wd) $out .= \"<td class=\\\"weekDays\\\">$wd</td>\\n\";\n\n\n // Previous month link\n $prevTS = strtotime(\"$year-$month-01 -1 month\"); // timestamp of the first of last month\n $pMax = date('t', $prevTS);\n $pDay = ($day > $pMax) ? $pMax : $day;\n list($y, $m) = explode('-', date('Y-m', $prevTS)); \n $pMax = date('t', $prevTS);\n $pDay = ($day > $pMax) ? $pMax : $day;\n list($y, $m) = explode('-', date('Y-m', $prevTS));\n echo \"<p>\";\n echo \"<a href=\\\"?year=$year&month=$m&day=$pDay\\\"><< Prev</a>\\n\";\n\n // Next month link\n $nextTS = strtotime(\"$year-$month-01 +1 month\");\n $nMax = date('t', $nextTS);\n $nDay = ($day > $nMax) ? $nMax : $day;\n list($y, $m) = explode('-', date('Y-m', $nextTS));\n echo \"<a href=\\\"?year=$y&month=$m&day=$nDay\\\">Next >></a>\\n\";\n echo \"</p>\";\n\n\n // Build Previous and Next Links from untitled-6\n //$previous_link = \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?date=\";\n //if($month == 1){\n // $previous_link .= mktime(0,0,0,12,$day,($year -1));\n //} else {\n // $previous_link .= mktime(0,0,0,($month -1),$day,$year);\n //}\n\n //$previous_link .= \"\\\"><< </a>\";\n\n //$next_link = \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?date=\";\n //if($month == 12){\n // $next_link .= mktime(0,0,0,1,$day,($year + 1));\n //} else {\n // $next_link .= mktime(0,0,0,($month +1),$day,$year);\n //}\n //$next_link .= \"\\\"> >></a>\";\n\n $i = 0;\n for ($d = (1 - $offset); $d <= $daysInMonth; $d++) {\n if ($i % 7 == 0) $out .= \"<tr>\\n\"; // Start new row\n if ($d < 1) $out .= \"<td class=\\\"nonMonthDay\\\"> </td>\\n\";\n else {\n if (in_array($d, $eventDays)) {\n $out .= \"<td class=\\\"monthDay\\\">\\n\";\n $out .= \"<a href=\\\"?year=$year&month=$month&day=$d\\\">$d</a>\\n\";\n $out .= \"</td>\\n\";\n } else $out .= \"<td class=\\\"monthDay\\\">$d</td>\\n\";\n }\n ++$i; // Increment position counter\n if ($i % 7 == 0) $out .= \"</tr>\\n\"; // End row on the 7th day\n }\n \n // Round out last row if we don't have a full week\n if ($i % 7 != 0) {\n for ($j = 0; $j < (7 - ($i % 7)); $j++) {\n $out .= \"<td class=\\\"nonMonthDay\\\"> </td>\\n\";\n }\n $out .= \"</tr>\\n\";\n }\n \n $out .= \"</table>\\n\";\n \n return $out;\n }", "function eventclass_student_attendance()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function IsMoonPhase() {\n switch($this->GetYear() . \"-\" . $this->GetMOnth() . \"-\" . $this->GetDay()) {\n case \"2015-01-20\":\n case \"2015-02-19\":\n case \"2015-03-20\":\n case \"2015-04-18\":\n case \"2015-05-18\":\n case \"2015-06-16\":\n case \"2015-07-16\":\n case \"2015-08-14\":\n case \"2015-09-13\":\n case \"2015-10-13\":\n case \"2015-11-11\":\n case \"2015-12-11\":\n return array(1, \"Nymåne\"); // new moon\n case \"2015-01-27\":\n case \"2015-02-25\":\n case \"2015-03-27\":\n case \"2015-04-26\":\n case \"2015-05-25\":\n case \"2015-06-24\":\n case \"2015-07-24\":\n case \"2015-08-22\":\n case \"2015-09-21\":\n case \"2015-10-20\":\n case \"2015-11-19\":\n case \"2015-12-18\":\n return array(3, \"Växande halvmåne\"); // first quarter moon\n case \"2015-01-05\":\n case \"2015-02-04\":\n case \"2015-03-05\":\n case \"2015-04-04\":\n case \"2015-05-04\":\n case \"2015-06-02\":\n case \"2015-07-02\":\n case \"2015-07-31\":\n case \"2015-08-29\":\n case \"2015-09-28\":\n case \"2015-10-27\":\n case \"2015-11-25\":\n case \"2015-12-25\":\n return array(5, \"Fullmåne\"); // full moon\n case \"2015-01-13\":\n case \"2015-02-12\":\n case \"2015-03-13\":\n case \"2015-04-12\":\n case \"2015-05-11\":\n case \"2015-06-09\":\n case \"2015-07-08\":\n case \"2015-08-07\":\n case \"2015-09-05\":\n case \"2015-10-04\":\n case \"2015-11-03\":\n case \"2015-12-03\":\n return array(7, \"Avtagande halvmåne\"); // third quarter moon\n default:\n return array(null, null);\n }\n }", "public function run()\n {\n $modalities = [\n 'Enduro',\n 'XCO',\n 'XC',\n 'Down Hill',\n 'Dirt',\n 'BMX',\n 'Bicicross',\n 'Contra Relógio',\n 'Speed',\n 'Infantil'\n ];\n\n\n foreach ($modalities as $modality) {\n EventModality::create(['name' => $modality]);\n }\n }", "private function generate_calendar($year, $month){\n\t\t// --- calculations\n\t\t$first_of_month = gmmktime(0,0,0,$month,1,$year);\n\t\t/* remember that mktime will automatically correct if invalid dates are entered\n\t\t for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998\n\t\t this provides a built in \"rounding\" feature to generate_calendar() */\n\t\n\t\t$day_names = array(); // generate all the day names according to the current locale\n\t\tfor($n=0,$t=(3+$this->firstDay)*86400; $n<7; $n++,$t+=86400) // January 4, 1970 was a Sunday\n\t\t\t$day_names[$n] = ucfirst(gmstrftime('%A',$t)); // %A means full textual day name\n\t\n\t\tlist($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));\n\t\t$weekday = ($weekday + 7 - $this->firstDay) % 7; // adjust for $firstDay\n\t\t$title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; // note that some locales don't capitalize month and day names\n\t\n\t\t// --- make calendar header\n\t\t@list($p, $pl) = each($this->canonicals); @list($n, $nl) = each($this->canonicals); // previous and next links, if applicable\n\t\tif($p) $p = '<div class=\"prev\">'.($pl ? '<a href=\"'.htmlspecialchars($pl).'\">'.$p.'</a>' : $p).'</div>&nbsp;';\n\t\tif($n) $n = '&nbsp;<div class=\"next\">'.($nl ? '<a href=\"'.htmlspecialchars($nl).'\">'.$n.'</a>' : $n).'</div>';\n\t\t$calendar = '<div class=\"calendar\"><div class=\"month\">'.$p.($this->monthLink ? '<a href=\"'.htmlspecialchars($this->monthLink).'\">'.$title.'</a>' : $title).$n.\"</div>\";\n\n\t\t// --- make days of the week titles\n\t\tif($this->dayNameLength){ //if the day names should be shown ($day_name_length > 0)\n\t\t\tforeach($day_names as $d)\n\t\t\t\t$calendar .= '<div class=\"box '.htmlentities($d).'\">'.htmlentities($this->dayNameLength < 4 ? substr($d,0,$this->dayNameLength) : $d).'</div>';\n\t\t\t$calendar .= '<br><div class=\"dom\">';\n\t\t}\n\n\t\t// --- make days of the month\n\t\tif($weekday > 0) $calendar .= '<div class=\"box offset'.$weekday.'\">&nbsp;</div>'; // initial 'empty' days\n\t\tfor($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){\n\t\t\tif($weekday == 7) $weekday = 0; // start a new week\n\n\t\t\tif(isset($this->days[$day]) and is_array($this->days[$day])){\n\t\t\t\t@list($link, $classes, $content) = $this->days[$day];\n\t\t\t\tif(is_null($content)) $content = $day;\n\t\t\t\t$calendar .= '<div class=\"box'.($classes ? ' '.htmlspecialchars($classes).'\">' : '\">').\n\t\t\t\t\t($link ? '<a href=\"'.htmlspecialchars($link).'\">'.$content.'</a>' : $content).'</div>';\n\t\t\t}\n\t\t\telse $calendar .= '<div class=\"box\">'.$day.'</div>';\n\t\t}\n\t\tif($weekday != 7) $calendar .= '<div class=\"box offset'.(7-$weekday).'\">&nbsp;</div>'; // remaining \"empty\" days\n\n\t\treturn $calendar.'<br class=\"clear\"/></div></div>';\n\t}", "public function status($state)\n {\n $this->view = 'aggregator/posts/index';\n $this->data['weeks'] = $this->post->get_week_numbers();\n $this->data['weeknumber'] = (isset($this->weeknumber)) ? $this->weeknumber : date('W');\n $this->data['posts'] = $this->post->aggregated_product($this->current_user, $this->data['weeknumber'], $state)->get_all();\n }", "abstract public function getEventName();", "function fh_augment_events_query($query)\r\r\n{\r\r\n\tif((($query->is_post_type_archive && $query->query['post_type'] == \"event\")\r\r\n\t\t\t|| ($query->is_archive && isset($query->query[\"event_categories\"])))\r\r\n\t\t&& (\r\r\n\t\t\t!is_admin() \r\r\n\t\t\t|| isset($query->query[\"event_filter\"]))\r\r\n\t\t)\r\r\n\t{\r\r\n\t\t// Modify the query to support comparison against current date\r\r\n\t\t$today = strtotime(date(\"Y-m-d\"));\r\r\n\t\t$tomorrow = ($today + (3600 * 24) - 1) . \"000\"; // One second shy of 24 hrs later...\r\r\n\t\t$today = $today . \"000\";\r\r\n\r\r\n\t\t$start_default = time();\r\r\n\t\tif(isset($query->query_vars[\"start_date\"]) && is_numeric($query->query_vars[\"start_date\"]))\r\r\n\t\t{\r\r\n\t\t\t$start_default = $query->query_vars[\"start_date\"];\r\r\n\t\t}\r\r\n\r\r\n\t\t$end_default = $start_default;\r\r\n\t\tif(isset($query->query_vars[\"end_date\"]) && is_numeric($query->query_vars[\"end_date\"]))\r\r\n\t\t{\r\r\n\t\t\t$end_default = $query->query_vars[\"end_date\"];\r\r\n\t\t}\r\r\n\r\r\n\t\t$first_of_month = strtotime(date(\"Y-m\", $start_default) . \"-01\");\r\r\n\t\tif(intval(date(\"m\", $start_default)) == 12)\r\r\n\t\t{\r\r\n\t\t\t$first_next_month = strtotime((date(\"Y\", $start_default) + 1) . \"-01-01\");\r\r\n\t\t}\r\r\n\t\telse\r\r\n\t\t{\r\r\n\t\t\t$first_next_month = strtotime(date(\"Y-\", $start_default) . (date(\"m\", $start_default) + 1) . \"-01\");\r\r\n\t\t}\r\r\n\r\r\n\t\t// \"upcoming\" is the default filter for the events archive:\r\r\n\t\tif((!isset($query->query['event_filter']) && !is_admin()) || (isset($query->query['event_filter']) && $query->query['event_filter'] == \"upcoming\"))\r\r\n\t\t{\r\r\n\t\t\t$meta_query = array(\r\r\n\t\t\t\t'relation' => 'OR',\r\r\n\t\t\t\tarray(\r\r\n\t\t\t\t\t'key' => slt_cf_field_key(\"event_date\"),\r\r\n\t\t\t\t\t'value' => $today,\r\r\n\t\t\t\t\t'type' => \"NUMERIC\",\r\r\n\t\t\t\t\t'compare' => '>='\r\r\n\t\t\t\t),\r\r\n\t\t\t\tarray(\r\r\n\t\t\t\t\t'key' => slt_cf_field_key(\"end_date\"),\r\r\n\t\t\t\t\t'value' => $today,\r\r\n\t\t\t\t\t'type' => \"NUMERIC\",\r\r\n\t\t\t\t\t'compare' => '>='\r\r\n\t\t\t\t)\r\r\n\t\t\t);\r\r\n\t\t\t$query->query_vars['meta_query'] = $meta_query;\r\r\n\t\t\t// Affect our sort order here:\r\r\n\t\t\tadd_filter('posts_clauses', \"fh_events_posts_clauses\");\r\r\n\t\t}\r\r\n\t\telse if($query->query['event_filter'] == \"month\")\r\r\n\t\t{\r\r\n\t\t\t// Prepare some parameters for use:\r\r\n\t\t\t$query->query_vars[\"_search_start\"] = $first_of_month;\r\r\n\t\t\t$query->query_vars[\"_search_end\"] = $first_next_month;\r\r\n\r\r\n\t\t\t// Getting a bit more aggressive here. Going to completely modify the WHERE and JOIN clauses.\r\r\n\t\t\tadd_filter(\"posts_clauses\", \"fh_events_search_clauses\", 10, 2);\r\r\n\t\t}\r\r\n\t\telse if($query->query['event_filter'] == \"range\")\r\r\n\t\t{\r\r\n\t\t\t$start_date = time();\r\r\n\t\t\tif(isset($query->query_vars[\"start_date\"]) && is_numeric($query->query_vars[\"start_date\"]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$start_date = $query->query_vars[\"start_date\"];\r\r\n\t\t\t}\r\r\n\t\t\t$end_date = $start_date;\r\r\n\t\t\tif(isset($query->query_vars[\"end_date\"]) && is_numeric($query->query_vars[\"end_date\"]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$end_date = $query->query_vars[\"end_date\"];\r\r\n\t\t\t\tif($end_date <= $start_date)\r\r\n\t\t\t\t{\r\r\n\t\t\t\t\t$end_date = $start_date;\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t// Temporary fix: add a day, minus a second, to the end date to get through the day:\r\r\n\t\t\t$end_date += (24*3600) - 1;\r\r\n\r\r\n\t\t\t$query->query_vars[\"_search_start\"] = $start_date;\r\r\n\t\t\t$query->query_vars[\"_search_end\"] = $end_date;\r\r\n\r\r\n\t\t\t// Getting a bit more aggressive here. Going to completely modify the WHERE and JOIN clauses.\r\r\n\t\t\tadd_filter(\"posts_clauses\", \"fh_events_search_clauses\", 10, 2);\r\r\n\t\t}\r\r\n\t}\r\r\n}", "public function buildCalendarList(){\n\t\t\n\t\t$first_day = $this->getFirstDay();\t\t\t\t\t\t//Determine what day of the week the month starts on\n\t\t$current_number_of_days = $this->getNumberOfDays();\t\t//Determine the number of days in the month\n\n\t\t$number_of_previous_days = $first_day;\t\t\t\t\t\t\t\t\t\t//Determine the number of days needed to complete the first week\n\t\t$prev_month_number_of_days = $this->getNumberOfDays($this->getMonth()-1); \t//Determine the number of days in the previous month\n\t\t\n\t\t$_SESSION['month'] = $this->getMonth();\n\t\t$_SESSION['year'] = $this->getYear();\n\t\t$_SESSION['view'] = 'list';\n\t\t\n\t\tob_start();?>\n <table border=\"0\" id=\"events_calendar\" class=\"calendar_list\">\n <?php echo $this->buildCalendarHead() ?>\n <tr>\n <td>\n <?php \n /*** CURRENT MONTH CELLS ***/\n $first_day = $this->getYear() . '-' . $this->getMonth() . '-01';\n $last_day = $this->getYear() . '-' . $this->getMonth() . '-' . $current_number_of_days;\n \n $object = $this->events_ob;\n $month_events = new $object();\n $month_events = $month_events->fetchAll(\"WHERE DATE(\" . $this->events_end_date_field . \") >= '\" . $first_day . \"' AND DATE(\" . $this->events_end_date_field . \") <= '\" . $last_day . \"'\", \"ORDER BY `\" . $this->events_end_date_field . \"` DESC\");\n \n if(count($month_events) > 0){\n for($day = 1; $day <= $current_number_of_days; $day++){\t\t//For each day in the current month\n $full_date = $this->getYear() . '-' . $this->getMonth() . '-' . $day;\n \n $events = $this->buildDayList($full_date);\t//get events for each day\n if(strlen(trim($events))){\n ?>\n <div class=\"day\">\n <?php echo $events; ?>\n </div>\n <?php\n }\n }\n }\n else{?>\n \t\t<h5><?php echo 'No events in ' . $this->getMonthName() . ' ' . $this->getYear();?></h5>\n <?php\n }\n ?> \n </td>\n </tr>\n </table>\n <?php\n return ob_get_clean();\n\t}", "function event_grid_view() {\n\tsp_calendar_grid();\n}", "public function Events($eventmask);", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "public function indexEvents(array $events, array $context = []): void;", "public function get_event_status()\n {\n return array(0 => 'undefined'//, 1 => 'due for approval'\n ,2 => 'confirmed', 3 => 'cancelled'//, 4 => 'delegated'\n ,10 => 'tentative', 11 => 'needs-action'\n );\n }" ]
[ "0.6175825", "0.6162063", "0.5841054", "0.58112425", "0.57283187", "0.5711853", "0.5703794", "0.56882274", "0.5682502", "0.5680761", "0.5651937", "0.54707706", "0.540894", "0.53920096", "0.5380182", "0.537313", "0.5363529", "0.53062934", "0.530338", "0.5268856", "0.5267212", "0.523075", "0.52115756", "0.5195593", "0.51595616", "0.5139849", "0.51374084", "0.50976163", "0.508921", "0.5082511", "0.5081209", "0.50780755", "0.50558776", "0.5043594", "0.5033303", "0.5001029", "0.49959183", "0.4989115", "0.4986919", "0.49794453", "0.4976646", "0.4976213", "0.49591345", "0.49422023", "0.4939465", "0.49382207", "0.49088943", "0.49071553", "0.4895575", "0.48825678", "0.4876087", "0.48724204", "0.48708194", "0.48699123", "0.48645625", "0.48627385", "0.48581645", "0.48578036", "0.48543793", "0.48531038", "0.48502323", "0.48400575", "0.4838191", "0.48325822", "0.48305076", "0.4829203", "0.48260367", "0.4825843", "0.4808035", "0.48065373", "0.4797945", "0.47973207", "0.4797005", "0.47936276", "0.4786247", "0.4783819", "0.47818223", "0.47678152", "0.47640082", "0.47581878", "0.47578552", "0.47522375", "0.47522375", "0.4750759", "0.47319", "0.47285685", "0.47242385", "0.4723124", "0.47211194", "0.47063816", "0.4699532", "0.4698193", "0.46940765", "0.46897936", "0.46891868", "0.46867615", "0.46866924", "0.46812272", "0.46723107", "0.46686307" ]
0.6700396
0
Events based on year, month, type and state.
public function yearMonthTypeState($year = null, $month = null, $type = null, $state = null) { return \App\Event::with('venue.city.states') ->whereHas('venue.city.states', function ($query) use ($state) { $query->where('abbr', strtoupper($state)); }) ->whereYear('start_date', $year) ->whereMonth('start_date', $month) ->where('type', $type) ->orderby('start_date', 'asc') ->paginate($this->paginate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function yearTypeState($year = null, $type = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function yearMonthState($year = null, $month = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}", "public function filter_event() {\n\t\tif ( isset( $_POST['campus'] ) && isset( $_POST['month'] ) && isset( $_POST['year'] ) ) {\n\t\t\tTribeEventsQuery::init();\n\n\t\t\t$event_args = array(\n\t\t\t\t'eventDisplay' => 'upcoming',\n\t\t\t\t'post_type' => 'tribe_events',\n\t\t\t\t'posts_per_page' => 10,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t);\n\n\t\t\tif ( '0' !== $_POST['month'] ) {\n\t\t\t\tif ( (int) $_POST['month'] >= (int) date( 'n' ) ) {\n\t\t\t\t\t$event_args['eventDisplay'] = 'monthly';\n\t\t\t\t} else {\n\t\t\t\t\t$event_args['eventDisplay'] = 'past';\n\t\t\t\t}\n\n\t\t\t\t$startdate = $_POST['year'] .'-'. $_POST['month'] . '-01 01:00:00';\n\t\t\t\tif ( $_POST['month'] === '12' ) {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. $_POST['month'] . '-31 23:00:00';\n\t\t\t\t} else {\n\t\t\t\t\t$enddate = $_POST['year'] .'-'. ( $_POST['month'] + 1 ) . '-01 01:00:00';\n\t\t\t\t}\n\n\t\t\t\t$event_args['meta_query'] = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $startdate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '>='\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => '_EventStartDate',\n\t\t\t\t\t\t'value' => $enddate,\n\t\t\t\t\t\t'type' => 'DATETIME',\n\t\t\t\t\t\t'compare' => '<'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( '0' !== $_POST['campus'] ) {\n\t\t\t\t$event_args['ctrs-campus'] = sanitize_text_field( $_POST['campus'] );\n\t\t\t}\n\n\t\t\tif ( '0' === $_POST['month'] ) {\n\t\t\t\t$event_query = TribeEventsQuery::getEvents( $event_args, true );\n\t\t\t} else {\n\t\t\t\t$event_query = new WP_Query( $event_args );\n\t\t\t}\n\n\t\t\tglobal $wp_query, $post;\n\t\t\t$wp_query = $event_query;\n\t\t\tif ( ! empty( $event_query->posts ) ) {\n\t\t\t\t$post = $event_query->posts[0];\n\t\t\t}\n\n\t\t\tob_start();\n\n\t\t\tif ( have_posts() ) { ?>\n\t\t\t\t<div class=\"events-container\">\n\t\t\t\t\t<!-- Notices -->\n\t\t\t\t\t<?php tribe_events_the_notices() ?>\n\n\t\t\t\t\t<!-- Events Loop -->\n\t\t\t\t\t<?php if ( have_posts() ) : ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_before_loop' ); ?>\n\t\t\t\t\t\t<?php tribe_get_template_part( 'list/loop' ) ?>\n\t\t\t\t\t\t<?php do_action( 'tribe_events_after_loop' ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</div>\n\t\t\t<?php } else { ?>\n\t\t\t\t<div class=\"tribe-events-notices\"><ul><li>There were no results found.</li></ul></div>\n\t\t\t<?php }\n\n\t\t\t$filtered_events = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\twp_reset_postdata();\n\n\t\t\techo $filtered_events;\n\t\t\tdie();\n\t\t} else {\n\t\t\tdie();\n\t\t}\n\t}", "function setEvent($year,$month,$day,$id=false,$url=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n\tif (!$id) $id=$this->cssEvent;\n$this->calEvents[$eventTime]=$id;\n$this->calEventsUrl[$eventTime]=$url;\n}", "public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function buildCalendar($month, $year);", "function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }", "public function actionMonthData()\n {\n $this->requireAjaxRequest();\n $this->requirePostRequest();\n\n $dateRangeStart = craft()->request->getPost('dateRangeStart');\n $dateRangeEnd = craft()->request->getPost('dateRangeEnd');\n $calendars = craft()->request->getPost('calendars', null);\n $nonEditable = craft()->request->getPost('nonEditable');\n $locale = craft()->request->getPost('locale', null);\n\n $criteria = array(\n 'dateRangeStart' => $dateRangeStart,\n 'dateRangeEnd' => $dateRangeEnd,\n );\n\n $calendarIds = null;\n if ($calendars) {\n if ($calendars !== '*') {\n $criteria['calendarId'] = explode(',', $calendars);\n }\n } else if (null !== $calendars) {\n $criteria['calendarId'] = -1;\n }\n\n /** @var Calendar_EventsService $eventsService */\n $eventsService = craft()->calendar_events;\n\n if (craft()->isLocalized()) {\n $criteria['locale'] = $locale ?: craft()->language;\n }\n\n // Check settings if disabled events should be shown\n\n /** @var Calendar_SettingsService $settings */\n $settings = craft()->calendar_settings;\n if ($settings->showDisabledEvents()) {\n $criteria['status'] = null;\n }\n\n $eventList = $eventsService->getEventList($criteria);\n $simpleEvents = $eventList->getEventsAsSimpleObject();\n\n if ($nonEditable) {\n foreach ($simpleEvents as $event) {\n $event->editable = false;\n }\n }\n\n $this->returnJson($simpleEvents);\n }", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }", "public function events_calendar_query($month = 1, $year = 2010)\n\t{\n\t\t$this->events = $this->_process(\"http://tigedealers.com/month_events_api/$year/$month\");\n\t\t\n\t\tif($this->events):\n\t\t\t$this->result = simplexml_load_string($this->events);\n\t\telse:\n\t\t\t$this->result = array(array(\"text\" => \"Trouble on the western front\"));\n\t\tendif;\n\t\t\n\t\t$this->month = $month;\n\t\t$this->year = $year;\n\t\t\n\t\t$this->_get_calendar_array();\n\t}", "public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "function calendar_events($events, $YEAR, $MONTH_START, $DAY_START, $WEEKENDS, $MONTH_END, $DOW, $OVERRIDE, $BOX) {\n $results = array('year'=>$YEAR, 'month_start'=>$MONTH_START, 'month_end'=>$MONTH_END, 'box'=>$BOX);\n $results_counter = array();\n $POSDOW = array(0 => 'sun', 1 => 'mon', 2 => 'tue', 3 => 'wed', 4 => 'thu', 5 => 'fri', 6 => 'sat', 7 => 'sun');\n for($month=$MONTH_START; $month <= $MONTH_END; $month++) {\n $month_len = cal_days_in_month(CAL_GREGORIAN, $month, $YEAR);\n $month_name = cal_info(0);\n $month_name = $month_name['months'][$month];\n $first = date(\"w\", mktime(0, 0, 0, $month, 1, $YEAR));\n for($day=1; $day <= $month_len; $day++) {\n $day_type = '';\n $day_num = '';\n $force_day = False;\n if ($month == $MONTH_START && $day < $DAY_START) {\n } elseif (isset($OVERRIDE[$month][$day])) {\n $day_type = $OVERRIDE[$month][$day];\n $force_day = True;\n } elseif (isset($DOW[$POSDOW[$first]])) {\n $day_type = $DOW[$POSDOW[$first]];\n }\n if ($day_type != '') {\n if (isset($events[$day_type])) {\n if (!isset($results_counter[$day_type])) {\n $results_counter[$day_type] = 1;\n } else {\n $results_counter[$day_type]++;\n }\n }\n if (isset($events[$day_type]) && isset($events[$day_type][$results_counter[$day_type]])) {\n $event = $events[$day_type][$results_counter[$day_type]];\n $day_num = $results_counter[$day_type];\n } else {\n $event = array();\n }\n if ($force_day || !empty($event)) {\n $results[$month][$day] = array('month'=>$month, 'day'=>$day, 'type'=>$day_type, 'type_num'=>$day_num, 'dow'=>$first, 'dow_eng'=>$POSDOW[$first], 'event'=>$event);\n }\n }\n $first++;\n if ($first == 7) {$first = 0;}\n }\n }\n return $results;\n }", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function month()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array('categories', 'category_fields', 'custom_fields', 'member_data', 'pagination', 'trackbacks');\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'enable',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'allowed_values' => $disable\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'first_day_of_week',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'start_date_segment',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 3\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Need to modify the starting date?\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = $this->P->value('first_day_of_week');\n\n\t\tif ($this->P->value('date_range_start') === FALSE)\n\t\t{\n\t\t\tif ($this->P->value('start_date_segment') AND ee()->uri->segment($this->P->value('start_date_segment')) AND strstr(ee()->uri->segment($this->P->value('start_date_segment')), '-'))\n\t\t\t{\n\t\t\t\tlist($year, $month) = explode('-', ee()->uri->segment($this->P->value('start_date_segment')));\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($year, $month, 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start', 'day') != 1)\n\t\t{\n\t\t\t$this->P->params['date_range_start']['value'] = $this->CDT->change_date($this->P->value('date_range_start', 'year'), $this->P->value('date_range_start', 'month'), 1);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->P->set('date_range_end', $this->CDT->add_day($this->CDT->days_in_month($this->P->value('date_range_start', 'month'), $this->P->value('date_range_start', 'year')) - 1));\n\t\t$this->P->set('pad_short_weeks', TRUE);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\t'EVENTS_PLACEHOLDER',\n\t\t\t\t\t\t'{/',\n\t\t\t\t\t\t'{',\n\t\t\t\t\t\t'}'\n\t\t\t\t\t\t);\n\t\t$replace = array(\tee()->TMPL->tagdata,\n\t\t\t\t\t\t\tLD.T_SLASH,\n\t\t\t\t\t\t\tLD,\n\t\t\t\t\t\t\tRD\n\t\t\t\t\t\t\t);\n\t\tee()->TMPL->tagdata = str_replace($find, $replace, $this->view('month.html', array(), TRUE, $this->sc->addon_theme_path.'templates/month.html'));\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_week'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_month'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_month'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day_of_week'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day_of_week'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "function _registration_open( $event_month, $event_year ){\n $open_month = ((floor(($event_month + 1) / 2) - 1) * 2) + (12 - floor(($event_month + 9) / 12) * 12);\n $open_year = $event_year + floor (($event_month + 9) / 12) - 1;\n $open_time = mktime( 0, 0, 0, $open_month, 1, $open_year);\n return $open_time < time();\n }", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function process(){\n echo \"Selected process current YEAR \\n\";\n $this->startDate = date(\"Y-01-01 H:i:s\");\n $this->endDate = date(\"Y-12-t H:i:s\");\n $this->printDates();\n $this->runDates();\n }", "public function eventsAction()\n {\n $year = $this->params()->fromQuery('year', date('Y'));\n $container = $this->getEvent()->getApplication()->getServiceManager();\n $adapter = $container->get('Application\\Service\\Adapter');\n $sql = \"SELECT * FROM events WHERE event_date LIKE ? ORDER BY event_date\";\n $events = $adapter->query($sql, Adapter::QUERY_MODE_PREPARE);\n $events->execute([$year . '%']);\n return new ViewModel(['events' => $events, 'year' => $year]);\n }", "function _getCalendarData( $year, $month, $day){\t\t\t\t\n\t\t$rows = $this->_listIcalEventsByMonth( $year, $month);\n \t\t\n\t\t$rowcount = count( $rows );\t\t\n\t\t$data = array();\n\t\t$data['year'] = $year;\n\t\t$data['month'] = $month;\n\t\t$month = intval($month);\n\t\tif( $month <= '9' ) {\n\t\t\t$month = '0' . $month;\n\t\t}\n\t\t$data['startday'] = $startday = (int) EventBookingHelper::getConfigValue('calendar_start_date');\t\t\n\t\t// get days in week\n\t\t$data[\"daynames\"] = array();\n\t\tfor( $i = 0; $i < 7; $i++ ) {\n\t\t\t$data[\"daynames\"][$i] = $this->_getDayName(($i+$startday)%7, true );\n\t\t}\t\t\n\t\t$data[\"dates\"]=array();\t\t\n\t\t//Start days\n\t\t$start = (( date( 'w', mktime( 0, 0, 0, $month, 1, $year )) - $startday + 7 ) % 7 );\t\t\n\t\t// previous month\n\t\t$priorMonth = $month-1;\n\t\t$priorYear = $year;\t\t\n\t\tif ($priorMonth <= 0) {\n\t\t\t$priorMonth += 12;\n\t\t\t$priorYear -= 1;\n\t\t}\t\t\t\n\t\t$dayCount=0;\n\t\tfor( $a = $start; $a > 0; $a-- ){\n\t\t\t$data[\"dates\"][$dayCount] = array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"] = \"prior\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"] = $priorMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"] = $priorYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay'] = 0;\n\t\t\t$dayCount++;\n\t\t}\n\t\tsort($data[\"dates\"]);\n\t\t//Current month\n\t\t$end = date( 't', mktime( 0, 0, 0,( $month + 1 ), 0, $year ));\n\t\tfor( $d = 1; $d <= $end; $d++ ){\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t// utility field used to keep track of events displayed in a day!\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"current\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$month;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$year;\t\t\n\t\t\t\t\t\t\n\t\t\t$t_datenow = $this->_getNow();\n\t\t\t$now_adjusted = $t_datenow->toUnix(true);\n\t\t\tif( $month == strftime( '%m', $now_adjusted)\n\t\t\t&& $year == strftime( '%Y', $now_adjusted)\n\t\t\t&& $d == strftime( '%d', $now_adjusted)) {\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=true;\n\t\t\t}else{\n\t\t\t\t$data[\"dates\"][$dayCount][\"today\"]=false;\n\t\t\t}\n\t\t\t$data[\"dates\"][$dayCount]['d']=$d;\t\t\t\t\t\t\n\t\t\t$data[\"dates\"][$dayCount]['events'] = array();\n\t\t\tif( $rowcount > 0 ){\n\t\t\t\tforeach ($rows as $row) {\n\t\t\t\t\t\t$date_of_event = explode('-',$row->event_date);\n\t\t\t\t\t\t$date_of_event = (int)$date_of_event[2];\t\t\t\t\t\t\n\t\t\t\t\t\tif ($d == $date_of_event ){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=count($data[\"dates\"][$dayCount]['events']);\n\t\t\t\t\t\t\t$data[\"dates\"][$dayCount]['events'][$i] = $row;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t$dayCount++;\n\t\t}\t\n \t\n\t\t// followmonth\n\t\t$days \t= ( 7 - date( 'w', mktime( 0, 0, 0, $month + 1, 1, $year )) + $startday ) %7;\n\t\t$d\t\t= 1;\n\t\t$followMonth = $month+1;\n\t\t$followYear = $year;\n\t\tif ($followMonth>12) {\n\t\t\t$followMonth-=12;\n\t\t\t$followYear+=1;\n\t\t}\n\t\t$data[\"followingMonth\"]=array();\n\t\tfor( $d = 1; $d <= $days; $d++ ) {\n\t\t\t$data[\"dates\"][$dayCount]=array();\n\t\t\t$data[\"dates\"][$dayCount][\"monthType\"]=\"following\";\n\t\t\t$data[\"dates\"][$dayCount][\"month\"]=$followMonth;\n\t\t\t$data[\"dates\"][$dayCount][\"year\"]=$followYear;\n\t\t\t$data[\"dates\"][$dayCount]['countDisplay']=0;\n\t\t\t$dayCount++;\n\t\t}\n\t\treturn $data;\t\t\n\t}", "public function calendar($year_month = null) {\n\n if(!isset($year_month)) {\n /* Setting the data and creating the first and last day of a month */\n $start_date = date('Y-m-01');\n $end_date = date('Y-m-t');\n }\n else {\n /* Getting the data and creating the first and last day of a month */\n $start_date = date('Y-m-d', strtotime($year_month.'-01'));\n $end_date = date('Y-m-t', strtotime($year_month.'-01'));\n }\n\n /* Querying the database to get the events for all days of certain month of the year */\n $calendar = [];\n $activities = [];\n while($start_date <= $end_date) {\n\n //Temporalmente, pedido por Amparo, ¿Qué te dije?, igual y mañana se queja de que se ven los eventos sin aprobar :P\n /*\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ? and (dci_status = ? or dci_status = ?) and user_status = ?',\n array($start_date, $start_date, 'En Proceso', 'Aprobado', 'Activo'))\n ->orderBy('time')->get();\n */\n $events = EventDCI::whereRaw('end_day >= ? and start_day <= ?',\n array($start_date, $start_date))\n ->orderBy('time')->get();\n\n $activities['activities'] = $events->toArray();\n\n //ola k ase\n $activities['date'] = $start_date;\n\n array_push($calendar, $activities);\n $activities = [];\n\n $next_date = new DateTime($start_date);\n $next_date->add(new DateInterval('P1D'));\n $s_next_date = $next_date->format('Y-m-d');\n $start_date = explode(' ', $s_next_date)[0];\n }\n\n return json_encode($calendar);\n\n }", "public function initEvent()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "public function addEvent($ev){\n if(date('m',$ev->timestamp)==$this->monthNum){\n if(date('Y',$ev->timestamp)==$this->yearNum){\n $d = date('j',$ev->timestamp);\n $this->days[$d-1]->addEvent($ev);\n }\n }\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "function GetEvent($date, $id_country = 0, $id_region = 0, $id_city = 0, $type = 0, $my_events = false){\n\tglobal $lang, $config, $config_index, $smarty, $dbconn, $user;\n\n\t$filter = $table = \"\";\n\tif ($id_country)$filter .= \" AND a.id_country = \".$id_country;\n\tif ($id_region)\t$filter .= \" AND a.id_region = \".$id_region;\n\tif ($id_city)\t$filter .= \" AND a.id_city = \".$id_city;\n\tif ($type)\t\t$filter .= \" AND a.type = \".$type;\n\n\tif ($my_events) {\n\t\t$table = \", \".EVENT_USERS_TABLE.\" b \";\n\t\t$filter .= \" AND a.id = b.id_event AND b.id_user = \".$user[ AUTH_ID_USER ];\n\t}\n\n\t$strSQL = \"SELECT a.id, a.event_name, a.id_creator FROM \".EVENT_DESCR_TABLE.\" a\".$table.\"\n\t\tWHERE (\t(a.periodicity = 'none' AND DATE_FORMAT(a.start_date,'%Y-%m-%d') = DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'daily' AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'weekly' AND DAYOFWEEK(a.start_date) = DAYOFWEEK('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'monthly' AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\n\t\t\tOR (a.periodicity = 'yearly' AND MONTH(a.start_date) = MONTH('\".$date.\"') AND DAYOFMONTH(a.start_date) = DAYOFMONTH('\".$date.\"') AND (DATE_FORMAT('\".$date.\"','%Y-%m-%d') <= a.die_date OR a.die_date = '0000-00-00') AND DATE_FORMAT(a.start_date,'%Y-%m-%d') <= DATE_FORMAT('\".$date.\"','%Y-%m-%d'))\t)\".$filter;\n\t$rs = $dbconn->Execute($strSQL);\n\t$num_records = $rs->RowCount();\n\tif($num_records>0){\n\t\t$event[\"event_count\"] = $num_records;\n\t\t$i = 0;\n\t\twhile(!$rs->EOF){\n\t\t\t$row = $rs->GetRowAssoc(false);\n\t\t\t$event[\"event\"][$i][\"id_event\"] = $row[\"id\"];\n\t\t\tif (strlen($row[\"event_name\"])<10) {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t} else {\n\t\t\t\t$event[\"event\"][$i][\"name\"] = stripslashes(substr($row[\"event_name\"],0,10).\"...\");\n\t\t\t}\n\t\t\t$event[\"event\"][$i][\"full_name\"] = stripslashes($row[\"event_name\"]);\n\t\t\t$i++;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $event;\n\t} else {\n\t\treturn '';\n\t}\n}", "private function _get_calendar_array()\n\t{\n\t $this->all_events = $this->result->xpath(\".//event\");\n\t \n\t foreach($this->all_events as $an_event):\n\t $start_at = $an_event->xpath(\"./start-at\");\n \t $start_at = $start_at[0];\n \t $end_at = $an_event->xpath(\"./end-at\");\n \t $end_at = $end_at[0];\n \t \n \t $start_at = new DateTime($start_at);\n \t $start_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $start_at->setTime(0, 0, 0);\n \t $end_at = new DateTime($end_at);\n \t $end_at->setTimezone(new DateTimeZone('America/Chicago'));\n \t $end_at->setTime(0, 0, 0);\n \t \n \t $start_timestamp = strtotime($start_at->format('Y-m-d'));\n $end_timestamp = strtotime($end_at->format('Y-m-d'));\n \n $start_year = date(\"Y\", $start_timestamp);\n $end_year = date(\"Y\", $end_timestamp);\n $start_month = date(\"m\", $start_timestamp);\n $end_month = date(\"m\", $end_timestamp);\n $start_day = date(\"d\", $start_timestamp);\n $start_day = $start_day + 1;\n $end_day = date(\"d\", $end_timestamp);\n $end_day = $end_day + 1;\n \n if(($start_year == $this->year && $start_month == $this->month) || ($end_year == $this->year && $end_month == $this->month)):\n if($start_year == $end_year):\n if($start_month == $end_month):\n $this->_calendar_array_one($start_day, $end_day);\n else:\n if($end_month != $this->month):\n $this->_calendar_array_two($start_day);\n else:\n $this->_calendar_array_three($end_day);\n endif;\n endif;\n endif;\n endif;\n endforeach;\n \n\t foreach($this->callinks as $callinks):\n\t foreach($callinks as $key => $value):\n\t $this->combined_callinks[\"$key\"] = $value;\n\t endforeach;\n\t endforeach;\n\t}", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "public static function __events () {\n \n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\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\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\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\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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\n\t\t\t\t\t\t\t// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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 ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\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$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\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$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\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$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "function getEvents(){\n \n $query = \"SELECT *\n FROM \" . $this->table_name . \"\n WHERE \n MONTH(date) = MONTH(NOW()) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 0, 12, MONTH(NOW()) - 1) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 13, 1, MONTH(NOW()) + 1) \n ORDER BY date DESC\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n \n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function findEvents($url=array()) {\n\t\t$events = $this->find('all',array('conditions'=>array('YEAR(date)='.$url['year'].' AND MONTH(date)='.$url['month']),'recursive'=>2));\n\t\tif ($url['tag'] != 'all') {\n\t\t\t$events = $this->findEventsByTag($events,$url['tag']);\n\t\t}\n\t\t\n\t\tif ($url['calendar'] != 'all' && $url['tag'] == 'all') {\n\t\t\t$events = $this->findEventsByCalendar($events,$url['calendar']);\n\t\t}\n\t\treturn $events;\n\t}", "function InterpretCalendarFunctions(){\n //clean our inputs\n $this->CleanInputs();\n if(array_key_exists('presentmonth',$this->arrPOST) && array_key_exists('monthaction',$this->arrPOST)){\n //we're changing the month\n if($this->arrPOST['monthaction'] == 'next'){\n if($this->arrPOST['presentmonth'] == 12){\n $this->intMonth = 1;\n $this->intYear = ($this->arrPOST['presentyear'] + 1);\n }\n else\n $this->intMonth = ($this->arrPOST['presentmonth'] + 1);\n }\n else if($this->arrPOST['monthaction'] == 'previous'){\n if($this->arrPOST['presentmonth'] == 1){\n $this->intMonth = 12;\n $this->intYear = ($this->arrPOST['presentyear'] - 1);\n }\n else\n $this->intMonth = ($this->arrPOST['presentmonth'] - 1);\n }\n else{\n //load our previous values\n if((int)$this->arrPOST['presentmonth'] > 0)\n $this->intMonth = ($this->arrPOST['presentmonth']);\n if((int)$this->arrPOST['presentyear'] > 0)\n $this->intYear = ($this->arrPOST['presentyear']);\n }\n }\n else{//make our defaults\n if($this->intMonth === 0)\n $this->intMonth = date('m') ;\n if($this->intDay === 0)\n $this->intDay = date('j') ;\n }\n //execute our calendar actions\n if(array_key_exists('calendaraction',$this->arrPOST)){\n $arrCalendarData = json_decode($this->arrPOST['actiondata'],TRUE);\n //clean up our data\n $arrCalendarData = $this->CleanActionData($arrCalendarData);\n //execute\n if($this->arrPOST['calendaraction'] == 'comparedates'){\n $this->CompareDates($arrCalendarData);\n }\n if($this->arrPOST['calendaraction'] == 'adddates'){\n $this->AddSelectedDates($arrCalendarData);\n }\n if($this->arrPOST['calendaraction'] == 'nowtillthen'){\n $this->GetTheTillNow($arrCalendarData);\n }\n }\n }", "public static function parseDate ($type, $year, $month)\n {\n $date = new Carbon();\n $currYear = $date->year;\n\n if ($type === \"year\") {\n $getMonth = [\n 'Jan' => 0,\n 'Feb' => 1,\n 'Mar' => 2,\n 'Apr' => 3,\n 'May' => 4,\n 'Jun' => 5,\n 'Jul' => 6,\n 'Aug' => 7,\n 'Sep' => 8,\n 'Oct' => 9,\n 'Nov' => 10,\n 'Dec' => 11\n ];\n\n return $getMonth;\n }\n else {\n $currMonth = $date->formatLocalized('%b');\n $currDay = $date->day;\n\n # Sets up the expected dataformat\n $monthData = [\n 'Jan' => [\n 'int' => 1,\n 'days' => 31\n ],\n 'Feb' => [\n 'int' => 2,\n 'days' => LogitFunctions::is_leap_year($year)\n ],\n 'Mar' => [\n 'int' => 3,\n 'days' => 31\n ],\n 'Apr' => [\n 'int' => 4,\n 'days' => 30\n ],\n 'May' => [\n 'int' => 5,\n 'days' => 31\n ],\n 'Jun' => [\n 'int' => 6,\n 'days' => 30\n ],\n 'Jul' => [\n 'int' => 7,\n 'days' => 31\n ],\n 'Aug' => [\n 'int' => 8,\n 'days' => 31\n ],\n 'Sep' => [\n 'int' => 9,\n 'days' => 30\n ],\n 'Oct' => [\n 'int' => 10,\n 'days' => 31\n ],\n 'Nov' => [\n 'int' => 11,\n 'days' => 30\n ],\n 'Dec' => [\n 'int' => 12,\n 'days' => 31\n ]\n ];\n\n\n if ($year == $currYear) {\n $monthData[$currMonth]['days'] = $currDay;\n\n $foundMonth = false;\n\n // Loops through all months. When we arrive at current month, remove all after\n foreach ($monthData as $key => $md) {\n if ($key == $currMonth) {\n $foundMonth = true;\n continue;\n }\n\n if ($foundMonth) {\n unset($monthData[$key]);\n }\n }\n }\n return $monthData;\n }\n }", "public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }", "public function run()\n {\n $modalities = [\n 'Enduro',\n 'XCO',\n 'XC',\n 'Down Hill',\n 'Dirt',\n 'BMX',\n 'Bicicross',\n 'Contra Relógio',\n 'Speed',\n 'Infantil'\n ];\n\n\n foreach ($modalities as $modality) {\n EventModality::create(['name' => $modality]);\n }\n }", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "public static function events();", "function getMonthlyEventData($month, $session=7) {\n //Check month format\n $isValidMonth = date_create_from_format(\"m\", $month);\n if(!$isValidMonth) {\n //TODO Add any more validations that may be required\n // createFromFormat returns false if the format is invalid or month is invalid\n echo \"Please enter a valid month as an int. Cannot proceed due to invalid month error\";\n } else if(!is_numeric($session) && ($session>0 && $session<8)){\n //$session is not valid\n echo \"Please enter a valid session as an int with value between 1 and 7 inclusive. Cannot proceed due to invalid session error\";\n }else {\n $monthUrl = sprintf(self::$monthEventUrl, $session, $month);\n return parent::convert($monthUrl,3);\n }\n }", "public function get_calendar_data_spec(){\r\n\r\n if (Go_to::is_on_page(\"edit_calendar\")){\r\n \r\n $this->active_month = $_GET['month'];\r\n $this->active_year = $_GET['year']; \r\n \r\n \r\n }\r\n if (Go_to::is_on_page(\"calendar_submit\")){\r\n \r\n $this->active_month = $_SESSION['active_month'];\r\n $this->active_year = $_SESSION['active_year']; \r\n// echo \"MIJESECCCCCC \" . $this->active_month; \r\n \r\n }\r\n \r\n \r\n if (Go_to::is_on_page(\"print_calendar\")){\r\n $room_id = $_POST['room_id'];\r\n \r\n }\r\n \r\n \r\n }", "public function __construct(int $type)\n {\n $this->_eventType = $type;\n }", "public static function month_calendar($day, $month, $year) {\r\n global $langDay_of_weekNames, $langMonthNames, $langToday, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n //Handle leap year\r\n $numberofdays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {\r\n $numberofdays[2] = 29;\r\n }\r\n\r\n $eventlist = Calendar_Events::get_calendar_events(\"month\", \"$year-$month-$day\");\r\n\r\n $events = array();\r\n if ($eventlist) {\r\n foreach ($eventlist as $event) {\r\n $eventday = new DateTime($event->startdate);\r\n $eventday = $eventday->format('j');\r\n if (!array_key_exists($eventday,$events)) {\r\n $events[$eventday] = array();\r\n }\r\n array_push($events[$eventday], $event);\r\n }\r\n }\r\n\r\n //Get the first day of the month\r\n $dayone = getdate(mktime(0, 0, 0, $month, 1, $year));\r\n //Start the week on monday\r\n $startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;\r\n\r\n $backward = array('month'=>$month == 1 ? 12 : $month - 1, 'year' => $month == 1 ? $year - 1 : $year);\r\n $foreward = array('month'=>$month == 12 ? 1 : $month + 1, 'year' => $month == 12 ? $year + 1 : $year);\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.':&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= '<table width=100% class=\"title1\">';\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"250\"><a href=\"#\" onclick=\"show_month(1,'.$backward['month'].','.$backward['year'].'); return false;\">&laquo;</a></td>';\r\n $calendar_content .= \"<td class='center'><b>{$langMonthNames['long'][$month-1]} $year</b></td>\";\r\n $calendar_content .= '<td width=\"250\" class=\"right\"><a href=\"#\" onclick=\"show_month(1,'.$foreward['month'].','.$foreward['year'].'); return false;\">&raquo;</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table><br />\";\r\n $calendar_content .= \"<table class='table-default'><tr class='list-header'>\";\r\n for ($ii = 1; $ii < 8; $ii++) {\r\n $calendar_content .= \"<th class='text-center'>\" . $langDay_of_weekNames['long'][$ii % 7] . \"</th>\";\r\n }\r\n $calendar_content .= \"</tr>\";\r\n $curday = -1;\r\n $today = getdate();\r\n\r\n while ($curday <= $numberofdays[$month]) {\r\n $calendar_content .= \"<tr>\";\r\n\r\n for ($ii = 0; $ii < 7; $ii++) {\r\n if (($curday == -1) && ($ii == $startdayofweek)) {\r\n $curday = 1;\r\n }\r\n if (($curday > 0) && ($curday <= $numberofdays[$month])) {\r\n $bgcolor = $ii < 5 ? \"class='alert alert-danger'\" : \"class='odd'\";\r\n $dayheader = \"$curday\";\r\n $class_style = \"class=odd\";\r\n if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {\r\n $dayheader = \"<b>$curday</b> <small>($langToday)</small>\";\r\n $class_style = \"class='today'\";\r\n }\r\n $calendar_content .= \"<td height=50 width=14% valign=top $class_style><b>$dayheader</b>\";\r\n $thisDayItems = \"\";\r\n if (array_key_exists($curday, $events)) {\r\n foreach ($events[$curday] as $ev) {\r\n $thisDayItems .= Calendar_Events::month_calendar_item($ev, Calendar_Events::$calsettings->{$ev->event_group.\"_color\"});\r\n }\r\n $calendar_content .= \"$thisDayItems</td>\";\r\n }\r\n $curday++;\r\n } else {\r\n $calendar_content .= \"<td width=14%>&nbsp;</td>\";\r\n }\r\n }\r\n $calendar_content .= \"</tr>\";\r\n }\r\n $calendar_content .= \"</table>\";\r\n\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n\r\n /*************************************** Bootstrap calendar ******************************************************/\r\n\r\n $calendar_content .= '<div id=\"bootstrapcalendar\"></div>';\r\n\r\n return $calendar_content;\r\n }", "private function parseEvent($str, $month, $year, $tzSrc, $tzDest) {\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML(\"<?xml encoding='UTF-8' ?>\" . $str);\n\t\t$event = array();\n\t\t$node = $html->getElementsByTagName(\"body\");\n\t\tforeach ($node as $body) {\n\t\t\tforeach ($body->childNodes as $node) {\n\t\t\t\t$_id = explode(\"_\", $node->getAttribute(\"id\"));\n\t\t\t\t$_id = $_id[0];\n\t\t\t\tforeach ($node->getElementsByTagName(\"div\") as $subnode) {\n\t\t\t\t\t$class = $subnode->getAttribute(\"class\");\n\t\t\t\t\tif ($class === \"eventDateBlock\") {\n\t\t\t\t\t\t// date\n\t\t\t\t\t\t$_date = explode(\" \", $subnode->firstChild->textContent);\n\t\t\t\t\t\t$_date = (strlen($_date[1]) === 1) ? \"0\" . $_date[1] : (string) $_date[1];\n\t\t\t\t\t\t$_date = \"$year-$month-\" . $_date;\n\t\t\t\t\t\t$_time = $subnode->childNodes->item(2)->textContent;\n\t\t\t\t\t} elseif ($class === \"playerAvatar\") {\n\t\t\t\t\t\t// url, images\n\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t$_url = $a->getAttribute(\"href\");\n\t\t\t\t\t\t$img = $a->firstChild;\n\t\t\t\t\t\t$_img_icon = $img->getAttribute(\"src\");\n\t\t\t\t\t\t// relocate onto a // aware domain, cdn.akamai.steamstatic.com → steamcdn-a.akamaihd.net\n\t\t\t\t\t\t$_img_icon = str_replace( \"http://cdn.akamai.steamstatic.com\", \"//steamcdn-a.akamaihd.net\", $_img_icon);\n\t\t\t\t\t\t$_appid = explode(\"/\", $_img_icon);\n\t\t\t\t\t\t$_appid = intval($_appid[count($_appid) - 2]);\n\t\t\t\t\t\tif ($_appid === 0) {\n\t\t\t\t\t\t\t$_img_header = \"\";\n\t\t\t\t\t\t\t$_img_header_small = \"\";\n\t\t\t\t\t\t\t$_img_capsule = \"\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$_img_header = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header.jpg\";\n\t\t\t\t\t\t\t$_img_header_small = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/header_292x136.jpg\";\n\t\t\t\t\t\t\t$_img_capsule = \"//steamcdn-a.akamaihd.net/steam/apps/\" . $_appid . \"/capsule_sm_120.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($class === \"eventBlockTitle\") {\n\t\t\t\t\t\t$l = $subnode->childNodes;\n\t\t\t\t\t\tforeach ($l as $a) {\n\t\t\t\t\t\t\tif ($a->nodeType === XML_ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tif ($a->tagName === \"a\") {\n\t\t\t\t\t\t\t\t\tif ($a->getAttribute(\"class\") === \"headlineLink\") {\n\t\t\t\t\t\t\t\t\t\t// title\n\t\t\t\t\t\t\t\t\t\t$a = $subnode->firstChild;\n\t\t\t\t\t\t\t\t\t\t$_title = $a->textContent;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// comment count\n\t\t\t\t\t\t\t\t\t\t$_comments = explode(\" \", $a->textContent);\n\t\t\t\t\t\t\t\t\t\t$_comments = intval($_comments[0]);\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\t\n\t\t$tempDate = new DateTime($_date . \" \" . $_time, $tzSrc);\n\t\t$tempDate->setTimeZone($tzDest);\n\n\t\t$event[\"id\"] = $_id;\n\t\t$event[\"url\"] = $_url;\n\t\t$event[\"title\"] = $_title;\n\t\t$event[\"comments\"] = $_comments;\n\t\t$event[\"date\"] = $tempDate->format(\"Y-m-d\");\n\t\t$event[\"time\"] = $tempDate->format(\"H:i\");\n\t\t$event[\"tz\"] = $tempDate->format(\"e\");\n\t\t$event[\"appid\"] = $_appid;\n\t\t$event[\"img_icon\"] = $_img_icon;\n\t\t$event[\"img_capsule\"] = $_img_capsule;\n\t\t$event[\"img_header\"] = $_img_header;\n\t\t$event[\"img_header_small\"] = $_img_header_small;\n\t\treturn $event;\n\t}", "public function getEvents($period='month', $filters=array())\n\t{\n\t\t$gid = (isset($filters['gid'])) ? intval($filters['gid']) : 0;\n\n\t\t// Build the query\n\t\tswitch ($period)\n\t\t{\n\t\t\tcase 'month':\n\t\t\t\t$select_date = $filters['select_date'];\n\t\t\t\t$select_date_fin = $filters['select_date_fin'];\n\n\t\t\t\t$sql = \"SELECT $this->_tbl.*\n\t\t\t\t\tFROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id\n\t\t\t\t\tAND (\n\t\t\t\t\t(\n\t\t\t\t\t\t\t(publish_up >= \" . $this->_db->quote($select_date . '%') . \" AND publish_up <= \" . $this->_db->quote($select_date_fin . '%') . \" AND publish_down IS NOT NULL AND publish_down != '0000-00-00 00:00:00')\n\t\t\t\t\t\tOR (publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down >= \" . $this->_db->quote($select_date . '%') . \" AND publish_down <= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($select_date . '%') . \" AND publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down <= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t\tOR (publish_up <= \" . $this->_db->quote($select_date . '%') . \" AND publish_down IS NOT NULL AND publish_down !='0000-00-00 00:00:00' AND publish_down >= \" . $this->_db->quote($select_date_fin . '%') . \")\n\t\t\t\t\t)\n\t\t\t\t\tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . intval($filters['category']) . \")\" : \")\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\n\t\t\tcase 'year':\n\t\t\t\t$year = $filters['year'];\n\n\t\t\t\t// $sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t// \tWHERE $this->_tbl.catid = b.id\n\t\t\t\t// \tAND publish_up LIKE \" . $this->_db->quote($year . '%') . \" AND (publish_down >= \" . $this->_db->quote($year . '%') . \" OR publish_down = '0000-00-00 00:00:00' OR publish_down IS NULL)\n\t\t\t\t// \tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t// Change made by Archie to prevent wrong formatting of year\n\t\t\t\t$sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id\n\t\t\t\t\tAND publish_up LIKE \" . $this->_db->quote($year . '%') . \" AND (publish_down >= \" . $this->_db->quote($year . '-01-01 00:00:00') . \" OR publish_down = '0000-00-00 00:00:00' OR publish_down IS NULL)\n\t\t\t\t\tAND $this->_tbl.state = '1'\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . intval($filters['category']) : \"\";\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\t\t//$sql .= \" LIMIT \".$filters['start'].\", \".$filters['limit'];\n\t\t\tbreak;\n\n\t\t\tcase 'week':\n\t\t\t\t$startdate = $filters['startdate'];\n\t\t\t\t$enddate = $filters['enddate'];\n\n\t\t\t\t$sql = \"SELECT * FROM $this->_tbl\n\t\t\t\t\tWHERE ((publish_up >= \" . $this->_db->quote($startdate . '%') . \" AND publish_up <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($startdate . '%') . \" AND publish_down <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($startdate . '%') . \" AND publish_down <= \" . $this->_db->quote($enddate . '%') . \")\n\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($enddate . '%') . \" AND publish_up <= \" . $this->_db->quote($startdate . '%') . \"))\n\t\t\t\t\tAND state = '1'\";\n\n\t\t\t\t\t//did we pass in a scope filter\n\t\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//did we pass in a scope id filter\n\t\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql .= \"ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\n\t\t\tcase 'day':\n\t\t\t\t$select_date = $filters['select_date'];\n\t\t\t\t$select_date_fin = $filters['select_date_fin'];\n\n\t\t\t\t$sql = \"SELECT $this->_tbl.* FROM #__categories AS b, $this->_tbl\n\t\t\t\t\tWHERE $this->_tbl.catid = b.id AND\n\t\t\t\t\t\t((publish_up >= \" . $this->_db->quote($select_date) . \" AND publish_up <= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_down >= \" . $this->_db->quote($select_date) . \" AND publish_down <= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_up <= \" . $this->_db->quote($select_date) . \" AND publish_down >= \" . $this->_db->quote($select_date_fin) . \") \n\t\t\t\t\t\tOR (publish_up >= \" . $this->_db->quote($select_date) . \" AND publish_down <= \" . $this->_db->quote($select_date_fin) . \"))\";\n\n\t\t\t\t$sql .= ($filters['category'] != 0) ? \" AND b.id=\" . $filters['category'] : \"\";\n\t\t\t\t$sql .= \" AND $this->_tbl.state = '1'\";\n\n\t\t\t\t//did we pass in a scope filter\n\t\t\t\tif (isset($filters['scope']) && $filters['scope'] != '')\n\t\t\t\t{\n\t\t\t\t\tif ($filters['scope'] == 'event')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql .= \" AND ({$this->_tbl}.scope IS NULL OR {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']) . \")\";\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$sql .= \" AND {$this->_tbl}.scope=\" . $this->_db->quote($filters['scope']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//did we pass in a scope id filter\n\t\t\t\tif (isset($filters['scope_id']) && $filters['scope_id'] != '')\n\t\t\t\t{\n\t\t\t\t\t$sql .= \" AND {$this->_tbl}.scope_id=\" . $this->_db->quote($filters['scope_id']);\n\t\t\t\t}\n\n\t\t\t\t$sql .= \" ORDER BY publish_up ASC\";\n\t\t\tbreak;\n\t\t}\n\n\t\tif (isset($filters['limit']))\n\t\t{\n\t\t\tif (isset($filters['start']))\n\t\t\t{\n\t\t\t\t$sql .= \" LIMIT \" . $filters['start'] . \",\" . $filters['limit'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql .= \" LIMIT \" . $filters['limit'];\n\t\t\t}\n\t\t}\n\n\t\t$this->_db->setQuery($sql);\n\t\treturn $this->_db->loadObjectList();\n\t}", "public function getEventByDate($year, $month, $day) {\n\t\tif (isset($this->events[$year][$month][$day]))\n\t\t\treturn $this->events[$year][$month][$day];\n\t\treturn FALSE;\n\t}", "public function indexEvents(array $events, array $context = []): void;", "public function getEvents(array $filters = array());", "public function get_events_by_year() {\n\t\tswitch_to_blog( get_network()->site_id );\n\n\t\t$years = array();\n\t\tforeach ($this->get_events() as $event) {\n\t\t\t$start = get_field( 'event_start', $event->ID );\n\n\t\t\tif ( $start ) {\n\t\t\t\t$year = date( 'Y', strtotime( $start ) );\n\t\t\t\t$years[ $year ][] = $event;\n\t\t\t}\n\t\t}\n\n\t\trestore_current_blog();\n\n\t\treturn $years;\n\t}", "function event__add_edit_event($type, $event, $id = null)\n {\n $_next_day = date('n/j/Y', strtotime($event['start_date'] . ' +1 day'));\n if (empty($event['end_date']))\n {\n if (empty($event['end_time']))\n {\n $event['end_date'] = (empty($event['start_time']) ? $_next_day : $event['start_date']);\n }\n else\n {\n $event['end_date'] = $event['start_date'];\n }\n }\n if (empty($event['start_time'])) $event['start_time'] = '12 am';\n if (empty($event['end_time'])) $event['end_time'] = $event['start_time'];\n\n // Manipulate dates based on checkbox states\n if (!empty($event['no_end_date']))\n {\n $event['end_date'] = (!empty($event['all_day_event']) ? $_next_day : $event['start_date']);\n $event['end_time'] = $event['start_time'];\n }\n elseif (!empty($event['all_day_event']))\n {\n $event['end_date'] = (!empty($event['end_date']) ? $event['end_date'] : $_next_day);\n $event['end_time'] = '12 am';\n }\n $event['date_start'] = date('Y-m-d H:i:s', strtotime($event['start_date'] . ' ' . $event['start_time']));\n $event['date_end'] = date('Y-m-d H:i:s', strtotime($event['end_date'] . ' ' . $event['end_time']));\n unset($event['start_date']);\n unset($event['start_time']);\n unset($event['end_date']);\n unset($event['end_time']);\n\n // Correct for blank latitude/longitude\n if (empty($event['latitude'])) $event['latitude'] = null;\n if (empty($event['longitude'])) $event['longitude'] = null;\n\n // Change '-' to null\n if ($event['status'] == '-') $event['status'] = null;\n\n // Add recordkeeping fields\n $event['date_last_updated'] = date('Y-m-d H:i:s');\n $event['last_updated_by'] = $this->session->userdata('member_id');\n\n // Initialize return variable (null for calls as void function)\n $return = null;\n\n // Determine database calls and some event values based on type\n switch ($type)\n {\n case 'edit':\n // Boolean fields\n if (empty($event['all_day_event'])) $event['all_day_event'] = 0;\n if (empty($event['multiday_event'])) $event['multiday_event'] = 0;\n if (empty($event['rsvp_only'])) $event['rsvp_only'] = 0;\n if (empty($event['hide_address'])) $event['hide_address'] = 0;\n\n // Update event in database\n $this->db->where('id', $id);\n $this->db->update('events', $event);\n\n break;\n case 'add':\n default:\n // Creation recordkeeping\n $event['date_added'] = date('Y-m-d H:i:s');\n $event['added_by'] = $this->session->userdata('member_id');\n\n // Add slug\n $event['slug'] = url_title($event['name'], '-', true);\n\n // Add event to database\n $this->db->insert('events', $event);\n\n // Set return variable to insert ID\n $return = $this->db->insert_id();\n\n break;\n }\n\n // Return insert ID\n return $return;\n }", "protected function build_year_calendar(&$tpl_var)\n {\n global $page;\n\n assert( count($page['chronology_date']) == 1 );\n $query='SELECT '.pwg_db_get_date_MMDD($this->date_field).' as period,\n COUNT(DISTINCT id) as count';\n $query.= $this->inner_sql;\n $query.= $this->get_date_where();\n $query.= '\n GROUP BY period\n ORDER BY period ASC';\n\n $result = pwg_query($query);\n $items=array();\n while ($row = pwg_db_fetch_assoc($result))\n {\n $m = (int)substr($row['period'], 0, 2);\n $d = substr($row['period'], 2, 2);\n if ( ! isset($items[$m]) )\n {\n $items[$m] = array('nb_images'=>0, 'children'=>array() );\n }\n $items[$m]['children'][$d] = $row['count'];\n $items[$m]['nb_images'] += $row['count'];\n }\n if (count($items)==1)\n { // only one month exists so bail out to month view\n list($m) = array_keys($items);\n $page['chronology_date'][CMONTH] = $m;\n return false;\n }\n global $lang;\n foreach ( $items as $month=>$month_data)\n {\n $chronology_date = array( $page['chronology_date'][CYEAR], $month );\n $url = duplicate_index_url( array('chronology_date'=>$chronology_date) );\n\n $nav_bar = $this->get_nav_bar_from_items( $chronology_date,\n $month_data['children'], false );\n\n $tpl_var['calendar_bars'][] =\n array(\n 'U_HEAD' => $url,\n 'NB_IMAGES' => $month_data['nb_images'],\n 'HEAD_LABEL' => $lang['month'][$month],\n 'items' => $nav_bar,\n );\n }\n\n return true;\n }", "function eventclass_student_attendance()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "function eventclass_program_billing()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function run()\n {\n $events = [\n [\n 'title' => 'Reuniao 01',\n 'start' => '2021-07-01',\n 'end' => '2021-07-03',\n ],\n [\n 'title' => 'Reuniao 02',\n 'start' => '2021-07-07',\n 'end' => '2021-07-010',\n ]\n ];\n }", "public function get_test_scheduled_events()\n {\n }", "public function viewEvents();", "function updateStatus($order, $newStatus) {\n $data = [];\n switch ($newStatus) {\n case 2: #processed\n $event = new OrderWasProcessed($order);\n $data['processed_on'] = Carbon::now();\n break;\n\n case 4: #traveling\n $event = new OrderShippedOn($order);\n $data['shipped_on'] = Carbon::now();\n $data['expected_delivery_on'] = Carbon::now()->addDay();\n break;\n\n case 5: #delivered\n $event = new OrderWasDelivered($order);\n $data['delivered_on'] = Carbon::now();\n break;\n }\n\n if (isset($event) && $event) {\n event($event);\n }\n\n return $data;\n}", "function draw_calendar($month,$year,$events = array()){\n\t\t$dayofweek = array('<td class=\"calendar-header\">Sunday</td>',\n\t\t'<td class=\"calendar-header\">Monday</td>',\n\t\t'<td class=\"calendar-header\">Tuesday</td>',\n\t\t'<td class=\"calendar-header\">Wednesday</td>',\n\t\t'<td class=\"calendar-header\">Thursday</td>',\n\t\t'<td class=\"calendar-header\">Friday</td>',\n\t\t'<td class=\"calendar-header\">Saturday</td>');\n\t\t\n\t\t/* draw table\n\t\t\t- fill top row with array using implode */\n\t\t$calendar = '<table class=\"calendar\"><tr class=\"calendar-row\">'.implode($dayofweek).'</tr>';\n\t\t\n\t\t// mktime(hour,minute,second,month,day,year);\n\t\t// figures out the which day of the week 1st is based on provided $month and $year\n\t\t$startDay = date('w',mktime(0,0,0,$month,1,$year)); // return days of the week\n\t\t$days = cal_days_in_month(CAL_GREGORIAN,$month,$year);\n\t\t$daysFilled;\n\t\t$counter = 0;\n\t\n\t\t/* row 2 */\n\t\t$calendar.= '<tr class=\"calendar-row\">';\n\t\n\t\t/* print \"blank\" days until the first of the month */\n\t\tfor($i = 0; $i < $startDay; $i++){\n\t\t\t$calendar.= '<td class=\"calendar-empty\"> </td>';\n\t\t\t$daysFilled++;\n\t\t}\n\t\n\t\t/* for loop to add days */\n\t\tfor($i = 1; $i <= $days; $i++):\n\t\t\t$calendar.= '<td class=\"calendar-day\"><div style=\"position:relative;height:100px;\"><div class=\"date\">'.$i.'</div>';\n\t\t\t\n\t\t\tif ($i < 10){\n\t\t\t\t$i = \"0\".$i;\n\t\t\t}\n\t\t\t\n\t\t\t// input event into calendar\n\t\t\t$eventDay = $year.'-'.$month.'-'.$i;\n\t\t\t\tif(isset($events[$eventDay])) { // if there are events on $eventDay\n\t\t\t\t\tforeach($events[$eventDay] as $eventid) { // for each event, add to calendar\n\t\t\t\t\t\t$mysql = new mysql();\n\t\t\t\t\t\t$tripdetail = $mysql->get_specifictrip($eventid);\n\t\t\t\t\t\t$calendar.= '<div class=\"event\"';\n\t\t\t\t\t\tif($tripdetail[approval]==0){\n\t\t\t\t\t\t\t$calendar.=' style=\"color:#FF6666;\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($tripdetail[approval]==-1){\n\t\t\t\t\t\t\t$calendar.=' style=\"color:#6666E0; text-decoration:line-through;\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$calendar.='><a style=\"text-decoration:none; color:inherit;\" href=\"?page=detail2&trip='.$tripdetail[eventid].'\"';\n\t\t\t\t\t\t$calendar.='>'.$tripdetail[destination].'</div>';\n\t\t\t\t\t}\n\t\t\t\t\t$calendar.='</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t$calendar.= '<p> </p><p> </p></div></td>';\n\t\t\t\t}\n\n\t\t\tif($startDay == 6){ // if the month starts on Saturday, end current row\n\t\t\t\t$calendar.= '</tr>';\n\t\t\t\tif(($counter+1) != $days){ // if there are still days left to fill, new row\n\t\t\t\t\t$calendar.= '<tr class=\"calendar-row\">';\n\t\t\t\t}\n\t\t\t\t$startDay = -1;\n\t\t\t\t$daysFilled = 0;\n\t\t\t}\n\t\t\t$daysFilled++;\n\t\t\t$startDay++;\n\t\t\t$counter++;\n\t\tendfor;\n\t\n\t\t// finish filling in the rest of the days with blanks\n\t\tif($daysFilled < 8 && $daysFilled !=1):\n\t\t\tfor($x = 1; $x <= (8 - $daysFilled); $x++):\n\t\t\t\t$calendar.= '<td class=\"calendar-empty\"> </td>';\n\t\t\tendfor;\n\t\tendif;\n\t\n\t\t// end row, table\n\t\t$calendar.= '</tr></table>';\n\t\t\n\t\t\n\t\t// return HTML code for calendar\n\t\treturn $calendar;\n\t}", "public function __construct() {\r\n $this->setMode(self::$modeMonth);\r\n }", "public function viewAllEvents();", "public function archive()\n\t{\n\t\t// --------------------------------------\n\t\t// Prep no_results to avoid conflicts\n\t\t// --------------------------------------\n\n\t\t$this->_prep_no_results();\n\n\t\t// --------------------------------------\n\t\t// Get the events\n\t\t// --------------------------------------\n\n\t\tif ( ! ($events = $this->_get_event_entries()))\n\t\t{\n\t\t\t$this->_log('No events found, returning no results');\n\t\t\treturn $this->EE->TMPL->no_results();\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Loop through events and add them to the months array\n\t\t// --------------------------------------\n\n\t\t$months = array();\n\n\t\tforeach ($events AS $event)\n\t\t{\n\t\t\t// Create Low Date objects from each date\n\t\t\t$start = new Low_date($event['start_date']);\n\t\t\t$end = new Low_date($event['end_date']);\n\n\t\t\t// Set both dates to the first of the month\n\t\t\t// and return the month url: YYYY-MM\n\t\t\t$start_month = $start->first_of_month()->month_url();\n\t\t\t$end_month = $end->first_of_month()->month_url();\n\n\t\t\t// If event starts and ends in the same month,\n\t\t\t// simply add it to the months array\n\t\t\tif ($start_month == $end_month)\n\t\t\t{\n\t\t\t\t$months[$start_month][] = $event['entry_id'];\n\t\t\t}\n\t\t\t// Or else add each spanning month to the months array\n\t\t\telse\n\t\t\t{\n\t\t\t\t// To do this, increase the start date by a month\n\t\t\t\t// until it exceeds the end month\n\t\t\t\twhile ($start->month_url() <= $end_month)\n\t\t\t\t{\n\t\t\t\t\t$months[$start->month_url()][] = $event['entry_id'];\n\t\t\t\t\t$start->add('month');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Sort the array by month\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('sort', 'asc') == 'asc')\n\t\t{\n\t\t\tksort($months);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tkrsort($months);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Create data array based on month\n\t\t// --------------------------------------\n\n\t\t$data = array();\n\n\t\tforeach ($months AS $month => $rows)\n\t\t{\n\t\t\t// Initiate new row for data\n\t\t\t$row = array(\n\t\t\t\t'month_url' => $month,\n\t\t\t\t'events_in_month' => count($rows)\n\t\t\t);\n\n\t\t\t// Create new date for this month\n\t\t\t$date = new Low_Date($month);\n\n\t\t\t// Add each possible format to this row\n\t\t\tforeach ($this->formats AS $fmt => $key)\n\t\t\t{\n\t\t\t\t$row[$key] = $date->ee_format($fmt);\n\t\t\t}\n\n\t\t\t// Then add the row to the data array\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\treturn $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $data);\n\n\t}", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public static function stateChanged($event)\r\n {\r\n }", "public function onEvent();", "function setEventType() // OK\n {\n }", "function __construct(vevent $event, $from_date, $to_date)\r\n {\r\n //$this_day = date('d', $from_date);\r\n //$this_month = date('m', $from_date);\r\n //$this_year = date('Y', $from_date);\r\n\r\n //For the list view\r\n $date = getdate();\r\n $date_unixtime = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);\r\n // TODO: List view needs to start today, not on the last selected date.\r\n// \t$from_date = ($date_unixtime + $to_date) / 2;\r\n \t$this_day = date('d', $from_date);\r\n $this_month = date('m', $from_date);\r\n $this_year = date('Y', $from_date);\r\n// \t$this_day = $date['mday'];\r\n// \t$this_month = $date['mon'];\r\n// \t$this_year = $date['year'];\r\n\r\n $start_month = $date['mon'] - 1;\r\n $start_year = $date['year'];\r\n $end_month = $this_month + 1;\r\n $end_year = $this_year;\r\n\r\n\r\n if ($this_month == 1)\r\n {\r\n $start_month = 12;\r\n $start_year --;\r\n }\r\n if ($this_month == 12)\r\n {\r\n $end_month = 1;\r\n $end_year ++;\r\n }\r\n\r\n $this->event = $event;\r\n $this->view_start = mktime(0, 0, 0, $start_month, 1, $start_year);\r\n $this->view_end = mktime(0, 0, 0, $end_month, 31, $end_year);\r\n\r\n if ($this->debug)\r\n {\r\n echo '<hr />';\r\n echo '<b>ICAL RECURRENCE</b>';\r\n echo '<hr />';\r\n echo '<table class=\"data_table\">';\r\n echo '<thead>';\r\n echo '<tr><th>Variable</td><th>Value</td>';\r\n echo '</thead>';\r\n echo '<tbody>';\r\n echo '<tr><td>Title</td><td>' . $this->event->summary['value'] . '</td>';\r\n echo '<tr><td>View begin</td><td>' . $this->view_start . ' (' . date('r', $this->view_start) . ')</td>';\r\n echo '<tr><td>View end</td><td>' . $this->view_end . ' (' . date('r', $this->view_end) . ')</td>';\r\n // echo '<tr><td>Event</td><td>';\r\n // echo '<pre>';\r\n // echo print_r($this->event, true);\r\n // echo '</pre>';\r\n // echo '</td>';\r\n // echo '</tr>';\r\n echo '</tbody>';\r\n echo '</table>';\r\n }\r\n }", "function is_event_calendar_page() {\n\n\tif ( class_exists( 'TribeEvents' ) ) {\n\n\t\t$is_event_calendar = false; // Default is false so if everything falls through it returns that it is not an EC page\n\n\t\tif ( tribe_is_month() && ! is_tax() ) { // Month View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && ! is_tax() ) { // List View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_past() || tribe_is_upcoming() && is_tax() ) { // List View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && ! is_tax() ) { // Week View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_week() && is_tax() ) { // Week View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && ! is_tax() ) { // Day View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_day() && is_tax() ) { // Day View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && ! is_tax() ) { // Map View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_map() && is_tax() ) { // Map View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && ! is_tax() ) { // Photo View Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( tribe_is_photo() && is_tax() ) { // Photo View Category Page\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_events’ ) ) { // Single Events\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_venue’ ) ) { // Single Venues\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} elseif ( is_singular( ‘tribe_organizer’ ) ) { // Single Organizers\n\n\t\t\t$is_event_calendar = true;\n\n\t\t} else {\n\n\t\t}\n\n\t\treturn $is_event_calendar;\n\t}\n}", "private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function testCreatePayrollCalendar()\n {\n }", "public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function import_the_events_calendar() {\n\t\tglobal $wgobd_view_helper,\n\t\t\t\t\t $wgobd_events_helper;\n\n\t\t$args = array(\n\t\t\t'post_type' \t=> 'post',\n\t\t\t'numberposts'\t=> -1,\n\t\t\t'meta_key'\t\t=> '_isEvent',\n\t\t\t'meta_value'\t=> 'yes'\n\t\t);\n\t\t$posts = get_posts( $args );\n\n\t\t$imported_events = 0;\n\t\tforeach( $posts as $post )\n\t\t{\n\t\t\t$event = new wgobd_Event( null );\n\t\t\t$postmeta = get_post_custom( $post->ID );\n\n\t\t\t// Need this to offset dates coming from The Events Calendar\n\t\t\t$gm_diff = mktime( 0 ) - gmmktime( 0 );\n\n\t\t\t$event->allday \t\t\t\t= $postmeta['_EventAllDay'][0] == 'yes' || $postmeta['_EventAllDay'][0] == 1;\n\t\t\t$event->start \t\t\t\t= strtotime( $postmeta['_EventStartDate'][0] ) - $gm_diff;\n\t\t\t$event->end \t\t\t\t\t= strtotime( $postmeta['_EventEndDate'][0] ) - $gm_diff;\n\t\t\t// If all-day event, align start/end to start/end of day\n\t\t\tif( $event->allday ) {\n\t\t\t\t$event->start = $wgobd_events_helper->gmgetdate( $event->start );\n\t\t\t\t$event->start = gmmktime( 0, 0, 0, $event->start['mon'], $event->start['mday'], $event->start['year'] );\n\t\t\t\t$event->end = $wgobd_events_helper->gmgetdate( $event->end );\n\t\t\t\t$event->end = gmmktime( 0, 0, 0, $event->end['mon'], $event->end['mday'], $event->end['year'] );\n\t\t\t}\n\t\t\t// Finally, convert to GMT storage format\n\t\t\t$event->start = $wgobd_events_helper->local_to_gmt( $event->start );\n\t\t\t$event->end = $wgobd_events_helper->local_to_gmt( $event->end );\n\t\t\t// Bug in The Events Calendar where some all-day events start and end at the same time\n\t\t\tif( $event->allday && $event->end - $event->start < ( 24 * 60 * 60 ) )\n\t\t\t\t$event->end = $event->start + 24 * 60 * 60;\n\t\t\t$event->venue \t\t\t\t= $postmeta['_EventVenue'][0];\n\t\t\t$event->country \t\t\t= $postmeta['_EventCountry'][0];\n\t\t\t$event->city \t\t\t\t\t= $postmeta['_EventCity'][0];\n\t\t\t$event->province \t\t\t= $postmeta['_EventState'][0];\n\t\t\t$event->postal_code \t= $postmeta['_EventZip'][0];\n\t\t\t$event->address = array();\n\t\t\tif( $postmeta['$_EventAddress'] ) $event->address[] = $postmeta['$_EventAddress'];\n\t\t\tif( $event->city ) $event->address[] = $event->city;\n\t\t\tif( $event->province ) $event->address[] = $event->province;\n\t\t\tif( $event->postal_code ) $event->address[] = $event->postal_code;\n\t\t\tif( $event->country ) $event->address[] = $event->country;\n\t\t\t$event->address = join( ', ', $event->address );\n\t\t\t$event->show_map \t\t\t= $postmeta['_EventShowMapLink'][0] == 'true' || $postmeta['_EventShowMap'][0] == 'true';\n\t\t\t$event->cost \t\t\t\t\t= $postmeta['_EventCost'][0];\n\t\t\t$event->contact_phone = $postmeta['_EventPhone'][0];\n\t\t\t$event->post \t\t\t\t\t= get_object_vars( $post );\n\t\t\t$event->post[\"post_type\"] = wgobd_POST_TYPE;\n\t\t\tunset( $event->post[\"ID\"] );\n\n\t\t\t// Transfer post categories => event categories, post tags => event tags\n\t\t\t$terms = wp_get_post_terms( $post->ID, array( 'category', 'post_tag' ) );\n\t\t\t$event->categories = array();\n\t\t\t$event->tags = array();\n\t\t\tforeach( $terms as $term )\n\t\t\t{\n\t\t\t\tswitch( $term->taxonomy )\n\t\t\t\t{\n\t\t\t\t\tcase 'category':\n\t\t\t\t\t\t// Ignore special \"Events\" category by The Events Calendar\n\t\t\t\t\t\tif( $term->name == 'Events' )\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Need to find out the category ID, if it exists.\n\t\t\t\t\t\t$event_term = get_term_by( 'name', $term->name, 'events_categories' );\n\t\t\t\t\t\t// If no category exists, create it.\n\t\t\t\t\t\tif( $event_term === false )\n\t\t\t\t\t\t\t$event_term = (object) wp_insert_term(\n\t\t\t\t\t\t\t\t$term->name,\n\t\t\t\t\t\t\t\t'events_categories',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'description' => $term->description,\n\t\t\t\t\t\t\t\t\t'slug' => $term->slug\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t$event->categories[] = $event_term->term_id;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'post_tag':\n\t\t\t\t\t\t// For some reason tag-like taxonomies are treated differently; term\n\t\t\t\t\t\t// IDs cannot be used; instead the actual term name must be appended\n\t\t\t\t\t\t$event->tags[] = $term->name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$post_id = $event->save();\n\t\t\t$wgobd_events_helper->cache_event( $event, $post_id );\n\n\t\t\t$imported_events++;\n\t\t}\n\n\t\t$wgobd_view_helper->display( \"import.php\", array( 'imported_events' => $imported_events ) );\n\t}", "function fh_augment_events_query($query)\r\r\n{\r\r\n\tif((($query->is_post_type_archive && $query->query['post_type'] == \"event\")\r\r\n\t\t\t|| ($query->is_archive && isset($query->query[\"event_categories\"])))\r\r\n\t\t&& (\r\r\n\t\t\t!is_admin() \r\r\n\t\t\t|| isset($query->query[\"event_filter\"]))\r\r\n\t\t)\r\r\n\t{\r\r\n\t\t// Modify the query to support comparison against current date\r\r\n\t\t$today = strtotime(date(\"Y-m-d\"));\r\r\n\t\t$tomorrow = ($today + (3600 * 24) - 1) . \"000\"; // One second shy of 24 hrs later...\r\r\n\t\t$today = $today . \"000\";\r\r\n\r\r\n\t\t$start_default = time();\r\r\n\t\tif(isset($query->query_vars[\"start_date\"]) && is_numeric($query->query_vars[\"start_date\"]))\r\r\n\t\t{\r\r\n\t\t\t$start_default = $query->query_vars[\"start_date\"];\r\r\n\t\t}\r\r\n\r\r\n\t\t$end_default = $start_default;\r\r\n\t\tif(isset($query->query_vars[\"end_date\"]) && is_numeric($query->query_vars[\"end_date\"]))\r\r\n\t\t{\r\r\n\t\t\t$end_default = $query->query_vars[\"end_date\"];\r\r\n\t\t}\r\r\n\r\r\n\t\t$first_of_month = strtotime(date(\"Y-m\", $start_default) . \"-01\");\r\r\n\t\tif(intval(date(\"m\", $start_default)) == 12)\r\r\n\t\t{\r\r\n\t\t\t$first_next_month = strtotime((date(\"Y\", $start_default) + 1) . \"-01-01\");\r\r\n\t\t}\r\r\n\t\telse\r\r\n\t\t{\r\r\n\t\t\t$first_next_month = strtotime(date(\"Y-\", $start_default) . (date(\"m\", $start_default) + 1) . \"-01\");\r\r\n\t\t}\r\r\n\r\r\n\t\t// \"upcoming\" is the default filter for the events archive:\r\r\n\t\tif((!isset($query->query['event_filter']) && !is_admin()) || (isset($query->query['event_filter']) && $query->query['event_filter'] == \"upcoming\"))\r\r\n\t\t{\r\r\n\t\t\t$meta_query = array(\r\r\n\t\t\t\t'relation' => 'OR',\r\r\n\t\t\t\tarray(\r\r\n\t\t\t\t\t'key' => slt_cf_field_key(\"event_date\"),\r\r\n\t\t\t\t\t'value' => $today,\r\r\n\t\t\t\t\t'type' => \"NUMERIC\",\r\r\n\t\t\t\t\t'compare' => '>='\r\r\n\t\t\t\t),\r\r\n\t\t\t\tarray(\r\r\n\t\t\t\t\t'key' => slt_cf_field_key(\"end_date\"),\r\r\n\t\t\t\t\t'value' => $today,\r\r\n\t\t\t\t\t'type' => \"NUMERIC\",\r\r\n\t\t\t\t\t'compare' => '>='\r\r\n\t\t\t\t)\r\r\n\t\t\t);\r\r\n\t\t\t$query->query_vars['meta_query'] = $meta_query;\r\r\n\t\t\t// Affect our sort order here:\r\r\n\t\t\tadd_filter('posts_clauses', \"fh_events_posts_clauses\");\r\r\n\t\t}\r\r\n\t\telse if($query->query['event_filter'] == \"month\")\r\r\n\t\t{\r\r\n\t\t\t// Prepare some parameters for use:\r\r\n\t\t\t$query->query_vars[\"_search_start\"] = $first_of_month;\r\r\n\t\t\t$query->query_vars[\"_search_end\"] = $first_next_month;\r\r\n\r\r\n\t\t\t// Getting a bit more aggressive here. Going to completely modify the WHERE and JOIN clauses.\r\r\n\t\t\tadd_filter(\"posts_clauses\", \"fh_events_search_clauses\", 10, 2);\r\r\n\t\t}\r\r\n\t\telse if($query->query['event_filter'] == \"range\")\r\r\n\t\t{\r\r\n\t\t\t$start_date = time();\r\r\n\t\t\tif(isset($query->query_vars[\"start_date\"]) && is_numeric($query->query_vars[\"start_date\"]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$start_date = $query->query_vars[\"start_date\"];\r\r\n\t\t\t}\r\r\n\t\t\t$end_date = $start_date;\r\r\n\t\t\tif(isset($query->query_vars[\"end_date\"]) && is_numeric($query->query_vars[\"end_date\"]))\r\r\n\t\t\t{\r\r\n\t\t\t\t$end_date = $query->query_vars[\"end_date\"];\r\r\n\t\t\t\tif($end_date <= $start_date)\r\r\n\t\t\t\t{\r\r\n\t\t\t\t\t$end_date = $start_date;\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t// Temporary fix: add a day, minus a second, to the end date to get through the day:\r\r\n\t\t\t$end_date += (24*3600) - 1;\r\r\n\r\r\n\t\t\t$query->query_vars[\"_search_start\"] = $start_date;\r\r\n\t\t\t$query->query_vars[\"_search_end\"] = $end_date;\r\r\n\r\r\n\t\t\t// Getting a bit more aggressive here. Going to completely modify the WHERE and JOIN clauses.\r\r\n\t\t\tadd_filter(\"posts_clauses\", \"fh_events_search_clauses\", 10, 2);\r\r\n\t\t}\r\r\n\t}\r\r\n}", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "function get_events()\n\t{\n\t\t$usercode=$_REQUEST['usercode'];\n\t\t\n\t\t$userdt=$this->ObjM->get_user_by_usercode($usercode);\n\t\t\n\t\tif($userdt[0]['user_type_id']=='1'){\n\t\t\t\n\t\t\t$result = $this->get_school_event($userdt);\n\t\t\t\n\t\t}\n\t\t\n\t\tif(count($result)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\t\n\t\tfor($i=0;$i<count($result);$i++){\n\t\t\t$sr_no=$i+1;\n\t\t\t$json_arr[]=array(\n\t\t\t\t'sr_no' \t=> $sr_no,\n\t\t\t\t'event_dt' \t=> $result[$i]['event_dt'],\n\t\t\t\t'event_code' => $result[$i]['event_code'],\n\t\t\t\t'event_title' \t=> $result[$i]['event_title'],\n\t\t\t\t'cover_img' \t=> $result[$i]['cover_img'],\n\t\t\t\t'validation'=>'true'\n\t\t\t);\n\t\t}\n\t\t\n\t\techo json_encode($json_arr);\n\t}", "function submitted_events_calendar($submission) {\n\tif (submitted_events_starts_with ( $submission->brunelgroup, 'Joint' )) {\n\t\treturn array (\n\t\t\t\t23,\n\t\t\t\t24 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '20' )) {\n\t\treturn array (\n\t\t\t\t23 \n\t\t);\n\t} elseif (submitted_events_starts_with ( $submission->brunelgroup, '40' )) {\n\t\treturn array (\n\t\t\t\t24 \n\t\t);\n\t} else {\n\t\treturn array ();\n\t}\n}", "public function run()\n {\n $data = [\n ['title'=>'Demo Event-1', 'start_date'=>'2019-06-11', 'end_date'=>'2019-06-12', 'user'=>'1','kids_under_two'=>'0','kids_under_six'=>'1','adults'=>'5','bags'=>'1','comments'=>''],\n ['title'=>'Demo Event-2', 'start_date'=>'2019-06-11', 'end_date'=>'2019-06-13', 'user'=>'1','kids_under_two'=>'2','kids_under_six'=>',','adults'=>'9','bags'=>'0','comments'=>''],\n ['title'=>'Demo Event-3', 'start_date'=>'2019-06-14', 'end_date'=>'2019-06-14', 'user'=>'1','kids_under_two'=>'0','kids_under_six'=>',','adults'=>'2','bags'=>'0','comments'=>''],\n ['title'=>'Demo Event-3', 'start_date'=>'2019-06-17', 'end_date'=>'2019-06-17', 'user'=>'1','kids_under_two'=>'5','kids_under_six'=>'0','adults'=>'2','bags'=>'0','comments'=>''],\n ];\n foreach ($data as $key => $value) {\n Event::create($value);\n }\n }", "function ct_event() {\n\t\tglobal $Language;\n\n\t\t// C_EVENT_ID\n\t\t$this->C_EVENT_ID = new cField('t_event', 't_event', 'x_C_EVENT_ID', 'C_EVENT_ID', '`C_EVENT_ID`', 3, -1, FALSE, '`C_EVENT_ID`', FALSE);\n\t\t$this->C_EVENT_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_EVENT_ID'] =& $this->C_EVENT_ID;\n\n\t\t// FK_CONGTY_ID\n\t\t$this->FK_CONGTY_ID = new cField('t_event', 't_event', 'x_FK_CONGTY_ID', 'FK_CONGTY_ID', '`FK_CONGTY_ID`', 3, -1, FALSE, '`FK_CONGTY_ID`', FALSE);\n\t\t$this->FK_CONGTY_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['FK_CONGTY_ID'] =& $this->FK_CONGTY_ID;\n\n\t\t// C_EVENT_NAME\n\t\t$this->C_EVENT_NAME = new cField('t_event', 't_event', 'x_C_EVENT_NAME', 'C_EVENT_NAME', '`C_EVENT_NAME`', 201, -1, FALSE, '`C_EVENT_NAME`', FALSE);\n\t\t$this->fields['C_EVENT_NAME'] =& $this->C_EVENT_NAME;\n\n\t\t// C_TYPE_EVENT\n\t\t$this->C_TYPE_EVENT = new cField('t_event', 't_event', 'x_C_TYPE_EVENT', 'C_TYPE_EVENT', '`C_TYPE_EVENT`', 3, -1, FALSE, '`C_TYPE_EVENT`', FALSE);\n\t\t$this->C_TYPE_EVENT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_TYPE_EVENT'] =& $this->C_TYPE_EVENT;\n\n\t\t// C_POST\n\t\t$this->C_POST = new cField('t_event', 't_event', 'x_C_POST', 'C_POST', '`C_POST`', 3, -1, FALSE, '`C_POST`', FALSE);\n\t\t$this->C_POST->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_POST'] =& $this->C_POST;\n\n\t\t// C_URL_IMAGES\n\t\t$this->C_URL_IMAGES = new cField('t_event', 't_event', 'x_C_URL_IMAGES', 'C_URL_IMAGES', '`C_URL_IMAGES`', 201, -1, FALSE, '`C_URL_IMAGES`', FALSE);\n\t\t$this->fields['C_URL_IMAGES'] =& $this->C_URL_IMAGES;\n\n\t\t// C_URL_LINK\n\t\t$this->C_URL_LINK = new cField('t_event', 't_event', 'x_C_URL_LINK', 'C_URL_LINK', '`C_URL_LINK`', 201, -1, FALSE, '`C_URL_LINK`', FALSE);\n\t\t$this->fields['C_URL_LINK'] =& $this->C_URL_LINK;\n\n\t\t// C_DATETIME_BEGIN\n\t\t$this->C_DATETIME_BEGIN = new cField('t_event', 't_event', 'x_C_DATETIME_BEGIN', 'C_DATETIME_BEGIN', '`C_DATETIME_BEGIN`', 135, 7, FALSE, '`C_DATETIME_BEGIN`', FALSE);\n\t\t$this->C_DATETIME_BEGIN->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_BEGIN'] =& $this->C_DATETIME_BEGIN;\n\n\t\t// C_DATETIME_END\n\t\t$this->C_DATETIME_END = new cField('t_event', 't_event', 'x_C_DATETIME_END', 'C_DATETIME_END', '`C_DATETIME_END`', 135, 7, FALSE, '`C_DATETIME_END`', FALSE);\n\t\t$this->C_DATETIME_END->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_END'] =& $this->C_DATETIME_END;\n\n\t\t// C_ODER\n\t\t$this->C_ODER = new cField('t_event', 't_event', 'x_C_ODER', 'C_ODER', '`C_ODER`', 135, 7, FALSE, '`C_ODER`', FALSE);\n\t\t$this->C_ODER->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ODER'] =& $this->C_ODER;\n\n\t\t// C_NOTE\n\t\t$this->C_NOTE = new cField('t_event', 't_event', 'x_C_NOTE', 'C_NOTE', '`C_NOTE`', 201, -1, FALSE, '`C_NOTE`', FALSE);\n\t\t$this->fields['C_NOTE'] =& $this->C_NOTE;\n\n\t\t// C_USER_ADD\n\t\t$this->C_USER_ADD = new cField('t_event', 't_event', 'x_C_USER_ADD', 'C_USER_ADD', '`C_USER_ADD`', 3, -1, FALSE, '`C_USER_ADD`', FALSE);\n\t\t$this->C_USER_ADD->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_ADD'] =& $this->C_USER_ADD;\n\n\t\t// C_ADD_TIME\n\t\t$this->C_ADD_TIME = new cField('t_event', 't_event', 'x_C_ADD_TIME', 'C_ADD_TIME', '`C_ADD_TIME`', 135, 7, FALSE, '`C_ADD_TIME`', FALSE);\n\t\t$this->C_ADD_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ADD_TIME'] =& $this->C_ADD_TIME;\n\n\t\t// C_USER_EDIT\n\t\t$this->C_USER_EDIT = new cField('t_event', 't_event', 'x_C_USER_EDIT', 'C_USER_EDIT', '`C_USER_EDIT`', 3, -1, FALSE, '`C_USER_EDIT`', FALSE);\n\t\t$this->C_USER_EDIT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_EDIT'] =& $this->C_USER_EDIT;\n\n\t\t// C_EDIT_TIME\n\t\t$this->C_EDIT_TIME = new cField('t_event', 't_event', 'x_C_EDIT_TIME', 'C_EDIT_TIME', '`C_EDIT_TIME`', 135, 7, FALSE, '`C_EDIT_TIME`', FALSE);\n\t\t$this->C_EDIT_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_EDIT_TIME'] =& $this->C_EDIT_TIME;\n\n\t\t// C_ACTIVE_LEVELSITE\n\t\t$this->C_ACTIVE_LEVELSITE = new cField('t_event', 't_event', 'x_C_ACTIVE_LEVELSITE', 'C_ACTIVE_LEVELSITE', '`C_ACTIVE_LEVELSITE`', 3, -1, FALSE, '`C_ACTIVE_LEVELSITE`', FALSE);\n\t\t$this->C_ACTIVE_LEVELSITE->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_ACTIVE_LEVELSITE'] =& $this->C_ACTIVE_LEVELSITE;\n\n\t\t// C_TIME_ACTIVE\n\t\t$this->C_TIME_ACTIVE = new cField('t_event', 't_event', 'x_C_TIME_ACTIVE', 'C_TIME_ACTIVE', '`C_TIME_ACTIVE`', 135, 7, FALSE, '`C_TIME_ACTIVE`', FALSE);\n\t\t$this->C_TIME_ACTIVE->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_TIME_ACTIVE'] =& $this->C_TIME_ACTIVE;\n\n\t\t// C_SEND_MAIL\n\t\t$this->C_SEND_MAIL = new cField('t_event', 't_event', 'x_C_SEND_MAIL', 'C_SEND_MAIL', '`C_SEND_MAIL`', 3, -1, FALSE, '`C_SEND_MAIL`', FALSE);\n\t\t$this->C_SEND_MAIL->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_SEND_MAIL'] =& $this->C_SEND_MAIL;\n\n\t\t// C_CONTENT_MAIL\n\t\t$this->C_CONTENT_MAIL = new cField('t_event', 't_event', 'x_C_CONTENT_MAIL', 'C_CONTENT_MAIL', '`C_CONTENT_MAIL`', 201, -1, FALSE, '`C_CONTENT_MAIL`', FALSE);\n\t\t$this->fields['C_CONTENT_MAIL'] =& $this->C_CONTENT_MAIL;\n\n\t\t// C_FK_BROWSE\n\t\t$this->C_FK_BROWSE = new cField('t_event', 't_event', 'x_C_FK_BROWSE', 'C_FK_BROWSE', '`C_FK_BROWSE`', 200, -1, FALSE, '`C_FK_BROWSE`', FALSE);\n\t\t$this->fields['C_FK_BROWSE'] =& $this->C_FK_BROWSE;\n\n\t\t// FK_ARRAY_TINBAI\n\t\t$this->FK_ARRAY_TINBAI = new cField('t_event', 't_event', 'x_FK_ARRAY_TINBAI', 'FK_ARRAY_TINBAI', '`FK_ARRAY_TINBAI`', 200, -1, FALSE, '`FK_ARRAY_TINBAI`', FALSE);\n\t\t$this->fields['FK_ARRAY_TINBAI'] =& $this->FK_ARRAY_TINBAI;\n\n\t\t// FK_ARRAY_CONGTY\n\t\t$this->FK_ARRAY_CONGTY = new cField('t_event', 't_event', 'x_FK_ARRAY_CONGTY', 'FK_ARRAY_CONGTY', '`FK_ARRAY_CONGTY`', 200, -1, FALSE, '`FK_ARRAY_CONGTY`', FALSE);\n\t\t$this->fields['FK_ARRAY_CONGTY'] =& $this->FK_ARRAY_CONGTY;\n\t}", "public function getEvents();", "public function getEvents();", "abstract protected function whenAll(DomainEvents $events);", "function Submissions_Latex_Event()\n {\n $event=$this->Event();\n $event=$this->EventsObj()->ApplyAllEnums($event,TRUE);\n $event=$this->EventsObj()->TrimLatexItem($event);\n\n return $event;\n }", "function isEvent($var){\n\tif ($this->calEvents){\n\t\t$checkTime=$this->mkActiveTime(0,0,1,$this->actmonth,$var,$this->actyear);\n\t\t$selectedTime=$this->mkActiveTime(0,0,1,$this->selectedmonth,$this->selectedday,$this->selectedyear);\n\t\t$todayTime=$this->mkActiveTime(0,0,1,$this->monthtoday,$this->daytoday,$this->yeartoday);\n\t\tforeach($this->calEvents as $eventTime => $eventID){\n\t\t\tif ($eventTime==$checkTime){\n\t\t\t\tif ($eventTime==$selectedTime) $this->eventID=$this->cssPrefixSelecEvent.$eventID;\n\t\t\t\telseif ($eventTime==$todayTime) $this->eventID=$this->cssPrefixTodayEvent.$eventID;\n\t\t\t\telse $this->eventID=$eventID;\n\t\t\t\tif ($this->calEventsUrl[$eventTime]) $this->eventUrl=$this->calEventsUrl[$eventTime];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\treturn false;\n\t}\n}", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "function filterprimary()\r\n\t{\t\r\n\t\t// make date and time variables\r\n\t\t$this->_setModelState();\r\n\t $model = $this->getModel( $this->get( 'suffix' ) );\r\n\t $state = $model->getState();\r\n\t \t\t\r\n\t\t$date->current = $state->filter_date_from; \r\n\t\t\r\n\t\t$date->month = date( 'm', strtotime($date->current) );\r\n\t\t$date->year = date( 'Y', strtotime($date->current) );\r\n\t\t\r\n\t\t// date time variables\r\n\t\t$date->days = $this->getDays( $date->current );\r\n\t\t$date->hours = $this->getHours( );\r\n\t\t\r\n\t\t// datetime matrix\r\n\t\t$datetime = array( );\r\n\t\tfor ( $i = 0; $i < 3; $i++ )\r\n\t\t{\r\n\t\t\tfor ( $j = 0; $j < 24; $j++ )\r\n\t\t\t{\r\n\t\t\t\t$dayskey = $date->days[$i];\r\n\t\t\t\t$hourskey = $date->hours[$j];\r\n\t\t\t\t$datetime[$dayskey][$hourskey] = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$date->datetime = $datetime;\r\n\t\t\r\n\t\t// navigation dates\r\n\t\t$date->nextthreedate = date( 'Y-m-d', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextmonth = date( 'm', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->nextyear = date( 'Y', strtotime( $date->current . ' +3 days' ) );\r\n\t\t$date->prevthreedate = date( 'Y-m-d', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevmonth = date( 'm', strtotime( $date->current . ' -3 days' ) );\r\n\t\t$date->prevyear = date( 'Y', strtotime( $date->current . ' -3 days' ) );\r\n\t\t\r\n\t\t// aditional variables\r\n\t\t$date->startday = date( 'd', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonth = date( 'm', strtotime( $date->days[0] ) );\r\n\t\t$date->startmonthname = date( 'F', strtotime( $date->days[0] ) );\r\n\t\t$date->startyear = date( 'Y', strtotime( $date->days[0] ) );\r\n\t\t$date->endday = date( 'd', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonth = date( 'm', strtotime( $date->days[2] ) );\r\n\t\t$date->endmonthname = date( 'F', strtotime( $date->days[2] ) );\r\n\t\t$date->endyear = date( 'Y', strtotime( $date->days[2] ) );\r\n\t\t$date->nonworkingdays = $this->getNonWorkingDays( );\r\n\t\t\r\n\t\t// take filter categories and do filtering\r\n\t\t$elements = json_decode( preg_replace('/[\\n\\r]+/', '\\n', JRequest::getVar( 'elements', '', 'post', 'string' ) ) );\r\n\t\t\r\n\t\t$categories = array();\r\n\t\tforeach($elements as $element)\r\n\t\t{\r\n\t\t\tif($element->checked && strpos ( $element->name , 'primary_cat_' ) !== false )\r\n\t\t\t{\r\n\t\t\t\t$categories[$element->name] = $element->value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$model->setState( 'filter_primary_categories', $categories );\r\n\t\t\r\n\t\t// order event instances by date and time\r\n\t\t$model->setState( 'order', 'tbl.eventinstance_date' );\r\n\t\t$model->setState( 'direction', 'ASC' );\r\n\t\t$query = $model->getQuery( );\r\n\t\t$query->order( 'tbl.eventinstance_start_time' );\r\n\t\t$model->setQuery( $query );\r\n\t\t\r\n\t\t// attach variables to the $vars object\r\n\t\t$vars->date = $date;\r\n\t\t$vars->items = $model->getList( );\r\n\t\t\r\n\t\t// echo output\r\n\t\t$html = $this->getLayout( 'default', $vars, 'three' ); \r\n\t\techo ( json_encode( array('msg'=>$html) ) );\r\n\t}", "public static function eventStatus()\n {\n return [\n 'abe' => 'Aberto',\n 'fec' => 'Fechado',\n 'can' => 'Cancelado'\n ];\n }", "function kilman_set_events($kilman) {\n // Adding the kilman to the eventtable.\n global $DB;\n if ($events = $DB->get_records('event', array('modulename' => 'kilman', 'instance' => $kilman->id))) {\n foreach ($events as $event) {\n $event = calendar_event::load($event);\n $event->delete();\n }\n }\n\n // The open-event.\n $event = new stdClass;\n $event->description = $kilman->name;\n $event->courseid = $kilman->course;\n $event->groupid = 0;\n $event->userid = 0;\n $event->modulename = 'kilman';\n $event->instance = $kilman->id;\n $event->eventtype = 'open';\n $event->timestart = $kilman->opendate;\n $event->visible = instance_is_visible('kilman', $kilman);\n $event->timeduration = ($kilman->closedate - $kilman->opendate);\n\n if ($kilman->closedate && $kilman->opendate && ($event->timeduration <= kilman_MAX_EVENT_LENGTH)) {\n // Single event for the whole kilman.\n $event->name = $kilman->name;\n calendar_event::create($event);\n } else {\n // Separate start and end events.\n $event->timeduration = 0;\n if ($kilman->opendate) {\n $event->name = $kilman->name.' ('.get_string('kilmanopens', 'kilman').')';\n calendar_event::create($event);\n unset($event->id); // So we can use the same object for the close event.\n }\n if ($kilman->closedate) {\n $event->name = $kilman->name.' ('.get_string('kilmancloses', 'kilman').')';\n $event->timestart = $kilman->closedate;\n $event->eventtype = 'close';\n calendar_event::create($event);\n }\n }\n}", "public function Events($eventmask);", "function get_type_events()\n{\n return 'atu_events';\n}", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public function run()\n {\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => null, \n 'studio_id' => 1,\n 'start' => '2017-11-19 00:00:00',\n 'end' => '2017-11-20 00:00:00',\n 'price' => null,\n 'notes' => 'weekend',\n 'category' => 'unavailable'\n ]);\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => null, \n 'studio_id' => 1,\n 'start' => '2017-11-25 00:00:00',\n 'end' => '2017-11-26 00:00:00',\n 'price' => null,\n 'notes' => 'weekend',\n 'category' => 'unavailable'\n ]);\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => null, \n 'studio_id' => 1,\n 'start' => '2017-11-24 00:00:00',\n 'end' => '2017-11-25 00:00:00',\n 'price' => null,\n 'notes' => null,\n 'category' => 'holiday'\n ]);\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => 2, \n 'studio_id' => 1,\n 'start' => '2017-11-20 09:00:00',\n 'end' => '2017-11-20 11:00:00',\n 'price' => 34.00,\n 'notes' => null,\n 'category' => 'appointment'\n ]);\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => 3, \n 'studio_id' => 1,\n 'start' => '2017-11-20 12:45:00',\n 'end' => '2017-11-20 13:45:00',\n 'price' => 35.00,\n 'notes' => null,\n 'category' => 'appointment'\n ]);\n DB::table('events')->insert([\n 'employee_created_id' => 1,\n 'employee_assigned_id' => 1,\n 'client_id' => 2, \n 'studio_id' => 1,\n 'start' => '2017-11-23 11:30:00',\n 'end' => '2017-11-23 13:00:00',\n 'price' => 356.00,\n 'notes' => null,\n 'category' => 'appointment'\n ]);\n }", "function setEventContent($year,$month,$day,$content,$url=false,$id=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n$eventContent[$eventTime]=$content;\n$this->calEventContent[]=$eventContent;\n\tif (!$id) $id=$this->cssEventContent;\n$this->calEventContentId[]=$id;\n\tif ($url) $this->calEventContentUrl[]=$url;\n\telse $this->calEventContentUrl[]=$this->calInit++;\n}", "abstract public function getEventName();", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }" ]
[ "0.6040468", "0.6003769", "0.59728014", "0.5645777", "0.5570092", "0.54929346", "0.5473005", "0.5466168", "0.5433758", "0.5401978", "0.5400446", "0.5396616", "0.5381684", "0.5316299", "0.52835757", "0.5279308", "0.5258948", "0.52385557", "0.5231329", "0.5216091", "0.52133423", "0.5194806", "0.5192082", "0.51720464", "0.51494384", "0.5120021", "0.5110835", "0.5079728", "0.50587857", "0.50553715", "0.50467587", "0.502555", "0.50235844", "0.5017729", "0.50116146", "0.50060254", "0.5005062", "0.49803412", "0.49671638", "0.49267927", "0.4917638", "0.4911495", "0.490672", "0.49046993", "0.48985097", "0.48966753", "0.48772347", "0.4868271", "0.48681706", "0.4860944", "0.4854917", "0.484922", "0.48425066", "0.48384985", "0.48330528", "0.4832625", "0.48274928", "0.48164582", "0.48133767", "0.48063374", "0.48039693", "0.4796695", "0.47932675", "0.47902313", "0.4781177", "0.47708556", "0.47629198", "0.47572777", "0.47527137", "0.47483882", "0.47457945", "0.47434247", "0.47364277", "0.47337013", "0.4730486", "0.472906", "0.47268358", "0.47241428", "0.4724113", "0.47226775", "0.47037804", "0.47032925", "0.46955103", "0.4693669", "0.46914148", "0.46914148", "0.46900433", "0.46844488", "0.4682271", "0.46817622", "0.4671136", "0.46708837", "0.466942", "0.46658376", "0.46658048", "0.46656716", "0.4657881", "0.4655243", "0.4655099", "0.4654167" ]
0.6783121
0
enumerate block details from hash
public static function get_block( $hash ) { if( preg_match('/^[0-9a-f]{64}$/i', $hash) !== 1 ) return RETURN_JSON ? json_encode( ['err'=>'not a valid block hash'] ) : [ 'err'=>'not a valid block hash' ]; $base = self::base(); if( isset($base['err']) ) return RETURN_JSON ? json_encode( $base ) : $base; if( ($block = self::block($base, $hash)) === false ) return RETURN_JSON ? json_encode( ['err'=>'no block with that hash'] ) : [ 'err'=>'no block with that hash' ]; $total = 0; foreach( $block as $id => $val ) if( $id === 'tx' ) foreach( $val as $txid ) { $transaction['id'] = $txid; if( ($tx = self::tx($base, $txid)) === false ) continue; if( isset($tx['vin'][0]['coinbase']) ) $transaction['coinbase'] = true; foreach( $tx['vout'] as $entry ) if( @$entry[1]['value'] > 0.0 ) { // nasty number formatting trick that hurts my soul, but it has to be done... $total += ( $transaction['outputs'][$entry['n']]['value'] = rtrim(rtrim(sprintf('%.8f', $entry['value']), '0'), '.') ); $transaction['outputs'][$entry['n']]['address'] = $entry['scriptPubKey']['addresses'][0]; } $base['output']['transactions'][] = $transaction; $transaction = null; } elseif( in_array($id, self::$block_fields) ) $base['output']['fields'][$id] = $val; $base['output']['total_out'] = $total; $base['rpc'] = null; return RETURN_JSON ? json_encode( $base['output'] ) : $base['output']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBlock($hash);", "public function getBlockHash();", "public function getBlockInfo();", "public function getBlockHash($index);", "public function getHashIndex();", "public function hashInfo($token,$hash)\n {\n $controller = new SignaBlockController;\n $response = $controller->hashInfo($token,$hash);\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data;\n }\n }\n return response()->json($this->jsonError);\n }", "public function getHashIndex()\n {\n return $this->hashIndex;\n }", "public function getHashIndex() {\n\t\treturn $this->_hashIndex;\n\t}", "public function getHashCount() {}", "public function getHashCount() {}", "function spectra_block_txcount ($blockhash)\n\t{\n\t\t$tx_list = mysqli_getset ($GLOBALS[\"tables\"][\"tx\"], \"`in_block` = '\".$blockhash.\"'\");\n\t\t\n\t\treturn count ($tx_list[\"data\"]);\n\t}", "public static function get_block_data()\n {\n }", "public function _blockDecoder($matches) {\n return $this->blocks[$matches[1]];\n }", "public function getHash() {}", "public function getBlockCount();", "protected function hashLockClause_getHashInt() {}", "function hashTag($hash, $count) {\n //clean any html from the hash\n $hash = strip_tags($hash);\n $hash = str_replace('#', '', $hash);\n /*\n * Set up hastag endpoint\n * from: https://www.instagram.com/developer/endpoints/tags/\n * this method only gets the most recent 'cards' based on a hashtag\n */\n $newEndPoint = $this->endPoint;\n\n $newEndPoint .= '/tags/' . $hash . '/media/recent/';\n if ($this->accessToken != '') {\n $newEndPoint = $newEndPoint . \"?access_token=\" . $this->accessToken . \".\" . $this->clientID . \"&scope=public_content&count=\" . $count;\n } else {\n $newEndPoint = $newEndPoint . \"?client_id=\" . $this->clientID . \"&scope=public_content&count=\" . $count;\n }\n\n $json = file_get_contents($newEndPoint);\n $obj = json_decode($json, true);\n $objCount = count($obj['data']) ;\n //the nextline is the full json from instagram, if you are looking for something now listed.\n //print_r($obj['data']);\n \n for ($i = 0; $i <= $objCount; $i++) {\n $uniqueId = $obj['data'][$i]['id'];\n $cardImage = $obj['data'][$i]['images']['standard_resolution']['url'];\n $userName = $obj['data'][$i]['user']['username'];\n $caption = $obj['data'][$i]['caption']['text'];\n $userImage = $obj['data'][$i]['user']['profile_picture'];\n $tagCount = count($obj['data'][$i]['tags']) ;\n for ($a = 0; $a <= $tagCount; $a++) {\n if ($a == 0) {\n $thisTag = $obj['data'][$i]['tags'][$a] . \"|\";\n }\n if ($a == $tagCount) {\n $thisTag .= $obj['data'][$i]['tags'][$a];\n } else {\n $thisTag .= $obj['data'][$i]['tags'][$a] . \"|\";\n }\n }\necho \"<br/><-------------------------fake view to delete number $i--------------------------------->\";\necho \"<div style='width:600px'>\";\n echo \"<div>\" . $uniqueId . \"</div>\";\n echo \"<div>\" . $userName . \" <img src='\" . $userImage . \"' /></div>\";\n echo \"<img src='\" . $cardImage . \"' />\";\n \n echo \"<div>\" . $caption . \"</div>\";\n //echo \"<div>\" . $thisTag . \"</div></div>\";\n echo \"<-------------------------end fake view to delete number $i---------------------------------><br/>\";\n }\n /* right now I am outputting the direct image, I need to pick out the vars I want to fill the \n * database with.\n */\n }", "public function getHash();", "function getLinkInfo($hash) {\n\t\t$link = getDbConnect();\n\t\n\t\t//get the id\n\t\t$id = base_convert($hash, 36, 10);\n\n\t\t//do our search\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls WHERE id = :id;\");\n\t\t$preparedStatement->execute(array(\":id\" => $id));\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function getLockHash() {}", "final public function enumerate() {\n\t\t$result = [];\n\t\t$blkidEnumsByType = [];\n\t\t// Get all file systems that are identified by the block device\n\t\t// identification library.\n\t\t// !!! Note !!!\n\t\t// File systems that are identified by the block device identification\n\t\t// library are processed in one step to increase performance. Otherwise\n\t\t// each backend must implement the \\ref enumerate method and call the\n\t\t// command 'blkid -t TYPE=<xxx> -o full'.\n\t\t$cmd = new \\OMV\\System\\Process(\"blkid\", \"-o full\");\n\t\t$cmd->setRedirect2to1();\n\t\t$cmd->execute($output);\n\t\tforeach ($output as $outputk => $outputv) {\n\t\t\t// Parse command output:\n\t\t\t// /dev/sdb: UUID=\"e6a0f61e-d969-ffcb-d4c5-06e7711285a3\" LABEL=\"dhcppc4:0\" TYPE=\"linux_raid_member\"\n\t\t\t// /dev/sdg1: LABEL=\"test\" UUID=\"d19bcea0-a323-4aea-9791-c6578180c129\" TYPE=\"jfs\"\n\t\t\t// /dev/sda5: UUID=\"902775c7-8250-4630-81eb-2602ac65e136\" TYPE=\"swap\"\n\t\t\t// /dev/sda1: LABEL=\"Ubuntu\" UUID=\"4aa77ba3-beb6-45dc-b2c7-e77cffd6c6fd\" TYPE=\"ext4\"\n\t\t\t// /dev/sdb1: UUID=\"A27E16CD7E1699DD\" TYPE=\"ntfs\"\n\t\t\t// /dev/sdc1: UUID=\"1a03b79f-d347-4a24-8ae2-62f1aa9a4554\" TYPE=\"ext4\"\n\t\t\t// /dev/sdd1: UUID=\"cb8f7844-362f-4151-8e9e-3888aab723c2\" TYPE=\"ext4\"\n\t\t\t// /dev/sda3: UUID=\"fdca09a8-cbc8-432f-9cba-ce033cb59139\" TYPE=\"ext4\" LABEL=\"Debian\"\n\t\t\t// /dev/sr0: LABEL=\"Debian 7.5.0 amd64 1\" TYPE=\"iso9660\"\n\t\t\t// /dev/sr0: UUID=\"2015-04-25-12-52-13-00\" LABEL=\"Debian 8.0.0 amd64 1\" TYPE=\"iso9660\" PTUUID=\"5e97595e\" PTTYPE=\"dos\"\n\t\t\t// /dev/sda1: LABEL=\"Music\" UUID=\"54AF-0252\" TYPE=\"exfat\"\n\t\t\t// /dev/sdk: LABEL=\"TestFS\" UUID=\"b7adba40-b980-4067-b33c-dd5c8ee17044\" UUID_SUB=\"7b19094b-e7df-4a3e-a3db-57e2d4c548b3\" TYPE=\"btrfs\"\n\t\t\t// /dev/sdl: LABEL=\"TestFS\" UUID=\"b7adba40-b980-4067-b33c-dd5c8ee17044\" UUID_SUB=\"ba1e2b16-5022-4cbd-ad35-6d609e9560e9\" TYPE=\"btrfs\"\n\t\t\t$regex = '/^(\\S+):\\s*(.+)$/i';\n\t\t\tunset($matches);\n\t\t\tif (1 !== preg_match($regex, $outputv, $matches))\n\t\t\t\tcontinue;\n\t\t\t// Set default values and extract key/value pairs.\n\t\t\t$data = [\n\t\t\t\t\"devicefile\" => $matches[1],\n\t\t\t\t\"uuid\" => \"\",\n\t\t\t\t\"label\" => \"\",\n\t\t\t\t\"type\" => \"\"\n\t\t\t];\n\t\t\t$parts = preg_split(\"/(\\S+=\\\\\\\"[^\\\\\\\"]+\\\\\\\")|[\\s]+/\", $matches[2],\n\t\t\t -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\t\t\tforeach ($parts as $partk => $partv) {\n\t\t\t\t$keyValue = explode(\"=\", $partv);\n\t\t\t\tif (count($keyValue) != 2)\n\t\t\t\t\tcontinue;\n\t\t\t\t$data[mb_strtolower($keyValue[0])] = substr(\n\t\t\t\t\t$keyValue[1], 1, -1);\n\t\t\t}\n\t\t\t// Append the found filesystem to the list for further processing.\n\t\t\tif (!array_key_exists($data['type'], $blkidEnumsByType))\n\t\t\t\t$blkidEnumsByType[$data['type']] = [];\n\t\t\t$blkidEnumsByType[$data['type']][] = $data;\n\t\t}\n\t\t// Now process all filesystems that are supported.\n\t\tforeach ($this->map as $backendk => $backendv) {\n\t\t\t$enums = [];\n\t\t\tif (TRUE === $backendv->isBlkidEnumerated()) {\n\t\t\t\t// Get the filesystem type handled by this backend, e.g.\n\t\t\t\t// 'vfat', 'ntfs' or 'ext4'.\n\t\t\t\t$type = $backendv->getType();\n\t\t\t\t// Check if the 'blkid' command in the previous step has\n\t\t\t\t// detected some filesystems of this type.\n\t\t\t\tif (!array_key_exists($type, $blkidEnumsByType))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Get the details of the filesystems that are detected by\n\t\t\t\t// 'blkid'. This is an array of objects with (at least) the\n\t\t\t\t// fields \\em devicefile, \\em uuid, \\em label and \\em type.\n\t\t\t\t$blkidEnums = $blkidEnumsByType[$type];\n\t\t\t\t// Finally let the backend process the list of detected\n\t\t\t\t// filesystems.\n\t\t\t\t$enums = $backendv->enumerateByBlkid($blkidEnums);\n\t\t\t} else {\n\t\t\t\t// Ask the backend for filesystem candidates.\n\t\t\t\t$enums = $backendv->enumerate();\n\t\t\t}\n\t\t\t// Validate the filesystems to ensure that the associative\n\t\t\t// array/dictionary contains at least the required fields.\n\t\t\tforeach ($enums as $enumk => $enumv) {\n\t\t\t\t$requiredKeys = ['devicefile', 'uuid', 'label', 'type'];\n\t\t\t\tif (!array_keys_exists($requiredKeys, $enumv)) {\n\t\t\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\t\t\"The array does not contain the required keys %s.\",\n\t\t\t\t\t\timplode(\", \", $requiredKeys)));\n\t\t\t\t}\n\t\t\t\t$result[] = $enumv;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function get_dynamic_block_names()\n {\n }", "function tammuz_block_info() {\r\n\t$blocks = array();\r\n\t\r\n\r\n\t$blocks['add_journey'] = array(\r\n\t\t// The name that will appear in the block list.\r\n\t\t'info' => t('Add a journey to the customer'),\r\n\t\t// Default setting.\r\n\t\t'cache' => DRUPAL_CACHE_PER_ROLE,\r\n\t);\r\n\treturn $blocks;\r\n}", "private function collect_infohash( string $infohash ) {\n\t\t$this->infohashes[] = $infohash;\n\t}", "final public function getHash() {}", "public function getBlockNames()\n {\n return array_keys($this->blocks);\n }", "function spectra_search_block ($search_text)\n\t{\n\t\techo \"\t\t<h2> Block Hash Search Results: </h2> \\n\\n\";\n\n\t\t$block = mysqli_getset ($GLOBALS[\"tables\"][\"block\"], \"`hash` LIKE '%\".$_POST[\"searchtext\"].\"%'\");\n\n\t\tif (!isset ($block[\"data\"]) || $block[\"data\"] == \"\")\n\t\t{\n\t\t\techo \"\t\t<p class=\\\"search_dark\\\"> No Matching Block Records </p> \\n\\n\";\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\techo \"\t\t<p class=\\\"search_dark\\\"> Block Hashes Containing \\\"\".substr ($_POST[\"searchtext\"], 0, 32).\"...\\\": </p> \\n\\n\";\n\n\t\t\tforeach ($block[\"data\"] as $block_data)\n\t\t\t{\n\t\t\t\techo \"\t\t<p> \\n\";\n\t\t\t\techo \"\t\t<a href=\\\"block.php?hash=\".$block_data[\"hash\"].\"\\\" title=\\\"Block Detaiil Page\\\"> \\n\";\n\t\t\t\techo \"\t\t\t\".$block_data[\"hash\"].\"\\n\";\n\t\t\t\techo \"\t\t</a> \\n\";\n\t\t\t\techo \"\t\t</p> \\n\\n\";\n\t\t\t}\n\t\t}\n\t}", "private function collect_infohash($infohash)\n {\n $this->infohashes[] = $infohash;\n }", "function findHash($hashToFind, $len = 4)\n {\n $max = pow(26, $len);\n $s = str_pad('',$len,\"a\",STR_PAD_LEFT);\n for ($i=0; $i<$max; $i++, $s++) {\n if (RSHash($s)==$hashToFind) {\n yield $s;\n }\n }\n }", "public function getNextBlock();", "public function getStateHash()\n {\n return $this->_hash;\n }", "public function getHash()\n\t{\n\t\treturn $this->_hash ;\n\t}", "public function getHash()\n\t{\n\t\treturn $this->hash;\n\t}", "function GetNameForHash($hash){\n $hash_array = parse_ini_file(\"Hashes.txt\");\n return $hash_array[$hash];\n }", "function GetBlocks($thing) {\n\t\n\t\n\t\t//query here to find the most liked \n\t\t$thingID = $thing->ID;\n\t\t\n\t\t$innerQuery = \"\tSELECT `image`, MAX(likes) AS HighestBlock \n\t\t\t\tFROM `blocks`\n\t\t\t\tWHERE `thing_id` = $thingID \n\t\t\t\t\";\n\t\t\t\t\n\t\tglobal $db;\n\t\t\t\t\n\t\t$blocks = $db->select($innerQuery);\n\t\t\n\t\tif(count($blocks)!=0){\n\t\t\t$topBlockImage = $blocks[0]->image;\n\t\t}\n\t\n\t\t$keyValuePairs = array(\n\t\t\n\t\t\t\"id\" \t\t\t=> \t$thingID,\n\t\t\t\"title\"\t\t\t=> \t$thing->title,\n\t\t\t\"post_time\"\t\t=>\t$thing->post_time,\n\t\t\t\"image\"\t\t\t=>\t$topBlockImage\n\t\t);\n\t\t\n\t\treturn $keyValuePairs;\n\t}", "public function hash($token,$hash)\n {\n $controller = new SignaBlockController;\n $response = $controller->hash($token,$hash); \n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->tx_hash;\n }\n }\n return response()->json($this->jsonError);\n }", "public function info(string $hash): array\n {\n return password_get_info($hash);\n }", "public function listSinceBlock($blockhash = null, $targetConfirmations = null);", "function profile_ctools_block_info($module, $delta, &$info) {\n // do with context.\n $info = NULL;\n}", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHash()\n {\n return $this->hash;\n }", "public function getHashIdentifier() : string;", "static function password_get_info($hash) {\n $return = array(\n 'algo' => 0,\n 'algoName' => 'unknown',\n 'options' => array(),\n );\n if (strlen($hash) === 60 && preg_match('#^\\$2([axy])\\$(\\d+)\\$#', $hash, $hash)) {\n $return['algo'] = PASSWORD_BCRYPT;\n $return['algoName'] = ltrim($hash[1] . 'bcrypt', 'y');\n $return['options']['cost'] = $hash[2];\n } elseif (strlen($hash) === 34 && preg_match('#^\\$[PM]\\$(.)#', $hash, $hash)) {\n $hash = strpos(self::$itoa64, $hash[1]);\n if (7 <= $hash && $hash <= 30) {\n $return['algoName'] = 'phpass-md5';\n $return['options']['cost'] = $hash - 5;\n }\n }\n return $return;\n }", "public function enumerateObjectsUsingBlock(\\Closure $block)\n {\n foreach ($this->array as $key => $value) {\n $block($value, $key);\n }\n }", "public function getStateHash()\n {\n return $this->stateHash;\n }", "public function getHash() {\n\t\treturn $this->Hash;\n\t}", "public function createUniqueKeysForBlocks() {\n $blocks = $this->getActions();\n $keys = [];\n foreach ($blocks as $block) {\n $keys[] = ($block['view_mode']) ? $block['machine_name'] . '+' . $block['view_mode'] : $block['machine_name'];\n }\n\n return $keys;\n }", "public function info($hashedValue)\n {\n\n }", "public function info() {\n echo \"<b>Improved Hash Algorithm</b><br>\";\n echo \"Version: \" . IHA_VERSION . \"<br>\";\n echo \"Algorithm: \" . (($this->sha1 == true AND function_exists(\"sha1\")) ? \"SHA1\" : \"MD5\") . \"<br>\";\n echo \"Rounds: \" . $this->rounds . \"<br>\";\n echo \"Salt-Length: \" . $this->saltLng . \"<br>\";\n echo \"Password: \" . ((empty($this->password)) ? \"No\" : \"Yes\") . \"<br>\";\n\n $this->benchmark();\n\n echo \"<br><br><br>\";\n }", "function password_get_info($hash) {\r\n $return = array(\r\n 'algo' => 0,\r\n 'algoName' => 'unknown',\r\n 'options' => array(),\r\n );\r\n if (_substr($hash, 0, 4) == '$2y$' && _strlen($hash) == 60) {\r\n $return['algo'] = PASSWORD_BCRYPT;\r\n $return['algoName'] = 'bcrypt';\r\n list($cost) = sscanf($hash, \"$2y$%d$\");\r\n $return['options']['cost'] = $cost;\r\n }\r\n return $return;\r\n }", "function password_get_info($hash) {\n $return = array(\n 'algo' => 0,\n 'algoName' => 'unknown',\n 'options' => array(),\n );\n if (substr($hash, 0, 4) == '$2y$' && strlen($hash) == 60) {\n $return['algo'] = PASSWORD_BCRYPT;\n $return['algoName'] = 'bcrypt';\n list($cost) = sscanf($hash, \"$2y$%d$\");\n $return['options']['cost'] = $cost;\n }\n return $return;\n }", "public function getHash(): string\n {\n return $this->data->hash;\n }", "private function parseLine() {\n $hash = array();\n $line = explode(':', fgets($this->handle));\n $key = array_shift($line);\n\n $hash[$key] = trim(implode(\":\", $line));\n \n return $hash;\n }", "public function getItemHash(GetHashEvent $event): void\n {\n $data = $event->getData();\n\n if ($data instanceof IItem) {\n $hash = sprintf(\n '%s_%s',\n $data->getMetaModel()->getTableName(),\n $data->get('id')\n );\n\n $event->setHash($hash);\n }\n }", "function get_block_id ($gid1, $gid2) {\n $values_gid1 = array(\n 'subject_id' => $gid1,\n 'type_id' => array (\n 'cv_id' => array (\n 'name' => 'sequence',\n ),\n 'name' => 'member_of',\n 'is_obsolete' => 0\n ),\n );\n\n $blk_region_gid1 = chado_select_record(\n 'feature_relationship', \n array('object_id'),\n $values_gid1\n );\n\n $values_gid2 = array(\n 'subject_id' => $gid2,\n 'type_id' => array ( \n 'cv_id' => array (\n 'name' => 'sequence',\n ),\n 'name' => 'member_of',\n 'is_obsolete' => 0\n ),\n );\n\n $blk_region_gid2 = chado_select_record(\n 'feature_relationship', \n array('object_id'), \n $values_gid2\n );\n\n // locate the block id shard by gid1 and gid2 \n $blk_html = '';\n foreach ($blk_region_gid1 as $blk1) {\n foreach ($blk_region_gid2 as $blk2) { \n // search block id shared by gid 1 and gid2\n $bid = db_query('SELECT blockid FROM {synblock} WHERE (b2=:blk1 AND b1=:blk2) OR (b1=:blk1 AND b2=:blk2)', \n\t\t\t array(\n ':blk1' => $blk1->object_id,\n ':blk2' => $blk2->object_id,\n\t\t\t )\n\t\t )->fetchField();\n $blk_html.= l($bid, \"synview/block/\" . $bid, array('attributes' => array('target' => \"_blank\")));\n }\n }\n\n if (empty($blk_html)) {\n $blk_html = 'NA';\n }\n\n\n return $blk_html; \n}", "private static function _getHash(self $item) {}", "function getBlockInformation($module, $result, $col_fields,$tabid,$block_label,$mode,$supportmultiapprove=false)\n{\n\tglobal $log;\n\t//changed by dingjianting on 2007-11-05 for php5.2.x\n\t$log->debug(\"Entering getBlockInformation() method ...\");\n\tglobal $adb;\n\t$editview_arr = Array();\n\t$returndata = Array();\n\n\tglobal $current_user,$mod_strings;\n \n\t$noofrows = $adb->num_rows($result);\n\n\tfor($i=0; $i<$noofrows; $i++)\n\t{\n\t\t$fieldtablename = $adb->query_result($result,$i,\"tablename\");\t\n\t\t$fieldcolname = $adb->query_result($result,$i,\"columnname\");\t\n\t\t$uitype = $adb->query_result($result,$i,\"uitype\");\t\n\t\t$fieldname = $adb->query_result($result,$i,\"fieldname\");\t\n\t\t$fieldlabel = $adb->query_result($result,$i,\"fieldlabel\");\n\t\t$block = $adb->query_result($result,$i,\"block\");\n\t\t$maxlength = $adb->query_result($result,$i,\"maximumlength\");\n\t\t$generatedtype = $adb->query_result($result,$i,\"generatedtype\");\n\t\t$typeofdata = $adb->query_result($result,$i,\"typeofdata\");\n //$multifieldid=$adb->query_result($result,$i,\"multifieldid\");\n\t\t$mandatory = 0;\n\t\tif(substr_count($typeofdata,\"~M\") > 0) {\n\t\t\t$mandatory = 1;\n\t\t}\n\t\t$readonly = 1;\n\t\t$custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module,$mode,$mandatory,$typeofdata);\n\t\t$custfld[0][1] = $readonly;\n\t\t$custfld[0][2] = $mandatory;\n\t\t$editview_arr[$block][]=$custfld;\n\t\t//if (isset($mvAdd_flag) && $mvAdd_flag == true) {\n\t\t//\t$mvAdd_flag = false;\n\t\t//}\n\t\t$i++;\n\t\tif($i<$noofrows)\n\t\t{\n\t\t\t$fieldtablename = $adb->query_result($result,$i,\"tablename\");\t\n\t\t\t$fieldcolname = $adb->query_result($result,$i,\"columnname\");\t\n\t\t\t$uitype = $adb->query_result($result,$i,\"uitype\");\t\n\t\t\t$fieldname = $adb->query_result($result,$i,\"fieldname\");\t\n\t\t\t$fieldlabel = $adb->query_result($result,$i,\"fieldlabel\");\n\t\t\t$block = $adb->query_result($result,$i,\"block\");\n\t\t\t$maxlength = $adb->query_result($result,$i,\"maximumlength\");\n\t\t\t$generatedtype = $adb->query_result($result,$i,\"generatedtype\");\n\t\t\t$typeofdata = $adb->query_result($result,$i,\"typeofdata\");\n //$multifieldid=$adb->query_result($result,$i,\"multifieldid\");\n\t\t\t$mandatory = 0;\n\t\t\tif(substr_count($typeofdata,\"~M\") > 0) {\n\t\t\t\t$mandatory = 1;\n\t\t\t}\n\t\t\t//added by dingjianting on 2007-2-5 for approve function by read/write permittion\n\t\t\t$readonly = 1;\n\t\t\t\n\t\t\t$custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module,$mode,$mandatory,$typeofdata);\n\t\t $custfld[0][1] = $readonly;\n\t\t\t$custfld[0][2] = $mandatory;\n\t\t\t\n\t\t\t$editview_arr[$block][]=$custfld;\n\t\t}\n\t}\n\tforeach($editview_arr as $headerid=>$editview_value)\n\t{\n\t\t$editview_data = Array();\n\t\tfor ($i=0,$j=0;$i<count($editview_value);$i=$i+2,$j++)\n\t\t{\n\t\t\t$key1=$editview_value[$i];\n\t\t\t$key2 = null;\n\t\t\tif(isset($editview_value[$i+1]) && is_array($editview_value[$i+1]))\n\t\t\t{\n\t\t\t\t$key2 = $editview_value[$i+1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$key2 = array();\n\t\t\t}\n\t\t\t$editview_data[$j]=array(0 => $key1,1 => $key2);\n\t\t}\n\t\t$editview_arr[$headerid] = $editview_data;\n\t}\n\tforeach($block_label as $blockid=>$label)\n\t{ \n\t\t\n\t\tif($label == '')\n\t\t{\n\t\t\tif(isset($mod_strings[$curBlock])) {\n\t\t\t\t$curBlock = $mod_strings[$curBlock];\n\t\t\t}\t\t\t$returndata[$curBlock]=array_merge((array)$returndata[$curBlock],(array)$editview_arr[$blockid]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$curBlock = $label;\n\t\t\tif(isset($mod_strings[$label])) {\n\t\t\t\t$label = $mod_strings[$label];\n\t\t\t}\n\t\t\tif(isset($returndata[$label]) && is_array($returndata[$label])) {\n\t\t\t\t$returndata_arr = $returndata[$label];\n\t\t\t} else {\n\t\t\t\t$returndata_arr = array();\n\t\t\t}\n\t\t\tif(isset($editview_arr[$blockid]) && is_array($editview_arr[$blockid])) {\n\t\t\t\t//$returndata[$label]=array_merge((array)$returndata[$label],(array)$editview_arr[$blockid]);\n\t\t\t\t$returndata[$label] = array_merge((array)$returndata_arr,(array)$editview_arr[$blockid]);\n\t\t\t}\n\t\t}\n\t}\n\t$log->debug(\"Exiting getBlockInformation method ...\");\n\treturn $returndata;\t\n\t\n}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function info($hashedValue);", "function spectra_block_top ()\n\t{\n\t\t$hash = getbestblockhash ();\n\t\t$block = getblock ($hash);\n\t\t\n\t\treturn $block;\n\t}", "public function getIblockId()\n {\n return $this->iblockId;\n }", "public function getChildHash()\n {\n return $this->childHash;\n }", "public function get_blocks ()\n {\n return $this->_blocks;\n }", "function OP_RETURN_unpack_block($binary)\n\t{\n\t\t$buffer=new OP_RETURN_buffer($binary);\n\t\t$block=array();\n\t\t\n\t\t$block['version']=$buffer->shift_unpack(4, 'V');\n\t\t$block['hashPrevBlock']=$buffer->shift_unpack(32, 'H*', true);\n\t\t$block['hashMerkleRoot']=$buffer->shift_unpack(32, 'H*', true);\n\t\t$block['time']=$buffer->shift_unpack(4, 'V');\n\t\t$block['bits']=$buffer->shift_unpack(4, 'V');\n\t\t$block['nonce']=$buffer->shift_unpack(4, 'V');\n\t\t$block['tx_count']=$buffer->shift_varint();\n\t\t\n\t\t$block['txs']=array();\n\t\t\n\t\t$old_ptr=$buffer->used();\n\t\t\n\t\twhile ($buffer->remaining()) {\n\t\t\t$transaction=OP_RETURN_unpack_txn_buffer($buffer);\n\t\t\t$new_ptr=$buffer->used();\n\t\t\t$size=$new_ptr-$old_ptr;\n\t\t\t\n\t\t\t$raw_txn_binary=substr($binary, $old_ptr, $size);\n\t\t\t$txid=reset(unpack('H*', strrev(hash('sha256', hash('sha256', $raw_txn_binary, true), true))));\n\t\t\t$old_ptr=$new_ptr;\n\t\t\n\t\t\t$transaction['size']=$size;\n\t\t\t$block['txs'][$txid]=$transaction;\n\t\t}\n\t\t\n\t\treturn $block;\n\t}", "public function blocks() { return $this->_m_blocks; }", "function getPostHash($hash, $users) {\n\t\t\t\n\t\t\t$endpoint = 'https://api.instagram.com/v1/tags/'.$hash.'/media/recent?client_id='.$this->client_id.'&count=80';\n \t\t\t\n\t\t\tfor ( $i = 0; $i < 2; $i++ ) {\n\t\t\t\n $data = $this->doCurl($endpoint);\n\t\t\t\n \t\t\tforeach( $data['data'] as $instagram ){\t\n \t\t\t\tif( in_array($instagram['user']['username'], $users) ) {\n \t\t\t\t\n \t\t\t\t\t$first = explode('/p/', $instagram['link']);\n \t\t\t\t\t$id = $first[1];\n \t\t\t\t\n \t\t\t\t\t $instagramArr[] = array('type' => 'instagram', 'id' => $id, 'handle' => $instagram['user']['username'], 'text' => '', 'img' => $instagram['images']['standard_resolution']['url'], 'time' => $instagram['created_time']);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t$endpoint = isset($data['pagination']['next_url']) ? $data['pagination']['next_url'] : NULL; \t\t\t\n\t\t\t}\n\n\t\treturn $instagramArr;\n\t}", "public static function identicon($_hash,$_size=NULL) {\n\t\t$_blox=F3::$global['IBLOCKS'];\n\t\tif (is_null($_size))\n\t\t\t$_size=F3::$global['IPIXELS'];\n\t\t// Rotatable shapes\n\t\t$_dynamic=array(\n\t\t\tarray(.5,1,1,0,1,1),\n\t\t\tarray(.5,0,1,0,.5,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.5),\n\t\t\tarray(0,.5,.5,0,1,.5,.5,1,.5,.5),\n\t\t\tarray(0,.5,1,0,1,1,0,1,1,.5),\n\t\t\tarray(1,0,1,1,.5,1,1,.5,.5,.5),\n\t\t\tarray(0,0,1,0,1,.5,0,0,.5,1,0,1),\n\t\t\tarray(0,0,.5,0,1,.5,.5,1,0,1,.5,.5),\n\t\t\tarray(.5,0,.5,.5,1,.5,1,1,.5,1,.5,.5,0,.5),\n\t\t\tarray(0,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,.5,.5,1,1,.5,.5,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.75,.5,.5,1,.25),\n\t\t\tarray(0,.5,.5,0,.5,.5,1,0,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,1,1,0,1,1,.5,.5,.25,.5,.75,0,.5,.5,.25),\n\t\t\tarray(0,.5,.5,.5,.5,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,.5,.5,.5,0,0,.5,1,.5,.5,1,.5,.5,0,1)\n\t\t);\n\t\t// Fixed shapes (for center sprite)\n\t\t$_static=array(\n\t\t\tarray(),\n\t\t\tarray(0,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,.5,.5,1,0,.5),\n\t\t\tarray(0,0,1,0,1,1,0,1,0,.5,.5,1,1,.5,.5,0,0,.5),\n\t\t\tarray(.25,0,.75,0,.5,.5,1,.25,1,.75,.5,.5,\n\t\t\t\t.75,1,.25,1,.5,.5,0,.75,0,.25,.5,.5),\n\t\t\tarray(0,0,.5,.25,1,0,.75,.5,1,1,.5,.75,0,1,.25,.5),\n\t\t\tarray(.33,.33,.67,.33,.67,.67,.33,.67),\n\t\t\tarray(0,0,.33,0,.33,.33,.67,.33,.67,0,1,0,1,.33,.67,.33,\n\t\t\t\t.67,.67,1,.67,1,1,.67,1,.67,.67,.33,.67,.33,1,0,1,\n\t\t\t\t0,.67,.33,.67,.33,.33,0,.33)\n\t\t);\n\t\t// Parse MD5 hash\n\t\t$_hash=F3::resolve($_hash);\n\t\tlist($_bgR,$_bgG,$_bgB)=self::rgb(F3::$global['BGCOLOR']);\n\t\tlist($_fgR,$_fgG,$_fgB)=self::rgb(substr($_hash,0,6));\n\t\t$_shapeC=hexdec($_hash[6]);\n\t\t$_angleC=hexdec($_hash[7]%4);\n\t\t$_shapeX=hexdec($_hash[8]);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_shapeS[$_i]=hexdec($_hash[9+$_i*2]);\n\t\t\t$_angleS[$_i]=hexdec($_hash[10+$_i*2]%4);\n\t\t}\n\t\t// Start with NxN blank slate\n\t\t$_identicon=imagecreatetruecolor($_size*$_blox,$_size*$_blox);\n\t\timageantialias($_identicon,TRUE);\n\t\t$_bg=imagecolorallocate($_identicon,$_bgR,$_bgG,$_bgB);\n\t\t$_fg=imagecolorallocate($_identicon,$_fgR,$_fgG,$_fgB);\n\t\t// Generate corner sprites\n\t\t$_corner=imagecreatetruecolor($_size,$_size);\n\t\timagefill($_corner,0,0,$_bg);\n\t\t$_sprite=$_dynamic[$_shapeC];\n\t\tfor ($_i=0,$_len=count($_sprite);$_i<$_len;$_i++)\n\t\t\t$_sprite[$_i]=$_sprite[$_i]*$_size;\n\t\timagefilledpolygon($_corner,$_sprite,$_len/2,$_fg);\n\t\tfor ($_i=0;$_i<$_angleC;$_i++)\n\t\t\t$_corner=imagerotate($_corner,90,$_bg);\n\t\t// Generate side sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_side[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_side[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeS[$_i]];\n\t\t\tfor ($_j=0,$_len=count($_sprite);$_j<$_len;$_j++)\n\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\timagefilledpolygon($_side[$_i],$_sprite,$_len/2,$_fg);\n\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t$_side[$_i]=imagerotate($_side[$_i],90,$_bg);\n\t\t}\n\t\t// Generate center sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_center[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_center[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeX];\n\t\t\tif ($_blox%2>0 && $_i==$_blox-3)\n\t\t\t\t// Odd center sprites\n\t\t\t\t$_sprite=$_static[$_shapeX%8];\n\t\t\t$_len=count($_sprite);\n\t\t\tif ($_len) {\n\t\t\t\tfor ($_j=0;$_j<$_len;$_j++)\n\t\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\t\timagefilledpolygon($_center[$_i],$_sprite,$_len/2,$_fg);\n\t\t\t}\n\t\t\tif ($_i<($_blox-3))\n\t\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t\t$_center[$_i]=imagerotate($_center[$_i],90,$_bg);\n\t\t}\n\t\t// Paste sprites\n\t\tfor ($_i=0;$_i<4;$_i++) {\n\t\t\timagecopy($_identicon,$_corner,0,0,0,0,$_size,$_size);\n\t\t\tfor ($_j=0;$_j<$_blox-2;$_j++) {\n\t\t\t\timagecopy($_identicon,$_side[$_j],\n\t\t\t\t\t$_size*($_j+1),0,0,0,$_size,$_size);\n\t\t\t\tfor ($_k=$_j;$_k<$_blox-3-$_j;$_k++)\n\t\t\t\t\timagecopy($_identicon,$_center[$_k],\n\t\t\t\t\t\t$_size*($_k+1),$_size*($_j+1),0,0,$_size,$_size);\n\t\t\t}\n\t\t\t$_identicon=imagerotate($_identicon,90,$_bg);\n\t\t}\n\t\tif ($_blox%2>0)\n\t\t\t// Paste odd center sprite\n\t\t\timagecopy($_identicon,$_center[$_blox-3],\n\t\t\t\t$_size*(floor($_blox/2)),$_size*(floor($_blox/2)),0,0,\n\t\t\t\t$_size,$_size);\n\t\t// Resize\n\t\t$_resized=imagecreatetruecolor($_size,$_size);\n\t\timagecopyresampled($_resized,$_identicon,0,0,0,0,$_size,$_size,\n\t\t\t$_size*$_blox,$_size*$_blox);\n\t\t// Make the background transparent\n\t\timagecolortransparent($_resized,$_bg);\n\t\tif (PHP_SAPI!='cli' && !headers_sent())\n\t\t\theader(F3::HTTP_Content.': image/png');\n\t\timagepng($_resized,NULL,self::PNG_Compress,PNG_NO_FILTER);\n\t\t// Free resources\n\t\timagedestroy($_identicon);\n\t\timagedestroy($_resized);\n\t\timagedestroy($_corner);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\timagedestroy($_side[$_i]);\n\t\t\timagedestroy($_center[$_i]);\n\t\t}\n\t}", "public function getHash(){\n\t\treturn $this->name->getHash();\n\t}", "abstract public function getDataxTrackHash();", "public function getblock($hash){\n return $this->bitcoin->getblock($hash);\n }", "public function getblockhash($num = 0){\n return $this->bitcoin->getblockhash($num);\n }", "public function getDescriptionHash()\n {\n return $this->description_hash;\n }", "public function ethGetBlockTransactionCountByHash(Hash32 $hash): Promise\n {\n $data = [(string) $hash];\n return $this->callEndpoint('eth_getBlockTransactionCountByHash', 1, \\int::class, $data);\n }", "function getBlock($offset){\r\n\tglobal $block_hash, $block, $tx_count, $count;\r\n\t$url = \"https://blockstream.info/api/block/\".$block_hash.\"/txs/\".$offset;\r\n\t$b = file_get_contents($url);\r\n\t$txs = json_decode($b,TRUE);\r\n\tif($count <= $tx_count){ \r\n\t\tarray_push($block, $txs); \r\n\t\t$count += count($txs);\r\n\t\t$offset = $offset + 25;\r\n\t\tif(300 % $offset == 0) { usleep(1000000); } // sleep for 1 second every dozen pages (in case rate limit)\r\n\t\tif(count($txs) > 0){ getBlock($offset); }else{ save($b); }\r\n\t}\r\n\tif($count == $tx_count){ echo \"Done\"; }\r\n}", "function DataHash(){\n return($this->data);\n }", "public function parseBlockFile($fname)\n {\n $blocks = 0;\n\n $log = $this->logger();\n $log->info(\"Processing file: \" . $fname);\n\n $content = file_get_contents($fname);\n $lines = explode(\"\\n\", $content);\n $delim = \"====\";\n $block = null;\n foreach ($lines as $line) {\n $line = trim($line);\n if (strlen($line) < 1) {\n continue;\n }\n \n if (!strncmp($line, $delim, strlen($delim))) {\n $blocks++;\n $this->cacheBlock($block);\n $block = null;\n } else {\n $block .= (($block) ? '|' : '') . $line;\n }\n }\n return $blocks;\n }", "public function getHash()\n {\n return $this->getData(self::HASH);\n }", "public function updateItemHashes()\n {\n foreach ($this->getItems() as $itemHash => $item) {\n $this->updateItemHash($itemHash);\n }\n }", "public function getCacheKeyInfo()\n {\n // Get Magento's standard product list block cache key info\n $info = parent::getCacheKeyInfo();\n\n // Dispatch event so others can modfify cache key info of this block without modifying module\n Mage::dispatchEvent('st_productlistblockcache_cache_info_add_before', array('cache_key_info' => $info));\n\n /** @var Mage_Catalog_Model_Category|null $currentCategory Current category model or null */\n $currentCategory = Mage::registry('current_category');\n\n /** @var string $categoryId Current category id. Empty string if we don't know. */\n $categoryId = '';\n\n // If we know current category, then add category id to cache key info\n if ($currentCategory instanceof Mage_Catalog_Model_Category) {\n $categoryId = $currentCategory->getId();\n }\n\n // Add category_id to cache key info\n $info['category_id'] = $categoryId;\n\n /** @var int $customerGroupId Get logged in user's customer group id */\n $customerGroupId = (int) Mage::getSingleton('customer/session')->getCustomerGroupId();\n\n // Add customer_group to cache key info\n $info['customer_group'] = $customerGroupId;\n\n /** @var int $currentWebsiteId Current website ID */\n $currentWebsiteId = (int) Mage::app()->getWebsite()->getId();\n\n // Add website_id to cache key info\n $info['website_id'] = $currentWebsiteId;\n\n /** @var string $layerStateKey */\n $layerStateKey = $this->getLayer()->getStateKey();\n $info['layer_state_key'] = $layerStateKey;\n \n /** @var string $formKey */\n $formKey = Mage::getSingleton('core/session')->getFormKey();\n $info['form_key'] = $formKey;\n\n /** @var string $originalRequestUri */\n $originalRequestUri = Mage::app()->getRequest()->getOriginalRequest()->getRequestUri();\n $info['request_uri'] = $originalRequestUri;\n\n // Current currency code\n $info['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();\n\n // Current locale code\n $info['locale'] = Mage::app()->getLocale()->getLocaleCode();\n\n // Dispatch event so others can modfify cache key info of this block without modifying module\n Mage::dispatchEvent('st_productlistblockcache_cache_info_add_after', array('cache_key_info' => $info));\n\n return $info;\n }", "public function blocklistAction()\n {\n // Module name\n $name = $this->params('name', '');\n\n $rowset = Pi::model('block')->select(['module' => $name]);\n $blocks = [];\n foreach ($rowset as $row) {\n if ('tab' == $row->type) {\n continue;\n }\n $blocks[] = [\n 'id' => $row->id,\n 'name' => $row->name,\n 'caption' => $row->title,\n 'description' => $row->description,\n ];\n }\n\n return [\n 'status' => 1,\n 'data' => $blocks,\n ];\n }", "public function getPrevBlock();", "public function getInfo() {\n return array(\n \"Hash\" => $this->getName(),\n \"Connected\" => $this->isConnected() ? \"yes\" : \"no\",\n \"IP:Port\" => $this->getIp().\":\".$this->getPort(),\n \"Line In\" => $this->getLineIn(),\n \"Line Out \" => $this->getLineOut(),\n \"Dec Key\" => Utils::bin2hex($this->getDecryptionKey(),64),\n \"Enc Key\" => Utils::bin2hex($this->getEncryptionKey(),64),\n );\n }", "function get24HourBlockIndex(){\n global $mysqli;\n $one_day = (60 * 60 * 24 * 1); // 60 seconds x 60 minutes x 24 hours x 1 day\n $block_time = time() - $one_day; // Block time 24 hours ago\n $results = $mysqli->query(\"SELECT block_index FROM blocks WHERE block_time >= {$block_time} ORDER BY block_index ASC LIMIT 1\");\n if($results && $results->num_rows){\n $row = $results->fetch_assoc();\n return $row['block_index'];\n }\n return 0;\n}", "public function load_blocks_list() {\n $tmp_blocks = apply_filters('wpucacheblocks_blocks', array());\n $blocks = array();\n foreach ($tmp_blocks as $id => $block) {\n /* Path ex : /tpl/header/block.php */\n if (!isset($block['fullpath']) && !isset($block['path'])) {\n /* A path should always be defined */\n continue;\n }\n /* Full path to the file */\n if (!isset($block['fullpath'])) {\n $block['fullpath'] = get_stylesheet_directory() . $block['path'];\n }\n\n /* Reload hooks */\n if (!isset($block['reload_hooks']) || !is_array($block['reload_hooks'])) {\n $block['reload_hooks'] = array();\n } else {\n /* Keep a list of all hooks used */\n foreach ($block['reload_hooks'] as $hook) {\n $this->reload_hooks[$hook] = $hook;\n }\n }\n\n if (!isset($block['minify'])) {\n $block['minify'] = true;\n }\n\n /* Expiration time */\n if (!isset($block['expires'])) {\n $block['expires'] = 3600;\n } else {\n /* Allow infinite lifespan for a cached block ( no front reload ) */\n if ($block['expires'] == 0) {\n $block['expires'] = false;\n }\n }\n $blocks[$id] = $block;\n }\n return $blocks;\n }", "function getBlockOutputs() {\n\tglobal $settings;\n\t//echo \"getting blocks\";\n\t\n\t$blockOutput = array();\n\t\n\t$blocksTmp = file_get_contents($settings['channelMemoryMapsFile']);\n\t\n\t//print_r($blocksTmp);\n\t\n\t$blocks = explode(\"\\n\",$blocksTmp);\n\t\n\t//print_r($blocks);\n\t$blockIndex=0;\n\t\n\tfor($blockIndex =0; $blockIndex<=count($blocks)-1;$blockIndex++) {\n\t\t$blockParts = explode(\",\",$blocks[$blockIndex]);\n\t\t$blockOutput[] = $blockParts[0];\n\t\t//$blockIndex++;\n\t\t//$blockOutput [] =\n\t}\n\t//print_r($blockOutput);\n\t\n\treturn $blockOutput;\n}", "function getPostHashMultiple($hash, $users) {\n \t\n \t$hashBase = 'bruinsinjapan'; // hardcode first hashtag\n \t\n \t$endpoint = 'https://api.instagram.com/v1/tags/'.$hashBase.'/media/recent?client_id='.$this->client_id.'&count=80';\n \t$data = $this->doCurl($endpoint);\n \t\n \tforeach( $data['data'] as $instagram ){\t\n\t\t\tif( (in_array($instagram['user']['username'], $users)) && (in_array($hash, $instagram['tags'])) ) {\n\t\t\t\n\t\t\t\t$first = explode('/p/', $instagram['link']);\n\t\t\t\t$id = $first[1];\n\t\t\t\n\t\t\t\t $instagramArr[] = array('type' => 'instagram', 'id' => $id, 'handle' => $instagram['user']['username'], 'text' => '', 'img' => $instagram['images']['standard_resolution']['url'], 'time' => $instagram['created_time']);\n\t\t\t}\n\t\t}\n\n \treturn $instagramArr;\n\t}", "abstract protected static function getHashOptions() : array;", "function getHash(){\r\n\r\n\t\t$hash = array();\r\n \r\n\t\t$hash['id'] = $this->id;\r\n\t\t$hash['user_id'] = $this->user_id;\r\n\t\t$hash['username'] = $this->username;\r\n\t\t$hash['gender'] = $this->gender;\r\n\t\t$hash['dob'] = $this->dob;\r\n\t\t$hash['country_id'] = $this->country_id;\r\n\t\t$hash['picture'] = $this->picture;\r\n\t\t$hash['link'] = $this->link;\r\n\t\t$hash['phone'] = $this->phone;\r\n\t\t$hash['likes'] = $this->likes;\r\n\t\t$hash['dislikes'] = $this->dislikes;\r\n\t\t$hash['hobbies'] = $this->hobbies;\r\n\t\t$hash['is_active'] = $this->is_active;\r\n\t\t$hash['created_on'] = $this->created_on;\r\n\t\t$hash['last_modified_on'] = $this->last_modified_on;\r\n\r\n\t\treturn $hash;\r\n\t}", "function get_assigned($handle, $key)\n {\n return $this->mBlockKeys[$handle][$key];\n }", "public function hash();", "public function hashCode() {\n return $this->_hash;\n }", "function Blocks_userapi_countitems()\n{\n $permFilter = array();\n $permFilter[] = array ('realm' => '0',\n 'component_left' => 'Blocks',\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'bkey',\n 'instance_middle' => 'title',\n 'instance_right' => 'bid',\n 'level' => ACCESS_OVERVIEW);\n\n $blocks = DBUtil::selectObjectArray ('blocks', '', '', -1, -1, '', $permFilter);\n return count($blocks);\n}", "public function getBlockList() {\n\t\t\n\t\treturn $this->_getResponse(self::URL_USERS_BLOCK_LIST, $this->_query);\n\t}" ]
[ "0.64859605", "0.63432807", "0.6139813", "0.59149665", "0.5818394", "0.55232525", "0.54541427", "0.5437273", "0.54072994", "0.54072994", "0.5292833", "0.528986", "0.52756727", "0.5261338", "0.520397", "0.5157688", "0.5142525", "0.5138767", "0.50763434", "0.507395", "0.5063275", "0.50586057", "0.5043299", "0.50206083", "0.50153613", "0.49864748", "0.49633533", "0.49629834", "0.49458107", "0.49239776", "0.49190065", "0.49115518", "0.49101567", "0.48871744", "0.4841902", "0.48394805", "0.48362848", "0.48318452", "0.482719", "0.4803883", "0.4803883", "0.4803883", "0.4803883", "0.4803883", "0.4803883", "0.47740012", "0.4750105", "0.47480598", "0.47476566", "0.47346476", "0.47291183", "0.4719006", "0.47000757", "0.4694043", "0.46852133", "0.4684394", "0.4673959", "0.4668207", "0.46616167", "0.46546742", "0.46535608", "0.4652086", "0.4652086", "0.4652086", "0.4652086", "0.4649844", "0.46379364", "0.46367416", "0.46354157", "0.46255702", "0.4613804", "0.4608935", "0.45748913", "0.45736742", "0.4565277", "0.45487794", "0.45441222", "0.4535043", "0.44961447", "0.4491731", "0.44885793", "0.44804627", "0.4478484", "0.44763184", "0.44742623", "0.44735187", "0.44708055", "0.44698706", "0.44576386", "0.44545364", "0.44488135", "0.44295076", "0.44266745", "0.44258043", "0.44142124", "0.4405685", "0.44050062", "0.43874946", "0.43848616", "0.4383719" ]
0.4828678
38
create summarized list from block number
public static function get_blocklist( $ofs, $n = BLOCKS_PER_LIST ) { $base = self::base(); if( isset($base['err']) ) return RETURN_JSON ? json_encode( $base ) : $base; $offset = $ofs === null ? $base['output']['num_blocks'] : abs( (int)$ofs ); if( $offset > $base['output']['num_blocks'] ) return RETURN_JSON ? json_encode( ['err'=>'block does not exist'] ) : [ 'err'=>'block does not exist' ]; $i = $offset; while( $i >= 0 && $n-- ) { $block = self::block( $base, $i ); $frame['hash'] = $block['hash']; $frame['height'] = $block['height']; $frame['difficulty'] = $block['difficulty']; $frame['time'] = $block['time']; $frame['date'] = date("Y-m-d H:i:s",str_replace(" UTC","",$block['time'])); $txCount = 0; foreach( $block['tx'] as $txid ) { $tradeid[] = $txid; $txCount++; if( ($tx = self::tx($base, $txid)) === false ) continue; foreach( $tx['vout'] as $vout ){ $valueOut[] = $vout['value']; } } $frame['tx_count'] = $txCount; @$frame['total_out'] = array_sum($valueOut); unset($valueOut); $frame['txid'] = $tradeid; unset($tradeid); $base['output']['blocks'][] = $frame; $frame = null; $i--; } $base['rpc'] = null; return RETURN_JSON ? json_encode( $base['output'] ) : $base['output']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filter_block_list ( $block_list ) {\n\t\t\t$block_list['exportsnapshot'] = _t( 'Latest Export Snapshots' );\n\t\t\treturn $block_list;\n\t\t}", "function getBlockOutputs() {\n\tglobal $settings;\n\t//echo \"getting blocks\";\n\t\n\t$blockOutput = array();\n\t\n\t$blocksTmp = file_get_contents($settings['channelMemoryMapsFile']);\n\t\n\t//print_r($blocksTmp);\n\t\n\t$blocks = explode(\"\\n\",$blocksTmp);\n\t\n\t//print_r($blocks);\n\t$blockIndex=0;\n\t\n\tfor($blockIndex =0; $blockIndex<=count($blocks)-1;$blockIndex++) {\n\t\t$blockParts = explode(\",\",$blocks[$blockIndex]);\n\t\t$blockOutput[] = $blockParts[0];\n\t\t//$blockIndex++;\n\t\t//$blockOutput [] =\n\t}\n\t//print_r($blockOutput);\n\t\n\treturn $blockOutput;\n}", "public function splitIntoBlockDataProvider() {}", "public function blocklistAction()\n {\n // Module name\n $name = $this->params('name', '');\n\n $rowset = Pi::model('block')->select(['module' => $name]);\n $blocks = [];\n foreach ($rowset as $row) {\n if ('tab' == $row->type) {\n continue;\n }\n $blocks[] = [\n 'id' => $row->id,\n 'name' => $row->name,\n 'caption' => $row->title,\n 'description' => $row->description,\n ];\n }\n\n return [\n 'status' => 1,\n 'data' => $blocks,\n ];\n }", "protected function _collectBlocks()\n {\n if ($blocks = $this->_layoutHandleUpdatesXml->xpath('//block/label/..')) {\n /* @var $block Mage_Core_Model_Layout_Element */\n foreach ($blocks as $block) {\n if ((string)$block->getAttribute('name') && $this->_filterBlock($block)) {\n $helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($block));\n $this->_blocks[(string)$block->getAttribute('name')] = $helper->__((string)$block->label);\n }\n }\n }\n asort($this->_blocks, SORT_STRING);\n }", "public function getBlocks(): Collection;", "function page_metaprocess_block_idnumbers($courseid, $courseidnumber) {\n global $DB;\n\n $sql = \"\n SELECT\n fpi.*\n FROM\n {format_page_items} fpi,\n {format_page} fp\n WHERE\n fp.courseid = ? AND\n fp.id = fpi.pageid AND\n fpi.idnumber IS NOT NULL AND\n fpi.idnumber != ''\n \";\n\n $identifiedblocks = $DB->get_records_sql($sql, array($courseid));\n\n if (!empty($identifiedblocks)) {\n foreach ($identifiedblocks as $fpi) {\n $fpi->idnumber = str_replace('{course:idnumber}', $courseidnumber, $fpi->idnumber);\n $DB->update_record('format_page_items', $fpi);\n }\n }\n}", "function getBlock($arr, $num){\n\tif(!is_array($arr)){ throw new Error('getBlock: arr is not an array'); }\n\t$ri = floor($num/3)*3;\n\t$ci = $num%3;\n\treturn array_reduce(array_slice($arr, $ri, 3), function($a, $c)use($ri, $ci){ \t\treturn array_merge($a, array_slice($c, $ci*3, 3)); }, []);\n}", "function _flatten_blocks(&$blocks)\n {\n }", "function sumMaterialPerGroup($summary)\n {\n // var_dump($summary);\n // die;\n\n $data = [\n 'total_rm' => 0,\n 'total_elc' => 0,\n 'total_pnu' => 0,\n 'total_hyd' => 0,\n 'total_mch' => 0,\n 'total_sub' => 0,\n 'total_import' => 0,\n 'total_onsite' => 0,\n ];\n foreach ($summary as $key => $item) {\n $data['total_rm'] += ($item['total_rm'] * $item['qty']);\n $data['total_elc'] += ($item['total_elc'] * $item['qty']);\n $data['total_pnu'] += ($item['total_pnu'] * $item['qty']);\n $data['total_hyd'] += ($item['total_hyd'] * $item['qty']);\n $data['total_mch'] += ($item['total_mch'] * $item['qty']);\n $data['total_sub'] += ($item['total_sub'] * $item['qty']);\n $data['total_import'] += ($item['total_import'] * $item['qty']);\n $data['total_onsite'] += ($item['total_onsite'] * $item['qty']);\n }\n return $data;\n }", "function render_block($parsed_block)\n {\n }", "public function getNextBlock();", "public function filter_block_list($blocklist = array())\n\t{\n\t\t$blocklist['singlepage_content'] = _t(\"Statische Seite\", __CLASS__);\n\t\tif(Post::type('photoset')) {\n\t\t\t$blocklist['photoset_randomphotos'] = _t(\"Zufällige Fotoauswahl\", __CLASS__);\n\t\t}\n\t\treturn $blocklist;\n\t}", "function db_list_blocks() {\n\n $query = db_select('block', 'b');\n $result = $query\n ->fields('b')\n// ->condition('b.status', 1)\n// ->condition('b.module', \"capa\")\n ->orderBy('b.module')\n ->groupBy(\"b.delta\")\n ->execute();\n\n//echo \"<pre>\";\n//var_dump($result->fetchAll());\n//die;\n return $result->fetchAll();\n}", "function EventReg_listblock_init()\n{\n // Security\n pnSecAddSchema('EventReg:Listblock:', 'Block title:Block Id:Type Id');\n}", "function get_dynamic_block_names()\n {\n }", "public function filter_dashboard_block_list($block_list)\n\t{\n\t\t$block_list['incoming_links'] = 'Incoming Links';\n\t\t$this->add_template( 'dashboard.block.incoming_links', __DIR__ . '/dashboard.block.incoming_links.php' );\n\t\treturn $block_list;\n\t}", "function sebd7tweaks_API_views_alter_blocks($blocks) {\n $displays = array();\n // For better performance, prepare an array of display by view to ensure not load the view twice or more\n foreach (array_keys($blocks) as $key) {\n list($view_name, $display_name) = explode('-', $key);\n $displays[$view_name][] = $display_name;\n }\n // Use the display title for associated blocks\n foreach ($displays as $view_name => $display_names) {\n // Load the view\n $view = views_get_view($view_name);\n // Load its displays\n $view->init_display();\n // Parse all of them which provide a block\n foreach ($display_names as $display_name) {\n foreach (array($display_name, 'default') as $candidate) {\n if (isset($view->display[$candidate]->display_options['title'])) {\n $blocks[\"$view_name-$display_name\"]['info'] = $view->display[$candidate]->display_options['title'];\n break;\n }\n }\n }\n // Save memory\n $view->destroy();\n }\n // Return blocks list\n return $blocks;\n}", "private function createStructData()\n\t{\n\t\tforeach ($this->data as $item)\n\t\t{\n\t\t\t$row = array();\n\t\t\t\n\t\t\tforeach ($item as $key => $val)\n\t\t\t\tif( in_array($key, $this->col_show) && $key != $this->col_aggr_sum)\n\t\t\t\t\t$row[$key] = $val;\n\t\t\t\n\t\t\tif( count($row) )\n\t\t\t{\n\t\t\t\tif($this->col_aggr_sum)\n\t\t\t\t\t$row[$this->col_aggr_sum] = 0;\n\t\t\t\t\n\t\t\t\t$row['details'] = array();\n\t\t\t\t$this->data_show[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->data_show = array_unique($this->data_show, SORT_REGULAR);\n\t}", "function parse_blocks($content)\n {\n }", "function build_blocks($items, $folder){\n\tglobal $ignore_file_list, $ignore_ext_list, $sort_by, $toggle_sub_folders, $ignore_empty_folders;\n\t\n\t$objects = array();\n\t$objects['directories'] = array();\n\t$objects['files'] = array();\n\t\n\tforeach($items as $c => $item) {\n\t\tif( $item == \"..\" OR $item == \".\") continue;\n\t\n\t\t// IGNORE FILE\n\t\tif(in_array($item, $ignore_file_list)) { continue; }\n\t\n\t\tif($folder && $item) {\n\t\t\t$item = \"$folder/$item\";\n\t\t}\n\n\t\t$file_ext = getFileExt($item);\n\t\t\n\t\t// IGNORE EXT\n\t\tif(in_array($file_ext, $ignore_ext_list)) { continue; }\n\t\t\n\t\t// DIRECTORIES\n\t\tif(is_dir($item)) {\n\t\t\t$objects['directories'][] = $item; \n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// FILE DATE\n\t\t$file_time = date(\"U\", filemtime($item));\n\t\t\n\t\t// FILES\n\t\tif($item) {\n\t\t\t$objects['files'][$file_time . \"-\" . $item] = $item;\n\t\t}\n\t}\n\t\n\tforeach($objects['directories'] as $c => $file) {\n\t\t$sub_items = (array) scandir( $file );\n\t\t\n\t\tif($ignore_empty_folders) {\n\t\t\t$has_sub_items = false;\n\t\t\tforeach($sub_items as $sub_item) {\n\t\t\t\t$sub_fileExt = getFileExt($sub_item);\n\t\t\t\tif( $sub_item == \"..\" OR $sub_item == \".\") continue;\n\t\t\t\tif(in_array($sub_item, $ignore_file_list)) continue;\n\t\t\t\tif(in_array($sub_fileExt, $ignore_ext_list)) continue;\n\t\t\t\n\t\t\t\t$has_sub_items = true;\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\t\n\t\t\tif($has_sub_items) echo display_block($file);\n\t\t} else {\n\t\t\techo display_block($file);\n\t\t}\n\t\t\n\t\tif($toggle_sub_folders) {\n\t\t\tif($sub_items) {\n\t\t\t\techo \"<div class='sub' data-folder=\\\"$file\\\">\";\n\t\t\t\tbuild_blocks( $sub_items, $file );\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// SORT BEFORE LOOP\n\tif( $sort_by == \"date_asc\" ) { ksort($objects['files']); }\n\telseif( $sort_by == \"date_desc\" ) { krsort($objects['files']); }\n\telseif( $sort_by == \"name_asc\" ) { natsort($objects['files']); }\n\telseif( $sort_by == \"name_desc\" ) { arsort($objects['files']); }\n\t\n\tforeach($objects['files'] as $t => $file) {\n\t\t$fileExt = getFileExt($file);\n\t\tif(in_array($file, $ignore_file_list)) { continue; }\n\t\tif(in_array($fileExt, $ignore_ext_list)) { continue; }\n\t\techo display_block( $file );\n\t}\n}", "function expose_blocks($content) {\n $raw_blocks = parse_blocks($content);\n $blocks = array();\n\n foreach ($raw_blocks as $block) {\n if ($block['blockName']) { \n $block['content'] = render_block($block);\n $blocks[] = $block;\n }\n }\n\n return $blocks;\n}", "private function buildBlocks($body){\n\n return $body['blocks'];\n }", "public function load_blocks_list() {\n $tmp_blocks = apply_filters('wpucacheblocks_blocks', array());\n $blocks = array();\n foreach ($tmp_blocks as $id => $block) {\n /* Path ex : /tpl/header/block.php */\n if (!isset($block['fullpath']) && !isset($block['path'])) {\n /* A path should always be defined */\n continue;\n }\n /* Full path to the file */\n if (!isset($block['fullpath'])) {\n $block['fullpath'] = get_stylesheet_directory() . $block['path'];\n }\n\n /* Reload hooks */\n if (!isset($block['reload_hooks']) || !is_array($block['reload_hooks'])) {\n $block['reload_hooks'] = array();\n } else {\n /* Keep a list of all hooks used */\n foreach ($block['reload_hooks'] as $hook) {\n $this->reload_hooks[$hook] = $hook;\n }\n }\n\n if (!isset($block['minify'])) {\n $block['minify'] = true;\n }\n\n /* Expiration time */\n if (!isset($block['expires'])) {\n $block['expires'] = 3600;\n } else {\n /* Allow infinite lifespan for a cached block ( no front reload ) */\n if ($block['expires'] == 0) {\n $block['expires'] = false;\n }\n }\n $blocks[$id] = $block;\n }\n return $blocks;\n }", "function serialize_blocks($blocks)\n {\n }", "function build_blocks( $items, $folder )\r\n{\r\n\tglobal $ignore_file_list, $ignore_ext_list, $sort_by, $toggle_sub_folders, $ignore_empty_folders;\r\n\t\r\n\t$objects = array();\r\n\t$objects['directories'] = array();\r\n\t$objects['files'] = array();\r\n\t\r\n\tforeach($items as $c => $item)\r\n\t{\r\n\t\tif( $item == \"..\" OR $item == \".\") continue;\r\n\t\r\n\t\t// IGNORE FILE\r\n\t\tif(in_array($item, $ignore_file_list)) { continue; }\r\n\t\r\n\t\tif( $folder && $item )\r\n\t\t{\r\n\t\t\t$item = \"$folder/$item\";\r\n\t\t}\r\n\r\n\t\t$file_ext = ext($item);\r\n\t\t\r\n\t\t// IGNORE EXT\r\n\t\tif(in_array($file_ext, $ignore_ext_list)) { continue; }\r\n\t\t\r\n\t\t// DIRECTORIES\r\n\t\tif( is_dir($item) ) \r\n\t\t{\r\n\t\t\t$objects['directories'][] = $item; \r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t\r\n\t\t// FILE DATE\r\n\t\t$file_time = date(\"U\", filemtime($item));\r\n\t\t\r\n\t\t// FILES\r\n\t\tif( $item )\r\n\t\t{\r\n\t\t\t$objects['files'][$file_time . \"-\" . $item] = $item;\r\n\t\t}\r\n\t}\r\n\t\r\n\tforeach($objects['directories'] as $c => $file)\r\n\t{\r\n\t\t$sub_items = (array) scandir( $file );\r\n\t\t\r\n\t\tif( $ignore_empty_folders )\r\n\t\t{\r\n\t\t\t$has_sub_items = false;\r\n\t\t\tforeach( $sub_items as $sub_item )\r\n\t\t\t{\r\n\t\t\t\t$sub_fileExt = ext( $sub_item );\r\n\t\t\t\tif( $sub_item == \"..\" OR $sub_item == \".\") continue;\r\n\t\t\t\tif(in_array($sub_item, $ignore_file_list)) continue;\r\n\t\t\t\tif(in_array($sub_fileExt, $ignore_ext_list)) continue;\r\n\t\t\t\r\n\t\t\t\t$has_sub_items = true;\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $has_sub_items ) echo display_block( $file );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo display_block( $file );\r\n\t\t}\r\n\t\t\r\n\t\tif( $toggle_sub_folders )\r\n\t\t{\r\n\t\t\tif( $sub_items )\r\n\t\t\t{\r\n\t\t\t\techo \"<div class='sub' data-folder=\\\"$file\\\">\";\r\n\t\t\t\tbuild_blocks( $sub_items, $file );\r\n\t\t\t\techo \"</div>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// SORT BEFORE LOOP\r\n\tif( $sort_by == \"date_asc\" ) { ksort($objects['files']); }\r\n\telseif( $sort_by == \"date_desc\" ) { krsort($objects['files']); }\r\n\telseif( $sort_by == \"name_asc\" ) { natsort($objects['files']); }\r\n\telseif( $sort_by == \"name_desc\" ) { arsort($objects['files']); }\r\n\t\r\n\tforeach($objects['files'] as $t => $file)\r\n\t{\r\n\t\t$fileExt = ext($file);\r\n\t\tif(in_array($file, $ignore_file_list)) { continue; }\r\n\t\tif(in_array($fileExt, $ignore_ext_list)) { continue; }\r\n\t\techo display_block( $file );\r\n\t}\r\n}", "public function getBlockCount();", "public function getNumberBlock0()\n {\n return $this->hasOne(Blockmaterials::className(), ['numberBlock' => 'numberBlock']);\n }", "public function initBlocks(int $number)\n {\n $this->blocks = new Blocks($number);\n\n return $this;\n }", "function tammuz_block_info() {\r\n\t$blocks = array();\r\n\t\r\n\r\n\t$blocks['add_journey'] = array(\r\n\t\t// The name that will appear in the block list.\r\n\t\t'info' => t('Add a journey to the customer'),\r\n\t\t// Default setting.\r\n\t\t'cache' => DRUPAL_CACHE_PER_ROLE,\r\n\t);\r\n\treturn $blocks;\r\n}", "function getColumnsListbyBlock($module,$block)\n\t{\n\t\tglobal $adb;\n\t\t$tabid = getTabid($module);\n\t\tglobal $current_user;\n\t\t\n\t\t$sql = \"select ec_field.* from ec_field INNER JOIN ec_def_org_field ON ec_def_org_field.fieldid=ec_field.fieldid AND ec_def_org_field.visible=0\";\n\t\t$sql.= \" where ec_field.tabid=\".$tabid.\" and ec_field.block in (\".$block.\") and\";\n\t\t$sql.= \" ec_field.displaytype in (1,2) union select ec_field.* from ec_field where ec_field.displaytype=3 and ec_field.block in (\".$block.\") and ec_field.tabid=\".$tabid;\n\t\t$sql.= \" order by sequence\";\n\t\t$result = $adb->query($sql);\n\t\t$noofrows = $adb->num_rows($result);\n\t\t//Added on 14-10-2005 -- added ticket id in list\n\t\t/*\n\t\tchanged by dingjianting on 2008-07-31 for delete ticket id in listview and Fenzu\n\t\tif($module == 'HelpDesk' && $block == 25)\n\t\t{\n\t\t\t$module_columnlist['ec_crmentity:crmid::HelpDesk_Ticket_ID:I'] = 'Ticket ID';\n\t\t}\n\t\t*/\n\t\t//Added to include ec_activity type in ec_activity ec_fenzu list\n\t\tif($module == 'Calendar' && $block == 19)\n\t\t{\n\t\t\t$module_columnlist['ec_activity:activitytype:activitytype:Calendar_Activity_Type:C'] = 'Activity Type';\n\t\t}\n\n\t\tfor($i=0; $i<$noofrows; $i++)\n\t\t{\n\t\t\t$fieldtablename = $adb->query_result($result,$i,\"tablename\");\n\t\t\t$fieldcolname = $adb->query_result($result,$i,\"columnname\");\n\t\t\t$fieldname = $adb->query_result($result,$i,\"fieldname\");\n\t\t\t$fieldtype = $adb->query_result($result,$i,\"typeofdata\");\n\t\t\t$fieldtype = explode(\"~\",$fieldtype);\n\t\t\t$fieldtypeofdata = $fieldtype[0];\n\t\t\t$fieldlabel = $adb->query_result($result,$i,\"fieldlabel\");\n\t\t\tif($fieldlabel == \"Related To\")\n\t\t\t{\n\t\t\t\t$fieldlabel = \"Related to\";\n\t\t\t}\n\t\t\tif($fieldlabel == \"Start Date & Time\")\n\t\t\t{\n\t\t\t\t$fieldlabel = \"Start Date\";\n\t\t\t\tif($module == 'Calendar' && $block == 19)\n\t\t\t\t\t$module_columnlist['ec_activity:time_start::Calendar_Start_Time:I'] = 'Start Time';\n\n\t\t\t}\n\t\t\t$fieldlabel1 = str_replace(\" \",\"_\",$fieldlabel);\n\t\t\t$optionvalue = $fieldtablename.\":\".$fieldcolname.\":\".$fieldname.\":\".$module.\"_\".$fieldlabel1.\":\".$fieldtypeofdata;\n\t\t\t//added to escape attachments fields in Fenzu as we have multiple attachments\n\t\t\tif($module != 'HelpDesk' || $fieldname !='filename')\n\t\t\t\t$module_columnlist[$optionvalue] = $fieldlabel;\n\t\t\tif($fieldtype[1] == \"M\")\n\t\t\t{\n\t\t\t\t$this->mandatoryvalues[] = \"'\".$optionvalue.\"'\";\n\t\t\t\t$this->showvalues[] = $fieldlabel;\n\t\t\t}\n\t\t}\n\t\treturn $module_columnlist;\n\t}", "public function set_grid_editor_discover_block_data( $block ) {\n\n\t\t$counts = (array) wp_count_posts( 'grid' );\n\t\tif ( is_wp_error( $counts ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$block->set_data( array(\n\t\t\t'counts' => array_map( 'intval', $counts ),\n\t\t\t'counts' => array_filter( $counts ),\n\t\t\t'total' => array_sum( $counts ),\n\t\t\t'edit' => admin_url( 'edit.php?post_type=grid' ),\n\t\t) );\n\t}", "protected function _getBlockArray()\n {\n return array(\n \n /*\n * Minicart section\n */\n array(\n 'version' => '0.0.1',\n 'identifier' => 'header_contact_information',\n 'stores' => [0],\n 'title' => 'Header Contact Information',\n 'content' => <<<HTML\n<div id=\"phone-hrs\">\n <a href=\"https://goo.gl/maps/seJQCD3gzao\" target=\"_blank\">Visit Us</a> or Call Us: <a id=\"phone-number\" href=\"tel:+18009387925\">(800) 938-7925</a> &nbsp;&nbsp; Today's Hours: 7:00am - 6:00pm\n</div>\nHTML\n ),\n array(\n 'version' => '0.0.3',\n 'identifier' => 'home_sidebar',\n 'stores' => [0],\n 'title' => 'Home Sidebar',\n 'content' => <<<HTML\n<div class=\"sidebar\">\n <div class=\"home-side-menu\">\n <h2 class=\"side-menu-title\">CATEGORIES</h2>\n {{block class=\"Smartwave\\Megamenu\\Block\\Topmenu\" name=\"sw.sidenav\" template=\"Smartwave_Megamenu::sidemenu.phtml\" ttl=\"3600\"}} </div>\n <!-- start -->\n <div id=\"ads-slider-demo-9\">\n <div class=\"item\">\n <h2><a href=\"#\">Blog Articles</a></h2>\n <ul class=\"recent-blog\" style=\"list-style:none; padding-inline-start:12px; padding-right:12px;\">\n <li><a title=\"Bosch Laser Level - GLL3-330CG\" href=\"https://www.masterwholesale.com/blog/bosch-green-line-laser-level-review/\" target=\"_blank\">Review: Bosch Green Line Laser Level</a></li>\n <li><a title=\"Makita LXT Lithium Ion Cordless Brushless Angle Grinder\" href=\"https://www.masterwholesale.com/blog/makita-18v-lxt-lithium-ion-cordless-brushless-angle-grinder-review/\" target=\"_blank\">Review: Makita&nbsp;<span>LXT Cordless Brushless Angle Grinder&nbsp;</span></a></li>\n <li><a title=\"Mixing Laticrete PermaColor Grout\" href=\"https://www.masterwholesale.com/blog/how-to-mix-small-batch-laticrete-permacolor-select-grout/\" target=\"_blank\">How to Mix a Small Batch of Laticrete PermaColor Grout</a></li>\n <li><a title=\"Polishing Tile Edges with Diamond Hand Polishing Pads\" href=\"https://www.masterwholesale.com/blog/polish-stone-porcelain-tile-diamond-hand-polishing-pads/\" target=\"_blank\">How to Polish Tile Edges w/ Diamond Hand Polishing Pads</a></li>\n <li><a title=\"Stoning Porcelain and Stone Tile\" href=\"https://www.masterwholesale.com/blog/stone-edge-porcelain-tile-stone/\" target=\"_blank\">How to Stone or Edge Porcelain and Stone Tiles</a></li>\n <li><a title=\"Bridge Saw vs Sliding Table Saw\" href=\"https://www.masterwholesale.com/blog/366-2/\" target=\"_blank\">Bridge Saw vs Sliding Table Saw</a></li>\n <li><a title=\"How to Core with a Diamond Core Drill Bit\" href=\"https://www.masterwholesale.com/blog/dry-core-drill-tile-stone/\" target=\"_blank\">How to Dry Core Drill on Stone or Tile</a></li>\n <li><a title=\"How to Reopen a diamond Core Bit \" href=\"https://www.masterwholesale.com/blog/master-wholesale-reopen-diamond-core-bit/\" target=\"_blank\">How to Sharpen or Reopen a Diamond Core Bit</a></li>\n <li><a title=\"Resin Glass Blade Shootout\" href=\"https://www.masterwholesale.com/blog/resin-glass-blade-shootout/\" target=\"_blank\">Resin Glass Blade Shootout with Blake Adsero</a></li>\n <li><a title=\"Makita Polishing Kit\" href=\"https://www.masterwholesale.com/blog/makita-pw5001c-wet-polishing-kit-master-wholesale/\" target=\"_blank\">How to Polish an Exposed Edge on Stone Tile</a></li>\n <li><a title=\"Deluxe Dry Polishing Kit\" href=\"https://www.masterwholesale.com/blog/?p=254\" target=\"_self\">MWI Deluxe Dry Polishing Kit Demo</a></li>\n <li><a title=\"Laser Level Shootout\" href=\"https://www.masterwholesale.com/blog/laser-level-shootout/\" target=\"_self\">Laser Level Shootout</a></li>\n <li><a title=\"Ishii Tile Cutters\" href=\"https://www.masterwholesale.com/blog/how-to-assemble-and-use-the-ishii-blue-tile-cutters/\" target=\"_self\">How to Assemble and Use Ishii BlueTile Cutters</a></li>\n <li><a title=\"Diamond Blade Shootout\" href=\"https://www.masterwholesale.com/blog/tile-saw-diamond-blade-shootout/\" target=\"_self\">Tile Saw Diamond Blade Shootout</a></li>\n </ul>\n </div>\n </div>\n <!-- end --> \n <!-- start -->\n <div id=\"ads-slider-demo-9\" class=\"owl-carousel\">\n <div class=\"item\" style=\"text-align:center;\"> <img src=\"\" alt=\"\" style=\"display:inline-block;\"/> </div>\n </div>\n <!-- end --> \n <!-- start -->\n <div id=\"ads-slider-demo-9\">\n <div class=\"item\" style=\"text-align:center;\"> {{block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"single_special\" template=\"Magento_Catalog::product/view/single_special.phtml\" ttl=\"3600\"}} </div>\n </div>\n <!-- end --> \n </div>\nHTML\n ),\n );\n }", "public function getGroupedBlocks() {\n $definitions = $this->getBlocks();\n $definitions = $this->blockManager->getGroupedDefinitions($definitions);\n $keys = array_map(function ($key) {\n return preg_replace('@[^a-z0-9-]+@', '_', strtolower($key));\n }, array_keys($definitions));\n\n return array_combine($keys, array_values($definitions));\n }", "function nbabanner_block_view($delta = '')\n{\n $block = array();\n \n switch($delta) {\n case 'nbabanner_block': \n $block['subject'] = t('NBA Banners: Block');\n $block['content'] = array(\n 'container' => array(\n '#type' => 'fieldset',\n '#title' => 'NBA Banners: Block',\n '#attributes' => array(\n 'class' => array(\n 'nbabanners'\n )\n )\n )\n );\n \n foreach (_nbabanner_get_banners((variable_get('nbabanner_randomise', 0) == '1')) as $index => $banner) {\n $term = taxonomy_term_view($banner);\n $block['content']['container']['nbabanner' . $index] = array(\n '#markup' => render($term)\n );\n }\n \n \n $block['content']['#attached']['css'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/vendor/flickity.css';\n $block['content']['#attached']['css'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/css/nbabanner.css';\n \n $block['content']['#attached']['js'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/vendor/flickity.js';\n $block['content']['#attached']['js'][] = array(\n 'data' => array(\n 'nbabanner' => array(\n 'autoplay' => variable_get('nbabanner_autoplay', 0),\n 'autoplay_duration' => (float) variable_get('nbabanner_autoplay_duration', 5000)\n )\n ),\n 'type' => 'setting'\n );\n $block['content']['#attached']['js'][] = drupal_get_path(\n 'module',\n 'nbabanner'\n ) . '/js/nbabanner.js';\n \n break;\n }\n \n return $block;\n}", "public function blocks() { return $this->_m_blocks; }", "function getBlock($offset){\r\n\tglobal $block_hash, $block, $tx_count, $count;\r\n\t$url = \"https://blockstream.info/api/block/\".$block_hash.\"/txs/\".$offset;\r\n\t$b = file_get_contents($url);\r\n\t$txs = json_decode($b,TRUE);\r\n\tif($count <= $tx_count){ \r\n\t\tarray_push($block, $txs); \r\n\t\t$count += count($txs);\r\n\t\t$offset = $offset + 25;\r\n\t\tif(300 % $offset == 0) { usleep(1000000); } // sleep for 1 second every dozen pages (in case rate limit)\r\n\t\tif(count($txs) > 0){ getBlock($offset); }else{ save($b); }\r\n\t}\r\n\tif($count == $tx_count){ echo \"Done\"; }\r\n}", "function print_blocks_table($StudentType)\n{\n\tglobal $config, $link;\n\n\techo(\" <table class='report-remaining' >\\n\");\n\techo(\" <tr>\\n\");\n\n\t$blocks = Array();\n\t$i = 0;\n\t$table_footer = Array();\n\n\t// Get a list of the current blocks from the database. This should be a list like 'a','b','c',etc.\n\t$sql_blocks = \"SELECT * FROM BLOCKS_Blocks WHERE Year=\".$config['current_year'].\" AND CourseType='\".$StudentType.\"' ORDER BY id\";\n\t$result_blocks = mysql_query($sql_blocks, $link);\n\n\tif ($result_blocks)\n\t{\n\t\twhile($row_blocks = mysql_fetch_array($result_blocks))\n\t\t{\n\t\t echo (\"<td ><table class='report-remaining-inner' >\");\n\t\t\techo (\" <thead><th width='10%'>\".$row_blocks['Name'].\"</th></thead>\");\n\n\t\t\t/** Get all the current courses for the current block.\n\t\t\t *\n\t\t\t * We build a list for each block, then print by row in a loop \n\t\t\t * later on in the code, so this isn't inefficient. \n\t\t\t */\n\t\t\t$sql = \"SELECT * FROM BLOCKS_Course INNER JOIN BLOCKS_CourseDef ON CourseDefID=BLOCKS_CourseDef.id\";\n\t\t\t$sql .= \" WHERE EnrolmentYear='\".$config['current_year'].\"' AND BlockID='\".$row_blocks['id'].\"' AND BLOCKS_CourseDef.Type='\".$StudentType.\"';\";\n\t\t\t$result = mysql_query($sql, $link);\n\n\t\t\tif ($result) {\n\t\t\t\t$i = 0;\n\t\t\t\twhile($row = mysql_fetch_array($result))\n\t\t\t\t{\n\t\t\t\t\t$html = $row['SubjectName'].\"\\n\";\n\n\t\t\t\t\t$remaining_places = get_places_taken($row[0]);\n\t\t\t\t\t$max_places = $row['MaxPupils'];\n\t\t\t\t\t\n\t\t\t\t\t$html .= \"<span style='float: right; vertical-align: top;' >\";\n\t\t\t\t\t$html .= \"(\".get_places_taken($row[0]);\n\t\t\t\t\t$html .= \"/\".$row['MaxPupils'].\")\";\n\t\t\t\t\t$html .= \"</span>\\n\";\n\n\t\t\t\t\t$blocks[$i][ $row_blocks['Name'] ] = $html;\n\n\t\t\t\t\t$bgcolour = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif ( get_places_taken($row[0]) > ($row['MaxPupils'] - 2) ) {\n\t\t\t\t\t\t$bgcolour = \"background: red;\";\n\t\t\t\t\t} else if ( get_places_taken($row[0]) > ($row['MaxPupils'] - 5) ) {\n\t\t\t\t\t\t$bgcolour = \"background: orange;\";\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\techo(\"<tr><td style='height: 1.1em; \".$bgcolour.\"'>\\n\");\n\t\t\t\t\techo($blocks[$i][ $row_blocks['Name'] ]);\n\t\t\t\t\techo(\"</td></tr>\\n\");\n\n\t\t\t\t\t$i += 1;\n\t\t\t\t}\n\t\t\t\techo(\"</table>\");\n\n\t\t\t} else { die('Invalid query: ' . mysql_error()); }\n\t\t}\n\t} else { die('Invalid query: ' . mysql_error()); }\n\n\techo(\" </tr>\\n\");\n\techo(\" </table>\");\n}", "function createSummaryDivs($numRows, $groupType) {\n\n\nfor ($i = 1; $i <= $numRows; $i++) { \n $divs .= \"<div id=\\\"$i$groupType\\\"></div>\\n\"; \n }\n\nreturn $divs;\n}", "public function blockStart() {\n\n $this->outputEditmode('<div class=\"pimcore_block_entry ' . $this->getName() . '\" key=\"' . $this->indices[$this->current] . '\">');\n $this->outputEditmode('<div class=\"pimcore_block_buttons_' . $this->getName() . ' pimcore_block_buttons\">');\n $this->outputEditmode('<div class=\"pimcore_block_amount_' . $this->getName() . ' pimcore_block_amount\"></div>');\n $this->outputEditmode('<div class=\"pimcore_block_plus_' . $this->getName() . ' pimcore_block_plus\"></div>');\n $this->outputEditmode('<div class=\"pimcore_block_minus_' . $this->getName() . ' pimcore_block_minus\"></div>');\n $this->outputEditmode('<div class=\"pimcore_block_up_' . $this->getName() . ' pimcore_block_up\"></div>');\n $this->outputEditmode('<div class=\"pimcore_block_down_' . $this->getName() . ' pimcore_block_down\"></div>');\n $this->outputEditmode('<div class=\"pimcore_block_clear\"></div>');\n $this->outputEditmode('</div>');\n\n $this->current++;\n }", "public function get_blocks ()\n {\n return $this->_blocks;\n }", "public function filter_block_list($block_list)\n\t{\n\t\t$block_list['menu'] = _t( 'Menu', 'termmenus' );\n\t\treturn $block_list;\n\t}", "public function filter_block_list( $block_list )\n\t{\n\t\t$allblocks = $this->allblocks;\n\t\tforeach ( $allblocks as $blockname => $nicename ) {\n\t\t\t$block_list[ $blockname ] = _t( $nicename );\n\t\t}\n\t\treturn $block_list;\n\t}", "public static function getBlockRenderList()\n {\n return ['onePageBlock'];\n }", "function page_render_block($block) {\n static $xtpl_block;\n \n if (!$xtpl_block) $xtpl_block = new XTemplate('html/block.xtpl');\n \n $xtpl_block->reset('block');\n $xtpl_block->assign('id', $block['id']);\n $xtpl_block->assign('title', $block['title']);\n $xtpl_block->assign('content', $block['content']);\n \n if (isset($block['links'])) {\n $xtpl_block->assign('links', $block['links']);\n $xtpl_block->parse('block.links');\n }\n \n $xtpl_block->parse('block');\n return $xtpl_block->text('block');\n}", "function event_details_cpt_single_blocks( $blocks ) {\n // Add new blocks with custom function output\n // Below is an example with an anonymous function but you can use custom functions as well ;)\n $blocks['custom_block'] = function() {\n\n echo '';\n\n };\n\n // Remove these content blocks\n unset( $blocks['comments'] );\n\t unset( $blocks['meta'] );\n\t unset( $blocks['title'] );\n\t unset( $blocks['media'] );\n\t\n // Return blocks\n return $blocks;\n\n}", "public function getSubBlocks();", "function render_block_core_page_list($attributes, $content, $block)\n {\n }", "function AggregateListRow() {\n\t}", "public function getChunksList(){\n return $this->_get(2);\n }", "public function dump() {\n $fmt = \"%-25s | %s | %2s | %s\\n\";\n foreach ($this->blocks as $block) {\n printf(\"Team: %25s\\n Rep: %s\\n\", $block->team, $block->representative);\n foreach (array('A', 'B', 'C', 'D') as $div) {\n foreach (array(RP::SKIPPER, RP::CREW) as $role) {\n $section = sprintf('%s_%s', $role, $div);\n foreach ($block->$section as $s) {\n printf($fmt,\n $s->getSailorName(),\n $s->division,\n $s->getSailorYear(),\n DB::makeRange($s->races_nums));\n }\n print(\"\\n\");\n }\n print(\"--------------------\\n\");\n }\n print(\"--------------------\\n\");\n }\n }", "function groom_block_info()\n{\n $blocks['groom_calendar_standard'] = array(\n 'info' => t('Calendrier Groom - Standard'),\n );\n $blocks['groom_calendar_solo'] = array(\n 'info' => t('Calendrier Groom - Solo'),\n );\n $blocks['groom_calendar_vip'] = array(\n 'info' => t('Calendrier Groom - VIP'),\n );\n\n return $blocks;\n}", "public function parseBlockFile($fname)\n {\n $blocks = 0;\n\n $log = $this->logger();\n $log->info(\"Processing file: \" . $fname);\n\n $content = file_get_contents($fname);\n $lines = explode(\"\\n\", $content);\n $delim = \"====\";\n $block = null;\n foreach ($lines as $line) {\n $line = trim($line);\n if (strlen($line) < 1) {\n continue;\n }\n \n if (!strncmp($line, $delim, strlen($delim))) {\n $blocks++;\n $this->cacheBlock($block);\n $block = null;\n } else {\n $block .= (($block) ? '|' : '') . $line;\n }\n }\n return $blocks;\n }", "protected function _outputBlocks()\n {\n $blocks = func_get_args();\n $output = $this->getLayout()->createBlock('adminhtml/text_list');\n foreach ($blocks as $block) {\n $output->insert($block, '', true);\n }\n $this->getResponse()->setBody($output->toHtml());\n }", "function wp_get_first_block($blocks, $block_name)\n {\n }", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "public function blocks_for_region($region) {\n $blockcontents = $this->page->blocks->get_content_for_region($region, $this);\n $blocks = $this->page->blocks->get_blocks_for_region($region);\n $lastblock = null;\n $zones = array();\n foreach ($blocks as $block) {\n $zones[] = $block->title;\n }\n $output = '';\n\n $oddnumberblocks = (count($blockcontents) % 2);\n foreach ($blockcontents as $index => $bc) {\n if ($bc instanceof block_contents) {\n $blockclass = '';\n if ($this->page->pagelayout == 'mydashboard') {\n $blockclass = 'db-singleblock';\n $currentblocktype = $bc->attributes['data-block'];\n if ($currentblocktype == \"calendar_month\" || $currentblocktype == \"calendar_upcoming\") {\n $blockclass = 'db-doubleblock';\n // Then add ml-auto or mr-auto depending on the side of the block.\n $blockclass .= ' ';\n $blockclass .= (($index % 2) ? ' ml-auto ' : ' mr-auto ');\n }\n }\n $output .= $this->block($bc, $region, $blockclass);\n $lastblock = $bc->title;\n } else if ($bc instanceof block_move_target) {\n $output .= $this->block_move_target($bc, $zones, $lastblock, $region);\n } else {\n throw new coding_exception('Unexpected type of thing (' . get_class($bc) . ') found in list of block contents.');\n }\n }\n return $output;\n }", "private function get_dynamic_block_names() {\n\t\t$blocks = array();\n\t\tforeach ( get_dynamic_block_names() as $name ) {\n\t\t\tif ( 0 !== strpos( $name, 'llms/' ) ) {\n\t\t\t\t$blocks[] = $name;\n\t\t\t}\n\t\t}\n\t\treturn apply_filters( 'llms_blocks_get_dynamic_block_names', $blocks );\n\t}", "function render_block_core_query_pagination_numbers($attributes, $content, $block)\n {\n }", "function listNumberMinMax($margin_left, $margin_top)\n{\n $sum = $margin_left;\n $text_number = 20;\n for ($i=0; $i < 7; $i++) {\n $newResult[] = array('text_number' => $text_number, 'margin_left' => $sum, 'margin_top' => $margin_top);\n $sum += 50;\n $text_number += 10;\n }\n\n return $newResult;\n}", "public function run()\n {\n $this->disableForeignKeys();\n $this->truncate('blocks');\n\n /*\n * ABOUT US PAGE BLOCKS\n */\n $blocks = [\n [\n 'page_id' => 1,\n 'title' => 'History',\n 'title_ru' => 'История',\n 'title_it' => 'Mostra di più',\n 'body' => 'The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time. Special care is devoted to details, the selection of tissues, and the coordination of color nuances.\n ',\n 'body_ru' => 'Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз. Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов.',\n 'body_it' => 'La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta. La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore.\n ',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Expression of style',\n 'title_ru' => 'Выражение стиля',\n 'title_it' => 'Espressione dello stile',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesce a ripristinare un design elegante e raffinato che si esprime in una cura amorosa per i dettagli, in una lavorazione a mano che esalta le texture, dando complementi di mobili con un unico e Fascino senza tempo.',\n 'body_ru' => 'Кроме того, в офисной зоне новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражается в любящей заботе о деталях, в ручном производстве, которое превозносит текстуры, придавая вам мебельные дополнения с уникальным и Вневременное очарование',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details, in a hand manufacturing that exalt the textures, giving you furniture complements with a unique and timeless charm',\n 'image' => 'under-history-right.jpg',\n 'title_limit' => 25,\n 'body_limit' => 330,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'The lifelong experience is being reflected in almost every project. At Cavio-Casa, we are welcoming challenges to foster our creativity. People inspire us and we want to inspire them too.<br><br>Everything we do at Cavio-Casa is guided by our vision to ensure that we all go the extra mile to help our customers reach their audiences. So far, we have achieved to play a dynamic role in shaping the jewelry industry.\n ',\n 'body_ru' => 'Жизненный опыт отражается почти во всех проектах. В Cavio-Casa мы приветствуем проблемы, способствующие нашему творчеству. Люди вдохновляют нас, и мы хотим их вдохновить. <br><br> Все, что мы делаем в Cavio-Casa, руководствуется нашим видением, чтобы все мы прошли лишнюю милю, чтобы помочь нашим клиентам достичь своей аудитории. До сих пор мы достигли динамичной роли в формировании ювелирной промышленности.',\n 'body_it' => 'L\\'esperienza permanente si riflette in quasi tutti i progetti. A Cavio-Casa, stiamo accogliendo sfide per promuovere la nostra creatività. La gente ci ispira e vogliamo ispirare anche loro<br><br> Tutto quello che facciamo a Cavio-Casa è guidato dalla nostra visione per assicurarci che tutti noi passiamo il miglio supplementare per aiutare i nostri clienti a raggiungere il loro pubblico. Finora abbiamo raggiunto un ruolo dinamico nella progettazione dell\\'industria dei gioielli.',\n 'image' => 'under-history-left.jpg',\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Philosofhy',\n 'title_ru' => 'Философия',\n 'title_it' => 'Filosofia',\n 'body' => 'The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time. Special care is devoted to details, the selection of tissues, and the coordination of color nuances.',\n 'body_ru' => 'Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз. Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов.',\n 'body_it' => 'La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta. La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore.',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body_it' => 'Tutto quello che facciamo a Cavio-Casa è guidato dalla nostra visione per assicurare che tutti noi andiamo il miglio supplementare per aiutare i nostri clienti a raggiungere il loro pubblico. Finora abbiamo raggiunto un ruolo dinamico nella progettazione dell\\'industria dei gioielli<br><br> L\\'esperienza permanente si riflette in quasi tutti i progetti. A Cavio-Casa, stiamo accogliendo sfide per promuovere la nostra creatività. Le persone ci ispirano e vogliamo ispirare anche loro.',\n 'body_ru' => 'Все, что мы делаем в Cavio-Casa, руководствуется нашим видением, чтобы все мы прошли лишнюю милю, чтобы помочь нашим клиентам достичь своей аудитории. До сих пор мы достигли динамичной роли в формировании ювелирной промышленности.<br>Жизненный опыт отражается почти во всех проектах. В Cavio-Casa мы приветствуем проблемы, способствующие нашему творчеству. Люди вдохновляют нас, и мы хотим вдохновить их тоже.',\n 'body' => 'Everything we do at Cavio-Casa is guided by our vision to ensure that we all go the extra mile to help our customers reach their audiences. So far, we have achieved to play a dynamic role in shaping the jewelry industry.<br>The lifelong experience is being reflected in almost every project. At Cavio-Casa, we are welcoming challenges to foster our creativity. People inspire us and we want to inspire them too.',\n 'image' => null,\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'We have been renowned for the high quality of our hand-made products, the innovative ideas, the effective co-operation with clients around the world and the ability to tailor our services to each customer’s needs surpassing their expectations.<br><br>We are always next to you, full of new ideas, determination and love because we believe in what we do.',\n 'image' => null,\n 'body_ru' => 'Мы были известны высоким качеством наших изделий ручной работы, инновационными идеями, эффективным сотрудничеством с клиентами по всему миру и возможностью адаптировать наши услуги к потребностям каждого клиента, превосходящим их ожидания. <br><br> Мы всегда рядом с вами, полны новых идей, решительности и любви, потому что мы верим в то, что делаем.',\n 'body_it' => 'Siamo stati rinomati per l\\'alta qualità dei nostri prodotti fatti a mano, le idee innovative, l\\'efficace collaborazione con i clienti in tutto il mondo e la capacità di adattare i nostri servizi alle esigenze di ogni cliente che supera le loro aspettative.<br><br> Siamo sempre accanto a voi, pieno di nuove idee, determinazione e amore perché crediamo in ciò che facciamo.',\n 'title_limit' => null,\n 'body_limit' => 500,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body_ru' => '<span class=colored>Свобода</span>для сопоставления<br>разных материалов и отделок<br>и <span class=colored>ошеломляющий</span>визуал.',\n 'image' => null,\n 'body' => 'The <span class=colored>freedom</span>to to juxtapose<br>different materials, finishes<br>and <span class=colored>stunning</span>visual.',\n 'body_it' => 'La <span class=colored>libertà</span>Per giungere a destra<br>Materiali diversi, finiture<br>e <span class=colored>stunning</span>visivo.',\n 'title_limit' => null,\n 'body_limit' => 150,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Mood',\n 'title_ru' => 'Настроение',\n 'title_it' => 'Umore',\n 'body' => 'Special care is devoted to details, the selection of tissues, and the coordination of color nuances. The collection is inspired by the Renaissance town of Verona, symbol of the classic and highly appreciated Italian style, romantic and elegant at a time.',\n 'body_ru' => 'Особое внимание уделяется деталям, выбору тканей и координации цветовых нюансов. Коллекция вдохновлена эпохой Возрождения Вероны, символом классического и высоко оцененного итальянского стиля, романтического и элегантного за один раз.',\n 'body_it' => 'La cura particolare è dedicata ai dettagli, alla selezione dei tessuti e al coordinamento delle sfumature di colore. La collezione è ispirata alla città rinascimentale di Verona, simbolo del classico stile italiano molto apprezzato, romantico ed elegante alla volta.',\n 'image' => null,\n 'title_limit' => 15,\n 'body_limit' => 300,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Expression',\n 'title_ru' => 'Выражение',\n 'title_it' => 'Espressione',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details.',\n 'body_ru' => 'Кроме того, в офисе новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражает себя в любящей заботе о деталях.',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesumina un design elegante e raffinato che si esprime in una cura amorosa per i dettagli.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Style',\n 'title_ru' => 'Стиль',\n 'title_it' => 'Stile',\n 'body' => 'In a hand manufacturing that exalt the textures, giving you furniture complements with a unique and timeless charm.\n ',\n 'body_ru' => 'В ручном производстве, которые превозносят текстуры, дают вам комплименты мебели с уникальным и неподвластным времени очарованием.',\n 'body_it' => 'In una produzione a mano che esalta le texture, dandovi complimenti per mobili con un fascino unico e senza tempo.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 1,\n 'title' => 'Quality',\n 'title_ru' => 'Качество',\n 'title_it' => 'Qualità',\n 'body' => 'Also in the office area a new concept of space, tailored to your needs, to revive an elegant and refined design that expresses itself in a loving care for details.\n ',\n 'body_ru' => 'Кроме того, в офисе новая концепция пространства, адаптированная к вашим потребностям, оживляет элегантный и изысканный дизайн, который выражает себя в любящей заботе о деталях.',\n 'body_it' => 'Anche nell\\'area dell\\'ufficio un nuovo concetto di spazio, adattato alle vostre esigenze, riesumina un design elegante e raffinato che si esprime in una cura amorosa per i dettagli.',\n 'image' => null,\n 'title_limit' => 12,\n 'body_limit' => 190,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n /*\n * Contacts PAGE BLOCKS\n */\n [\n 'page_id' => 2,\n 'title' => 'CAVIO Factory & Showroom',\n 'title_ru' => 'CAVIO Фабрики & Посредники',\n 'title_it' => 'CAVIO Factory & Showroom',\n 'body' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_ru' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_it' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR)\n Italia<br><br>Telefone: <a href=\"tel:+39 045 71 44 503\" class=tel>+39 045 71 44 503</a><br>Fax:\n <a href=\"tel:+39 045 71 44 277\" class=tel>+39 045 71 44 277</a><br><br><a\n href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'image' => 'cont-r.jpg',\n 'title_limit' => 26,\n 'body_limit' => 400,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 2,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => 'cont-map.jpg',\n 'title_limit' => null,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 2,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => 'cont-bottom.jpg',\n 'title_limit' => null,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 8,\n 'title' => 'Our philosofy',\n 'title_ru' => 'Наша философия',\n 'title_it' => 'La filosofia',\n 'body' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'body_ru' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'body_it' => '<div class=wrap-phil-p><p>Italian furniture showroom CAVIO found its adherents in 38 countries, including Switzerland, France, Sweden, Netherlands, Germany, Australia and the United States.</div><div class=wrap-phil-p><p>In Kiev, the Italian furniture CAVIO presented in several showrooms, conveniently located on the left and right banks.</div><div class=wrap-phil-p><p>Here, professional consultants will help you to implement a holistic complete interior - from the kitchen, bedroom, living room and study to the children\\'s room <a href=# class=link-arrow>→</a></div>',\n 'image' => 'phil-image.jpg',\n 'title_limit' => 15,\n 'body_limit' => 810,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 9,\n 'title' => 'Privacy Policy',\n 'title_ru' => 'Политика приватности',\n 'title_it' => 'Politica sulla riservatezza',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'image' => null,\n 'title_limit' => 30,\n 'body_limit' => null,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n\n /*\n * Showroom page\n */\n\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-2.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-3.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => '',\n 'body_ru' => '',\n 'body_it' => '',\n 'title_limit' => null,\n 'body_limit' => null,\n 'image' => 'show_r-slide-1.jpg',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => '',\n 'title_ru' => '',\n 'title_it' => '',\n 'body' => 'Don’t found showroom<br>near you? <span class=colored>Contact main</span><br>',\n 'body_ru' => 'Не нашли салон рядом<br>с вами? <span class=colored>Обратитесь в главный</span><br>',\n 'body_it' => 'Non ho trovato lo showroom<br>vicino a te? <span class=colored>Contatto principale</span><br>',\n 'image' => null,\n 'title_limit' => null,\n 'body_limit' => 100,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'page_id' => 5,\n 'title' => 'Main Showroom',\n 'title_ru' => 'Главный магазин',\n 'title_it' => 'Showroom principale',\n 'body' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_ru' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'body_it' => 'Viale Europa, 6/a, 37050<br>San Pietro di Morubio (VR) Italia<br><br>Telefone: <a href=tel:+390457144503 class=tel>+39 045 71 44 503</a><br>Fax: <a href=tel:+390457144277 class=tel>+39 045 71 44 277</a><br><br><a href=mailto:[email protected] class=\"colored_link anim-underline\">[email protected]</a>',\n 'image' => 'main-showroom.jpg',\n 'title_limit' => null,\n 'body_limit' => 320,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n\n\n ];\n\n DB::table('blocks')->insert($blocks);\n\n\n $this->enableForeignKeys();\n }", "function EventReg_listblock_info()\n{\n // Values\n return array('text_type' => 'EventRegList',\n 'module' => 'EventReg',\n 'text_type_long' => 'EventReg list N events',\n 'allow_multiple' => true,\n 'form_content' => false,\n 'form_refresh' => false,\n 'show_preview' => true);\n}", "public static function get_block_data()\n {\n }", "function fmcontent_list_show($options) {\n\n $content_handler = xoops_getmodulehandler ( 'page', 'fmcontent' );\n $topic_handler = xoops_getmodulehandler ( 'topic', 'fmcontent' );\n\n global $xoTheme;\n\n $block = array();\n $forMods = $options[0];\n $show = $options[1];\n $content_infos['content_limit'] = $options[2];\n $content_infos['lenght_title'] = $options[3];\n $showimg = $options[4];\n $showdescription = $options[5];\n $showdate = $options[6];\n $content_infos['content_sort'] = $options[7];\n $width = $options[8];\n $float = $options[9];\n $content_infos['content_order'] = $options[10];\n\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n array_shift($options);\n\n $module_handler = xoops_gethandler('module');\n $forMods = $module_handler->getByDirname($forMods);\n\n $options0 = $options[0];\n $content_infos ['topics'] = $topic_handler->getall ();\n $contents = $content_handler->getContentBlockList($forMods, $content_infos ,$options);\n\n // Add block data\n\t $block['show'] = $show;\n $block['img'] = $showimg;\n $block['imgurl'] = XOOPS_URL . xoops_getModuleOption('img_dir', 'fmcontent');\n $block['description'] = $showdescription;\n $block['date'] = $showdate;\n $block['contents'] = $contents;\n $block['width'] = $width;\n $block['float'] = $float;\n\n // Add styles\n $xoTheme->addStylesheet(XOOPS_URL . '/modules/' . $forMods->getVar('dirname') . '/css/blocks.css', null);\n\n return $block;\n\n}", "public function run()\n {\n $amount = [\n \"Second\" => [\n 1 => [\n \"dummy_index\",\n \"9981\",\n \"10072\",\n \"10165\",\n \"10258\",\n \"10352\",\n \"10453\",\n \"10543\",\n \"10640\"\n ],\n 2 => [\n \"dummy_index\",\n \"10667\",\n \"10761\",\n \"10856\",\n \"10952\",\n \"11049\",\n \"11147\",\n \"11245\",\n \"11345\"\n ],\n 3 => [\n \"dummy_index\",\n \"11387\",\n \"11488\",\n \"11589\",\n \"11691\",\n \"11795\",\n \"11899\",\n \"12004\",\n \"12110\"\n ],\n 4 => [\n \"dummy_index\",\n \"12155\",\n \"12262\",\n \"12371\",\n \"12480\",\n \"12591\",\n \"12702\",\n \"12814\",\n \"12927\"\n ],\n 5 => [\n \"dummy_index\",\n \"12975\",\n \"13117\",\n \"13206\",\n \"13322\",\n \"13440\",\n \"13559\",\n \"13679\",\n \"13799\"\n ],\n 6 => [\n \"dummy_index\",\n \"13851\",\n \"13973\",\n \"14096\",\n \"14221\",\n \"14347\",\n \"14474\",\n \"14602\",\n \"14731\"\n ],\n 7 => [\n \"dummy_index\",\n \"14785\",\n \"14916\",\n \"15048\",\n \"15181\",\n \"15315\",\n \"15450\",\n \"15587\",\n \"15725\"\n ],\n 8 => [\n \"dummy_index\",\n \"15818\",\n \"15969 \",\n \"16121\",\n \"16275 \",\n \"16430 \",\n \"16586\",\n \"16586\",\n \"16903\"\n ],\n 9 => [\n \"dummy_index\",\n \"16986\",\n \"17142 \",\n \"17299\",\n \"17458 \",\n \"17618 \",\n \"17780\",\n \"17943\",\n \"18108\"\n ],\n 10 => [\n \"dummy_index\",\n \"18217 \",\n \"18385 \",\n \"18553\",\n \"18724 \",\n \"18896 \",\n \"19095 \",\n \"19244\",\n \"19421\"\n ],\n 11 => [\n \"dummy_index\",\n \"19620\",\n \"19853\",\n \"20088\",\n \"20326\",\n \"20567\",\n \"20,811\",\n \"21,058\",\n \"21,307\"\n ],\n 12 => [\n \"dummy_index\",\n \"21,387\",\n \"21,626\",\n \"21,868\",\n \"22,113\",\n \"22,361\",\n \"22,611\",\n \"22,864\",\n \"23,120\"\n ],\n 13 => [\n \"dummy_index\",\n \"23,257\",\n \"23,517\",\n \"23,780\",\n \"24,047\",\n \"24,315\",\n \"24,587\",\n \"24,863\",\n \"25,141\"\n ],\n 14 => [\n \"dummy_index\",\n \"25,290\",\n \"25,573\",\n \"25,859\",\n \"26,149\",\n \"26,441\",\n \"26,737\",\n \"27,036\",\n \"27,339\"\n ],\n 15 => [\n \"dummy_index\",\n \"27,565\",\n \"27,887\",\n \"28,214\",\n \"28,544\",\n \"28,877\",\n \"29,214\",\n \"29,557\",\n \"29,902\"\n ],\n 16 => [\n \"dummy_index\",\n \"30,044\",\n \"30,396\",\n \"30,751\",\n \"31,111\",\n \"31,474\",\n \"31,843\",\n \"32,215\",\n \"32,592\"\n ],\n 17 => [\n \"dummy_index\",\n \"32,747\",\n \"33,131\",\n \"33,518\",\n \"33,909\",\n \"34,306\",\n \"34,707\",\n \"35,113\",\n \"35,524\"\n ],\n 18 => [\n \"dummy_index\",\n \"35,693\",\n \"36,111\",\n \"36,532\",\n \"36,960\",\n \"37,392\",\n \"37,829\",\n \"38,272\",\n \"38,719\"\n ],\n 19 => [\n \"dummy_index\",\n \"39,151\",\n \"39,685\",\n \"40,227\",\n \"40,776\",\n \"41,333\",\n \"41,898\",\n \"42,470\",\n \"43,051\"\n ],\n 20 => [\n \"dummy_index\",\n \"43,250\",\n \"43,841\",\n \"44,440\",\n \"45,047\",\n \"45,662\",\n \"46,285\",\n \"46,917\",\n \"47,559\"\n ],\n 21 => [\n \"dummy_index\",\n \"47,779\",\n \"48,432\",\n \"49,094\",\n \"49,764\",\n \"50,443\",\n \"51,132\",\n \"51,831\",\n \"52,539\"\n ],\n 22 => [\n \"dummy_index\",\n \"52,783\",\n \"53,503\",\n \"54,234\",\n \"54,975\",\n \"55,726\",\n \"56,487\",\n \"57,258\",\n \"58,040\"\n ],\n 23 => [\n \"dummy_index\",\n \"58,310\",\n \"59,106\",\n \"59,913\",\n \"60,732\",\n \"61,561\",\n \"62,402\",\n \"63,255\",\n \"64,118\"\n ],\n 24 => [\n \"dummy_index\",\n \"64,416\",\n \"65,296\",\n \"66,187\",\n \"67,092\",\n \"68,008\",\n \"68,937\",\n \"69,878\",\n \"70,832\"\n ],\n 25 => [\n \"dummy_index\",\n \"71,476\",\n \"72,452\",\n \"73,441\",\n \"74,444\",\n \"75,461\",\n \"76,491\",\n \"77,536\",\n \"78,595\"\n ],\n 26 => [\n \"dummy_index\",\n \"78,960\",\n \"80,039\",\n \"81,132\",\n \"82,240\",\n \"83,363\",\n \"84,502\",\n \"85,657\",\n \"86,825\"\n ],\n 27 => [\n \"dummy_index\",\n \"87,229\",\n \"88,420\",\n \"89,628\",\n \"90,852\",\n \"92,093\",\n \"93,351\",\n \"94,625\",\n \"95,925\"\n ],\n 28 => [\n \"dummy_index\",\n \"96,363\",\n \"97,679\",\n \"99,013\",\n \"100,366\",\n \"101,736\",\n \"103,126\",\n \"104,534\",\n \"105,962\"\n ],\n 29 => [\n \"dummy_index\",\n \"106,454\",\n \"107,908\",\n \"109,382\",\n \"110,875\",\n \"112,390\",\n \"113,925\",\n \"115,481\",\n \"117,058\"\n ],\n 30 => [\n \"dummy_index\",\n \"117,601\",\n \"119,208\",\n \"120,836\",\n \"122,486\",\n \"124,159\",\n \"125,855\",\n \"127,573\",\n \"129,316\"\n ],\n 31 => [\n \"dummy_index\",\n \"152,325\",\n \"154,649\",\n \"157,008\",\n \"159,404\",\n \"161,836\",\n \"164,305\",\n \"166,812\",\n \"169,357\"\n ],\n 32 => [\n \"dummy_index\",\n \"177,929\",\n \"180,700\",\n \"183,513\",\n \"186,372\",\n \"189,274\",\n \"192,221\",\n \"195,215\",\n \"198,255\"\n ],\n 33 => [\n \"dummy_index\",\n \"215,804\",\n \"222,278\",\n ],\n ],\n \"Third\" => [\n 1 => [\n \"dummy_index\",\n \"10,510\",\n \"10,602\",\n \"10,695\",\n \"10,789\",\n \"10,884\",\n \"10,982\",\n \"11,076\",\n \"11,173\"\n ],\n 2 => [\n \"dummy_index\",\n \"11,200\",\n \"11,293\",\n \"11,386\",\n \"11,480\",\n \"11,575\",\n \"11,671\",\n \"11,767\",\n \"11,864\"\n ],\n 3 => [\n \"dummy_index\",\n \"11,914\",\n \"12,013\",\n \"12,112\",\n \"12,212\",\n \"12,313\",\n \"12,414\",\n \"12,517\",\n \"12,620\"\n ],\n 4 => [\n \"dummy_index\",\n \"12,674\",\n \"12,778\",\n \"12,884\",\n \"12,990\",\n \"13,097\",\n \"13,206\",\n \"13,315\",\n \"13,424\"\n ],\n 5 => [\n \"dummy_index\",\n \"13,481\",\n \"13,606\",\n \"13,705\",\n \"13,818\",\n \"13,932\",\n \"14,047\",\n \"14,163\",\n \"14,280\"\n ],\n 6 => [\n \"dummy_index\",\n \"14,340\",\n \"14,459\",\n \"14,578\",\n \"14,699\",\n \"14,820\",\n \"14,942\",\n \"15,066\",\n \"15,190\"\n ],\n 7 => [\n \"dummy_index\",\n \"15,254\",\n \"15,380\",\n \"15,507\",\n \"15,635\",\n \"15,765\",\n \"15,895\",\n \"16,026\",\n \"16,158\"\n ],\n 8 => [\n \"dummy_index\",\n \"16,282\",\n \"16,433\",\n \"16,585\",\n \"16,739\",\n \"16,895\",\n \"17,051\",\n \"17,209\",\n \"17,369\"\n ],\n 9 => [\n \"dummy_index\",\n \"17,473\",\n \"17,627 \",\n \"17,781\",\n \"17,937\",\n \"18,095\",\n \"18,253\",\n \"18,413\",\n \"18,575\"\n ],\n 10 => [\n \"dummy_index\",\n \"18,718\",\n \"18,883\",\n \"19,048\",\n \"19,215\",\n \"19,384\",\n \"19,567\",\n \"19,725\",\n \"19,898\"\n ],\n 11 => [\n \"dummy_index\",\n \"20,179\",\n \"20,437\",\n \"20,698\",\n \"20,963\",\n \"21,231\",\n \"21,502\",\n \"21,777\",\n \"22,055\"\n ],\n 12 => [\n \"dummy_index\",\n \"22,149\",\n \"22,410\",\n \"22,674\",\n \"22,942\",\n \"23,212\",\n \"23,486\",\n \"23,763\",\n \"24,043\"\n ],\n 13 => [\n \"dummy_index\",\n \"24,224\",\n \"24,510\",\n \"24,799\",\n \"25,091\",\n \"25,387\",\n \"25,686\",\n \"25,989\",\n \"26,296\"\n ],\n 14 => [\n \"dummy_index\",\n \"26,494\",\n \"26,806\",\n \"27,122\",\n \"27,442\",\n \"27,766\",\n \"28,093\",\n \"28,424\",\n \"28,759\"\n ],\n 15 => [\n \"dummy_index\",\n \"29,010\",\n \"29,359\",\n \"29,713\",\n \"30,071\",\n \"30,432\",\n \"30,799\",\n \"31,170\",\n \"31,545\"\n ],\n 16 => [\n \"dummy_index\",\n \"31,765\",\n \"32,147\",\n \"32,535\",\n \"32,926\",\n \"33,323\",\n \"33,724\",\n \"34,130\",\n \"34,541\"\n ],\n 17 => [\n \"dummy_index\",\n \"34,781\",\n \"35,201\",\n \"35,624\",\n \"36,053\",\n \"36,487\",\n \"36,927\",\n \"37,371\",\n \"37,821\"\n ],\n 18 => [\n \"dummy_index\",\n \"38,085\",\n \"38,543\",\n \"39,007\",\n \"39,477\",\n \"39,952\",\n \"40,433\",\n \"40,920\",\n \"41,413\"\n ],\n 19 => [\n \"dummy_index\",\n \"42,099\",\n \"42,730\",\n \"43,371\",\n \"44,020\",\n \"44,680\",\n \"45,350\",\n \"46,030\",\n \"46,720\"\n ],\n 20 => [\n \"dummy_index\",\n \"47,037\",\n \"47,742\",\n \"48,457\",\n \"49.184\",\n \"49,921\",\n \"50,669\",\n \"50,669\",\n \"52,199\"\n ],\n 21 => [\n \"dummy_index\",\n \"52,554\",\n \"53,341\",\n \"54,141\",\n \"54,952\",\n \"55,776\",\n \"56,612\",\n \"57,460\",\n \"58,322\"\n ],\n 22 => [\n \"dummy_index\",\n \"58,717\",\n \"59,597\",\n \"60,491\",\n \"61,397\",\n \"62,318\",\n \"63,252\",\n \"64,200\",\n \"65,162\"\n ],\n 23 => [\n \"dummy_index\",\n \"65,604\",\n \"66,587\",\n \"67,585\",\n \"68,598\",\n \"69,627\",\n \"70,670\",\n \"71,730\",\n \"72,805\"\n ],\n 24 => [\n \"dummy_index\",\n \"72,805\",\n \"74,397\",\n \"75,512\",\n \"76,644\",\n \"77,793\",\n \"78,959\",\n \"80,143\",\n \"81,344\"\n ],\n 25 => [\n \"dummy_index\",\n \"82,439\",\n \"83,674\",\n \"84,928\",\n \"86,201\",\n \"87,493\",\n \"88,805\",\n \"90,136\",\n \"91,487\"\n ],\n 26 => [\n \"dummy_index\",\n \"92,108\",\n \"93,488\",\n \"94,889\",\n \"96,312\",\n \"97,755\",\n \"99,221\",\n \"100,708\",\n \"102,217\"\n ],\n 27 => [\n \"dummy_index\",\n \"102,910\",\n \"104,453\",\n \"106,019\",\n \"107,608\",\n \"109,221\",\n \"110,858\",\n \"112,519\",\n \"114,210\"\n ],\n 28 => [\n \"dummy_index\",\n \"114,981\",\n \"116,704\",\n \"118,453\",\n \"120,229\",\n \"122,031\",\n \"123,860\",\n \"125,716\",\n \"127,601\"\n ],\n 29 => [\n \"dummy_index\",\n \"128,467\",\n \"130,392\",\n \"132,346\",\n \"134,330\",\n \"136,343\",\n \"138,387\",\n \"140,461\",\n \"142,566\"\n ],\n 30 => [\n \"dummy_index\",\n \"143,534\",\n \"145,685\",\n \"147,869\",\n \"150,085\",\n \"152,335\",\n \"154,618\",\n \"156,935\",\n \"159,288\"\n ],\n 31 => [\n \"dummy_index\",\n \"198,168\",\n \"201,615\",\n \"205,121\",\n \"208,689\",\n \"212,318\",\n \"216,011\",\n \"219,768\",\n \"223,590\"\n ],\n 32 => [\n \"dummy_index\",\n \"233,857\",\n \"238,035\",\n \"242,288\",\n \"246,618\",\n \"251,024\",\n \"255,509\",\n \"255,509\",\n \"264,721\"\n ],\n 33 => [\n \"dummy_index\",\n \"289,401\",\n \"298,083\",\n ],\n ],\n \"Fourth\" => [\n 1 => [\n \"dummy_index\",\n \"11,066\",\n \"11,160\",\n \"11,254\",\n \"11,348\",\n \"11,443\",\n \"11,538\",\n \"11,635\",\n \"11,732\"\n ],\n 2 => [\n \"dummy_index\",\n \"11,761\",\n \"11,851\",\n \"11,942\",\n \"12,034\",\n \"12,126\",\n \"12,219\",\n \"12,313\",\n \"12,407\"\n ],\n 3 => [\n \"dummy_index\",\n \"12,466\",\n \"12,562\",\n \"12,658\",\n \"12,756\",\n \"12,854\",\n \"12,952\",\n \"13,052\",\n \"13,152\"\n ],\n 4 => [\n \"dummy_index\",\n \"13,214\",\n \"13,316\",\n \"13,418\",\n \"13,521\",\n \"13,625\",\n \"13,729\",\n \"13,835\",\n \"13,941\"\n ],\n 5 => [\n \"dummy_index\",\n \"14,007\",\n \"14,115\",\n \"14,223\",\n \"14,332\",\n \"14,442\",\n \"14,553\",\n \"14,665\",\n \"14,777\"\n ],\n 6 => [\n \"dummy_index\",\n \"14,847\",\n \"14,961\",\n \"15,076\",\n \"15,192\",\n \"15,309\",\n \"15,426\",\n \"15,545\",\n \"15,664\"\n ],\n 7 => [\n \"dummy_index\",\n \"15,738\",\n \"15,859\",\n \"15,981\",\n \"16,104\",\n \"16,227\",\n \"16,352\",\n \"16,477\",\n \"16,604\"\n ],\n 8 => [\n \"dummy_index\",\n \"16,758\",\n \"16,910\",\n \"17,063\",\n \"17,217\",\n \"17,372\",\n \"17,529\",\n \"17,688\",\n \"17,848\"\n ],\n 9 => [\n \"dummy_index\",\n \"17,975\",\n \"18,125 \",\n \"18,277\",\n \"18,430\",\n \"18,584\",\n \"18,739\",\n \"18,896\",\n \"19,054\"\n ],\n 10 => [\n \"dummy_index\",\n \"19,233\",\n \"19,394\",\n \"19,556\",\n \"19,720\",\n \"19,884\",\n \"20,051\",\n \"20,218\",\n \"20,387\"\n ],\n 11 => [\n \"dummy_index\",\n \"20,754\",\n \"21,038\",\n \"21,327\",\n \"21,619\",\n \"21,915\",\n \"22,216\",\n \"22,520\",\n \"22,829\"\n ],\n 12 => [\n \"dummy_index\",\n \"22,938\",\n \"23,222\",\n \"23,510\",\n \"23.801\",\n \"24,096\",\n \"24,395\",\n \"24,697\",\n \"25,003\"\n ],\n 13 => [\n \"dummy_index\",\n \"25,232\",\n \"25.545\",\n \"25,861\",\n \"26,181\",\n \"26,181\",\n \"26,834\",\n \"27,166\",\n \"27,503\"\n ],\n 14 => [\n \"dummy_index\",\n \"27,755\",\n \"28,099\",\n \"28,447\",\n \"28,800\",\n \"29,156\",\n \"29,517\",\n \"29,883\",\n \"30,253\"\n ],\n 15 => [\n \"dummy_index\",\n \"30,531\",\n \"30,909\",\n \"31,292\",\n \"31,680\",\n \"32,072\",\n \"32,469\",\n \"32,871\",\n \"33,279\"\n ],\n 16 => [\n \"dummy_index\",\n \"33,584\",\n \"34,000\",\n \"34,421\",\n \"34,847\",\n \"35,279\",\n \"35,716\",\n \"36,159\",\n \"36,606\"\n ],\n 17 => [\n \"dummy_index\",\n \"36,942\",\n \"37,400\",\n \"37,863\",\n \"38,332\",\n \"38,807\",\n \"39,288\",\n \"39,774\",\n \"40,267\"\n ],\n 18 => [\n \"dummy_index\",\n \"40,637\",\n \"41,140\",\n \"41,650\",\n \"42,165\",\n \"42,688\",\n \"43,217\",\n \"43,752\",\n \"44,294\"\n ],\n 19 => [\n \"dummy_index\",\n \"45,269\",\n \"46,008\",\n \"46,759\",\n \"47,522\",\n \"48,298\",\n \"49,086\",\n \"49,888\",\n \"50,702\"\n ],\n 20 => [\n \"dummy_index\",\n \"51,155\",\n \"51,989\",\n \"52,838\",\n \"53,700\",\n \"54,577\",\n \"55,468\",\n \"56,373\",\n \"57,293\"\n ],\n 21 => [\n \"dummy_index\",\n \"57,805\",\n \"58,748\",\n \"59,707\",\n \"60,681\",\n \"61,672\",\n \"62,678\",\n \"63,701\",\n \"64,741\"\n ],\n 22 => [\n \"dummy_index\",\n \"65,319\",\n \"66,385\",\n \"67,469\",\n \"68,570\",\n \"69,689\",\n \"70,827\",\n \"71,983\",\n \"73,157\"\n ],\n 23 => [\n \"dummy_index\",\n \"73,811\",\n \"75,015\",\n \"76,240\",\n \"77,484\",\n \"78,749\",\n \"80,034\",\n \"81,340\",\n \"82,668\"\n ],\n 24 => [\n \"dummy_index\",\n \"83,406\",\n \"84,767\",\n \"86,151\",\n \"87,557\",\n \"88,986\",\n \"90,439\",\n \"91,915\",\n \"93,415\"\n ],\n 25 => [\n \"dummy_index\",\n \"95,083\",\n \"96,635\",\n \"98,212\",\n \"99,815\",\n \"101,444\",\n \"103,100\",\n \"104,783\",\n \"106,493\"\n ],\n 26 => [\n \"dummy_index\",\n \"107,444\",\n \"109,197\",\n \"110,980\",\n \"112,791\",\n \"114,632\",\n \"116,503\",\n \"118,404\",\n \"120,337\"\n ],\n 27 => [\n \"dummy_index\",\n \"121,411\",\n \"123,393\",\n \"125,407\",\n \"127,454\",\n \"129,534\",\n \"131,648\",\n \"133,797\",\n \"135,981\"\n ],\n 28 => [\n \"dummy_index\",\n \"137,195\",\n \"139,434\",\n \"141,710\",\n \"144,023\",\n \"146,373\",\n \"148,763\",\n \"151,191\",\n \"153,658\"\n ],\n 29 => [\n \"dummy_index\",\n \"155,030\",\n \"157,561\",\n \"160,132\",\n \"162.746\",\n \"165,402\",\n \"168,102\",\n \"170,845\",\n \"173,634\"\n ],\n 30 => [\n \"dummy_index\",\n \"175,184\",\n \"178,043\",\n \"180,949\",\n \"183,903\",\n \"186,904\",\n \"189,955\",\n \"193,055\",\n \"196,206\"\n ],\n 31 => [\n \"dummy_index\",\n \"257,809\",\n \"262,844\",\n \"267,978\",\n \"273,212\",\n \"278,549\",\n \"283,989\",\n \"289,536\",\n \"295,191\"\n ],\n 32 => [\n \"dummy_index\",\n \"307,365\",\n \"313,664\",\n \"319,887\",\n \"326,338\",\n \"332,919\",\n \"339,633\",\n \"346,483\",\n \"353,470\"\n ],\n 33 => [\n \"dummy_index\",\n \"388,096\",\n \"399,739\",\n ],\n ]\n ];\n\n $tranche = [\"Second\" => \"Second\",\"Third\" => \"Third\",\"Fourth\" => \"Fourth\"];\n foreach($tranche as $indexTranche){\n foreach(range(1,33) as $indexGrade){\n foreach(range(1,8) as $indexStep){\n if($indexGrade == 33 && $indexStep > 2){\n continue;\n }\n\n $salaryArray = [\n \"salary_tranche\" => $tranche[$indexTranche],\n \"salary_grade\" => $indexGrade,\n \"salary_step\" => $indexStep,\n \"salary_amount\" => str_replace(',','',$amount[$indexTranche][$indexGrade][$indexStep]),\n \"status\" => 1\n ];\n SalaryGrade::create($salaryArray);\n }\n }\n }\n\n }", "function render_block($block)\r\n {\r\n $block = ProfilerBlock :: factory($this, $block);\r\n return $block->run();\r\n }", "public function getBlocksDataFullRaw(): void\n\t{\n\t\t// Get global settings direct from file.\n\t\t$settings = $this->getSettingsManifest();\n\n\t\t$namespace = $settings['namespace'];\n\n\t\t$blocks = \\array_map(\n\t\t\tstatic function ($block) use ($namespace) {\n\t\t\t\t// Check if blocks-namespace is defined in block or in global manifest settings.\n\t\t\t\t$block['namespace'] = $namespace;\n\t\t\t\t$block['blockFullName'] = \"{$namespace}/{$block['blockName']}\";\n\n\t\t\t\treturn $block;\n\t\t\t},\n\t\t\t$this->getBlocksManifests()\n\t\t);\n\n\t\t// Register store and set all the data.\n\t\tComponents::setStore();\n\t\tComponents::setSettings($settings);\n\t\tComponents::setBlocks($blocks);\n\t\tComponents::setComponents($this->getComponentsManifests());\n\t\tComponents::setVariations($this->getVariationsManifests());\n\t\tComponents::setConfigFlags();\n\t\tComponents::setPaths();\n\n\t\tif (Components::getConfigUseWrapper()) {\n\t\t\tComponents::setWrapper($this->getWrapperManifest());\n\t\t}\n\t}", "public function filter_dashboard_block_list($block_list)\n\t\t{\n\t\t\treturn $this->filter_block_list($block_list);\n\t\t}", "function getLayoutListEntries($module)\n{\n\t$tabid = getTabid($module);\n\tglobal $adb;\n\tglobal $theme;\n\tglobal $current_language;\n\tglobal $app_strings;\n\tif($module == \"Events\") {\n\t\t$module = \"Calendar\";\n\t}\n\t$cur_module_strings = return_specified_module_language($current_language,$module);\n\t$theme_path=\"themes/\".$theme.\"/\";\n\t$image_path=$theme_path.\"images/\";\n\t$query = \"select * from ec_blocks where tabid='\".$tabid.\"' order by sequence\";\n\t$block_result = $adb->getList($query);\n\t$blcoklist = Array();\n\tforeach($block_result as $block_row)\n\t{\n\t\t$blockid = $block_row['blockid'];\n\t\t$blocklabel = $block_row['blocklabel'];\n\t\tif(isset($cur_module_strings[$blocklabel])) {\n\t\t\t$blocklabel = $cur_module_strings[$blocklabel];\n\t\t}\n\t\t\n\t\t$dbQuery = \"select ec_field.fieldid,ec_field.fieldlabel,ec_field.block,ec_field.sequence,ec_field.typeofdata from ec_field inner join ec_def_org_field on ec_def_org_field.fieldid=ec_field.fieldid where ec_def_org_field.visible=0 and ec_field.tabid=$tabid and displaytype in(1,2,4) and ec_field.block='\".$blockid.\"' order by ec_field.block,ec_field.sequence\";\n\t\t$result = $adb->getList($dbQuery);\n\t\t$count=1;\n\t\t$cflist = Array();\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$cf_element = Array();\n\t\t\t\t$cf_element['no'] = $count;\n\t\t\t\tif(isset($cur_module_strings[$row[\"fieldlabel\"]])) {\n\t\t\t\t\t$cf_element['fieldlabel'] = $cur_module_strings[$row[\"fieldlabel\"]];\n\t\t\t\t} elseif(isset($app_strings[$row[\"fieldlabel\"]])) {\n\t\t\t\t\t$cf_element['fieldlabel'] = $app_strings[$row[\"fieldlabel\"]];\n\t\t\t\t} else {\n\t\t\t\t\t$cf_element['fieldlabel'] = $row[\"fieldlabel\"];\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$cf_element['sequence'] = $row[\"sequence\"];\n\t\t\t\t$typeofdata = $row[\"typeofdata\"];\n\t\t\t\tif(strpos($typeofdata,\"~M\") > -1) {\n\t\t\t\t\t$typeofdata = \"true\";\n\t\t\t\t} else {\n\t\t\t\t\t$typeofdata = \"false\";\n\t\t\t\t}\n\t\t\t\t$cf_element['typeofdata'] = $typeofdata;\n\t\t\t\t//getCreateCustomBlockForm(customModule,blockid,tabid,label,order)\n\t\t\t\t$cf_element['tool']='<img src=\"'.$image_path.'editfield.gif\" border=\"0\" style=\"cursor:pointer;\" onClick=\"getFieldLayoutForm(\\''.$module.'\\',\\''.$row[\"fieldid\"].'\\',\\''.$tabid.'\\',\\''.$cf_element['fieldlabel'].'\\',\\''.$blocklabel.'\\',\\''.$row[\"sequence\"].'\\',\\''.$row['block'].'\\',\\''.$typeofdata.'\\')\" alt=\"'.$app_strings['LNK_EDIT'].'\" title=\"'.$app_strings['LNK_EDIT'].'\"/>';\n\n\t\t\t\t$cflist[] = $cf_element;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t$blcoklist[$blocklabel] = $cflist;\n }\n\treturn $blcoklist;\n}", "function spectra_block_top ()\n\t{\n\t\t$hash = getbestblockhash ();\n\t\t$block = getblock ($hash);\n\t\t\n\t\treturn $block;\n\t}", "public function generateRows(){\n foreach ($this->blocks as $block){\n if ($block->isNotSquared()){\n // do nothing\n } else {\n $block->generateRows();\n }\n }\n }", "private function computeGroup()\n {\n $this->group = [];\n\n foreach (range(1, $this->getSize()) as $number) {\n if (1 === $this->gcd($number, $this->getSize())) {\n $this->group[] = $number;\n }\n }\n }", "protected function generateSummaryTable(&$params)\n {\n \t$newFields = array($params[\"grouping_fields\"][0]);\n \t$newHeaders = array($params[\"headers\"][array_search($params[\"grouping_fields\"][0],$params[\"fields\"])]);\n \t$indices = array(array_search($params[\"grouping_fields\"][0],$params[\"fields\"]));\n \t$newParams = array(\"total\"=>array(false), \"type\"=>array(\"string\"));\n \tforeach($params[\"data_params\"]['total'] as $index => $value)\n \t{\n \t\tif($value === true)\n \t\t{\n \t\t\t$tempField = $params[\"fields\"][$index];\n \t\t $newFields[] = $tempField;\n \t\t $newHeaders[] = $params[\"headers\"][array_search($tempField,$params[\"fields\"])];\n \t\t $indices[] = array_search($tempField,$params[\"fields\"]);\n \t\t $newParams[\"total\"][] = true;\n \t\t $newParams[\"type\"][] = $params[\"data_params\"][\"type\"][$index];\n \t\t}\n \t}\n\n \t$filteredData = array();\n \t\n \tforeach($this->reportData as $data)\n \t{\n \t\t$row = array();\n \t\tforeach($indices as $index)\n \t\t{\n \t\t\t$row[] = $data[$index];\n \t\t}\n \t\t$filteredData[] = $row;\n \t}\n \t\n \t$summarizedData = array();\n \t$currentRow = $filteredData[0][0];\n \t\n \tfor($i = 0; $i < count($filteredData); $i++)\n \t{\n \t\t$row = array();\n \t\t$row[0] = $currentRow;\n \t\t$add = false;\n \t\twhile($filteredData[$i][0] == $currentRow)\n \t\t{\n \t\t\tfor($j = 1; $j < count($indices); $j++)\n \t\t\t{\n \t\t\t\t$add = true;\n \t\t\t\t$row[$j] += str_replace(\",\", \"\", $filteredData[$i][$j]);\n \t\t\t}\n \t\t\t$i++;\n \t\t}\n \t\tif($add) $summarizedData[] = $row;\n \t\t$currentRow = $filteredData[$i][0];\n $i--;\n \t}\n $table = new TableContent($newHeaders, $summarizedData, $newParams);\n $table->style[\"autoTotalsBox\"] = true;\n $params[\"report\"]->add($table);\n }", "function renderFileGroupedList($list, $resultcount, $pointer, $listLength) {\n\n\t\t// @TODO merge this function with renderFilelist\n\n\t\tif (!is_array($list)) {\n\t\t\t//no result is given\n\t\t\treturn $this->pi_getLL('noDocInCat');\n\t\t}\n\n\t\tif (!intval($resultcount) || $resultcount < 1) {\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog('tx_damfrontend_rendering.renderFileList: Invalid resultcount. Counter is less than 1 or null. Allowed values are integer >0', 'dam_frontend', 2, $list);\n\t\t\treturn $this->pi_getLL('noDocInCat');\n\t\t}\n\t\tif (!intval($pointer) || $pointer < 0) $pointer = 0;\n\t\tif (!intval($listLength) || $listLength < 1) $listLength = $this->cObj->stdWrap($this->conf['filelist.']['defaultLength'], $this->conf['filelist.']['defaultLength.']);\n\t\tif (!isset($this->fileContent)) return $this->pi_getLL('error_renderFileList_template');\n\n\t\t// Optionsplit for ###FILELIST_RECORD###\n\t\tif ($this->conf['filelist.']['useAlternatingRows'] == 1) {\n\t\t\t$filelist_record_marker = $GLOBALS['TSFE']->tmpl->splitConfArray(array('cObjNum' => $this->conf['filelist.']['marker.']['filelist_record_alterning']), count($list));\n\t\t}\n\t\telse {\n\t\t\tif (!isset($this->conf['filelist.']['marker.']['filelist_record'])) {\n\t\t\t\t$this->conf['filelist.']['marker.']['filelist_record'] = '###FILELIST_RECORD###';\n\t\t\t}\n\t\t\t$filelist_record_marker = $GLOBALS['TSFE']->tmpl->splitConfArray(array('cObjNum' => $this->conf['filelist.']['marker.']['filelist_record']), count($list));\n\t\t}\n\n\t\t$list_Code = tsLib_CObj::getSubpart($this->fileContent, '###FILELIST###');\n\t\t$countElement = 0;\n\t\t$rows = '';\n\t\t$cObj = t3lib_div::makeInstance('tslib_cObj');\n\t\tforeach ($list as $elem) {\n\t\t\t$record_Code = tsLib_CObj::getSubpart($this->fileContent, $filelist_record_marker[$countElement]['cObjNum']);\n\t\t\tif ($currentCategory <> $elem['categoryTitle']) {\n\t\t\t\t$currentCategory = $elem['categoryTitle'];\n\t\t\t\t// render the category header\n\t\t\t\t$rows .= $this->renderCategoryHeader($currentCategory);\n\t\t\t}\n\t\t\t$cObj->start($elem, 'tx_dam');\n\t\t\t$countElement++;\n\t\t\t$elem['count_id'] = $countElement;\n\t\t\tif ($pointer > 0) $elem['count_id'] = $countElement + $pointer * $listLength;\n\n\t\t\t$markerArray = $this->recordToMarkerArray($elem, 'renderFields', 'tx_dam');\n\t\t\t$markerArray = $markerArray + $this->substituteLangMarkers($record_Code);\n\n\t\t\t$markerArray['###TX_DAMFRONTEND_FEUSER_UPLOAD###'] = $this->get_FEUserName($elem['tx_damfrontend_feuser_upload']);\n\t\t\t$markerArray['###CRDATE_AGE###'] = $cObj->stdWrap($elem['crdate'], $this->conf['renderFields.']['crdate_age.']);\n\t\t\t$markerArray['###DATE_CR_AGE###'] = $cObj->stdWrap($elem['date_cr'], $this->conf['renderFields.']['date_cr_age.']);\n\t\t\t$markerArray['###CATEGORY###'] = $cObj->cObjGetSingle($this->conf['singleView.']['category.']['cObject'], $this->conf['singleView.']['category.']['cObject.']);\n\t\t\tif (!is_null($this->staticInfoObj)) {\n\t\t\t\t$markerArray['###LANGUAGE###'] = $this->staticInfoObj->getStaticInfoName('LANGUAGES', $elem['language'], '', '', false);\n\t\t\t}\n\n\t\t\t// adding Markers for links to download and single View\n\t\t\tif ($this->piVars['pointer']) $this->conf['filelist.']['link_single.']['stdWrap.']['typolink.']['additionalParams'] .= '&tx_damfrontend_pi1[pointer]=' . $this->piVars['pointer'];\n\t\t\tforeach ($this->piVars as $piVar => $value) {\n\t\t\t\tif (substr($piVar, 0, 5) == \"sort_\") $this->conf['filelist.']['link_single.']['stdWrap.']['typolink.']['additionalParams'] .= '&tx_damfrontend_pi1[' . $piVar . ']=' . $this->piVars[$piVar];\n\t\t\t}\n\t\t\t#if ($this->piVars['pointer']) $this->conf['filelist.']['link_single.']['stdWrap.']['typolink.']['additionalParams'].= '&tx_damfrontend_pi1[pointer]='.$this->piVars['pointer'];\n\n\t\t\t$markerArray['###LINK_SINGLE###'] = $cObj->cObjGetSingle($this->conf['filelist.']['link_single'], $this->conf['filelist.']['link_single.']);\n\n\t\t\t// this is a field in the database, if true, then the fe user has to fill out a request form\n\t\t\tif ($useRequestForm == 1 && $elem['tx_damfrontend_use_request_form'] == 1) {\n\t\t\t\tdie('this function is not implemented at this time!');\n\t\t\t\t$paramRequest = array(\n\t\t\t\t\t'docID' => $elem['uid'],\n\t\t\t\t\t'showRequestform' => 1\n\t\t\t\t);\n\t\t\t\t// TODO implement me with cObj\n\t\t\t\t$markerArray['###LINK_DOWNLOAD###'] = $this->pi_linkTP('request', $paramRequest);\n\n\t\t\t} else {\n\t\t\t\t$markerArray['###LINK_DOWNLOAD###'] = $cObj->cObjGetSingle($this->conf['filelist.']['link_download'], $this->conf['filelist.']['link_download.']);\n\t\t\t}\n\t\t\t$markerArray['###LINK_SELECT_DOWNLOAD###'] = '';\n\t\t\tif (is_array($this->conf['filelist.']['link_select_download.'])) {\n\n\t\t\t\t$markerArray['###LINK_SELECT_DOWNLOAD###'] .= '<select name=\"' . $this->prefixId . '[' . $elem['uid'] . '][convert]\">';\n\t\t\t\t$i = 1;\n\t\t\t\twhile (is_array($this->conf['filelist.']['link_select_download.'][$i . '.'])) {\n\t\t\t\t\t$markerArray['###LINK_SELECT_DOWNLOAD###'] .= $cObj->TEXT($this->conf['filelist.']['link_select_download.'][$i . '.']);\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$markerArray['###LINK_SELECT_DOWNLOAD###'] .= '</select>';\n\t\t\t\t$markerArray['###LINK_SELECT_DOWNLOAD###'] .= '<input type=\"submit\" name=\"' . $this->prefixId . '[' . $elem['uid'] . '][submit]\" value=\"ok\" />';\n\t\t\t}\n\t\t\t$markerArray['###FILEICON###'] = $cObj->stdWrap('<img src=\"' . $this->getFileIconHref($elem['file_mime_type'], $elem['file_mime_subtype']) . '\" title=\"' . $elem['title'] . '\" alt=\"' . $elem['title'] . '\"/>', $this->conf['renderFields.']['fileicon.']);\n\n\t\t\t//render deletion button\n\t\t\tif ($elem['allowDeletion'] == 1 AND $this->conf['enableDeletions'] == 1) {\n\t\t\t\t$markerArray['###BUTTON_DELETE###'] = $cObj->cObjGetSingle($this->conf['filelist.']['button_delete'], $this->conf['filelist.']['button_delete.']);\n\t\t\t} else {\n\t\t\t\t$markerArray['###BUTTON_DELETE###'] = '';\n\t\t\t}\n\t\t\t//render edit button\n\t\t\tif ($elem['allowEdit'] == 1 AND $this->conf['enableEdits'] == 1) {\n\t\t\t\t$markerArray['###BUTTON_EDIT###'] = $cObj->cObjGetSingle($this->conf['filelist.']['button_edit'], $this->conf['filelist.']['button_edit.']);\n\t\t\t\t$markerArray['###BUTTON_CATEDIT###'] = $cObj->cObjGetSingle($this->conf['filelist.']['button_catedit'], $this->conf['filelist.']['button_catedit.']);\n\t\t\t} else {\n\t\t\t\t$markerArray['###BUTTON_EDIT###'] = '';\n\t\t\t\t$markerArray['###BUTTON_CATEDIT###'] = '';\n\t\t\t}\n\n\t\t\t// NEW Hook for additional fields\n\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['DAM_FRONTEND']['RENDER_GROUPEDLIST_VIEW'])) {\n\t\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['DAM_FRONTEND']['RENDER_GROUPEDLIST_VIEW'] as $_classRef) {\n\t\t\t\t\t$_procObj = &t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t$_procObj->renderListView($markerArray, $this, $elem);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rows .= tslib_cObj::substituteMarkerArray($record_Code, $markerArray);\n\t\t\t$sortlinks = array();\n\t\t}\n\t\t$content = tslib_cObj::substituteMarker($list_Code, '###FILELIST_RECORDS###', $rows);\n\t\t$content = tslib_cObj::substituteMarker($content, '###DOWNLOAD_FORM_URL###', $this->cObj->typolink('', $this->conf['filelist.']['link_select_download.']['typolink.']));\n\t\t$content = tslib_cObj::substituteMarker($content, '###LISTLENGTH###', $listLength);\n\t\t$content = tslib_cObj::substituteMarker($content, '###TOTALCOUNT###', $resultcount);\n\n\t\tif (!isset($this->conf['filelist.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['filelist.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['filelist.']['form_url.']['returnLast'] = 'url';\n\t\t$content = tslib_cObj::substituteMarker($content, '###FORM_URL###', $this->cObj->typolink('', $this->conf['filelist.']['form_url.']));\n\t\t$markerArray = array();\n\t\t$markerArray['###FILENAME_HEADER###'] = $this->pi_getLL('FILENAME_HEADER');\n\t\t$markerArray['###FILETYPE_HEADER###'] = $this->pi_getLL('FILETYPE_HEADER');\n\t\t$markerArray['###CR_DATE_HEADER###'] = $this->pi_getLL('CR_DATE_HEADER');\n\t\t$markerArray['###LANGUAGE_HEADER###'] = $this->pi_getLL('LANGUAGE_HEADER');\n\t\t$markerArray['###OWNER_HEADER###'] = $this->pi_getLL('OWNER_HEADER');\n\t\t$markerArray['###CREATOR_HEADER###'] = $this->pi_getLL('CREATOR_HEADER');\n\n\t\t// substitute Links for Sorting\n\t\t$record = $list[0];\n\n\t\tforeach ($record as $key => $value) {\n\t\t\t$content = tsLib_CObj::substituteMarker($content, '###SORTLINK_' . strtoupper($key) . '###', $this->renderSortLink($key));\n\t\t\t$tmpPiVars = $this->piVars;\n\t\t\tunset ($this->piVars);\n\t\t\tif ($this->conf['filelist.']['sortLinksForTitles'] == 1) {\n\t\t\t\tif ($tmpPiVars['sort_' . $key]) {\n\t\t\t\t\tif ($this->piVars['sort_' . $key] == 'DESC') {\n\t\t\t\t\t\t$this->piVars['sort_' . $key] = 'ASC';\n\t\t\t\t\t\t$tsWrap = 'asc';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->piVars['sort_' . $key] = 'DESC';\n\t\t\t\t\t\t$tsWrap = 'desc';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->piVars['sort_' . $key] = 'ASC';\n\t\t\t\t\t$tsWrap = 'no_sort';\n\t\t\t\t}\n\t\t\t\t// check if current header is allready sorted\n\t\t\t\t$markerArray['###' . strtoupper($key) . '_HEADER###'] = $this->cObj->stdWrap($this->pi_linkTP_keepPiVars($this->cObj->cObjGetSingle($this->conf['filelist.']['sortlinks.'][$key], $this->conf['filelist.']['sortlinks.'][$key . '.'])), $this->conf['filelist.']['sortlinks.'][$key . '.'][$tsWrap . '.']);\n\t\t\t\t// todo unset kills the whole piVars need to find a more elegant way to deal with it\n\t\t\t\tunset ($this->piVars);\n\t\t\t\t$this->piVars = $tmpPiVars;\n\t\t\t}\n\t\t}\n\n\t\tforeach (array('FILELIST_BATCH_SELECT', 'FILELIST_BATCH_GO', 'FILELIST_BATCH_CREATEZIPFILE', 'FILELIST_BATCH_SENDASMAIL', 'FILELIST_BATCH_SENDZIPPEDFILESASMAIL', 'FILELIST_BATCH_SENDFILELINK', 'FILELIST_BATCH_SENDZIPPEDFILELINK', 'FILENAME_HEADER', 'FILENAME_HEADER', 'FILETYPE_HEADER', 'CR_DATE_HEADER') as $label) {\n\t\t\t$content = tsLib_CObj::substituteMarker($content, '###' . $label . '###', $this->pi_getLL($label, $label));\n\t\t}\n\t\t$content = tslib_cObj::substituteMarkerArray($content, $markerArray);\n\n\t\t$markerArray['###FILELIST_BACK_PID###'] = $GLOBALS['TSFE']->id;\n\t\t$markerArray['###COMMENT_DEFAULT###'] = $this->pi_getLL('COMMENT_DEFAULT');\n\t\t$markerArray['###COMMENT###'] = $this->pi_getLL('COMMENT');\n\t\t$markerArray['###SUBJECT###'] = $this->pi_getLL('SUBJECT');\n\t\t$markerArray['###TO###'] = $this->pi_getLL('TO');\n\t\t$markerArray['###FROM###'] = $this->pi_getLL('FROM');\n\t\t$markerArray['###SUBJECT_DEFAULT###'] = $this->pi_getLL('SUBJECT_DEFAULT');\n\t\t$markerArray['###FROM_DEFAULT###'] = $GLOBALS['TSFE']->fe_user->user['email'];\n\t\t$markerArray['###MESSAGE###'] = $this->pi_getLL('MAIL_SUCCESS');\n\t\tif ($this->conf['filelist.']['mailOptions.']['signatures.']) {\n\t\t\tforeach ($this->conf['filelist.']['mailOptions.']['signatures.'] as $signatureID => $value) {\n\t\t\t\tif ('.' <> substr($signatureID, -1)) {\n\t\t\t\t\t$options[$signatureID] = $this->cObj->cObjGetSingle($this->conf['filelist.']['mailOptions.']['signatures.'][$signatureID], $this->conf['filelist.']['mailOptions.']['signatures.'][$signatureID . '.']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$selektor = $this->renderSelector($options, '', 'tx_damfrontend_pi1[signature]', 1, false, false);\n\t\t\t$markerArray['###SIGNATURE###'] = $this->cObj->cObjGetSingle($this->conf['filelist.']['mailOptions.']['label'], $this->conf['filelist.']['mailOptions.']['label.']);\n\t\t\t$markerArray['###SIGNATURE###'] .= $this->cObj->stdWrap($selektor, $this->conf['filelist.']['mailOptions.']['signaturesSelector.']);\n\t\t\t$markerArray['###SIGNATURE###'] = $this->cObj->stdWrap($markerArray['###SIGNATURE###'], $this->conf['filelist.']['mailOptions.']);\n\t\t}\n\t\telse {\n\t\t\t$markerArray['###SIGNATURE###'] = '';\n\t\t}\n\t\t# mail markers\n\t\t$mailArray['###MAIL_SALUTATION###'] = $this->pi_getLL('MAIL_SALUTATION');\n\t\t#$mailArray['###MAIL_COMMENT###']=$this->pi_getLL('MAIL_SUCCESS');\n\t\t$mailArray['###MAIL_FOOTER###'] = $this->pi_getLL('MAIL_FOOTER');\n\t\t$mailCode = tsLib_CObj::getSubpart($this->fileContent, '###MAIL_MESSAGE###');\n\t\t$mailCode = tslib_cObj::substituteMarkerArray($mailCode, $mailArray);\n\t\t$markerArray['###MAIL_TEMPLATE###'] = htmlspecialchars($mailCode);\n\t\tif ($listConf['MESSAGE_VISIBILTY'] == \"mail_success\") {\n\t\t\t$markerArray['###MESSAGE_VISIBILTY###'] = 'visible';\n\t\t}\n\t\telse {\n\t\t\t$markerArray['###MESSAGE_VISIBILTY###'] = 'hidden';\n\t\t}\n\t\t$markerArray['###CLOSE###'] = $this->pi_getLL('CLOSE');\n\t\t$content = tslib_cObj::substituteMarkerArray($content, $markerArray);\n\n\t\t// substitute static user defined markers\n\t\t$this->pi_loadLL();\n\t\t$staticMarkers['###SETROWSPERVIEW###'] = $this->pi_getLL('setRowsPerView');\n\t\t$staticMarkers['###LABEL_COUNT###'] = $this->pi_getLL('label_Count');\n\t\t$staticMarkers = $staticMarkers + $this->substituteLangMarkers($list_Code);\n\t\t$content = tslib_cObj::substituteMarkerArray($content, $staticMarkers);\n\n\t\t// substitute Links for Browseresult\n\t\t$browseresults = $this->renderBrowseResults($resultcount, $pointer, $listLength);\n\t\t$content = tsLib_CObj::substituteMarker($content, '###BROWSERESULTS###', $browseresults);\n\n\t\treturn $content;\n\t}", "public function getBlocks(): Collection\n {\n return $this->blocks;\n }", "function getListSums(&$conf,&$sql,&$content,&$tpl,&$DEBUG) {\n\t\t//echo __METHOD__.\":displayListScreen 0 $DEBUG\";\n\t\tif ($conf['list.']['sumFields']) {\n\t\t\t$table=$conf['table'];\n\t\t\t$sumFields = '';\n\t\t\t$sumSQLFields = '';\n\t\t\t$somme = 0;\n\t\t\t$sumFields = explode(',', $conf['list.']['sumFields']);\n\t\t\tforeach($sumFields as $fieldName) {\n\t\t\t\tif ($conf['list.']['sqlcalcfields.'][$fieldName]) {\n\t\t\t\t\t$calcField=$conf['list.']['sqlcalcfields.'][$fieldName]; // TO BE IMPROVED\n\t\t\t\t\tif ($calcField) {\n\t\t\t\t\t\tif (preg_match(\"/min\\(|max\\(|count\\(|sum\\(|avg\\(/i\",$calcField)) {\n\t\t\t\t\t\t\t// we test for group by functions\n\t\t\t\t\t\t\t$sumSQLFields.=$sumSQLFields?\",$calcField as 'sum_$fieldName'\":\"$calcField as 'sum_$fieldName'\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$sumSQLFields.=$sumSQLFields?\",sum($calcField) as 'sum_$fieldName'\":\"sum($calcField) as 'sum_$fieldName'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$fieldAlias=$this->metafeeditlib->xeldAlias($table,$fieldName,$conf);\n\t\t\t\t\t$sumSQLFields.=$sumSQLFields?\",sum($fieldAlias) as 'sum_$fieldName'\":\"sum($fieldAlias) as 'sum_$fieldName'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sumSQLFields.=', count(*) as metafeeditnbelts';\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($sumSQLFields, $sql['fromTables'], '1 '.$sql['where']);\n\t\t\tif ($conf['debug.']['sql']) $this->metafeeditlib->debug('DisplayList Sum SQL ',$GLOBALS['TYPO3_DB']->SELECTquery($sumSQLFields.$sql['gbFields'], $sql['fromTables'], '1 '.$sql['where']),$DEBUG);\n\t\t\t//echo __METHOD__.\":displayListScreen 5 $DEBUG\";\n\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t//We handle here multiple group bys ...\n\t\t\t$value=array();\n\t\t\twhile($valueelt = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\tforeach($valueelt as $key=>$val) {\n\t\t\t\t\t$value[$key]+=$val;\n\t\t\t\t\tif ($key=='metafeeditnbelts') break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($sumFields as $fieldName){\n\t\t\t\t// we handle a stdWrap on the Data..\n\t\t\t\t$std=$conf[$conf['cmdmode'].'.']['stdWrap.']?$conf[$conf['cmdmode'].'.']['stdWrap.']:$conf['stdWrap.'];\n\t\t\t\t$fa=t3lib_div::trimexplode('.',$fieldName);\n\t\t\t\t$sfn=array_pop($fa);\n\t\t\t\t//TODO handle whole relation ...\n\t\t\t\tif ($std[$sfn.'.'] || $std[$table.'.'][$sfn.'.'] ) {\n\t\t\t\t\tif ($std[$sfn.'.']) $stdConf = $std[$sfn.'.'];\n\t\t\t\t\tif ($std[$table.'.'][$sfn.'.']) $stdConf = $std[$table.'.'][$sfn.'.'];\n\t\t\t\t\t//$dataArr['EVAL_'.$_fN] = \n\t\t\t\t\t$value['sum_'.$fieldName]=$this->cObj->stdWrap($value['sum_'.$fieldName], $stdConf);\n\t\t\t\t}\n\t\t\t\t$this->markerArray[\"###SUM_FIELD_$fieldName###\"]= $value['sum_'.$fieldName];\n\t\t\t}\n\t\t\t$this->markerArray[\"###SUM_FIELD_metafeeditnbelts###\"]= $value['metafeeditnbelts'];\n\t\t\t$sumcontent=$this->cObj->stdWrap(trim($this->cObj->substituteMarkerArray($tpl['itemSumCode'], $this->markerArray)),$conf['list.']['sumWrap.']);\n\t\t\t$content=$this->cObj->substituteSubpart($content,'###SUM_FIELDS###',$sumcontent);\n\t\t} else {\n\t\t\t$this->markerArray[\"###SUM_FIELD_metafeeditnbelts###\"]=\"\";\n\t\t\t$sumcontent=$this->cObj->stdWrap(trim($this->cObj->substituteMarkerArray($tpl['itemSumCode'], $this->markerArray)),$conf['list.']['sumWrap.']);\n\t\t\t$content=$this->cObj->substituteSubpart($content,'###SUM_FIELDS###',$sumcontent);\n\t\t}\n\t}", "function render_block($block)\r\n {\r\n $personal_messenger_block = PersonalMessengerBlock :: factory($this, $block);\r\n return $personal_messenger_block->run();\r\n }", "function blocks_print_group($page, $instances) {\n\n if(empty($instances)) {\n return;\n }\n\n switch($page->type) {\n case MOODLE_PAGE_COURSE:\n $isediting = isediting($page->id);\n $ismoving = ismoving($page->id);\n $isteacheredit = isteacheredit($page->id);\n break;\n }\n\n // Include the base class\n @include_once($CFG->dirroot.'/blocks/moodleblock.class.php');\n if(!class_exists('moodleblock')) {\n error('Class MoodleBlock is not defined or file not found for /course/blocks/moodleblock.class.php');\n }\n\n $maxweight = max(array_keys($instances));\n\n foreach($instances as $instance) {\n $block = blocks_get_record($instance->blockid);\n if(!$block->visible) {\n // Disabled by the admin\n continue;\n }\n\n $obj = block_instance($block->name, $instance);\n\n if ($isediting && !$ismoving && $isteacheredit) {\n $options = 0;\n $options |= BLOCK_MOVE_UP * ($instance->weight != 0);\n $options |= BLOCK_MOVE_DOWN * ($instance->weight != $maxweight);\n $options |= BLOCK_MOVE_RIGHT * ($instance->position != BLOCK_POS_RIGHT);\n $options |= BLOCK_MOVE_LEFT * ($instance->position != BLOCK_POS_LEFT);\n // DH - users can configure this instance if the block class allows multiple instances, not just if the administrator has allowed this block class to display multiple for the given site as would be found in $block->multiple\n $options |= BLOCK_CONFIGURE * ( $obj->instance_allow_multiple() );\n $obj->add_edit_controls($options);\n }\n\n if(!$instance->visible) {\n if($isediting) {\n $obj->print_shadow();\n }\n }\n else {\n $obj->print_block();\n }\n }\n}", "function serialize_block($block)\n {\n }", "private static function getBlockItems($xmlobject) {\n\t\t$data = array ();\n\t\t$i = 0;\n\t\tif (count ( $xmlobject )) {\n\t\t\tforeach ( $xmlobject as $blocks ) {\n\t\t\t\tforeach ( $blocks->block as $block ) {\n\t\t\t\t\t$data [$i] ['block'] ['name'] = ( string ) $block;\n\t\t\t\t\t$data [$i] ['action'] = ( string ) $block ['action'];\n\t\t\t\t\t$data [$i] ['side'] = ( string ) $block ['side'];\n\t\t\t\t\t$data [$i] ['position'] = ( string ) $block ['position'];\n\t\t\t\t\t$i ++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! empty ( $data ) && is_array ( $data )) {\n\t\t\tself::$blocks = array_merge ( self::$blocks, $data );\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function render_block_core_comments_pagination_numbers($attributes, $content, $block)\n {\n }", "function render_block_core_page_list( $attributes, $content, $block ) {\n\tstatic $block_id = 0;\n\t$block_id++;\n\n\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby values is resolved,\n\t// update 'sort_column' to 'menu_order, post_title'. Sorting by both menu_order and post_title ensures a stable sort.\n\t// Otherwise with pages that have the same menu_order value, we can see different ordering depending on how DB\n\t// queries are constructed internally. For example we might see a different order when a limit is set to <499\n\t// versus >= 500.\n\t$all_pages = get_pages(\n\t\tarray(\n\t\t\t'sort_column' => 'menu_order',\n\t\t\t'order' => 'asc',\n\t\t)\n\t);\n\n\t$top_level_pages = array();\n\n\t$pages_with_children = array();\n\n\tforeach ( (array) $all_pages as $page ) {\n\t\tif ( $page->post_parent ) {\n\t\t\t$pages_with_children[ $page->post_parent ][ $page->ID ] = array(\n\t\t\t\t'title' => $page->post_title,\n\t\t\t\t'link' => get_permalink( $page->ID ),\n\t\t\t);\n\t\t} else {\n\t\t\t$top_level_pages[ $page->ID ] = array(\n\t\t\t\t'title' => $page->post_title,\n\t\t\t\t'link' => get_permalink( $page->ID ),\n\t\t\t);\n\n\t\t}\n\t}\n\n\t$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );\n\n\t$wrapper_markup = '<ul %1$s>%2$s</ul>';\n\n\t$items_markup = block_core_page_list_render_nested_page_list( $nested_pages );\n\n\t$colors = block_core_page_list_build_css_colors( $block->context );\n\t$font_sizes = block_core_page_list_build_css_font_sizes( $block->context );\n\t$classes = array_merge(\n\t\t$colors['css_classes'],\n\t\t$font_sizes['css_classes']\n\t);\n\t$style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );\n\t$css_classes = trim( implode( ' ', $classes ) );\n\n\tif ( $block->context && $block->context['showSubmenuIcon'] ) {\n\t\t$css_classes .= ' show-submenu-icons';\n\t}\n\n\t$wrapper_attributes = get_block_wrapper_attributes(\n\t\tarray(\n\t\t\t'class' => $css_classes,\n\t\t\t'style' => $style_attribute,\n\t\t)\n\t);\n\n\treturn sprintf(\n\t\t$wrapper_markup,\n\t\t$wrapper_attributes,\n\t\t$items_markup\n\t);\n}", "function _excerpt_render_inner_blocks($parsed_block, $allowed_blocks)\n {\n }", "public function run()\n {\n \n\n \\DB::table('blocks')->delete();\n \n \\DB::table('blocks')->insert(array (\n 0 => \n array (\n 'sectionID' => 'CHV1SEC1',\n 'blockID' => 'CHV1SEC1BLK1',\n 'dependencyID' => '',\n 'name' => 'HOW MANY STAFF MEMBERS HAVE BEEN TRAINED IN THE FOLLOWING?',\n 'created_at' => '2015-07-18 18:18:47',\n 'updated_at' => '2015-07-18 18:18:47',\n 'deleted_at' => NULL,\n ),\n 1 => \n array (\n 'sectionID' => 'CHV1SEC1',\n 'blockID' => 'CHV1SEC1BLK2',\n 'dependencyID' => '',\n 'name' => 'HEALTH SERVICES',\n 'created_at' => '2015-07-18 18:18:47',\n 'updated_at' => '2015-07-18 18:18:47',\n 'deleted_at' => NULL,\n ),\n 2 => \n array (\n 'sectionID' => 'CHV1SEC1',\n 'blockID' => 'CHV1SEC1BLK3',\n 'dependencyID' => '',\n 'name' => 'INFRASTRUCTURE: IMCI Consultation Room',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 3 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK01',\n 'dependencyID' => '',\n 'name' => 'GUIDELINES AND JOBS AIDS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 4 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK02',\n 'dependencyID' => '',\n 'name' => 'DOES THE UNIT HAVE THE FOLOWING TOOLS?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 5 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK03',\n 'dependencyID' => '',\n 'name' => 'TOTAL U5 CHILDREN SEEN IN THE LAST 1 MONTH',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 6 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK04',\n 'dependencyID' => '',\n 'name' => 'ARE THE FOLLOWING DANGER SIGNS ASSESSED IN ONGOING SESSION FOR A CHILD',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 7 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK05',\n 'dependencyID' => '',\n 'name' => 'ASSESSMENT FOR THE MAIN SYMPTOMS IN AN ONGOING SESSION FOR A CHILD',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 8 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK06',\n 'dependencyID' => 'CHV1SEC2BLK5RW02COL02chsyes_no1',\n 'name' => 'Coughing/Difficulty Breathing',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 9 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK07',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 10 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK08',\n 'dependencyID' => 'CHV1SEC2BLK7RW02COL02chsyes_no1',\n 'name' => 'Diarrhoea',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 11 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK09',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 12 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK10',\n 'dependencyID' => 'CHV1SEC2BLK9RW02COL02chsyes_no1',\n 'name' => 'Fever',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 13 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK11',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 14 => \n array (\n 'sectionID' => 'CHV1SEC2',\n 'blockID' => 'CHV1SEC2BLK12',\n 'dependencyID' => 'CHV1SEC2BLK11RW02COL02chsyes_no1',\n 'name' => 'Ear Infection',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 15 => \n array (\n 'sectionID' => 'CHV1SEC3',\n 'blockID' => 'CHV1SEC3BLK1',\n 'dependencyID' => '',\n 'name' => 'Malnutrition',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 16 => \n array (\n 'sectionID' => 'CHV1SEC3',\n 'blockID' => 'CHV1SEC3BLK2',\n 'dependencyID' => '',\n 'name' => 'Anaemia',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 17 => \n array (\n 'sectionID' => 'CHV1SEC3',\n 'blockID' => 'CHV1SEC3BLK3',\n 'dependencyID' => '',\n 'name' => 'Condition',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 18 => \n array (\n 'sectionID' => 'CHV1SEC4',\n 'blockID' => 'CHV1SEC4BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 19 => \n array (\n 'sectionID' => 'CHV1SEC4',\n 'blockID' => 'CHV1SEC4BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE AVAILABILITY, LOCATION, SUPPLIER AND QUANTITIES ON HAND OF THE FOLLOWING COMMODITIES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 20 => \n array (\n 'sectionID' => 'CHV1SEC4',\n 'blockID' => 'CHV1SEC4BLK3',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 21 => \n array (\n 'sectionID' => 'CHV1SEC4',\n 'blockID' => 'CHV1SEC4BLK4',\n 'dependencyID' => '',\n 'name' => 'INDICATE AVAILABILITY, LOCATION, SUPPLIER AND QUANTITIES ON HAND OF THE FOLLOWING COMMODITIES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 22 => \n array (\n 'sectionID' => 'CHV1SEC5',\n 'blockID' => 'CHV1SEC5BLK1',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 23 => \n array (\n 'sectionID' => 'CHV1SEC5',\n 'blockID' => 'CHV1SEC5BLK2',\n 'dependencyID' => '',\n 'name' => 'ORAL REHYDRATION THERAPY CORNER ASSESSMENT',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 24 => \n array (\n 'sectionID' => 'CHV1SEC6',\n 'blockID' => 'CHV1SEC6BLK1',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY, LOCATION AND FUNCTIONALITY OF THE FOLLOWING EQUIPMENT AT THE ORT CORNER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 25 => \n array (\n 'sectionID' => 'CHV1SEC7',\n 'blockID' => 'CHV1SEC7BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 26 => \n array (\n 'sectionID' => 'CHV1SEC7',\n 'blockID' => 'CHV1SEC7BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY OF THE FOLLOWING SUPPLIES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 27 => \n array (\n 'sectionID' => 'CHV1SEC8',\n 'blockID' => 'CHV1SEC8BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 28 => \n array (\n 'sectionID' => 'CHV1SEC8',\n 'blockID' => 'CHV1SEC8BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND LOCATION OF THE FOLLOWING RESOURCES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 29 => \n array (\n 'sectionID' => 'CHV1SEC9',\n 'blockID' => 'CHV1SEC9BLK1',\n 'dependencyID' => '',\n 'name' => 'COMMUNITY STRATEGY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 30 => \n array (\n 'sectionID' => 'CHV2SEC1',\n 'blockID' => 'CHV2SEC1BLK1',\n 'dependencyID' => '',\n 'name' => 'H',\n 'created_at' => '2015-07-18 18:18:47',\n 'updated_at' => '2015-07-18 18:18:47',\n 'deleted_at' => NULL,\n ),\n 31 => \n array (\n 'sectionID' => 'CHV2SEC1',\n 'blockID' => 'CHV2SEC1BLK2',\n 'dependencyID' => '',\n 'name' => 'H',\n 'created_at' => '2015-07-18 18:18:47',\n 'updated_at' => '2015-07-18 18:18:47',\n 'deleted_at' => NULL,\n ),\n 32 => \n array (\n 'sectionID' => 'CHV2SEC2',\n 'blockID' => 'CHV2SEC2BLK1',\n 'dependencyID' => '',\n 'name' => 'GUIDELINES AND JOBS AIDS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 33 => \n array (\n 'sectionID' => 'CHV2SEC2',\n 'blockID' => 'CHV2SEC2BLK2',\n 'dependencyID' => '',\n 'name' => 'DOES THE UNIT HAVE THE FOLOWING TOOLS?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 34 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK96A',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 35 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK96D',\n 'dependencyID' => 'CHV2SEC3BLK96ARW01COL02chsyes_no1',\n 'name' => '2015',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 36 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK97A',\n 'dependencyID' => 'CHV2SEC3BLK96ARW01COL02chsyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 37 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK97D',\n 'dependencyID' => 'CHV2SEC3BLK97ARW01COL02chsyes_no1',\n 'name' => '2014',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 38 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK98A',\n 'dependencyID' => 'CHV2SEC3BLK97ARW01COL02chsyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 39 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK98D',\n 'dependencyID' => 'CHV2SEC3BLK98ARW01COL02chsyes_no1',\n 'name' => '2013',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 40 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK99A',\n 'dependencyID' => 'CHV2SEC3BLK98ARW01COL02chsyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 41 => \n array (\n 'sectionID' => 'CHV2SEC3',\n 'blockID' => 'CHV2SEC3BLK99D',\n 'dependencyID' => 'CHV2SEC3BLK99ARW01COL02chsyes_no1',\n 'name' => '2012',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 42 => \n array (\n 'sectionID' => 'CHV2SEC4',\n 'blockID' => 'CHV2SEC4BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 43 => \n array (\n 'sectionID' => 'CHV2SEC4',\n 'blockID' => 'CHV2SEC4BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND MAIN REASON FOR UNAVAILABILITY FOR THE COMMODITIES BELOW',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 44 => \n array (\n 'sectionID' => 'CHV2SEC5',\n 'blockID' => 'CHV2SEC5BLK1',\n 'dependencyID' => '',\n 'name' => 'ORAL REHYDRATION THERAPY CORNER ASSESSMENT',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 45 => \n array (\n 'sectionID' => 'CHV2SEC6',\n 'blockID' => 'CHV2SEC6BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 46 => \n array (\n 'sectionID' => 'CHV2SEC6',\n 'blockID' => 'CHV2SEC6BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY OF THE FOLLOWING SUPPLIES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 47 => \n array (\n 'sectionID' => 'CHV2SEC7',\n 'blockID' => 'CHV2SEC7BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 48 => \n array (\n 'sectionID' => 'CHV2SEC7',\n 'blockID' => 'CHV2SEC7BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND LOCATION OF THE FOLLOWING RESOURCES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 49 => \n array (\n 'sectionID' => 'CHV2SEC8',\n 'blockID' => 'CHV2SEC8BLK1',\n 'dependencyID' => '',\n 'name' => 'COMMUNITY STRATEGY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 50 => \n array (\n 'sectionID' => 'IMCIV1SEC1',\n 'blockID' => 'IMCIV1SEC1BLK4',\n 'dependencyID' => '',\n 'name' => 'HCW Profile',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 51 => \n array (\n 'sectionID' => 'IMCIV1SEC1',\n 'blockID' => 'IMCIV1SEC1BLK5',\n 'dependencyID' => '',\n 'name' => 'Work Station Profile',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 52 => \n array (\n 'sectionID' => 'IMCIV1SEC2',\n 'blockID' => 'IMCIV1SEC2BLK1',\n 'dependencyID' => '',\n 'name' => 'Child Profile',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 53 => \n array (\n 'sectionID' => 'IMCIV1SEC2',\n 'blockID' => 'IMCIV1SEC2BLK2',\n 'dependencyID' => '',\n 'name' => 'Are the following Services Offered to a child?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 54 => \n array (\n 'sectionID' => 'IMCIV1SEC2',\n 'blockID' => 'IMCIV1SEC2BLK3',\n 'dependencyID' => '',\n 'name' => 'Are the following Danger Signs assessed in ongoing session for a child?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 55 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK01',\n 'dependencyID' => '',\n 'name' => 'Assessment of the main Symptoms in an ongoing session for a child',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 56 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK02',\n 'dependencyID' => 'IMCIV1SEC3BLK1RW02COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 57 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK03',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 58 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK04',\n 'dependencyID' => 'IMCIV1SEC3BLK3RW02COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 59 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK05',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 60 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK06',\n 'dependencyID' => 'IMCIV1SEC3BLK5RW02COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 61 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK07',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 62 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK08',\n 'dependencyID' => 'IMCIV1SEC3BLK7RW02COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 63 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK09',\n 'dependencyID' => '',\n 'name' => '5A. Feeding Problem',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 64 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK10',\n 'dependencyID' => '',\n 'name' => '5B. Weight',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 65 => \n array (\n 'sectionID' => 'IMCIV1SEC3',\n 'blockID' => 'IMCIV1SEC3BLK11',\n 'dependencyID' => '',\n 'name' => '6. Special Treatment Needs',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 66 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK01',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 67 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK02',\n 'dependencyID' => 'IMCIV1SEC4BLK1RW01COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 68 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK03',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 69 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK04',\n 'dependencyID' => 'IMCIV1SEC4BLK3RW01COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 70 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK05',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 71 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK06',\n 'dependencyID' => 'IMCIV1SEC4BLK5RW01COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 72 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK07',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 73 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK08',\n 'dependencyID' => 'IMCIV1SEC4BLK7RW01COL02ztyes_no1',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 74 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK10',\n 'dependencyID' => '',\n 'name' => '5A. Feeding Problem',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 75 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK11',\n 'dependencyID' => '',\n 'name' => '5B. Weight',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 76 => \n array (\n 'sectionID' => 'IMCIV1SEC4',\n 'blockID' => 'IMCIV1SEC4BLK12',\n 'dependencyID' => '',\n 'name' => '6. Special Treatment Needs',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 77 => \n array (\n 'sectionID' => 'IMCIV1SEC5',\n 'blockID' => 'IMCIV1SEC5BLK1',\n 'dependencyID' => '',\n 'name' => 'MALNUTRITION',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 78 => \n array (\n 'sectionID' => 'IMCIV1SEC5',\n 'blockID' => 'IMCIV1SEC5BLK2',\n 'dependencyID' => '',\n 'name' => 'ANAEMIA',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 79 => \n array (\n 'sectionID' => 'IMCIV1SEC5',\n 'blockID' => 'IMCIV1SEC5BLK3',\n 'dependencyID' => '',\n 'name' => 'CONDITION',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 80 => \n array (\n 'sectionID' => 'IMCIV1SEC5',\n 'blockID' => 'IMCIV1SEC5BLK4',\n 'dependencyID' => '',\n 'name' => 'TREATMENT AND COUNSELLING',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 81 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK1',\n 'dependencyID' => '',\n 'name' => 'Consultation Observation',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 82 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK2',\n 'dependencyID' => '',\n 'name' => 'Exit Interview with Caregiver',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 83 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK3',\n 'dependencyID' => '',\n 'name' => 'Assessment Outcome',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 84 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK4',\n 'dependencyID' => '',\n 'name' => 'Criteria For Certification : Section A',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 85 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK5',\n 'dependencyID' => '',\n 'name' => 'Checked For The Following: Section B',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 86 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK6',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 87 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK7',\n 'dependencyID' => '',\n 'name' => 'CERTIFICATION',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 88 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK8',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 89 => \n array (\n 'sectionID' => 'IMCIV1SEC6',\n 'blockID' => 'IMCIV1SEC6BLK9',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 90 => \n array (\n 'sectionID' => 'MNHV1SEC1',\n 'blockID' => 'MNHV1SEC1BLK1',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 91 => \n array (\n 'sectionID' => 'MNHV1SEC1',\n 'blockID' => 'MNHV1SEC1BLK2',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 92 => \n array (\n 'sectionID' => 'MNHV1SEC1',\n 'blockID' => 'MNHV1SEC1BLK3',\n 'dependencyID' => '',\n 'name' => 'PROVISION OF SERVICES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 93 => \n array (\n 'sectionID' => 'MNHV1SEC1',\n 'blockID' => 'MNHV1SEC1BLK4',\n 'dependencyID' => '',\n 'name' => 'Health Facility Management',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 94 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK1',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 95 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK2',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 96 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK3',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 97 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK4',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 98 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK5',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 99 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK6',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 100 => \n array (\n 'sectionID' => 'MNHV1SEC2',\n 'blockID' => 'MNHV1SEC2BLK7',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 101 => \n array (\n 'sectionID' => 'MNHV1SEC3',\n 'blockID' => 'MNHV1SEC3BLK1',\n 'dependencyID' => '',\n 'name' => 'GUIDELINES AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 102 => \n array (\n 'sectionID' => 'MNHV1SEC3',\n 'blockID' => 'MNHV1SEC3BLK2',\n 'dependencyID' => '',\n 'name' => 'JOB AIDS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 103 => \n array (\n 'sectionID' => 'MNHV1SEC3',\n 'blockID' => 'MNHV1SEC3BLK3',\n 'dependencyID' => '',\n 'name' => 'TOOLS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 104 => \n array (\n 'sectionID' => 'MNHV1SEC4',\n 'blockID' => 'MNHV1SEC4BLK1',\n 'dependencyID' => '',\n 'name' => 'HOW MANY STAFF MEMBERS HAVE BEEN TRAINED IN THE FOLLOWING?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 105 => \n array (\n 'sectionID' => 'MNHV1SEC5',\n 'blockID' => 'MNHV1SEC5BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 106 => \n array (\n 'sectionID' => 'MNHV1SEC5',\n 'blockID' => 'MNHV1SEC5BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY, MAIN REASON FOR UNAVAILABILITY, DURATION OF UNAVAILABILITY & WHAT HAPPENED WHEN THE COMMODITY WAS NOT AVAILABLE',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 107 => \n array (\n 'sectionID' => 'MNHV1SEC6',\n 'blockID' => 'MNHV1SEC6BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY, MAIN REASON FOR UNAVAILABILITY, DURATION OF UNAVAILABILITY & WHAT HAPPENED WHEN THE COMMODITY WAS NOT AVAILABLE',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 108 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK1',\n 'dependencyID' => '',\n 'name' => 'Equipment Availability',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 109 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK2',\n 'dependencyID' => '',\n 'name' => 'Testing Supplies',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 110 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK21',\n 'dependencyID' => '',\n 'name' => 'SECTION 7 OF 8: II. KITS/SETS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 111 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK3',\n 'dependencyID' => '',\n 'name' => 'Delivery Kit Components',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 112 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK4',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 113 => \n array (\n 'sectionID' => 'MNHV1SEC7',\n 'blockID' => 'MNHV1SEC7BLK5',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND MAIN REASON FOR UNAVAILABILITY FOR THE FOLLOWING KITS/SETS',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 114 => \n array (\n 'sectionID' => 'MNHV1SEC8',\n 'blockID' => 'MNHV1SEC8BLK1',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND LOCATION OF THE FOLLOWING RESOURCES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 115 => \n array (\n 'sectionID' => 'MNHV1SEC8',\n 'blockID' => 'MNHV1SEC8BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE STORAGE AND ACCESS TO WATER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 116 => \n array (\n 'sectionID' => 'MNHV1SEC8',\n 'blockID' => 'MNHV1SEC8BLK3',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND STORAGE, SUPPLIER AND SOURCE OF THE FOLLOWING',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 117 => \n array (\n 'sectionID' => 'MNHV1SEC8',\n 'blockID' => 'MNHV1SEC8BLK4',\n 'dependencyID' => '',\n 'name' => 'PROVISION FOR WASTE DISPOSAL',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 118 => \n array (\n 'sectionID' => 'MNHV1SEC9',\n 'blockID' => 'MNHV1SEC9BLK1',\n 'dependencyID' => '',\n 'name' => 'COMMUNITY STRATEGY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 119 => \n array (\n 'sectionID' => 'MNHV2SEC1',\n 'blockID' => 'MNHV2SEC1BLK1',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 120 => \n array (\n 'sectionID' => 'MNHV2SEC1',\n 'blockID' => 'MNHV2SEC1BLK2',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 121 => \n array (\n 'sectionID' => 'MNHV2SEC1',\n 'blockID' => 'MNHV2SEC1BLK3',\n 'dependencyID' => '',\n 'name' => 'PROVISION OF SERVICES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 122 => \n array (\n 'sectionID' => 'MNHV2SEC1',\n 'blockID' => 'MNHV2SEC1BLK4',\n 'dependencyID' => '',\n 'name' => 'Health Facility Management',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 123 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK1',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 124 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK2',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 125 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK3',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 126 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK4',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 127 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK5',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 128 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK6',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 129 => \n array (\n 'sectionID' => 'MNHV2SEC2',\n 'blockID' => 'MNHV2SEC2BLK7',\n 'dependencyID' => '',\n 'name' => '',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 130 => \n array (\n 'sectionID' => 'MNHV2SEC3',\n 'blockID' => 'MNHV2SEC3BLK1',\n 'dependencyID' => '',\n 'name' => 'GUIDELINES AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 131 => \n array (\n 'sectionID' => 'MNHV2SEC3',\n 'blockID' => 'MNHV2SEC3BLK2',\n 'dependencyID' => '',\n 'name' => 'JOB AIDS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 132 => \n array (\n 'sectionID' => 'MNHV2SEC3',\n 'blockID' => 'MNHV2SEC3BLK3',\n 'dependencyID' => '',\n 'name' => 'TOOLS AVAILABILITY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 133 => \n array (\n 'sectionID' => 'MNHV2SEC4',\n 'blockID' => 'MNHV2SEC4BLK1',\n 'dependencyID' => '',\n 'name' => 'HOW MANY STAFF MEMBERS HAVE BEEN TRAINED IN THE FOLLOWING?',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 134 => \n array (\n 'sectionID' => 'MNHV2SEC5',\n 'blockID' => 'MNHV2SEC5BLK1',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 135 => \n array (\n 'sectionID' => 'MNHV2SEC5',\n 'blockID' => 'MNHV2SEC5BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY, MAIN REASON FOR UNAVAILABILITY, DURATION OF UNAVAILABILITY & WHAT HAPPENED WHEN THE COMMODITY WAS NOT AVAILABLE',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 136 => \n array (\n 'sectionID' => 'MNHV2SEC6',\n 'blockID' => 'MNHV2SEC6BLK1',\n 'dependencyID' => '',\n 'name' => 'Equipment Availability',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 137 => \n array (\n 'sectionID' => 'MNHV2SEC6',\n 'blockID' => 'MNHV2SEC6BLK2',\n 'dependencyID' => '',\n 'name' => 'Testing Supplies',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 138 => \n array (\n 'sectionID' => 'MNHV2SEC6',\n 'blockID' => 'MNHV2SEC6BLK3',\n 'dependencyID' => '',\n 'name' => 'Delivery Kit Components',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 139 => \n array (\n 'sectionID' => 'MNHV2SEC6',\n 'blockID' => 'MNHV2SEC6BLK4',\n 'dependencyID' => '',\n 'name' => 'MAIN SUPPLIER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 140 => \n array (\n 'sectionID' => 'MNHV2SEC6',\n 'blockID' => 'MNHV2SEC6BLK5',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND MAIN REASON FOR UNAVAILABILITY FOR THE FOLLOWING KITS/SETS',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 141 => \n array (\n 'sectionID' => 'MNHV2SEC7',\n 'blockID' => 'MNHV2SEC7BLK1',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND LOCATION OF THE FOLLOWING RESOURCES',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 142 => \n array (\n 'sectionID' => 'MNHV2SEC7',\n 'blockID' => 'MNHV2SEC7BLK2',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE STORAGE AND ACCESS TO WATER',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 143 => \n array (\n 'sectionID' => 'MNHV2SEC7',\n 'blockID' => 'MNHV2SEC7BLK3',\n 'dependencyID' => '',\n 'name' => 'INDICATE THE AVAILABILITY AND STORAGE, SUPPLIER AND SOURCE OF THE FOLLOWING',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 144 => \n array (\n 'sectionID' => 'MNHV2SEC7',\n 'blockID' => 'MNHV2SEC7BLK4',\n 'dependencyID' => '',\n 'name' => 'PROVISION FOR WASTE DISPOSAL',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n 145 => \n array (\n 'sectionID' => 'MNHV2SEC8',\n 'blockID' => 'MNHV2SEC8BLK1',\n 'dependencyID' => '',\n 'name' => 'COMMUNITY STRATEGY',\n 'created_at' => '2016-03-04 08:55:17',\n 'updated_at' => '2016-03-04 08:55:17',\n 'deleted_at' => NULL,\n ),\n ));\n \n \n }", "function createBlock( $block_index=null ){\n global $mysqli, $counterparty;\n $data = (object) $counterparty->execute('get_block_info', array('block_index' => $block_index));\n $data->block_hash_id = createTransaction($data->block_hash);\n $data->previous_block_hash_id = createTransaction($data->previous_block_hash);\n $data->ledger_hash_id = createTransaction($data->ledger_hash);\n $data->txlist_hash_id = createTransaction($data->txlist_hash);\n $data->messages_hash_id = createTransaction($data->messages_hash);\n $results = $mysqli->query(\"SELECT block_index FROM blocks WHERE block_index='{$data->block_index}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n $id = $row['id'];\n $sql = \"UPDATE blocks SET\n block_time = '{$data->block_time}',\n block_hash_id = '{$data->block_hash_id}',\n previous_block_hash_id = '{$data->previous_block_hash_id}',\n ledger_hash_id = '{$data->ledger_hash_id}',\n txlist_hash_id = '{$data->txlist_hash_id}',\n messages_hash_id = '{$data->messages_hash_id}',\n difficulty = '{$data->difficulty}'\n WHERE\n block_index='{$block_index}'\";\n $results = $mysqli->query($sql);\n if($results){\n return $id;\n } else {\n byeLog('Error while trying to update block ' . $data->block_index);\n }\n } else {\n // Grab data on the asset from api and set some values before stashing info in db\n $sql = \"INSERT INTO blocks (block_index, block_time, block_hash_id, previous_block_hash_id, ledger_hash_id, txlist_hash_id, messages_hash_id, difficulty) values (\n '{$data->block_index}',\n '{$data->block_time}',\n '{$data->block_hash_id}',\n '{$data->previous_block_hash_id}',\n '{$data->ledger_hash_id}',\n '{$data->txlist_hash_id}',\n '{$data->messages_hash_id}',\n '{$data->difficulty}')\";\n $results = $mysqli->query($sql);\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create block ' . $data->block_index);\n }\n }\n } else {\n byeLog('Error while trying to lookup record in blocks table');\n }\n}", "public function generateRows(){\n $alphabet = $this->generateAlphabet();\n $this->refreshRows();\n for ($i = 0; $i < $this->nbRows; $i++){\n $row = new BlockRow();\n if ($this->rowLabel === 2){\n $name = ''.($i+1);\n $row->setName($name);\n } else {\n $row->setName($alphabet[$i]);\n }\n $row->setBlock($this);\n $row->setNbSeats($this->getNbSeatsPerRow());\n $row->setNumerotationSystem($this->getSeatLabel());\n $this->addRow($row);\n }\n $this->generateSeats();\n }", "function _build_block_template_result_from_file($template_file, $template_type)\n {\n }", "function starter_comment_block() {\n $items = array();\n $number = variable_get('comment_block_count', 10);\n\n foreach (comment_get_recent($number) as $comment) {\n //kpr($comment->changed);\n //print date('Y-m-d H:i', $comment->changed);\n $items[] =\n '<h3>' . l($comment->subject, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)) . '</h3>' .\n ' <time datetime=\"'.date('Y-m-d H:i', $comment->changed).'\">' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->changed))) . '</time>';\n }\n\n if ($items) {\n return theme('item_list', array('items' => $items, 'daddy' => 'comments'));\n }\n else {\n return t('No comments available.');\n }\n}", "function email_printblocks($userid, $courseid, $printsearchblock=true) {\n\n\tglobal $CFG, $USER;\n\n\t$strcourse = get_string('course');\n\t$strcourses = get_string('mailboxs','block_email_list');\n\t$strsearch = get_string('search');\n\t$strmail = get_string('name', 'block_email_list');\n\n\t// For title blocks\n\t$startdivtitle\t= '<div class=\"title\">';\n\t$enddivtitle = '</div>';\n\n\t$list = array();\n\t$icons = array();\n\n\tif ( $printsearchblock ) {\n\t\t// Print search block\n\t\t$form = email_get_search_form($courseid);\n\t\tprint_side_block_start($startdivtitle.$strsearch.$enddivtitle);\n\t\techo $form;\n\t\tprint_side_block_end();\n\t}\n\n\t// Print my folders\n\temail_print_tree_myfolders( $userid, $courseid );\n\n\t// Remove old fields\n\tunset($list);\n\tunset($icons);\n\n\t// Get my course\n\t$mycourses = get_my_courses($USER->id, NULL, 'id, fullname, visible');\n\n\t$list = array();\n\t$icons = array();\n\n\t// Get courses\n\tforeach( $mycourses as $mycourse ) {\n\n\t\t$context = get_context_instance(CONTEXT_COURSE, $mycourse->id);\n\n\n\t\t//Get the number of unread mails\n\t\t$numberunreadmails = email_count_unreaded_mails($USER->id, $mycourse->id);\n\t\t$unreadmails = '';\n\n\t\t// Only show if has unreaded mails\n\t\tif ( $numberunreadmails > 0 ) {\n\t\t\t$unreadmails = '<b>('.$numberunreadmails.')</b>';\n\t\t\t// Define default path of icon for course\n\t\t\t$icon = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/images/openicon.gif\" height=\"16\" width=\"16\" alt=\"'.$strcourse.'\" />';\n\t\t} else {\n\t\t\t// Define default path of icon for course\n\t\t\t$icon = '<img src=\"'.$CFG->wwwroot.'/blocks/email_list/email/icon.gif\" height=\"16\" width=\"16\" alt=\"'.$strcourse.'\" />';\n\t\t}\n\n\t\t$linkcss = $mycourse->visible ? '' : ' class=\"dimmed\" ';\n\n\t\tif ( (! $mycourse->visible and ! has_capability('moodle/legacy:student', $context, $USER->id, false) )\n\t\t\t\tor !has_capability('moodle/legacy:student', $context, $USER->id, false)\n\t\t\t\tor ( has_capability('moodle/legacy:student', $context, $USER->id, false) and $mycourse->visible) ) {\n\t\t\t$list[] = '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$mycourse->id.'\" '.$linkcss.'>'.$mycourse->fullname .' '. $unreadmails.'</a>';\n\t\t\t$icons[] = $icon;\n\t\t}\n\t}\n\n\t// Print block of my courses\n\tprint_side_block($startdivtitle.$strcourses.$enddivtitle, '', $list, $icons);\n\n}", "function testBlockIteration()\n {\n $data = array(\n 'a',\n array('b', array('1', '2', '3', '4')),\n 'c',\n array('d', array('5', '6', '7'))\n );\n\n $result = $this->tpl->loadTemplateFile('blockiteration.html', true, true);\n if (PEAR::isError($result)) {\n $this->assertTrue(false, 'Error loading template file: '. $result->getMessage());\n }\n foreach ($data as $value) {\n if (is_array($value)) {\n $this->tpl->setVariable('outer', $value[0]);\n foreach ($value[1] as $v) {\n $this->tpl->setVariable('inner', $v);\n $this->tpl->parse('inner_block');\n }\n } else {\n $this->tpl->setVariable('outer', $value);\n }\n $this->tpl->parse('outer_block');\n }\n $this->assertEquals('a#b|1|2|3|4#c#d|5|6|7#', $this->_stripWhitespace($this->tpl->get()));\n }", "function renderUsesSummary() {\n\n reset($this->usesTypes);\n while (list($k, $type) = each($this->usesTypes)) {\n if (0 == count($this->uses[$type]))\n continue;\n\n $this->tpl->setCurrentBlock(\"usessummary_loop\");\n\n reset($this->uses[$type]);\n while (list($file, $uses) = each($this->uses[$type])) {\n\n $this->tpl->setVariable(\"FILE\", $file);\n if (isset($uses[\"doc\"][\"shortdescription\"]))\n $this->tpl->setVariable(\"SHORTDESCRIPTION\", $this->encode($uses[\"doc\"][\"shortdescription\"][\"value\"]));\n\n if (\"true\" == $uses[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock();\n }\n\n $this->tpl->setCurrentBlock(\"usessummary\");\n $this->tpl->setVariable(\"TYPE\", $type);\n $this->tpl->parseCurrentBlock();\n }\n\n }", "function get_block_id ($gid1, $gid2) {\n $values_gid1 = array(\n 'subject_id' => $gid1,\n 'type_id' => array (\n 'cv_id' => array (\n 'name' => 'sequence',\n ),\n 'name' => 'member_of',\n 'is_obsolete' => 0\n ),\n );\n\n $blk_region_gid1 = chado_select_record(\n 'feature_relationship', \n array('object_id'),\n $values_gid1\n );\n\n $values_gid2 = array(\n 'subject_id' => $gid2,\n 'type_id' => array ( \n 'cv_id' => array (\n 'name' => 'sequence',\n ),\n 'name' => 'member_of',\n 'is_obsolete' => 0\n ),\n );\n\n $blk_region_gid2 = chado_select_record(\n 'feature_relationship', \n array('object_id'), \n $values_gid2\n );\n\n // locate the block id shard by gid1 and gid2 \n $blk_html = '';\n foreach ($blk_region_gid1 as $blk1) {\n foreach ($blk_region_gid2 as $blk2) { \n // search block id shared by gid 1 and gid2\n $bid = db_query('SELECT blockid FROM {synblock} WHERE (b2=:blk1 AND b1=:blk2) OR (b1=:blk1 AND b2=:blk2)', \n\t\t\t array(\n ':blk1' => $blk1->object_id,\n ':blk2' => $blk2->object_id,\n\t\t\t )\n\t\t )->fetchField();\n $blk_html.= l($bid, \"synview/block/\" . $bid, array('attributes' => array('target' => \"_blank\")));\n }\n }\n\n if (empty($blk_html)) {\n $blk_html = 'NA';\n }\n\n\n return $blk_html; \n}", "public function fetch_vbd_report_status_block_wise()\n {\n\n\t\t $subdivision_code=$this->uri->segment(3);\n\t\t $category_id=$this->uri->segment(4);\n\t\t $data['category_id']=$category_id;\n\t\t $data['fetch_block']=$this->Mod_report->fetchblock($subdivision_code);\n\t\t $data['fetch_subcategory_name']=$this->Mod_report->fetch_subcategory_name($category_id);\n \t\t $this->load->view('reports/vbd_report_status_block_wise',$data);\t\n }", "function toccmap_block_view($delta = '')\n{\n $block = array();\n $title = '';\n \n switch($delta) {\n case 'toccmap_block':\n $title = db_query(\n \"SELECT title FROM {block} where delta='\" . $delta . \"' and `status`=1\"\n )->fetchField();\n break;\n }\n \n switch($delta) {\n case 'toccmap_block':\n $areas = tabs_api_get_vocabulary('toccmap');\n \n // 'Area Panels' are the blocks of content displayed for each area\n $area_panels_themed = array();\n \n // Retrieving default info section content (see config screen)\n $default_title = variable_get('toccmap_default_title', '');\n $default_desc = variable_get('toccmap_default_desc', '');\n \n // Theming of default content if appropriate\n if (($default_title && strlen($default_title) > 0)\n && ($default_desc && strlen($default_desc) > 0)) \n {\n $area_panels_themed[] = theme(\n 'toccmap_area_panel',\n array(\n 'title' => $default_title,\n 'desc' => $default_desc,\n )\n );\n }\n \n // Iterating through returned TOCC Map taxonomy\n foreach ($areas as $taxid => $field) {\n $image = $field->toccmap_areaimage->value();\n $image_themed = theme(\n 'image', \n array_merge(\n $image,\n array(\n 'path' => file_create_url($image['uri'])\n )\n )\n );\n \n $area_panels_themed[] = theme(\n 'toccmap_area_panel',\n array(\n 'image' => $image_themed,\n 'title' => $field->name->value(),\n 'desc' => $field->toccmap_areadesc->value(),\n 'link' => $field->toccmap_link->value(),\n 'buttontext' => $field->toccmap_buttontext->value()\n )\n );\n }\n \n $block['subject'] = t('TOCC Map');\n $block['content'] = theme(\n $delta,\n array(\n 'area_panels' => $area_panels_themed\n )\n );\n break;\n }\n \n return $block;\n}", "public function initTotals()\n {\n $parent = $this->getParentBlock();\n $this->source = $parent->getSource();\n //@codingStandardsIgnoreLine\n $total = new \\Magento\\Framework\\DataObject(['code' => 'giftcard', 'block_name' => $this->getNameInLayout()]);\n $parent->removeTotal('giftcard');\n $parent->addTotal($total);\n return $this;\n }", "public function getBlocknameAndNumberAttribute() {\n return implode(': ', array_filter([$this->full_block_number, $this->name]));\n }", "function list_billable() {\n\t\n\t$graph_items = db_fetch_assoc(\"SELECT \n\t\t\ti.id AS item_id, \n\t\t\ti.local_graph_id, \n\t\t\ti.task_item_id, \n\t\t\ti.text_format, \n\t\t\tg.id AS graph_id, \n\t\t\tg.title_cache,\n\t\t\td.local_data_id,\n\t\t\td.data_source_name\n\t\tFROM \n\t\t\tgraph_templates_item AS i, \n\t\t\tgraph_templates_graph AS g,\n\t\t\tdata_template_rrd as d\n\t\tWHERE \n\t\t\ti.local_graph_id = g.local_graph_id AND \n\t\t\ti.task_item_id = d.id AND\n\t\t\ti.local_graph_id <> 0 AND \n\t\t\ti.task_item_id <> 0 AND \n\t\t\ti.graph_type_id = 1 AND \n\t\t\ttext_format LIKE '%|%|%'\n\t\tORDER BY\n\t\t\ti.local_graph_id;\n\t\t\");\n\n\t$local_graph_id_prev = 0;\n\t$count_graph = 0;\n\t$count_graph_item = 0;\n\t$item_type = \"N/A\";\n\t$match = array();\n\tif (sizeof($graph_items) > 0) {\n\t\tprintf(\"\\n%-80s\\n\",\"Cacti Billable Graphs List\");\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tprintf(\"%-10s%-70s\\n\",\"Graph ID\",\"Graph Title\");\n\t\tprintf(\"%2s%'--78s\\n\",\"\",\"\");\n\t\tprintf(\"%2s%-7s%-25s%-46s\\n\",\"\",\"ID\",\"Item Type\",\"Example Output\");\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tforeach ($graph_items as $graph_item) {\n\t\t\t$item_type = \"N/A\";\n\t\t\t$match = array();\n\t\t\tif (preg_match('/\\|sum\\:.*\\|/',$graph_item[\"text_format\"]) > 0) { \n\t\t\t\t$item_type = \"Bandwidth Summation\";\n\t\t\t} elseif (preg_match('/\\|([0-9]{1,2})\\:[\\:0-9a-z_]+\\|/',$graph_item[\"text_format\"], $match) > 0) { \n\t\t\t\t$item_type = get_pretty_nth_value($match[1]);\n\t\t\t}\n\t\t\tif ($graph_item[\"local_graph_id\"] <> $local_graph_id_prev) {\t\n\t\t\t\tif ($local_graph_id_prev <> 0) {\n\t\t\t\t\tprintf(\"%'=80s\\n\",\"\");\n\t\t\t\t}\n\t\t\t\tprintf(\"%-10s%-80s\\n\", $graph_item[\"local_graph_id\"], $graph_item[\"title_cache\"]);\n\t\t\t\tprintf(\"%2s%'--78s\\n\",\"\",\"\");\n\t\t\t\t$count_graph++;\n\t\t\t}\n\t\t\t$count_graph_item++;\n\t\t\tprintf(\"%2s%-7s%-25s%-46s\\n\",\"\", $graph_item[\"item_id\"],$item_type, process_variables($graph_item[\"text_format\"],$graph_item));\n\t\t\t$local_graph_id_prev = $graph_item[\"local_graph_id\"];\n\t\t}\n\t\tprintf(\"%'=80s\\n\",\"\");\n\t\tprintf(\"Totals: Graphs: %d Items: %d\\n\\n\", $count_graph, $count_graph_item);\n\t} else {\n\t\tprint \"\\n No items found \\n\";\n\t}\n\t\n}", "function getBlockInformation($module, $result, $col_fields,$tabid,$block_label,$mode,$supportmultiapprove=false)\n{\n\tglobal $log;\n\t//changed by dingjianting on 2007-11-05 for php5.2.x\n\t$log->debug(\"Entering getBlockInformation() method ...\");\n\tglobal $adb;\n\t$editview_arr = Array();\n\t$returndata = Array();\n\n\tglobal $current_user,$mod_strings;\n \n\t$noofrows = $adb->num_rows($result);\n\n\tfor($i=0; $i<$noofrows; $i++)\n\t{\n\t\t$fieldtablename = $adb->query_result($result,$i,\"tablename\");\t\n\t\t$fieldcolname = $adb->query_result($result,$i,\"columnname\");\t\n\t\t$uitype = $adb->query_result($result,$i,\"uitype\");\t\n\t\t$fieldname = $adb->query_result($result,$i,\"fieldname\");\t\n\t\t$fieldlabel = $adb->query_result($result,$i,\"fieldlabel\");\n\t\t$block = $adb->query_result($result,$i,\"block\");\n\t\t$maxlength = $adb->query_result($result,$i,\"maximumlength\");\n\t\t$generatedtype = $adb->query_result($result,$i,\"generatedtype\");\n\t\t$typeofdata = $adb->query_result($result,$i,\"typeofdata\");\n //$multifieldid=$adb->query_result($result,$i,\"multifieldid\");\n\t\t$mandatory = 0;\n\t\tif(substr_count($typeofdata,\"~M\") > 0) {\n\t\t\t$mandatory = 1;\n\t\t}\n\t\t$readonly = 1;\n\t\t$custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module,$mode,$mandatory,$typeofdata);\n\t\t$custfld[0][1] = $readonly;\n\t\t$custfld[0][2] = $mandatory;\n\t\t$editview_arr[$block][]=$custfld;\n\t\t//if (isset($mvAdd_flag) && $mvAdd_flag == true) {\n\t\t//\t$mvAdd_flag = false;\n\t\t//}\n\t\t$i++;\n\t\tif($i<$noofrows)\n\t\t{\n\t\t\t$fieldtablename = $adb->query_result($result,$i,\"tablename\");\t\n\t\t\t$fieldcolname = $adb->query_result($result,$i,\"columnname\");\t\n\t\t\t$uitype = $adb->query_result($result,$i,\"uitype\");\t\n\t\t\t$fieldname = $adb->query_result($result,$i,\"fieldname\");\t\n\t\t\t$fieldlabel = $adb->query_result($result,$i,\"fieldlabel\");\n\t\t\t$block = $adb->query_result($result,$i,\"block\");\n\t\t\t$maxlength = $adb->query_result($result,$i,\"maximumlength\");\n\t\t\t$generatedtype = $adb->query_result($result,$i,\"generatedtype\");\n\t\t\t$typeofdata = $adb->query_result($result,$i,\"typeofdata\");\n //$multifieldid=$adb->query_result($result,$i,\"multifieldid\");\n\t\t\t$mandatory = 0;\n\t\t\tif(substr_count($typeofdata,\"~M\") > 0) {\n\t\t\t\t$mandatory = 1;\n\t\t\t}\n\t\t\t//added by dingjianting on 2007-2-5 for approve function by read/write permittion\n\t\t\t$readonly = 1;\n\t\t\t\n\t\t\t$custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module,$mode,$mandatory,$typeofdata);\n\t\t $custfld[0][1] = $readonly;\n\t\t\t$custfld[0][2] = $mandatory;\n\t\t\t\n\t\t\t$editview_arr[$block][]=$custfld;\n\t\t}\n\t}\n\tforeach($editview_arr as $headerid=>$editview_value)\n\t{\n\t\t$editview_data = Array();\n\t\tfor ($i=0,$j=0;$i<count($editview_value);$i=$i+2,$j++)\n\t\t{\n\t\t\t$key1=$editview_value[$i];\n\t\t\t$key2 = null;\n\t\t\tif(isset($editview_value[$i+1]) && is_array($editview_value[$i+1]))\n\t\t\t{\n\t\t\t\t$key2 = $editview_value[$i+1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$key2 = array();\n\t\t\t}\n\t\t\t$editview_data[$j]=array(0 => $key1,1 => $key2);\n\t\t}\n\t\t$editview_arr[$headerid] = $editview_data;\n\t}\n\tforeach($block_label as $blockid=>$label)\n\t{ \n\t\t\n\t\tif($label == '')\n\t\t{\n\t\t\tif(isset($mod_strings[$curBlock])) {\n\t\t\t\t$curBlock = $mod_strings[$curBlock];\n\t\t\t}\t\t\t$returndata[$curBlock]=array_merge((array)$returndata[$curBlock],(array)$editview_arr[$blockid]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$curBlock = $label;\n\t\t\tif(isset($mod_strings[$label])) {\n\t\t\t\t$label = $mod_strings[$label];\n\t\t\t}\n\t\t\tif(isset($returndata[$label]) && is_array($returndata[$label])) {\n\t\t\t\t$returndata_arr = $returndata[$label];\n\t\t\t} else {\n\t\t\t\t$returndata_arr = array();\n\t\t\t}\n\t\t\tif(isset($editview_arr[$blockid]) && is_array($editview_arr[$blockid])) {\n\t\t\t\t//$returndata[$label]=array_merge((array)$returndata[$label],(array)$editview_arr[$blockid]);\n\t\t\t\t$returndata[$label] = array_merge((array)$returndata_arr,(array)$editview_arr[$blockid]);\n\t\t\t}\n\t\t}\n\t}\n\t$log->debug(\"Exiting getBlockInformation method ...\");\n\treturn $returndata;\t\n\t\n}", "public function block($block, $file = NULL)\n\t{\n\t\tif ($file == NULL)\n\t\t{\n\t\t\t$file = $this->last_file;\n\t\t}\n\t\telse if (!isset($this->files[$file]))\n\t\t{\n\t\t\t$this->load($file);\n\t\t}\n\n\t\t// assign this block a number\n\t\t// block number is used rather than the block name as we could be looping through the same block multiple times (and don't want each block to have the same content)\n\t\t$this->block++;\n\n\t\t$pattern = '#\\[block:\\s*(' . $block . ')\\](.*)\\[/block:\\s*(' . $block . ')\\]#is';\n\n\t\t// find the content of the wanted block from the selected template file\n\t\tif(preg_match($pattern, $this->files[$file], $matches))\n\t\t{\n\t\t\t// put the blocks info into the merged array with the block number\n\t\t\t$this->merged[$this->block] = $matches[2];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t$this->core->message(\"Error cannot find block named ($block).\", 1);\n\t\t}\n\t}", "private function summariseData($inputData){\n\t\t$this->totalSummaryItem[\"count\"]++;\n\n\t\t//echo \"Summarise Data\\n\";\n\t\t# Initialise the data summary\n\t\t# Red/Blue for the player codes. Item number for the game number.\n\t\t$outputData = array(\"red\"=>0, \"blue\"=>0,\"itemNumber\"=>NULL);\n\t\tforeach ($inputData as $firstItem){\n\t\t\tforeach ($firstItem as $secondItem){\n\t\t\t\t// Check to see if the item has a value or is currently set.\t\t\t\t\n\t\t\t\tif ( strlen( trim($secondItem) ) > 0 ){\n\t\t\t\t\t//echo 'Item Data: '.\t$secondItem.\"\\n\";\n\t\t\t\t\tif (isset( $outputData[$secondItem] )){\n\t\t\t\t\t\t//echo 'Increment Value: '.$outputData[$secondItem].\"\\n\";\n\t\t\t\t\t\t$outputData[$secondItem]++;\n\n\t\t\t\t\t\t$this->totalSummaryItem[$secondItem]++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $outputData;\n\t}" ]
[ "0.55285275", "0.5468423", "0.53987384", "0.53633046", "0.53461796", "0.53125405", "0.5253618", "0.52531075", "0.5194986", "0.5163947", "0.5146528", "0.51087254", "0.5097638", "0.5043628", "0.5038214", "0.50126135", "0.50125146", "0.4981652", "0.4977719", "0.49584764", "0.4943083", "0.4935726", "0.4916006", "0.49115607", "0.48989585", "0.4884796", "0.48771232", "0.4870901", "0.48640385", "0.48542818", "0.48400038", "0.48361486", "0.48241997", "0.48148", "0.48060775", "0.48023418", "0.47932804", "0.47833294", "0.47631362", "0.4738371", "0.47074547", "0.4700954", "0.47003758", "0.46924606", "0.46913603", "0.46758527", "0.46758392", "0.46755087", "0.4671517", "0.46699932", "0.46467194", "0.46430582", "0.46386603", "0.46371186", "0.4631785", "0.46295756", "0.46284676", "0.46180788", "0.46171245", "0.4614494", "0.46128556", "0.46064767", "0.46030602", "0.4600843", "0.4591724", "0.4587948", "0.45871696", "0.4583869", "0.4580759", "0.45722345", "0.45696628", "0.45613754", "0.45589617", "0.45546278", "0.45503592", "0.45422128", "0.4539777", "0.45344883", "0.4530319", "0.4528127", "0.452691", "0.45239088", "0.45225254", "0.45170093", "0.45161426", "0.45157793", "0.4508956", "0.45051286", "0.4504511", "0.44975483", "0.4492639", "0.44891536", "0.4487058", "0.44861972", "0.4483433", "0.448148", "0.44766188", "0.447352", "0.44678858", "0.44629687" ]
0.5472095
1
Register user via request.
public function registerViaRequest() { return User::create(array_merge([ 'password' => bcrypt(input('password')), ], only('email', 'name', 'is_public'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}", "public function registerUserRequest()\n {\n $user = factory(User::class)->make();\n\n return $this->json('POST', '/api/v2/user', array_merge($user->toArray(), ['password' => 'secret1234', 'agb_check' => true]));\n }", "protected function registered(Request $request, $user) {\n \n }", "protected function registered(Request $request, $user)\n {\n // \n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "protected function registered(Request $request, $user)\n {\n //\n }", "public function register($userId, $request)\n {\n return $this->start()->uri(\"/api/user/registration\")\n ->urlSegment($userId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function registerUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n $password_repeat = $request->input('password_repeat');\n\n\n // Check email\n if (!$email) {\n $this->showRegisterForm(['Please enter email']);\n }\n // Check password\n if(!$password){\n $this->showRegisterForm(['Please enter password']);\n }\n if (!$password || !$password_repeat || $password != $password_repeat) {\n $this->showRegisterForm(['Passwords do not match']);\n }\n\n // Check user exist\n if ($this->getUser($email)) {\n $this->showRegisterForm(['User already isset']);\n }\n\n // Save user to DB\n $user = new User();\n $user->email = $email;\n $user->password = md5($password);\n $user->rights = 20;\n\n // Check save process\n if (!$user->save()) {\n $this->showRegisterForm(['Something goes wrong']);\n }\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_register']);\n }", "public function register() {\n\t\tif ($this->Session->check('Auth.User')) {\n\t\t\t$this->redirect('/');\n\t\t}\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$data = $this->request->data;\n\t\t\tif ($this->User->save($data)) {\n\t\t\t\t$this->Session->setFlash(\"User has been created.\", 'default', array(), 'register');\n\t\t\t\t$this->redirect('/login');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(\"This user couldn't created. Please try again.\");\n\t\t\t}\n\t\t} else\n\t\t\t$this->Session->delete('Message.register');\n\t}", "public function postRegister(Request $request)\r\n { \r\n \tUser::register($request);\r\n\r\n \treturn response(array('success' => true), 201);\r\n }", "public function registerAction(Request $request){\n //for the view\n $params = array(\"title\" => _(\"Sign up\"), \"errors\" => array());\n\n $params['username'] = \"\";\n $params['email'] = \"\";\n\n //handle register form\n if ($request->isMethod('post')){\n\n $username = $request->input('username');\n $params['username'] = $username;\n $email = $request->input('email');\n $params['email'] = $email;\n $password = $request->input('password');\n $password_bis = $request->input('password_bis');\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateUsername($username);\n $validator->validateUniqueUsername($username);\n $validator->validateEmail($email);\n $validator->validateUniqueEmail($email);\n $validator->validatePassword($password);\n $validator->validatePasswordBis($password_bis, $password);\n\n if ($validator->isValid()){\n //hydrate user obj\n $securityHelper = new SH();\n $user = new User();\n \n $user->setNewUuid();\n $user->setUsername( $username );\n $user->setEmail( $email );\n $user->setEmailValidated(false);\n $user->setRole( \"user\" );\n $user->setSalt( SH::randomString() );\n $user->setToken( SH::randomString() );\n $user->setSiteLanguage( 'en' );\n $user->setActive( true );\n\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt() );\n \n $user->setPassword( $hashedPassword );\n// $user->setIpAtRegistration( $_SERVER['REMOTE_ADDR'] );\n $user->setIpAtRegistration($request->ip());\n $user->setDateCreated( time() );\n $user->setDateModified( time() );\n\n //save it\n $userManager = new UserManager();\n $userManager->save($user);\n// @TODO: MAILER\n// send email confirmation message\n// $mailer = new Mailer();\n//\n// $mailerResult = $mailer->sendRegistrationConfirmation($user);\n\n //log user in right now (will redirect home)\n $this->logUser($request, $user);\n// $this->logUser($request, $user);\n $json = new JsonResponse();\n $json->setData(array(\"redirectTo\" => Route('graph')));\n $json->send();\n }\n //not valid\n else {\n $errors = $validator->getErrors();\n $params[\"errors\"] = $errors;\n return response()->json([\n 'error' => $errors\n ],400);\n }\n\n }\n return view('auth.register',['params'=> $params]);\n// $view = new View(\"register.php\", $params);\n// $view->setLayout(\"../View/layouts/modal.php\");\n// $view->send(true);\n }", "function registerAction() {\n if ($this->request->isPost() && $this->request->isAjax()) {\n try {\n $userObj = new User(\n $this->request->getQuery('username')\n , $this->request->getQuery('password')\n );\n $userObj->save();\n\n return parent::httpResponse(json_encode($userObj));\n } catch (Exception $e) {\n return parent::httpResponse($e->getMessage());\n }\n }\n }", "public function register(Request $request)\n\t{\n\t\t$this->validate($request, [\n\t\t\t'username' => 'required|unique:users',\n\t\t\t'password' => 'required|min:10',\n\t\t\t'options' => 'array'\n\t\t]);\n\n\t\t$user = User::make([\n\t\t\t'username' => $request->input('username'),\n\t\t\t'options' => \\json_encode($request->input('options', []))\n\t\t]);\n\t\t$user->password = Hash::make($request->input('password'));\n\t\t$user->generateToken();\n\t\t$user->save();\n\n\t\treturn response()->json([\n\t\t\t'status' => 'Account created',\n\t\t\t'token' => $user->token\n\t\t], 201);\n\t}", "public function registerUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$registered = Application_Model_User::registerUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($registered) {\n\t\t\t\t\t\techo json_encode($registered);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "public function register(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $author_found = true;\n $registered = false;\n\n if ($request->author === \"true\") {\n $author = Author::find($request->author_id);\n if (!$author) {\n $author_found = false;\n }\n }\n\n if ($author_found) {\n event(new Registered($user = $this->create($request->all())));\n $registered = true;\n }\n\n if ($registered && $request->author === \"true\") {\n $author->user_id = $user->user_id;\n $author->save();\n }\n\n if ($registered && $author_found) {\n \\Session::flash('success', 'User created.');\n } elseif (!$registered && $author_found) {\n \\Session::flash('error', 'User could not be created.');\n } elseif (!$registered && !$author_found) {\n \\Session::flash('error',\n 'Author \"' . $request->author_id . '\" not found');\n }\n\n return redirect($this->redirectPath());\n }", "private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }", "public function register()\n {\n $create_from = $this->request->get_body_params();\n\n $input = (object) array_intersect_key( $create_from,\n array_fill_keys(['username', 'password', 'email'], false)\n );\n\n $update = [\n 'first_name',\n 'last_name',\n ];\n\n /** @var \\WP_Error|integer $user */\n $user_id = \\wp_create_user($input->username, $input->password, $input->email);\n\n if (\\is_wp_error($user_id)) {\n throw new UnauthorizedException($user_id->get_error_message());\n }\n\n /** @var \\WP_User $user */\n $user = \\get_userdata($user_id);\n\n foreach ($update as $att) {\n $user->$att = $create_from[$att];\n }\n\n \\wp_update_user($user);\n\n return $this->response->ok([\n 'message' => sprintf(__('Hello %s', PMLD_TD), $user->nickname),\n 'user' => User::make($user),\n ]);\n\n }", "public function register(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $user = $this->create($request->all());\n if($user && $user->id > 0)\n {\n return redirect($this->redirectPath());\n }\n else\n {\n return redirect(\"/register\");\n }\n }", "public function register(Request $request)\n {\n //\n }", "public function register(Request $request){\n\n $user = $this->user->create([\n 'cpf_cnpj' => $request->cpf_cnpj,\n 'nome_razaosocial' => $request->nome_razaosocial,\n 'tipo_pessoa' => $request->tipo_pessoa,\n 'password' => bcrypt($request->password),\n 'senha' => md5($request->password)\n ]);\n \n return response()->json(['status'=>true,'messagem'=>'Usuário criado com successo','data'=>$user],200);\n }", "public function register()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\n\t\t\t// CakePHP automatically call $this->User->validates() for us before saving it.\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t// we set the id of our newly created User to the request->data params\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id;\n\t\t\t\t// so we can log in directly. (We don't use $this->User because the password is now encrypted so it would not match).\n\t\t\t\t$this->Auth->login($this->request->data['User']);\n\t\t\t\treturn $this->redirect(array('controller' => 'messages', 'action' => 'index'));\n\t\t\t}\n\t\t}\n\t}", "public function registerAction(Request $request)\r\n {\r\n $user = new User();\r\n $form = $this->createForm(UserType::class, $user);\r\n\r\n // 2) handle the submit (will only happen on POST)\r\n $form->handleRequest($request);\r\n if ($form->isSubmitted() && $form->isValid()) {\r\n\r\n // 3) Encode the password (you could also do this via Doctrine listener)\r\n $password = $this->get('security.password_encoder')\r\n ->encodePassword($user, $user->getPlainPassword());\r\n $user->setPassword($password);\r\n\r\n // 4) save the User!\r\n $em = $this->getDoctrine()->getManager();\r\n $em->persist($user);\r\n $em->flush();\r\n\r\n // ... do any other work - like sending them an email, etc\r\n // maybe set a \"flash\" success message for the user\r\n\r\n //return $this->redirectToRoute('agencia_actors_backend_homepage');\r\n return $this->render('AgenciaActorsBackendBundle:Default:objecteAdded.html.twig', array(\r\n 'titol' => 'Usuari registrat',\r\n 'name' => $user->getUsername()));\r\n }\r\n\r\n return $this->render(\r\n 'AgenciaActorsBackendBundle:Default:register.html.twig',\r\n array('form' => $form->createView())\r\n );\r\n }", "public function register(Request $request)\n {\n //validate incoming request \n $this->validate($request, [\n 'username' => 'required|string|unique:users',\n 'password' => 'required|confirmed',\n \n ]);\n\n try \n {\n $user = new User;\n $user->username= $request->input('username');\n $user->password = app('hash')->make($request->input('password'));\n $user->user_ip = $request->ip();\n $user->register_date =Carbon::now();\n $user->isAdmin = true;\n $user->save();\n\n return response()->json( [\n 'entity' => 'users', \n 'action' => 'create', \n 'result' => 'success'\n ], 201);\n\n } \n catch (\\Exception $e) \n {\n return response()->json( [\n 'entity' => 'users', \n 'action' => 'create', \n 'result' => 'failed'\n ], 409);\n }\n }", "public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }", "public function registerAction()\n {\n if (!isset($this->post['name'])) {\n return new ResponseModel(ResponseModel::ERRORMSG, \"No name was supplied\");\n }\n $name = $this->post['name'];\n if (strlen($name) < 3) {\n return new ResponseModel( ResponseModel::ERRORMSG, \"Name is too short\");\n }\n\n $session = QuizSessionService::getSession();\n $user = $this->quizService->registerUser($name);\n $session->userId = $user->id;\n return new ResponseModel(ResponseModel::USER, $user);\n }", "public function registrationAction(Request $request)\n {\n try {\n $this->validator->validate($request, 'user_registration');\n } catch (\\Exception $e) {\n $errors = json_decode($e->getMessage(), true);\n $errorMessage = [];\n foreach ($errors as $field => $_errors) {\n foreach ($_errors as $error) {\n $errorMessage[] = $error;\n }\n }\n $ret = new JsonResponse(['message' => implode(', ', $errorMessage)]);\n $ret->setStatus(JsonResponse::STATUS_ERROR);\n return $ret;\n }\n\n $username = $request->get('username');\n $password = $request->get('password');\n\n try {\n $user = $this->security->createUser($username, $password, $request->get('data',array()));\n $this->security->loginByCredentials($username, $password);\n\n $dispatcher = $this->app['dispatcher'];\n $dispatcher->dispatch(SecurityInterface::REGISTRATION_EVENT, new RegistrationEvent($user));\n\n } catch (Exception $e) {\n if ($request->isXmlHttpRequest()) {\n $ret = new JsonResponse(['message' => $e->getMessage()]);\n $ret->setStatus(JsonResponse::STATUS_SYSTEM_ERROR);\n return $ret;\n }\n }\n\n if (!$request->isXmlHttpRequest()) {\n return $this->app->redirect('/?event=welcome');\n } else {\n $user['password'] = $password;\n return new JsonResponse($user);\n }\n\n }", "public function register(Request $request) {\n $user_data = $request->all();\n $validator = $this->validator($user_data);\n\n if ($validator->fails())\n return response()->json(['registered' => false]);\n\n $user_data['password'] = bcrypt($user_data['password']);\n $user = \\App\\User::create($user_data);\n $user->roles()->attach(\\App\\Role::where('name', 'user')->get()[0]->id);\n\n return response()->json(['registered' => true]);\n }", "public function store(Requests\\UserRegisterRequest $request)\n {\n $data=array_merge($request->all(),['avatar'=>'/image/default-avatar.jpg','confirm_code'=>str_random(48)]);\n User::register($data);\n //return redirect('/');\n\n return redirect('/success');\n }", "public function register(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:50',\n 'email' => 'required|string|email|unique:users',\n 'password' => 'required|string|min:6',\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors' => $validator->errors()], 422);\n }\n\n $data = $request->only(['name', 'email', 'password']);\n $data['password'] = bcrypt($data['password']);\n\n $user = User::create($data);\n $user->is_admin = 0;\n\n return response()->json([\n 'user' => $user,\n 'token' => $user->createToken('JGalleria')->accessToken,\n ]);\n }", "public function register(RegisterRequest $request): void\n {\n $user = User::register(\n $request['name'],\n $request['email'],\n $request['password']\n );\n\n $this->mailer->to($user->email)->send(new VerifyMail($user));\n $this->dispatcher->dispatch(new Registered($user));\n }", "public function register(Request $request) {\n $input = $request->all();\n $user = User::create([\n 'name' => $input['name'],\n 'phone' => $input['phone'],\n 'password' => bcrypt($input['password']),\n 'type' => 1\n ]);\n $token = $user->createToken('auth')-> accessToken;\n return response()->json(['token'=>$token,'user'=>$user]);\n }", "public function register(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'username' => ['required', 'string', 'max:255', 'unique:users'],\n 'password' => ['required', 'string', 'min:8', 'confirmed'],\n ]);\n\n if ($validator->fails()) {\n return response()->json(['error' => $validator->errors()]);\n }\n\n try {\n $user = new User([\n 'username' => $request->username,\n 'password' => Hash::make($request->password),\n ]);\n $user->registerAsLoveReacter();\n return $this->respondWithToken(auth()->login($user));\n } catch (QueryException $e) {\n return response()->json(['error' => 'There was a problem creating your account.']);\n }\n }", "public function register(Request $request)\n {\n $id = uniqid();\n\n $validator = Validator::make($request->all(),[\n 'name' => 'required',\n 'email' => 'required|email|unique:users',\n 'password' => 'required',\n 'confirm_password' => 'required|same:password'\n ]);\n\n if ($validator->fails())\n {\n $result['success'] = false;\n $result['message'] = $validator->errors();\n return response()->json($result,462);\n }\n\n //Raise event and send to function for creation\n event(new Registered(\n $user = $this->create($request->all())\n ));\n\n //Create a profile for user as well\n Profile::create([\n 'user_id' => $user->id\n ]);\n\n // $success = $this->login($request);\n $result['token'] = $user->createToken($this->tokenName . $id)->accessToken;\n $result['name'] = $user->name;\n $result['unique_id'] = $this->tokenName . $id;\n $result['profile'] = $user->profile;\n\n return response()->json($result, $this->successStatus);\n }", "public function registerAction(Request $request)\n {\n $userManager = $this->get('fos_user.user_manager');\n $data = $request->request->all();\n $em = $this->getDoctrine()->getManager();\n\n $findUser = $em->getRepository('AppBundle:User')->findByUsername($data['username']);\n if ( $findUser){\n return new JsonResponse([\"msg\"=>\"Usuario Existente\"],401);\n }\n\n // Do a check for existing user with userManager->findByUsername\n\n $user = $userManager->createUser();\n $user->setUsername($data['username']);\n $user->setEmail($data['email']);\n $user->setPlainPassword($data['password']);\n $user->addRole($data[\"role\"]);\n $user->setCity($data[\"city\"]);\n $user->setDescription($data[\"description\"]);\n $user->setAddress($data[\"address\"]);\n $user->setLatitude($data[\"latitude\"]);\n $user->setLongitude($data[\"longitude\"]);\n $user->setLogo($data[\"logo\"]);\n $user->setEnabled(true);\n $userManager->updateUser($user);\n\n return $this->generateToken($user, 201);\n }", "function user_action_user_register($env, $vars) {\n // Prepare the response object.\n $response = new stdClass();\n $user = UserFactory::requestAction($env, $vars['data']['action'], $vars['data']);\n // Check if there are validation errors.\n if (!empty($user->getData('validation_errors'))) {\n foreach ($user->getData('validation_errors') as $error) {\n new Message($env, $error, MESSAGE_WARNING);\n }\n $response->errors = Message::burnMessages();\n }\n else {\n $username = array_pop($vars['data']['name']);\n $user = UserFactory::load($env, $username);\n $user->logIn(NULL, t('Hello %user, thank you for signing up. You are now a registered member.', array('%user' => $username)), TRUE);\n $response->redirect = NodeFactory::current($env)->getName();\n }\n\n // Encode the response JSON code.\n $response_json = json_encode($response);\n\n exit($response_json);\n}", "public function store(RegisterUserRequest $request)\n {\n $user = null;\n DB::transaction(function () use ($request, &$user) {\n\n $input = $request->all();\n $input['password'] = Hash::make($request->password);\n\n $user = UsUser::create($input);\n $user->token = null;\n\n // registro en us_userlogins\n $user->us_socialnetworks()->attach(\n 1,\n ['id_social' => 'peru_'.Str::random(20), 'us_users_email' => $request->email, 'user_add' => $user->id, 'date_add' => $user->date_add]\n );\n\n // registro en us_subscribes_and_follows\n // Aqui Invocar a la Api de Sites para subscribir al usuario con su SITE (¿Como trabajo los registros transaccionales con 2 apis?)\n\n });\n\n return $this->successResponse(true, new UsUserResource($user));\n }", "public function registerAction(Request $request) \n {\n $form = $this->createForm(new UserType());\n\n if ($request->getMethod() == 'POST') {\n \n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $user = $form->getData();\n \n $factory = $this->get('security.encoder_factory');\n \n $encoder = $factory->getEncoder($user);\n \n $password = $encoder->encodePassword($user->getPassword(), $user->getSalt());\n \n $user->setPassword($password);\n\n $token = $this->getToken(array($user->email, $user->created, rand()));\n \n $user->setToken($token);\n \n $saveUser = $this->baseRepository()->save($user);\n\n return $this->redirect($this->generateUrl('thankyou', array('email' => $user->getEmail())));\n }\n }\n\n return $this->render('UserBundle:User:save.html.twig', array('form' => $form->createView(), 'action' => 'Registreren'));\n }", "public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\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\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}", "public function registerAction(Request $request)\n {\n\n /** @var $formFactory \\FOS\\UserBundle\\Form\\Factory\\FactoryInterface */\n $formFactory = $this->get('fos_user.registration.form.factory');\n /** @var $userManager \\FOS\\UserBundle\\Model\\UserManagerInterface */\n $userManager = $this->get('fos_user.user_manager');\n /** @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface */\n $dispatcher = $this->get('event_dispatcher');\n\n $user = $userManager->createUser();\n $user->setEnabled(true);\n\n $event = new GetResponseUserEvent($user, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n $form = $formFactory->createForm();\n $form->setData($user);\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $event = new FormEvent($form, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);\n\n $userManager->updateUser($user);\n\n // ajout de l'utilisateur dans la table patient\n $patient = new Patient();\n $patient->setUtilisateur($user);\n $em = $this->getDoctrine()->getManager();\n $em->persist($patient);\n $em->flush();\n\n if (null === $response = $event->getResponse()) {\n $url = $this->generateUrl('fos_user_registration_confirmed');\n $response = new RedirectResponse($url);\n }\n\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));\n\n return $response;\n }\n\n return $this->render('FOSUserBundle:Registration:register.html.twig', array(\n 'form' => $form->createView(),\n ));\n }", "public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }", "public function register(Request $request)\n {\n $this->validator($request->except('form_type'))->validate();\n\n $user = $this->create($request->except('form_type'));\n $role = Role::findOrFail($request->input('role_id'));\n $user->attachRole($role);\n $form_type = $request->only('form_type');\n switch ($form_type['form_type']){\n case 'admin_create' :\n $this->guard()->login($user);\n $this->registered($request, $user);\n break;\n\n case 'dashboard_create' :\n return redirect()->route('admin.user.index')->with('success', 'User is created !');\n break;\n }\n }", "public function register(){\n\t\t//Better to be implemented through db table\n\t\t$userRole = array('Job Seeker'=>'Job Seeker', 'Employer'=>'Employer');\n\t\t$this->set('userRole',$userRole);\n\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\t\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('You are now registered and may login'));\n\t\t\t\treturn $this->redirect(array('controller'=>'jobs','action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Unable to create new user'));\n\n\t\t\t}\n\t\t}\n\t}", "public function registerAction(Request $request)\n {\n $form = $this->createFormBuilder()\n ->add('username',EmailType::Class)\n ->add('password',RepeatedType::Class, array('type' => PasswordType::Class))\n ->getForm();\n \n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n # var_dump($form->getData());\n $data = $form->getData();\n $user = new User();\n $user->setUsername($data['username']);\n $user->setPassword($this->encodePassword($user,$data['password']));\n $user->setRoles(array(\"ROLE_ADMIN\"));\n #$user->setRole(\"ROLE_USER\");\n $em = $this->getDoctrine()->getManager();\n $em->persist($user);\n $em->flush();\n $url=$this->generateUrl('book_index');\n return $this->redirect($url);\n \n }\n return array('form' => $form->createView());\n \n }", "public function registerUser($data);", "public function register(Request $request): Response\n {\n $this->init('You\\'r already loggedIn', '/chatroom');\n\n /* We can refactor by extracting:\n * credentials,\n * user creation,\n * user persisting\n */\n try {\n // $this->userCredentials().\n $userName = htmlentities($request->get('_username'), ENT_QUOTES);\n $password = htmlentities($request->get('_password'), ENT_QUOTES);\n\n // $this->createUser($userName, $password).\n $newUser = new User();\n $newUser->setName($userName);\n $newUser->setPassword(password_hash($password, PASSWORD_DEFAULT));\n\n // $this->persist($newUser).\n $userRepository = new UserRepository();\n $userRepository->save($newUser);\n } catch (\\Exception $e) {\n // In future use LOGGER service.\n echo $e->getMessage();\n }\n\n return new RedirectResponse('/chatroom');\n }", "public function registerAction(Request $request)\n {\n $encoder = new MessageDigestPasswordEncoder();\n $em = $this->get('doctrine.orm.default_entity_manager');\n $previous_url = $request->headers->get('referer');\n $data = $request->request->all();\n if ($request->getMethod() === 'POST') {\n $user = $this->getDoctrine()->getRepository('iFlairLetsBonusAdminBundle:FrontUser')->findOneBy(\n ['email' => $data['email'], 'loginType' => 1]\n );\n if (null === $user) {\n $user = new FrontUser();\n $userbirthdate = $data['userBirthDate']['year'].'-'.$data['userBirthDate']['month'].'-'.$data['userBirthDate']['day'];\n $password = $encoder->encodePassword($data['password']['first'], $user->getSalt());\n $user->setName($data['name']);\n $user->setSurname($data['surname']);\n $user->setEmail($data['email']);\n $user->setUsername($data['email']);\n $user->setPassword($password);\n $user->setUserBirthDate(new \\DateTime($userbirthdate));\n $user->setUserGender($data['userGender']);\n $user->setCity($data['city']);\n $user->setIsShoppiday(1);\n $user->setApiFlag(0);\n $user->setLoginType(1);\n $user->setFacebookId(0);\n $user->setGoogleId(0);\n $user->addRole(FrontUser::ROLE_DEFAULT);\n $user->setCreated(new \\Datetime());\n $user->setModified(new \\Datetime());\n $user->setUserCreateDate(new \\Datetime());\n $user->setConfirmationToken($this->get('fos_user.util.token_generator')->generateToken());\n $em->persist($user);\n $em->flush();\n\n $message = \\Swift_Message::newInstance()\n ->setSubject('Confirma tu cuenta y empieza a ahorrar')\n ->setFrom($this->container->getParameter('from_send_email_id'))\n ->setTo($data['email'])\n ->setBody(\n $this->renderView(\n 'iFlairLetsBonusFrontBundle:Email:registere_success.html.twig',\n [\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'gender' => $data['userGender'],\n 'token' => $user->getConfirmationToken(),\n ]\n ),\n 'text/html'\n );\n\n\n $this->get('mailer')->send($message);\n $request->getSession()\n ->getFlashBag()\n ->add(\n 'success',\n '¡Bienvenido a Shoppiday! Confirma tu registro en el e-mail que te hemos enviado'\n );\n } elseif ($user->isToImport()) {\n $this->sendEmailRecoverPassword($user, $request);\n } else {\n $request->getSession()\n ->getFlashBag()\n ->add('notice', 'Este email ya ha sido registrado');\n }\n\n return $this->redirect($previous_url);\n }\n }", "public function register($u) {\n $this->user_id = $u; \n }", "public function registerAction(Request $request)\n {\n if ($request->isMethod('GET')) {\n $authenticated = $this->_isUserAuthenticated($request);\n if ($authenticated) {\n $url = $this->container->get('router')->generate('connection_homepage');\n return new RedirectResponse($url);\n }\n }\n /** @var $formFactory \\FOS\\UserBundle\\Form\\Factory\\FactoryInterface */\n $formFactory = $this->container->get('fos_user.registration.form.factory');\n /** @var $userManager \\FOS\\UserBundle\\Model\\UserManagerInterface */\n $userManager = $this->container->get('fos_user.user_manager');\n /** @var $dispatcher \\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface */\n $dispatcher = $this->container->get('event_dispatcher');\n\n $user = $userManager->createUser();\n $user->setEnabled(true);\n\n $event = new GetResponseUserEvent($user, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);\n\n if (null !== $event->getResponse()) {\n return $event->getResponse();\n }\n\n $form = $formFactory->createForm();\n $form->setData($user);\n\n if ('POST' === $request->getMethod()) {\n $form->bind($request);\n\n if ($form->isValid()) {\n $event = new FormEvent($form, $request);\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);\n\n $userManager->updateUser($user);\n\n if (null === $response = $event->getResponse()) {\n $url = $this->container->get('router')->generate('edit_user_profile');\n $response = new RedirectResponse($url);\n }\n\n $dispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));\n\n return $response;\n }\n }\n\n $registrationType = $form->get('registrationType')->getData();\n if (empty($registrationType) || $registrationType == 'quick') {\n return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:register.html.twig', array(\n 'form' => $form->createView(),\n ));\n } else {\n return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:extended_register.html.twig', array(\n 'form' => $form->createView(),\n ));\n }\n }", "public function register(Request $request)\n {\n $validatedData = $request->validate([\n 'name' => 'required|max:55',\n 'email' => 'required|email|unique:users',\n 'telephone' => 'required',\n 'password' => 'required|string|min:8|confirmed',\n 'email_verified_at' => now(),\n 'rank' => 'integer'\n ]);\n //hashpassword\n $validatedData['password'] = Hash::make($validatedData['password']);\n\n //create a new user\n $user = User::create($validatedData);\n //create an access token for the user\n\n if ($user->rank == 0) {\n $accessToken = $user->createToken('authToken')->accessToken;\n } else if ($user->rank == 1) {\n $accessToken = $user->createToken('authToken', ['delete', 'add_product'])->accessToken;\n }\n return response()->json(['user' => $user, 'access_token' => $accessToken, \"status\" => 201]);\n }", "public function postRegister(Request $request)\n {\n\n $validator = UserService::validator($request->all());\n \n if ($validator->fails())\n {\n $this->throwValidationException(\n $request, $validator\n );\n }\n\n if ($user = UserService::create($request->all()))\n {\n \tAuth::login($user);\n UserService::createOwner($user);\n\n return view('auth.activateAccount')\n ->with('email', $request->input('email'));\n }\n else\n {\n \\Session::flash('message', \\Lang::get('notCreated') );\n return redirect()->back()->withInput();\n }\n }", "public function register(Request $request)\n {\n $this->validate($request, [\n 'firstName' => 'required',\n 'lastName' => 'required',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|confirmed|min:6',\n ]);\n $user = User::create([\n 'firstName' => $request->firstName,\n 'lastName' => $request->lastName,\n 'email' => $request->email,\n 'password' => bcrypt($request->password),\n 'active' => 0,\n 'role' => 2,\n ]);\n $token = $user->createToken('TutsForWeb')->accessToken;\n return response()->json(['token' => $token], 200);\n }", "public function registerAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Registration request sent to LB\", true);\n $txtName = $_POST['txtName'];\n $txtEmail = $_POST['txtEmail'];\n $txtPhoneNumber = $_POST['txtPhoneNumber'];\n $result = Lb_Points_Helper_Data::registerUser($txtName,$txtEmail,$txtPhoneNumber);\n echo json_encode($result);\n }", "public function register(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n 'email' => 'required|email',\n 'password' => 'required',\n 'c_password' => 'required|same:password',\n ]);\n\n if ($validator->fails()) {\n return response()->json(['error' => $validator->errors()], 401);\n }\n\n $input = $request->all();\n $input['password'] = bcrypt($input['password']);\n $user = User::create($input);\n $success['token'] = $user->createToken('TrelloClone')->accessToken;\n $success['name'] = $user->name;\n\n return response()->json(['success' => $success], $this->successStatus);\n }", "public function registershop(RegisterRequest $request)\n {\n $emailVerificationRequired = config('settings.mail.email_verification') == 1 && $request->filled('email');\n $phoneVerificationRequired = config('settings.sms.phone_verification') == 1 && $request->filled('phone');\n\n // New User\n $user = new User();\n $input = $request->only($user->getFillable());\n foreach ($input as $key => $value) {\n $user->{$key} = $value;\n }\n\n $user->country_code = config('country.code');\n $user->language_code = config('app.locale');\n $user->password = Hash::make($request->input('password'));\n $user->phone_hidden = $request->input('phone_hidden');\n $user->user_type_id = $request->input('company');\n $user->ip_addr = Ip::get();\n $user->ip_addr = Ip::get();\n $user->verified_email = 1;\n $user->verified_phone = 1;\n\n // Email verification key generation\n if ($emailVerificationRequired) {\n $user->email_token = md5(microtime() . mt_rand());\n $user->verified_email = 0;\n }\n\n // Mobile activation key generation\n if ($phoneVerificationRequired) {\n $user->phone_token = mt_rand(100000, 999999);\n $user->verified_phone = 0;\n }\n\n // Save\n $user->save();\n\n // Message Notification & Redirection\n $request->session()->flash('message', t(\"Your account has been created.\"));\n $nextUrl = config('app.locale') . '/register/finish';\n\n // Send Admin Notification Email\n if (config('settings.mail.admin_notification') == 1) {\n try {\n // Get all admin users\n $admins = User::permission(Permission::getStaffPermissions())->get();\n if ($admins->count() > 0) {\n Notification::send($admins, new UserNotification($user));\n /*\n foreach ($admins as $admin) {\n Notification::route('mail', $admin->email)->notify(new UserNotification($user));\n }\n */\n }\n } catch (\\Exception $e) {\n flash($e->getMessage())->error();\n }\n }\n\n // Send Verification Link or Code\n if ($emailVerificationRequired || $phoneVerificationRequired) {\n\n // Save the Next URL before verification\n session(['userNextUrl' => $nextUrl]);\n\n // Email\n if ($emailVerificationRequired) {\n // Send Verification Link by Email\n $this->sendVerificationEmail($user);\n\n // Show the Re-send link\n $this->showReSendVerificationEmailLink($user, 'user');\n }\n\n // Phone\n if ($phoneVerificationRequired) {\n // Send Verification Code by SMS\n $this->sendVerificationSms($user);\n\n // Show the Re-send link\n $this->showReSendVerificationSmsLink($user, 'user');\n\n // Go to Phone Number verification\n $nextUrl = config('app.locale') . '/verify/user/phone/';\n }\n\n // Send Confirmation Email or SMS,\n // When User clicks on the Verification Link or enters the Verification Code.\n // Done in the \"app/Observers/UserObserver.php\" file.\n\n }\n else\n {\n\n // Send Confirmation Email or SMS\n if (config('settings.mail.confirmation') == 1) {\n try {\n $user->notify(new UserActivated($user));\n } catch (\\Exception $e) {\n flash($e->getMessage())->error();\n }\n }\n\n // Redirect to the user area If Email or Phone verification is not required\n if (Auth::loginUsingId($user->id)) {\n return redirect()->intended(config('app.locale') . '/account');\n }\n\n }\n\n // Redirection\n $success['token'] = $user->createToken('theqqaPassport')->accessToken;\n $success['name'] = $user->name;\n return response()->json([\n 'status' => 'success',\n 'data' => $success,\n ]);\n }", "public function register(Request $request)\n {\n if ($request->header('x-api-key') == 'HrwCTKGnwDXO25ePj5UNkC1G8QOZKpGm') {\n $name = $request->input('name');\n $email = $request->input('email');\n $password = $request->input('password');\n $address = $request->input('address');\n\n $this->validate($request, [\n 'name' => 'required|min:5',\n 'email' => 'required|unique:users|email',\n 'address' => 'required',\n 'password' => 'required|confirmed',\n ]);\n\n $user = User::create([\n 'name' => $name,\n 'email' => $email,\n 'address' => $address,\n 'password' => Hash::make($password),\n 'api_token' => Str::random(40)\n ]);\n\n if ($user) {\n return response()->json([\n 'success' => true,\n 'message' => 'Register success',\n 'user' => $user,\n ], 201);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'Register fail',\n 'data' => '',\n ], 400);\n }\n } else {\n return response()->json([\n 'error' => true,\n 'message' => 'wrong api-key!',\n ], 400);\n }\n }", "public function register(Request $request)\n {\n //validate incoming request \n $this->validate($request, [\n 'name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|confirmed',\n 'rol' => 'required|string',\n ]);\n\n try {\n\n $user = new User;\n $user->name = $request->input('name');\n $user->email = $request->input('email');\n $user->rol = $request->input('rol');\n $plainPassword = $request->input('password');\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return response()->json(['user' => $user, 'message' => 'CREATED'], 201);\n\n } catch (\\Exception $e) {\n //return error message\n return response()->json(['message' => 'User Registration Failed!'], 409);\n }\n\n }", "public function register(Request $request)\n {\n $this->validate($request, [\n 'email' => 'required|email|unique:users',\n 'password' => 'required|min:6',\n ]);\n \n $user = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request->password)\n ]);\n \n $token = JWTAuth::fromUser($user);\n\n return response()->json(compact('user','token'),201);\n }", "public function register(Request $request) {\n $rules = array(\n 'email' => 'unique:users|email|required',\n 'password' => 'required|confirmed',\n 'name' => 'required'\n );\n $validator = Validator::make($request->all(), $rules);\n $errors = [];\n $success = true;\n $data = null;\n $user = null;\n if ($validator->fails()) {\n $success = false;\n $messages = $validator->messages()->all();\n $errors = $messages;\n }\n else {\n $request->request->add(['confirmation_token' => str_random(50)]);\n $request->request->add(['active' => false]);\n $user = User::create($request->all());\n\n Mail::send('emails.users.confirm_user', ['user' => $user], function($m) use ($user) {\n $m->from('[email protected]', 'Bienvenido a URTracker');\n $m->to($user->email, $user->name);\n });\n }\n\n return response()->json(array(\n 'success' => $success,\n 'errors' => $errors,\n 'data' => $user\n ));\n }", "public function addUser($request)\n {\n $this->name = $request[\"name\"];\n $this->email = trim($request[\"email\"]);\n $this->enabled = $request[\"enabled\"];\n $this->access_level = $request[\"access_level\"];\n\n if (array_key_exists(\"password\", $request)) {\n $this->password = $this->passwordHash($request[\"password\"]);\n } else {\n $this->password = $this->passwordHash($this->generatePassword(12));\n }\n\n if (Auth::user()->isModerator()) {\n $this->group_id = Auth::user()->group_id;\n }\n\n if (Auth::user()->isAdministrator()) {\n $this->group_id = $request[\"group_id\"];\n }\n\n $this->save();\n }", "public function register(Request $request) {\n $data = $request->all();\n \n\n // validate with the validator below\n $this->validator($request->all())->validate();\n\n // new registered user event\n event(new Registered($user = $this->create($request->all())));\n\n $port = $request->server('SERVER_PORT') == 8000 ? ':8000' : '';\n return redirect( ( $request->secure() ? 'https://' : 'http://' ) . $port . '/login?success=1' );\n\n }", "public function register (Request $request) {\n\n\t $validator = $this->validator($request->all());\n\n\t if ($validator->fails()) {\n\t return response(['errors'=>$validator->errors()->all()], 422);\n\t }\n\n\t $request['password'] = Hash::make($request['password']);\n\t \n\t $user = User::create($request->toArray());\n\n\t $token = $user->createToken('Laravel Password Grant Client')->accessToken;\n\t \n\t $response = ['token' => $token];\n\n\t return response($response, 200);\n\n\t}", "public function register(Request $request) {\n\n $validation_array = [\n 'first_name' => 'required|string',\n 'last_name' => 'required|string',\n 'email' => 'required|string|email|unique:app_users',\n 'password' => 'required|string|min:8|confirmed'\n ];\n\n $validator = Validator::make($request->all(), $validation_array);\n\n if ($validator->fails()) {\n return response()->json([\n 'success' => 'false',\n 'message' => 'INVALID REQUEST',\n 'data' => [\n 'errors' => $validator->errors()\n ]\n ], 200);\n }\n\n $user = new AppUser();\n $user->first_name = $request->first_name;\n $user->last_name = $request->last_name;\n $user->email = $request->email;\n $user->password = Hash::make($request->password);\n $user->save();\n\n return response()->json([\n 'success' => 'true',\n 'message' => 'USER CREATED'\n ], 201);\n\n }", "public function registerDetails(Request $request)\n {\n DB::beginTransaction();\n\n try {\n validateInput($request->all(), User::updateRulesOnRegister());\n\n $user = $this->jobChoiceService->user()->verifyUser($request);\n Auth::loginUsingId($user->id);\n $this->jobChoiceService->user()->saveClientType($request, $user);\n\n $this->data['results']['token'] = $user->createToken('JobChoice')->accessToken;\n $this->jobChoiceService->slug()->store($user);\n $user = $this->jobChoiceService->user()->updateUserOnRegister($request, $user->id);\n $this->data['results']['message'] = \"Successfully registered\";\n $this->data['results']['user'] = $user;\n $this->data['status'] = 200;\n\n // Validate User ID\n if($user->type == 'job_seeker') {\n // Set Data\n $data = [\n 'user_id' => $user->id,\n 'contact_no' => $request->contact_no,\n 'action' => 'send',\n 'lang' => $request->lang\n ];\n // Send Verification Code\n $twilio = $this->jobChoiceService->twilio()->store($data);\n }\n\n Auth::logout();\n\n } catch (\\Exception $e) {\n DB::rollBack();\n $this->data['error'] = $e->getMessage();\n }\n\n // return 'let me know';\n DB::commit();\n return response()->json($this->data, $this->data['status']);\n }", "public function register()\n {\n $user = new UserManager;\n $request = new Request;\n $errorMessage = '';\n $method = $request->getMethode();\n if ($method == \"POST\") {\n $mailUser = $request->getPost('mail');\n $password = $request->getPost('mdp');\n $checkPassword = $request->getPost('cmdp');\n $userName = $request->getPost('userName');\n $userData = array();\n $userData['mail'] = $mailUser;\n $userData['pass'] = $password;\n $userData['userName'] = $userName;\n $userData['role'] = 'user';\n $mailUsed = $user->checkMail($mailUser);\n $userNameUsed = $user->checkUserName($userName);\n\n //if true register user on session \n if (!$mailUsed) {\n if (!$userNameUsed) {\n if ($password == $checkPassword) {\n if (filter_var($mailUser, FILTER_VALIDATE_EMAIL)) {\n $errorMessage = 'Vous êtes connecté avec succés ';\n $request->newSession(\"user\", $userData);\n $hashPassword = hash(\"sha256\", $password);\n $user->newUser($userName, $mailUser, $hashPassword);\n } else {\n $errorMessage = 'Le format de l\\'email est incorrect ';\n }\n } else {\n $errorMessage = 'Les mots de passe ne sont pas identique ';\n }\n } else {\n $errorMessage = 'Le nom d\\'utilisateur entré n\\'est pas disponible ';\n }\n } else {\n $errorMessage = 'Cette email est déja utilisé';\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }", "public function register(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:100',\n 'surname' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6'\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n 'code' => 'denegated',\n 'status' => 400,\n 'message' => $validator->errors(),\n ], 400);\n }\n\n $user = new User($request->all());\n $user->email = $request->email;\n $user->name = $request->name;\n $user->surname = $request->surname;\n $user->password = bcrypt($request->password);\n\n $token = JWTAuth::fromUser($user);\n\n $user->save();\n\n return response()->json([\n 'code' => 'success',\n 'status' => 201,\n 'message' => 'Usuario registrado',\n 'token' => $token,\n 'user' => $user\n ], 201);\n }", "public function register(Request $request)\n {\n //validate incoming request\n $this->validate($request, [\n 'first_name' => 'required|string',\n 'last_name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|confirmed',\n ]);\n\n try {\n\n $user = new User;\n $user->first_name = $request->input('first_name');\n $user->last_name = $request->input('last_name');\n $user->email = $request->input('email');\n $plainPassword = $request->input('password');\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return response()->json(['user' => $user, 'message' => 'CREATED'], 200);\n\n } catch (\\Exception $e) {\n //return error message\n return response()->json(['message' => 'User Registration Failed!'], 409);\n }\n\n }", "public function register(Request $request)\n {\n $email = $request->input(\"email\");\n $password = $request->input(\"password\");\n $username = $request->input(\"username\");\n\n /** @phpstan-ignore-next-line */\n $user = User::where('email', '=', $email)->first();\n\n if ($user) {\n abort(403, 'Email already taken.'); // return?\n }\n\n $newUser = new User();\n $newUser->email = $email;\n $newUser->password = bcrypt($password);\n $newUser->username = $username;\n $newUser->save();\n\n // auto log in\n $request->session()->put('user', $newUser);\n\n return redirect('/tasks');\n }", "public function registerNewUser()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('register', Input::all());\n\n\t\t# if we successfully register a new user\n\t\tif(isset($response['success']))\n\t\t{\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# grab the data array from the response\n\t\t\tSession::flash('success', $response['success']['data']);\n\n\t\t\t# show the user profile screen\n\t\t\treturn Redirect::route('profile');\n\t\t}\n\t\t# there was a problem registering the user\n\t\telse \n\t\t{\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('registration-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the sign up form again\n\t\t\treturn Redirect::back();\n\t\t}\n\t}", "public function store(Requests\\RegisterRequest $request)\n {\n $input = $request->all();\n\n $data = [\n 'email' => $input['email'],\n 'password' => $input['password'],\n ];\n\n $input['is_admin'] = $request->get('is_admin') ? true : false;\n $input['password'] = bcrypt($input['password']);\n\n $user = $this->userModel->fill($input);\n $user->save();\n\n\n\n Auth::attempt($data);\n\n return redirect()->route('account.orders');\n }", "public function store(RegisterRequest $request){\n\n $data = $request->all();\n\n User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'level' => 'client',\n 'country' => $data['country'],\n 'gender' => $data['gender'],\n 'password' => Hash::make($data['password']),\n \n ]);\n\n return redirect()->route('site.pending');\n\n }", "public function registerPost()\n {\n $this->response->getHeaders()->setStatusCode(302);\n\n $regForm = $this->_getRegisterForm();\n $request = $this->getRequest();\n\n $failRedirect = $this->_router->assemble(\n array('controller' => 'user', 'action' => 'register'), \n array('name' => 'default')\n );\n\n if (!$this->getRequest()->isPost() || !$regForm->isValid($request->post()->toArray())) {\n $this->_flashMessenger->addMessage($regForm);\n $this->response->getHeaders()->addHeader('Location', $failRedirect);\n return $this->response;\n }\n $user = self::$di->get('userService')->createFromForm($regForm);\n var_dump($user);\n die('success!');\n }", "public function register($request, $response)\n {\n// $app = new \\Slim\\Slim();\n// $app->post('/register', function ($request, $response){ //How it is supposed to be\n $first_name = $request->getParam('txtFirstName');\n $last_name \t= $request->getParam('txtLastName');\n $email \t= $request->getParam('txtEmail');\n $password \t= md5($request->getParam('txtPassword'));\n $created_at = date(\"Y/m/d\");\n $updated_at = date(\"Y/m/d\");\n\n User::create([ //STORE IN DB\n 'name' => $first_name,\n 'email' => $email,\n 'password' => $password,\n 'created_at' => $created_at,\n 'updated_at' => $updated_at,\n 'verified' => 0\n ]);\n\n $this->send_verification_email($email);\n// });\n }", "public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }", "public function register(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|min:3|confirmed',\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n 'error' => true,\n 'message' => $validator->errors(),\n 'data' => []\n ], 422);\n }\n\n try {\n $user = User::create([\n 'name' => $request->get('name'),\n 'email' => $request->get('email'),\n 'password' => Hash::make($request->get('password')),\n 'role' => 'student',\n ]);\n\n return response()->json([\n 'error' => false,\n 'message' => 'Your account already created',\n 'data' => [\n 'name' => $request->get('name'),\n 'email' => $request->get('email'),\n 'role' => 'student',\n ]\n ], 200);\n } catch (\\Throwable $th) {\n return response()->json([\n 'error' => true,\n 'message' => 'Something went wrong at our server',\n 'data' => []\n ], 500);\n }\n }", "public function registerAction() {\n\n $user = new User();\n\n // データを保存し、エラーをチェックする\n// $success = $user->save($this->request->getPost(), array('name', 'email'));\n\n $user->findFirst($this->request->getPost());\n\n if ($success) {\n echo \"Thanks for registering!\";\n } else {\n echo \"Sorry, the following problems were generated: \";\n foreach ($user->getMessages() as $message) {\n echo $message->getMessage(), \"<br/>\";\n }\n }\n\n $this->view->disable();\n\n }", "protected function register(Request $request)\n {\n $token =Str::random(80);\n $data =$request->all();\n $user= User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => Hash::make($data['password']),\n \"api_token\" => hash('sha256', $token), \n ]);\n \n return $token;\n\n // return $user;\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function store(RegisterRequest $request)\n {\n\n $user = new User();\n $user->name = $request->user_name;\n $user->email = $request->user_email;\n $user->password = bcrypt($request->user_password);\n $user->roles = $request->user_roles;\n if ($request->user_contract_id) {\n $user->contract_id = $request->user_contract_id;\n }\n $user->save();\n //dung session de dua ra thong bao\n\n return response()->json($user);\n }", "public function register(Request $request)\n {\n $user = new users;\n $user->name = $request->input('name');\n $user->email = $request->input('email');\n $user->password = Hash::make($request->input('password'));\n $user->user_type = $request->input('user_type');\n $user->save();\n $sp = new data_operator;\n $sp->user_id = Auth::user()->id;\n $sp->save();\n return redirect('/dashboard');\n }", "public function register(Request $request)\n\t{\n $this->validator($request->all())->validate();\n\n event(new Registered($user = $this->create($request->all())));\n\n return $this->registered($request, $user)\n ?: redirect($this->redirectPath());\n }", "protected function register(RegisterRequest $request)\n {\n Session::forget('user');\n Session::forget('phone_number');\n\n $username = Str::slug($request->firstname . \"-\" . $request->lastname);\n $userRows = User::whereRaw(\"username REGEXP '^{$username}(-[0-9]*)?$'\")->get();\n $countUser = count($userRows) + 1;\n $username = ($countUser > 1) ? \"{$username}-{$countUser}\" : $username;\n\n $user = new User([\n 'name' => $request->firstname . ' ' . $request->lastname,\n 'firstname' => $request->firstname,\n 'lastname' => $request->lastname,\n 'email' => $request->email,\n 'password' => Hash::make($request->password),\n ]);\n\n $user = $this->createUsername($user, 0);\n\n Session::put('user', $user);\n\n \n return response()->json([\n 'success' => true,\n 'message' => 'Register success.',\n 'user' => $user,\n ], 201);\n }", "public function register(Request $request)\n {\n $validation = $this->validator($request->all());\n \n if ($validation->fails()) {\n return response()->json(\n $this->messageFormatter->formatErrorMessage(ResponseErrorCode::VALIDATION_FAILED, $validation->messages()),\n 400\n );\n }\n \n event(new Registered($user = $this->create($request->all())));\n \n return response()->json($user, 200);\n }", "public function register(Request $request)\n {\n $validator = $this->validator($request->all())->validate();\n $user = $this->create($request->all());\n\n event(new Registered($user));\n\n // If the client is created by the manager the client receives an email with his credentials\n // else he receives an e-mail confirming the request of the account\n if (Auth::guard(\"manager\")->check()) {\n $password = str_random(8);\n $user->password = bcrypt($password);\n $user->save();\n Mail::to($request->email)->send(new SendLoginInfo($user->username,$password,$request->name));\n // Returns the id of the new client to associate it to an account\n return $user->id;\n } else {\n Mail::to($request->email)->send(new InactiveAccount($request->name));\n $askForAccount = true;\n return view('client.auth.register',compact('askForAccount'));\n }\n\n }", "public function register(Request $request)\n {\n\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:8',\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors'=>$validator->errors()], 422);\n }\n\n $user = User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request->password),\n ]);\n\n $token = Token::create([\n 'token'=>Str::random(60),\n 'user_id'=> $user->id\n ]);\n\n return response()->json([\n 'access_token' => $token,\n 'email' => $user->email\n ]);\n }", "public function register(RegisterRequest $request)\n {\n $newUser = User::createUser($request);\n\n if (!$newUser) {\n $error = 'Failed to create new user';\n\n return $this->toJsonResponse(500, false, $error);\n }\n\n return $this->toJsonResponse(200, $newUser, false);\n }", "public function register(Request $request)\n {\n $this->validator($request->all())->validate();\n $email = $request->email; \n $pass = $request->password; \n\n event(new Registered($user = $this->create($request->all())));\n \n $this->updatePass($email, $pass);\n \n $this->guard()->login($user);\n\n return $this->registered($request, $user)\n ?: redirect(route('officer.dashboard'));\n }", "public function register(Request $request)\n {\n \n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n 'email' => 'required|email',\n 'password' => 'required',\n 'c_password' => 'required|same:password'\n ]);\n\n\n if($validator->fails()) {\n return response()->json($validator->errors(), 202);\n }\n $input = $request->all();\n $input['password'] = bcrypt($input['password']);\n\n $user = User::create($input);\n\n $responseArray = [];\n $responseArray['token'] = $user->createToken('ApiFn')->accessToken;\n $responseArray['name'] = $user->name;\n\n return response()->json($responseArray, 200);\n\n }", "public function action_register(){\n\t\t\n\t\t$user = CurUser::get();\n\t\t\n\t\tif($user->save($_POST, User_Model::SAVE_REGISTER)){\n\t\t\t$user->login($user->{CurUser::LOGIN_FIELD}, $_POST['password']);\n\t\t\tApp::redirect('user/profile/greeting');\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\tMessenger::get()->addError('При регистрации возникли ошибки:', $user->getError());\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function postRegister(Request $request)\n {\n\n $name = Input::get('name');\n $email = Input::get('email');\n $password = Input::get('password');\n\n $user = $this->userServices->register($name, $email, $password);\n\n if($user){\n\n $credentials = $request->only('name', 'email', 'password');\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'invalid_credentials'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['error' => 'could_not_create_token'], 500);\n }\n\n return Response::json([\n 'token' => $token,\n 'data' => $this->transform($user)\n ],200);\n }else{\n return Response::json([\n 'error' => [\n 'message' => 'could not create new user'\n ]\n ],500);\n }\n }", "public function register(){\n $user = Container::getModel('User');\n $user->__set('name',$_POST['name']);\n $user->__set('email',$_POST['email']);\n if(isset($_POST['password']) && $_POST['password'] != ''){\n $user->__set('password',md5($_POST['password'])); \n }\n\n //if the fields are correct\n if($user->validateRegister()){\n //if user doesn't alredy exist\n if(count($user->getUserByEmail()) == 0){\n //success\n $user->save();\n $this->render('register');\n }else{\n //user does alredy exist\n $this->render('email_alredy_exists');\n }\n\n }else{\n //error if any of the fields are incorrect\n //this array will be use to auto-fill the fields\n $this->view->user = array(\n 'name' => $_POST['name'],\n 'email' => $_POST['email'],\n 'password' => $_POST['password']\n\n );\n $this->view->erroRegister = true;\n $this->render('inscreverse');\n }\n }", "protected function register(Request $request)\n {\n \n try{\n $this->validator($request->all());\n if ($this->validator($request->all())->fails()) {\n $statusCode = 200;\n $response[\"status\"] = -2;\n $response['message'] = Helper::ArrayToString($this->validator($request->all())->errors()->all());\n\n } else {\n $user = $this->create($request->all()) ;\n $statusCode = 200;\n $response['status'] = 1;\n $response['message'] = \"Success register\";\n $response['data'] = $user;\n \n return response()->json($response, $statusCode); \n\n }\n\n }catch(Exception $e){\n\n $statusCode = 200;\n $response['status'] = -1;\n $response['message'] = $e->getMessage();\n return response()->json($response, $statusCode);\n\n }finally {\n return response()->json($response, $statusCode);\n }\n \n }", "public function registerUser()\n {\t\n\t\t/**\n\t\t * Our UserModel will return an error \n\t\t * if the email already exists, \n\t\t * or if the passwords do not match\n\t\t */\n\t\ttry{\n\t\t$user = new UserModel();\n\t\t$user->name = Input::get('name');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Input::get('password');\n\t\t$user->password_confirmation = Input::get('password_confirmation');\n\t\t$user->save();\t\n\t\t$this->setToken($user);\n\t\treturn $this->sendResponse('You have been registered and are logged in');\n\t\t}\n\t\tcatch(Exeption $e){\n\t\t\treturn $this->sendResponse(false, $e->getMessage());\n\n\t\t}\n }", "public function register(Request $request)\n {\n $this->validator($request->all())->validate();\n\n event(new Registered($user = $this->create($request->all())));\n\n if($request->ajax())\n return response('Utilisateur crée avec success');\n\n return redirect()->route('admin.users.index')->with([\n 'message' => 'Utilisateur crée avec success',\n 'type' => 'success'\n ]);\n }", "public function register(Request $request)\n {\n DB::beginTransaction();\n\n # 1 : Check if email existed\n $email = $request->email;\n if(User::where('role_id', getConfig('role.merchant_admin'))->where('email', $email)->exists())\n return back()->with('err', \"Email address existed, please login or use different email address.\")->withInput();\n \n # 2 : Create merchant admin account\n $user = User::create([\n 'name' => $request->name,\n 'email' => $email,\n 'password' => \\Hash::make($request->password),\n 'role_id' => getConfig('role.merchant_admin'),\n ]);\n\n # 3 : Login user and redirect to onboarding page \n Auth::login($user); \n DB::commit();\n\n return redirect(route('onboarding.index'));\n }", "public function register(RegisterRequest $request): JsonResponse\n {\n $input = $request->validated();\n\n $user = User::create([\n 'name' => $input['name'],\n 'email' => $input['email'],\n 'password' => Hash::make($input['password']),\n ]);\n\n Auth::login($user);\n\n $request->session()->regenerate();\n\n return response()->json([], 201);\n }" ]
[ "0.7621214", "0.75986886", "0.74917525", "0.7481841", "0.7403179", "0.7403179", "0.7403179", "0.7403179", "0.7403179", "0.7403179", "0.7403179", "0.73909616", "0.7306015", "0.72192657", "0.7198478", "0.71894664", "0.7184115", "0.7160245", "0.7114681", "0.70717055", "0.70652246", "0.7045334", "0.70362526", "0.70353484", "0.7021609", "0.70213443", "0.70086825", "0.7008413", "0.6989564", "0.6987034", "0.6976412", "0.6972034", "0.6970766", "0.69556576", "0.6949826", "0.6946812", "0.694008", "0.6933559", "0.6932407", "0.6931457", "0.69216734", "0.68850565", "0.6884368", "0.68831885", "0.6878672", "0.687652", "0.68759185", "0.68701977", "0.6865244", "0.68641895", "0.6862416", "0.6857284", "0.6848451", "0.6831172", "0.6820758", "0.6813256", "0.681282", "0.6806055", "0.6799588", "0.67944", "0.67915434", "0.6788991", "0.67856175", "0.67826647", "0.6780784", "0.6777705", "0.67772263", "0.6767483", "0.676256", "0.67586666", "0.67583644", "0.6754489", "0.6742609", "0.67394644", "0.673748", "0.6731141", "0.6726726", "0.672158", "0.6718426", "0.67098325", "0.6702989", "0.6699196", "0.66922355", "0.6689087", "0.66871077", "0.66824806", "0.66820145", "0.6680124", "0.6677615", "0.6673762", "0.6662576", "0.66598886", "0.66597927", "0.66586345", "0.66549766", "0.66538936", "0.66503465", "0.6648419", "0.6647617", "0.6642638" ]
0.6868604
48
Update user via request.
public function updateUserViaRequest(User $user) { upload()->check($user); $user->load('user', 'photo'); $user->update(parameters()->fill(['email', 'name', 'is_public'], $user)); return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function updateUser($request)\n {\n DB::table('users')\n ->where('id', $request->id)\n ->update(['name' => $request->name,\n 'last_name'=> $request->lastName,\n 'email' => $request->email,\n 'auth_id' => $request->authId]);\n }", "public function update(Request $request, User $user)\n {\n \n }", "public function update(Request $request, User $user)\n {\n \n }", "public function updateUser($request)\n {\n $this->name = $request[\"name\"];\n $this->email = trim($request[\"email\"]);\n $this->enabled = $request[\"enabled\"];\n\n if (array_key_exists(\"password\", $request)) {\n $this->password = $this->passwordHash($request[\"password\"]);\n }\n\n if ($request[\"reset-password\"]) {\n $this->password = $this->passwordHash($this->generatePassword(12));\n }\n\n if (Auth::user()->isAdministrator()) {\n $this->access_level = $request[\"access_level\"];\n $this->group_id = $request[\"group_id\"];\n }\n $this->update();\n }", "public function update(Request $request, user $user)\n {\n //\n }", "public function put()\n {\n $request = new EditRequest();\n\n $account = new User();\n\n $account->update($_SESSION['user'], [\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'password' => $request->password,\n 'email' => $request->email,\n ]);\n\n Redirect::route('account');\n }", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function update(Request $request, User $user)\n {\n }", "public function updateUser(Request $request){\n $this->userRepository->updateUser($request);\n return back();\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update(Request $request, User $user)\n {\n //\n }", "public function update($user)\n {\n }", "public function update(Request $request, User $User)\n {\n //\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function testUpdateUser()\n {\n }", "public function updateUser($userId, $request)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function update(Request $request, Server_User $server_User)\n {\n //\n }", "public function update(Request $request)\n {\n $user = User::find(1);\n\n }", "public function update(Request $request, User $user)\n {\n //\n //только изменение информации, кроме head и blocked\n }", "public function update(Request $request, $id)\n {\n // xử lí update user info \n }", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function updateUser($data) {\n\t\t\n\t}", "public function update(Request $request, NameUser $nameUser)\n {\n //\n }", "public function update(UpdateRequest $request) {\n\t\tif ($user->id != (\\Auth::user()->id))\n\t\t\treturn $this->forbiddenResponse();\n\n\t\t$user = $request->candidate();\n\t\tif ($user->update($request->data()))\n\t\t\treturn $this->innerRedirect('show', $user);\n\n\t\treturn $this->backRedirect('Failed to update user');\n\t}", "public function update(Request $request, User $user)\n {\n $user->update($request->all());\n }", "public function update(UserUpdateRequest $request, int $id)\n {\n //\n }", "public function update(UserRequest $request, User $user)\n {\n $this->user = $user;\n return $this->props($request)\n ->save()\n ->redirect($request,'Updated');\n }", "public function update(Request $request, User $user) {\n\t\t$this->accessible();\n\t\t$this->validate($request, $this->rules($user->id));\n\t\t$user->name = $request->get('name');\n\t\t$user->email = $request->get('email');\n\t\t$user->is_admin = !!$request->get('is_admin');\n\t\t$user->save();\n\n\t\treturn back();\n\t}", "public function update(Request $request)\n\t{\n\t\t//update user info\n\t\t$user = Auth::User();\n \t$user->name = $request->input('name');\n $user->email = $request->input('email');\n $user->save();\n\t}", "public function update(Request $request, User $user)\n\t{\n\t\t$data = $request->except(['_token', \"_method\"]);\n\t\t$user->update($data);\n\t\treturn redirect()->route('admin.users.index');\n\t}", "public function update(Request $request)\r\n {\r\n Users::update($request->input(), $request->params->id);\r\n }", "public function updateUser(UserInterface $user);", "public function updating(User $user)\n {\n //\n }", "public function update(Request $request, WxUser $wxUser)\n {\n //\n }", "public function update(Request $request, PagoUser $pagoUser)\n {\n //\n }", "public function update(Request $request, User $user) {\n $user->update($request->all());\n return back();\n }", "public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }", "public function update()\n {\n $user = Auth::user();\n\n $data = request()->validate([\n 'name' => 'required|string',\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n ]);\n\n $user->update($data);\n }", "public function update(Request $request, EndUser $endUser)\n {\n //\n }", "public function update(Request $request){\n if(Auth::user()->id == $request->id){\n $user = \\App\\User::find(Auth::user()->id);\n $user->id = Auth::user()->id;\n $user->name = $request->name;\n $user->email = $request->email;\n $user->profile_pic = $request->photo;\n if($user->save()){\n $msg = 'user updated';\n return response($msg);\n }\n }\n }", "function updateUser()\r\n {\r\n return $this->UD->user_update($_GET['uid']);\r\n }", "public function update()\n { if (is_null($this->id))\n trigger_error(\"User::update(): Attempt to update a User object that does not have its ID property set.\", E_USER_ERROR);\n \n // Update the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE users SET user_name=:user_name, user_password_hash=:user_password_hash, user_email=:user_email, orcid=:orcid, orcid_code=:orcid_code, orcid_access_token=:orcid_access_token WHERE user_id = :id\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n $st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "public function update(Request $request)\n {\n $user = auth('api')->user();\n\n $this->validate($request, [\n 'id' => 'required|numeric|unique:users,id,' . $user->id,\n 'name' => ['required', 'string', 'min:3', 'max:60'],\n 'email' => 'required|email|unique:users,email,' . $user->id,\n 'address' => ['required', 'string', 'min:3', 'max:80'],\n 'birthdate' => ['required', 'date'],\n 'city' => ['required', 'min:3', 'max:40']\n ]);\n\n $user->update([\n 'name' => request('name'),\n 'email' => request('email'),\n 'address' => request('address'),\n 'city' => request('city'),\n ]);\n \n return ['message' => 'Success'];\n }", "public function update(Request $request, User $user) {\n //\n if ($user->id != $this->user->id) {\n return response(\"Cannot update\", 403);\n }\n $request['id'] = $this->user->id;\n $this->validator($request->all())->validate();\n User::find($request->_id)->fill([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request->password),\n ])->save();\n $admin = User::find($this->user->id);\n return response()->json($admin, 200);\n }", "public function update(Request $request, User $user)\n {\n $this->serve->updateUser($request, $user);\n if ($user->role == DefineCode::ROLE_MEMBER) {\n return redirect('backend/user')->with('success', 'Cập nhật user thành công');\n } else {\n return redirect('backend/company')->with('success', 'Cập nhật user thành công');\n }\n }", "public function updateuser(Request $request, $id = 0) {\n $login_user = Auth::guard('user')->user();\n if ($request->isMethod('post')) {\n $data = $request->all();\n unset($data['_token']);\n User::where('id', $login_user->id)->update($data);\n return redirect('user/home');\n }\n }", "public function update(Request $request, User $user)\n {\n $action = $request->input('action');\n if ($action == 'changeRole') {\n $role = $request->input('role');\n if (in_array($role, ['student', 'teacher', 'moderator', 'admin', 'superadmin'])) {\n $user->update(['role' => $role]);\n return response()\n ->json([\n 'status' => 'ok',\n 'message' => 'role updated successfully'\n ], 200);\n }\n } elseif ($action == 'changeStatus') {\n $status = $request->input('status');\n if (in_array($status, ['0', '1'])) {\n $user->update(['status' => $status]);\n return response()\n ->json([\n 'status' => 'ok',\n 'message' => 'status updated successfully'\n ], 200);\n }\n }\n return response()\n ->json([\n 'status' => 'error'\n ], 401);\n }", "public function update(UserRequest $request)\n\t{\n\t\t// Save the current user\n\t\t$user = $request->user();\n\t\t// Update user's info\n\t\t$data = $request->only(['name', 'email']);\n\n\t\tif ($request->has('password'))\n\t\t\t$data['password'] = Hash::make($request->password);\n\n\t\tif ($request->has('image'))\n\t\t{\n\t\t\tStorage::delete($user->image);\n\t\t\t$data['image'] = Storage::putFile('images', $request->file('image'));\n\t\t}\n\n\t\t$user->update($data);\n\n\t\t// Return updated info\n\t\treturn response(['user' => $user]);\n\t}", "public function update(Request $request)\n\t{\n\t\t$user = User::find(Auth::guard('admin')->user()->id);\n\t\t$user->firstname = $request->input('firstname');\n\t\t$user->lastname = $request->input('lastname');\n\t\t$user->email = $request->input('email');\n\t\t$user->save();\n\n\t\treturn redirect()\n\t\t\t->back()\n\t\t\t->with('status', 'Benutzerdaten erfolgreich geändert');\n\t}", "public function update(Request $request, $id) {\n\n if ($request->session()->get('user_id') != $id)\n \\Policy::check('manage_users')->handle();\n\n $params = [\n 'ID' => $request->session()->get('user_id'),\n '_method' => 'PUT',\n 'first_name' => Input::get('first_name'),\n 'last_name' => Input::get('last_name'),\n 'username' => Input::get('username'),\n 'email' => Input::get('email'),\n 'password' => Input::get('password'),\n 'old_password' => Input::get('old_password'),\n 'phone' => Input::get('phone'),\n 'bio' => Input::get('bio'),\n 'role' => Input::get('role'),\n ];\n\n if (empty(Input::get('password'))) {\n unset($params['password']);\n unset($params['old_password']);\n }\n\n $response = \\API::post('users/update/' . $id, ['Authorization' => $request->session()->get('user_data')['auth']], $params);\n\n\n if ($response[\"code\"] == \"200\") {\n\n if ($request->session()->get('user_id') != $id) {\n\n $client = UsersTrait::getClientId($response['data']->id);\n\n if ($client) {\n\n $response['data']->client_id = $client;\n\n \\Redis::publish('user-update', json_encode($response[\"data\"]));\n }\n }\n\n $message = 'User ' . $response[\"data\"]->username . ' has been updated';\n\n return $request->session()->get('user_id') == \"1\" ? redirect('/admin/users')->with('success', $message) : redirect()->back()->with('success', $message);\n } else {\n\n return redirect()->back()->with('errors', $response['data']->messages);\n }\n }", "public function editinfo(UpdateUserRequest $request)\n {\n $user = User::where('id', $request->id)->first();\n\n $data = $request->only(['name', 'email', 'gender', 'phone', 'birthdate', 'nationality']);\n\n $user->update($data);\n\n if($user)\n {\n return response()->json([\n 'status' => 'true',\n 'msg' => 'success'\n ]) ;\n }\n else\n {\n return response()->json([\n 'status' => 'false',\n 'msg' => 'error'\n ]) ;\n }\n }", "public function update(Request $request, User $user)\n {\n $this->authorize('update', $user);\n $user->update(['name' => $request->name,\n 'username' => $request->username,\n 'email' => $request->email,]);\n //TODO data validation\n //dd($request->all());\n return redirect(route('dashboard'))->with('message', 'User Updated successfully!');\n }", "public function update(Request $request, User $id)\n {\n $user = User::find('$id');\n $user-> name = request('name');\n $user-> email = request('email');\n $user-> password = request('password');\n $user-> enabled = request('enabled');\n $user-> banned = request('banned');\n $user-> last_logged_in = request('last_logged_in');\n $user-> email_verified_at = request('email_verified_at');\n\n $user->save();\n }", "public function update(Request $request, $id_user)\n {\n //\n return DB::table('users')->where('id_user',$id_user)->update($request->all());\n }", "public function update($id, Request $req){\n \n $user = User::find($id);\n\n $user->username = $req->username;\n $user->password = $req->password;\n $user->email = $req->email;\n $user->userType = $req->usertype;\n $user->save();\n\n return redirect('/home/userlist');\n \n }", "public function update_user(Request $request)\n {\n try\n {\n $user_id = $this->user->getUserId($request);\n $user = DB::table('customer')\n ->where('id',$user_id)\n ->update([\n 'name' => $request->name,\n 'gender' => $request->gender,\n ]);\n if($user <= 0 || $user == false || $user == null)\n {\n return FS_Response::error(500,'no update found');\n }\n return FS_Response::success('message','user successfully updated');\n }\n catch (\\Illuminate\\Database\\QueryException $e)\n {\n throw new ErrorException('wishlist,server error found please try agian or contact our customer service');\n }\n }", "public function update(Request $request, User $user)\n {\n\n $user->first_name = request('first_name');\n $user->last_name = request('last_name');\n $user->job_title = request('job_title');\n $user->auth_level = request('auth_level');\n $user->last_user = request('user_email');\n $user->address = request('address');\n $user->city = request('city');\n $user->state = request('state');\n $user->zip = request('zip');\n $user->save();\n\n return redirect('home');\n }", "public function update(User $model);", "public function update_put()\n {\n $response = $this->UserM->update_user(\n $this->put('id'),\n $this->put('email'),\n $this->put('nama'),\n $this->put('nohp'),\n $this->put('pekerjaan')\n );\n $this->response($response);\n }", "public function update()\n {\n $updateUser = new UpdateUser($this->_user->getID(), $this->_user->account);\n if (CSRF::validate() && $updateUser->execute()) {\n return new RedirectResponse('/account/bewerken');\n }\n\n return $this->edit();\n }", "public function update(Request $request, type_of_user $type_of_user)\n {\n //\n }", "public function update(Request $request)\n {\n User::whereId(Auth::id())->update([$request->field=>$request->value]);\n\n return response(['status' => \"alert-success\", 'message' => \"User information has been updated.\"], 200);\n }", "public function update(Request $request, User $user)\n {\n //\n $data = $request->only(['name','email']);\n $user->update($data);\n session()->flash(\"success\",\"User updated successfully\");\n return redirect(route(\"users.index\"));\n }", "public function userUpdate(Request $request, $userID)\n {\n $user = User::find($userID);\n\t\t$user->name = $request->input('name');\n\t\t$user->phone = $request->input('phone');\n\t\t$user->email = $request->input('email');\n $user->save();\n\t\treturn redirect(\"/userEdit/$userID\");\n }", "public function postEdit()\n {\n // If we are not authentified, redirect to the login page.\n if(Auth::guest()) return Redirect::action('frontend\\UserController@getLogin');\n\n $loggedUser = Auth::user();\n\n $user = API::put('api/v1/user/' . $loggedUser->id, Input::all());\n\n // If the API throws a ValidationException $user will be a JSON string with our errors.\n if(is_string($user)) {\n $errors = json_decode($user, true);\n return Redirect::action('frontend\\UserController@getIndex')\n ->withErrors($errors);\n } else {\n return Redirect::action('frontend\\UserController@getIndex')\n ->with('success', 'Profile edited!');\n }\n }" ]
[ "0.7800408", "0.7798503", "0.7798503", "0.7784652", "0.77721477", "0.7749831", "0.7748213", "0.7732556", "0.77232254", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.7711381", "0.76879495", "0.7565166", "0.7545411", "0.7543785", "0.7535848", "0.75352734", "0.75016004", "0.7500436", "0.749585", "0.7487415", "0.7445194", "0.7440224", "0.7407763", "0.7378957", "0.73665273", "0.734443", "0.7330791", "0.7327766", "0.73203284", "0.7314244", "0.7303222", "0.72909355", "0.72885644", "0.72869307", "0.727673", "0.7273983", "0.7259184", "0.72429496", "0.7240821", "0.72235113", "0.7191078", "0.719031", "0.71836185", "0.7166853", "0.7161084", "0.7156229", "0.71510947", "0.7142082", "0.7141869", "0.7141052", "0.71299785", "0.71283454", "0.7120969", "0.7115665", "0.71046716", "0.7103728", "0.7090129", "0.70887107", "0.70874655", "0.70864993", "0.7081198", "0.7080949", "0.70567906", "0.70566595", "0.70485914", "0.70476097" ]
0.0
-1
Create user via request.
public function createUserViaRequest() { $photo = photos()->createPhotoViaRequest(); $user = User::create(array_merge([ 'user_uuid' => authenticated()->uuid, 'photo_uuid' => $photo->uuid, 'photo_url' => config('storage.path') . $photo->photo_url, 'password' => bcrypt(input('password')), 'location' => parser()->pointFromCoordinates(input('coordinates')), ], only('name', 'email', 'is_public'))); $user->photos()->attach($photo->uuid); $user->load('photo', 'user'); return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser($request) {\n $response = $this->client->request('POST', 'user', [\n 'body' => $request,\n 'form_params' => [\n 'name' => $request->input('name'),\n 'email' => $request->input('email'),\n 'password'=> md5($request->input('password'))\n ]\n ]);\n \n return $response;\n }", "public function createUser($userId, $request)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlSegment($userId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function create(Request $request)\n {\n return $this->doCreateUser($request); \n }", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "public function createUserHttpPost(Request $request) \n { \n $newUser = [ \n 'email'=>$request->get('email'),\n 'name'=>$request->get('name'),\n 'password'=>$request->get('password'),\n ]; \n /**\n * Create new account of the new user\n */\n // print \" createUserHttp($email, $fullName, $password) <br>\"; \n print_r($newUser); \n $isCreated = $this->create( $newUser ); \n\n /**\n * status if success of not new user creation\n */\n if($isCreated) { \n $response = Response::json(['ok']);\n $response->header('Content-Type', 'application/json');\n return $response; \n } \n }", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "public function store(CreateUserRequest $request)\n {\n // --\n // Check role/permission\n if (!AdminHelper::can_action(6, 'created')) {\n return response()->json(\"Access denied\", 403);\n }\n\n $user = $this->userRepo->create($request);\n // --\n // Send email verification link\n try {\n $this->helper->sendActivateEmail($user,$request->get('password'));\n } catch (\\Exception $e) {\n return response()->json(['error' => $e->getMessage()], 500);\n }\n return response()->json('success');\n }", "public static function setNewUser($request){\r\n \t//Post vars\r\n\t \t$postVars = $request->getPostVars();\r\n\t\t$nome = $postVars['nome'] ?? '';\r\n\t\t$email = $postVars['email'] ?? '';\r\n\t\t$senha = $postVars['senha'] ?? '';\r\n\r\n\t\t//Valida email\r\n\t\t$obUser = EntityUser::getUserByEmail($email);\r\n\t\tif($obUser instanceof EntityUser){\r\n\r\n\t\t\t$request->getRouter()->redirect('/admin/users/new?status=duplicated');\r\n\t\t}\r\n\r\n\t\t//NOVA INSTANCIA DE FEEDBACK\r\n\t\t$obUser = new EntityUser;\r\n\t\t$obUser->nome = $nome;\r\n\t\t$obUser->email = $email;\r\n\t\t$obUser->senha = password_hash($senha,PASSWORD_DEFAULT);\r\n\t\t$obUser->cadastrar();\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users/'.$obUser->id.'/edit?status=created');\r\n\r\n\t}", "public function createUser(Request $request)\n {\n\n // Validate key parameters\n $validator = Validator::make(Input::all(), [\n \"name\" => \"required|max:255\",\n \"email\" => \"required|email|max:255|unique:users,email\",\n \"password\" => \"required|min:8|max:16\"\n ]);\n\n // On fail, return error messages.\n if($validator->fails())\n {\n return StandardResponse::json($validator->errors(), 400);\n }\n\n // Fill User object, create password and api_token hashes.\n $user = User::create(Input::all());\n\n // Return User object.\n return StandardResponse::json([\n \"user\" => $user, \n \"api_token\" => $user->api_token\n ], 200);\n\n }", "public function createUser()\n {\n }", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function createEnterpriseUser($input);", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function store(CreateUserRequest $request)\n {\n return $this->respondCreated(\n User::create(request()->all())\n );\n }", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "public function create(){\n\n $user = User::create($this->_cleaned);\n return $this->respond($user);\n }", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "public function store(Request $request)\n {\n return $this->user->create($request->all());\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function create(Request $request)\n {\n $user = new User;\n $user-> name = request('name');\n $user-> email = request('email');\n $user-> password = request('password');\n $user-> enabled = request('enabled');\n $user-> banned = request('banned');\n $user-> last_logged_in = request('last_logged_in');\n $user-> email_verified_at = request('email_verified_at');\n\n $user->save();\n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function store(FormUserCreateRequest $request)\n {\n $user = new User();\n $user->name = $request->name;\n $user->surname = $request->surname;\n $user->email = $request->email;\n $user->role = $request->role;\n $user->department_id = $request->department;\n $user->active = $request->active;\n $user->password = Hash::make($request->password);\n $saved = $user->save();\n if($saved)\n return response()->json(['success' => true, 'message' => 'Usuario registrado exitosamente.'], 200);\n }", "private function createUserAccount(Request $request){\n\n \tDB::transaction( function () use ($request){\n\n \t\t$user = User::create([\n \t\t\t'name' => $request->name,\n \t\t\t'email' => $request->email\n \t\t]);\n\n \t\t$this->addSocialAccountToUser($request, $user);\n\n \t});\n\n }", "public function create(CreateUserRequest $request) {\n $user = $request->commit();\n\n //Trigger user edited event\n event(new UserCreated($user));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User created'\n ]);\n }", "static public function createPost(){\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/CreateRequest.php');\n\n\t\t$requests = new CreateRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\t//Criar url de redirecionar\n\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users/create';\n\n\t\tif(count($errors) > 0){\n\t\t\t//seta os params de retorno\n\t\t\t$back .= '?errors=' . json_encode($errors) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\n\t\t}else{\n\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t\n\t\t\t//Cria criptografia de senha\n\t\t\t$password = crypt($_POST['password'], SALT);\n\n\t\t\t//seta os dados do usuario na instância da class User\n\t\t\t$user->setName($_POST['name'])\n\t\t\t\t->setEmail($_POST['email'])\n\t\t\t\t->setPassword($password);\n\t\t\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\ttry {\n\t\t\t\t//metodo save(), salva os dados do usuario no banco de dados\n\t\t\t\t$save = $crud->save();\n\n\t\t\t\t//Verificação se o cadastro foi com successo\n\t\t\t\tif($save){\n\t\t\t\t\t$back .= '?success=Usuário cadastrado com sucesso!';\n\t\t\t\t}else{\n\n\t\t\t\t\t//cria message de retorno com erro\n\t\t\t\t\t$messageError = ['Error' => 'Erro ao salvar usuario'];\n\t\t\t\t\t$back .= '?errors=' . json_encode($messageError) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\techo '<pre>';\n\t\t\t\t\tprint_r($th);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//Redireciona para $back\n\t\theader('Location: ' . $back);\n\t}", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function store(UserCreateRequest $request)\n {\n\n $data = $request->all();\n\n $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_CREATE);\n\n // encrypt password\n $data['password'] = bcrypt($data['password']);\n\n $user = $this->repository->create($data);\n\n // A. return 201 created\n// return $this->response->created(null);\n\n // B. return data\n return $user;\n\n }", "public function store(UserCreateRequest $request): UserResource\n {\n /* Convert request to array */\n $data = $request->all();\n\n /* Hashing password */\n $data['password'] = bcrypt($request->input('password'));\n\n /* Store data to database */\n $user = User::create($data);\n\n /* Send Register email to the user */\n event(new Registered($user));\n\n activity(\"Admin\")\n ->on($user)\n ->withProperties([\n ['IP' => $request->ip()],\n ['user_data' => $request->all()],\n ])\n ->log('Store a user');\n\n return new UserResource($user->loadMissing('plans'));\n }", "public function store(UserCreateRequest $request)\n {\n $name = $request->name;\n $email = $request->email;\n $createFail = $this->user->createNewUser($name, $email);\n if ($createFail[0]) {\n $error = 'Add duplicate user ' . $createFail[1] . '!';\n return $this->serverResponse($error, null);\n } else {\n $success = 'Add user \\'' . $name . '\\' success';\n return $this->serverResponse(null, $success);\n }\n }", "public function creating(User $user)\n {\n\n }", "public function createNewRequest()\n { \n return $this->clientManager->createNewRequest('user');\n }", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "function create(StoreUserRequest $request){\n\n try {\n $this->userService->createUser($request->all());\n\n return response()->json(['status' => true], Response::HTTP_CREATED);\n }catch (\\Throwable $error){\n\n return response()->json([\n 'success' => false,\n 'errors' => $error->getMessage()\n ], Response::HTTP_BAD_REQUEST);\n }\n\n }", "public function store(Request $request)\n {\n User::create($request->all());\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "public function createUser(Request $request)\r\n\t{\r\n\t\t$username = '';\r\n\t\tif (!empty($request->username))\r\n\t\t{\r\n\t\t\t$username = $request->username;\r\n\t\t}\r\n\r\n\t\tif (!empty($request->password))\r\n\t\t{\r\n\t\t\t$passwordPlain = $request->password;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$passwordPlain = $this->generator->getPassword();\r\n\t\t}\r\n\r\n\t\t$passwordHash = $this->hashPassword($username, $passwordPlain);\r\n\r\n\t\treturn new User($username, $passwordHash, $passwordPlain);\r\n\t}", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function store(Requests\\CreateUserRequest $request)\n {\n $request->permission_id = $this->userRepository->getPermissionRepository()->getAll()->get(1)->id;\n $created = $this->userRepository\n ->create($request);\n\n if(!$created){\n return redirect('/users/systemusers')->withErrors('User creation failed.');\n }\n\n return redirect('/users/systemusers')->withMessage('New user has been created successfully.');\n }", "public function store(UserCreateRequest $request)\n {\n $user = User::make($request->all());\n\n $user->password = config('custom.default_user_pass');\n $user->save();\n\n return $this->storeResponse(new UserResource($user));\n }", "public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }", "public function create(UserRequest $request)\n {\n /**\n * Store the user\n */\n $item = new User;\n $item->firstname = request('firstname');\n $item->lastname = request('lastname');\n $item->email = request('email');\n $item->title = request('title');\n $item->password = Hash::make(request('password'));\n $item->is_active = true;\n $item->save();\n\n\n /**\n * Record the activity\n */\n $activity = new Activity;\n $activity->user = Auth::user()->firstname . ' ' . Auth::user()->lastname;\n $activity->description = trans('api/activitiy.user.create', [\n 'firstname' => request('firstname'),\n 'lastname' => request('lastname')\n ]);\n $activity->save();\n\n return new UserResource($item);\n }", "public function create(User $user)\n {\n\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }" ]
[ "0.78471977", "0.78471977", "0.78471977", "0.78471977", "0.7579334", "0.7570741", "0.7533397", "0.7428788", "0.7406948", "0.7389362", "0.7387138", "0.73340595", "0.7333226", "0.73217547", "0.7312451", "0.72899294", "0.72792363", "0.72752625", "0.7263636", "0.7254979", "0.7247759", "0.72309965", "0.7223781", "0.71959984", "0.71941274", "0.71915144", "0.7190265", "0.71767795", "0.7169509", "0.71562195", "0.7154321", "0.71483374", "0.71458703", "0.7145688", "0.71372175", "0.71362907", "0.712401", "0.7117747", "0.7087983", "0.7081852", "0.70741117", "0.7073781", "0.70730436", "0.70704395", "0.7065906", "0.7063792", "0.7042041", "0.70408267", "0.70405966", "0.7036717", "0.70344096", "0.70298225", "0.70187646", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511", "0.701511" ]
0.0
-1
Check if userA is same of userB
public function sameUser(User $userA, User $userB) { return $userA->uuid === $userB->uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sameOwner(User $userA, User $userB)\n {\n return $userA->user_uuid === $userB->user_uuid;\n }", "function compairUser($d1,$d2) {\n if (!isset($d1[\"user\"]) || !isset($d2[\"user\"]))\n return false;\n return strtolower($d1[\"user\"])==strtolower($d2[\"user\"]);\n}", "public function sameuser($user)\n {\n return $this->hasuser() && $this->user()->equals($user);\n }", "public function isOwner(User $userA, User $userB)\n {\n return $userA->uuid === $userB->user_uuid;\n }", "static function compareUser($User1 = null, $User2 = null)\r\n {\r\n if ($User1 === null || $User2 === null)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n if ($User1->getUsername() == $User2->getUsername())\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n }", "public function isWorker(User $userA, User $userB)\n {\n return $userA->user_uuid === $userB->uuid;\n }", "public static function Match($userOne, $userTwo): bool\n\t{\n\t\treturn $userOne->Username == $userTwo->Username\n\t\t && get_class($userOne) == get_class($userTwo);\n\t}", "function checkSameUser($userId) {\n if(Auth::guest()) {\n return false; //User not logged in\n }\n if(Auth::user()->id == $userId) {\n return true;\n } else {\n return false;\n }\n}", "function compairUserLink($d1,$d2) {\n if (isset($d1[\"lastname\"]) && isset($d2[\"lastname\"]) && isset($d1[\"firstname\"]) && isset($d2[\"firstname\"])) {\n return getPersonLink($d1[\"lastname\"],$d1[\"firstname\"])==getPersonLink($d2[\"lastname\"],$d2[\"firstname\"]);\n }\n else\n return false;\n}", "function equals(UserInterface $user){\n return $this->getUsername() == $user->getUsername() && $this->getId() == $user->getId();\n }", "function compareUsers($user1, $user2)\n{\n\tif ($user1->id > $user2->id) return 1;\n\telseif ($user1->id == $user2->id) return 0;\n\telse return -1;\n}", "static function users_have_added_them_both($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1 OR \n `user2` = \".$user1.\" AND `user1` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 2);\n }", "static function user_already_has_a_relationship_with($user1, $user2) {\n global $con;\n\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `relationship` WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\";\";\n $query = mysqli_query($con, $sql);\n if (mysqli_fetch_object($query)->count == 0) {\n return false;\n }\n return true;\n }", "public function isEqualTo(UserInterface $user): bool;", "static function user_has_added_user($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 1);\n }", "function can_message_each_other($user_id1, $user_id2) {\n\n\tif (user_is_at_least_role(ROLE_ADMIN, $user_id1) || user_is_at_least_role(ROLE_ADMIN, $user_id2)) {\n\t\t// Everyone can talk to an admin\n\t\treturn true;\n\t} else if (get_relationship($user_id1, $user_id2) == LIKE && get_relationship($user_id2, $user_id1) == LIKE) {\n\t\t// If they like each other mutually\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function equals(UserInterface $user) {\n return md5($this->getUsername()) == md5($user->getUsername());\n\n }", "public function testLoginAgainWithSameUser() : void\n {\n $res = self::$dataService->login( \"login\", null, $this->userA[\"user\"], $this->userA[\"pass\"], [ \"user_agent\" => $this->userA[\"getBrowserName\"], \"time\" => $this->userA[\"getCurrentDateTime\"], \"ip\" => $this->userA[\"getReqIp\"] ] );\n\n $this->assertIsArray( $res, 'testLoginAgainWithSameUser' );\n $this->assertArrayHasKey('status', $res, 'testLoginAgainWithSameUser' );\n $this->assertArrayHasKey('msg', $res, 'testLoginAgainWithSameUser' );\n $this->assertCount(2, $res, 'testLoginAgainWithSameUser' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"This user already logged in.\" ], $res, 'testLoginAgainWithSameUser' );\n }", "function loginDifferentUser( $user_id ) //, $attributes_to_export, $seperationChar )\n {\n $http =& eZHTTPTool::instance();\n $currentuser =& eZUser::currentUser();\n $user =& eZUser::fetch( $user_id );\n\n if ($user==null)\n return false;\n\n //bye old user\n $currentID = $http->sessionVariable( 'eZUserLoggedInID' );\n $http =& eZHTTPTool::instance();\n $currentuser->logoutCurrent();\n\n //welcome new user\n $user->loginCurrent();\n $http->setSessionVariable( 'eZUserAdditionOldID', $user_id );\n\n return true;\n }", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "public function OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }", "function friendable($user1ID, $user2ID) {\n if($user1ID == $user2ID) {\n return false;\n }\n $db = new DataBase();\n\n $sql = 'SELECT COUNT(*) as count FROM Friends WHERE userID = \\'' . $user1ID . '\\' AND friendID = \\'' . $user2ID . '\\'';\n $result = $db->select($sql);\n\n if($result['count'] == 0) {\n return true;\n }\n\n return false;\n }", "public function equals( $A, $B );", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "function test_NoIdempotencyKey_ActIndependently() {\n\t\t$user = $this->buildJohn();\n\t\t$user1 = $this->_api->Users->Create($user);\n\t\t$user2 = $this->_api->Users->Create($user);\n $this->assertTrue($user2->Id > $user1->Id);\n }", "public function isEqualTo(UserInterface $user)\n {\n if (!$user instanceof self) {\n return false;\n }\n if ($this->getId() !== $user->getId()) {\n return false;\n }\n\n return true;\n }", "function test_DifferentIdempotencyKey_ActIndependentlyAndRetreivable() {\n\t\t$idempotencyKey1 = md5(uniqid());\n\t\t$idempotencyKey2 = md5(uniqid());\n\t\t$user = $this->buildJohn();\n\t\t$user1 = $this->_api->Users->Create($user, $idempotencyKey1);\n\t\t$user2 = $this->_api->Users->Create($user, $idempotencyKey2);\n $this->assertTrue($user2->Id > $user1->Id);\n\n\t\t// responses may be retreived later\n\t\t$resp1 = $this->_api->Responses->Get($idempotencyKey1);\n\t\t$resp2 = $this->_api->Responses->Get($idempotencyKey2);\n $this->assertTrue($resp1->Resource->Id == $user1->Id);\n $this->assertTrue($resp2->Resource->Id == $user2->Id);\n }", "public function test_a_user_cannot_modify_another_users_account_information()\n {\n $userA = factory(User::class)->create();\n $userB = factory(User::class)->create();\n\n // When user A tries to view user B data\n Passport::actingAs($userA);\n $response = $this->json('GET', 'api/v1/users/' . $userB->id);\n\n // Then it is not successful\n $response->assertStatus(ResponseCode::HTTP_UNAUTHORIZED);\n $response->assertSee('Unauthorized Access');\n }", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "private function is_duplicate () {\n $email = $this->payload['email'];\n $facebook_id = '0';\n if (!empty($this->payload['facebook_id'])) {\n $facebook_id = $this->payload['facebook_id'];\n }\n $sql = \"SELECT id FROM users WHERE email='$email' OR facebook_id='$facebook_id'\";\n $sql = $this->conn->query($sql);\n\n return $sql->num_rows > 0;\n }", "function isUserfollowing($userA, $userB)\n{\n global $conn;\n\n $sql = \"SELECT * FROM `user_follows` WHERE userA=$userA AND userB=$userB\";\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) == 0) {\n\n # userA is not following\n return false;\n } else {\n\n # userA is following\n return true;\n }\n}", "public function isEqualTo(\\Symfony\\Component\\Security\\Core\\User\\UserInterface $user): bool\n {\n return $user->getUsername() === $this->getUsername() && $this->isEnabled();\n }", "function cmp_privkeys($a, $b) {\n\t$auser = strncmp(\"user-\", $a, 5);\n\t$buser = strncmp(\"user-\", $b, 5);\n\tif ($auser != $buser) {\n\t\treturn $auser - $buser;\n\t}\n\n\t/* name compare others */\n\treturn strcasecmp($a, $b);\n}", "public static function areSame($model1,$model2){\n if($model1->modelName==$model2->modelName && $model1->id==$model2->id){\n return true;\n }\n return false;\n }", "private function setCurrentUser(){\t\n $userIsSet = false;\n\n // MERGE on this node - which will create it if it doesnt exist or return the node\n $queryTemplate = \"MERGE (userGUIDNode:PersonGUID{source_uid:'\".$this->user['source_uid'].\"', datasource_name:'\".$this->dataSourceName.\"'})\n SET userGUIDNode.created = timestamp()\n RETURN userGUIDNode;\";\n $query = new Cypher\\Query($this->client, $queryTemplate);\n $r = $query->getResultSet();\n \n foreach ($r as $row) {\n $this->datasourceGUIDNode = $row['userGUIDNode'];\n $userIsSet = true;\n }\n \n return $userIsSet;\n\t\t}", "protected function owner_matches_current_user()\n {\n }", "public function isUserDuplicate(){\n\n\t\t$today = Carbon::today();\n\n\t\t$user = User::on('bk')\n\t\t\t\t\t->where('created_at', '>=', $today)\n\t\t\t\t\t->select('id')\n\t\t\t\t\t->get();\n\n\t\t$str1 = '( ';\n\t\t$str2 = '( ';\n\t\tforeach ($user as $key) {\n\t\t\t// $user_id_arr .= $key->id.\",\";\n\t\t\t$str1 .= 'id = '.$key->id.\" OR \";\n\t\t\t$str2 .= 'u1.id = '.$key->id.\" OR \";\n\t\t}\n\n\t\t$str1 = rtrim($str1, \"OR \");\n\t\t$str2 = rtrim($str2, \"OR \");\n\n\t\t$str1 .= ')';\n\t\t$str2 .= ')';\n\n\t\t$qry_str = \"Select u1.id,\n\t\t\t\t\tif(u1.id in \n\t\t\t\t\t (Select max(u2.id)\n\t\t\t\t\t from users u2\n\t\t\t\t\t where is_ldy = 0\n\t\t\t\t\t and is_plexuss = 0 \n\t\t\t\t\t and email REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$'\n\t\t\t\t\t and email not like '%test%'\n\t\t\t\t\t and fname not like '%test'\n\t\t\t\t\t and email not like '%nrccua%'\n\t\t\t\t\t and \".$str1.\"\n\t\t\t\t\t\t group by email)\n\t\t\t\t\t, 0, 1) as 'is_duplicate'\n\t\t\t\t\tfrom users u1\n\t\t\t\t\twhere is_ldy = 0\n\t\t\t\t\tand is_plexuss = 0 \n\t\t\t\t\tand email REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$'\n\t\t\t\t\tand email not like '%test%'\n\t\t\t\t\tand fname not like '%test'\n\t\t\t\t\tand email not like '%nrccua%'\n\t\t\t\t\tand \".$str2.\";\";\n\n\t\t$qry = DB::connection('bk')->select($qry_str);\n\n\t\tforeach ($qry as $key) {\n\t\t\tif ($key->is_duplicate == 1) {\n\t\t\t\t$attr = array('user_id' => $key->id);\n\t\t\t\t$val = array('user_id' => $key->id, 'is_duplicate' => $key->is_duplicate);\n\n\t\t\t\tEmailLogicHelper::updateOrCreate($attr, $val);\n\t\t\t}\n\t\t}\n\t}", "public function notAuthenticated() {\n $objUser = App_Factory_Security::getSecurity()->getObjuser();\n\n if(!($objUser instanceof App_Data_User)) {\n return true;\n }\n \n if($objUser->getUID() !== $this->getlngPlayer1() && $objUser->getUID() !== $this->getlngPlayer2()) {\n return true;\n }\n\n return false;\n }", "public function isSameValueAs(Uom $other)\n {\n return $this->getName() === $other->getName();\n }", "public function isSameFood($foodA, $foodB);", "public function equals(Usuarios $user) {\n return md5($this->getUsername()) == md5($user->getUsername());\n \n }", "public function chkUserDuplicate() {\n $this->load->model('register_model');\n $user_name = $this->input->post('user_name');\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_name');\n $condition_to_pass = array(\"user_name\" => $user_name);\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'false';\n } else {\n echo 'true';\n }\n }", "public function hasUser();", "public function isEqualTo(UserInterface $user)\n {\n return $this->getUsername() === $user->getUsername();\n }", "public function chkEditUsernameDuplicate() {\r\n\r\n if ($this->input->post('user_name') == $this->input->post('user_name_old')) {\r\n echo 'true';\r\n } else {\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_name');\r\n $condition_to_pass = array(\"user_email\" => $this->input->post('user_name'));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'false';\r\n } else {\r\n echo 'true';\r\n }\r\n }\r\n }", "public function testSimpleIdentity() {\n $this->loadClass('sample_User');\n $userBeau = new sample_User('beau');\n $userMapOne = array('user' => $userBeau);\n $userMapTwo = array('user' => $userBeau);\n $this->assertTrue($userMapOne['user'] === $userMapTwo['user']);\n }", "public function GetisOwnerThisRecord(){\n return ($this->{$this->nameFieldUserId}==h::userId());\n}", "protected static function hashEquals($a, $b) {\n if (function_exists('hash_equals'))\n return hash_equals($a, $b);\n\n $nonce = openssl_random_pseudo_bytes(32);\n return hash_hmac(self::HASH_ALGORITHM, $a, $nonce) === hash_hmac(self::HASH_ALGORITHM, $b, $nonce);\n }", "function getMatchingUser($submittedUser)\n{\n foreach( getUsers() as $user)\n {\n if( $submittedUser == sha1($user[\"email\"]) )\n {\n return $user;\n }\n }\n}", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "public static function checkSameUsersInAgency($userID , $targetID) {\n\t\t//echo $userID ;\n\t\t//echo '<br />';\n\t\t//echo $targetID;\n\t\t//return;\n $query = \"SELECT * FROM agencies WHERE (user_one_id =$userID OR user_two_id =$userID ) AND ( ( user_one_id = $targetID OR user_two_id = $targetID ) ) AND accepted =1\";\n\t\t\n\t\t$agencySth = ConnectionFactory::SelectAsStatementHandler($query, array($userID , $targetID));\n\t\t\n\t\t//echo \"<pre>\";\n\t\t//var_dump($agencySth);\n\t\t$agencySth->rowCount();\n\t\t\n\t\tif($agencySth->rowCount() < 1)\n\t\t{\n\t\t\t//echo \"i am empty\";\n\t\t\treturn false;\n\t\t} \n\t\telse {\n\t\t\t//echo \"i am not empty\";\n\t\t\treturn true;\n\n\t\t}\n\t\t\n\t\t/*if(count($agencySth) < 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;*/\n\t}", "public function sortUsers($a, $b) {\n return strnatcmp($a->person->Last_Name, $b->person->Last_Name);\n }", "function equals($other);", "public function isEqualTo(UserInterface $user)\n {\n // TODO: Implement isEqualTo() method.\n }", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "function hashEquals($a,$b){\n\tif(!val('s',$a,$b))return false;\n\t$m=microtime();\n\t$str1 = sha1($a.$m.$b);\n\t$str2 = sha1($b.$m.$a);\n\treturn hash_equals($str1, $str2);\n}", "public function hasUserLoginToTwoDevices($user_id){\n $user = User::where(['name'=>$user_id])->withCount('devices')->first();\n if($user){\n //user found check number of devices\n if($user->devices_count == 2){\n return true;\n }else{\n return false;\n }\n }else {\n //user not found insert to device to database\n return false;\n }\n }", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "public function testSaveOtherUser()\n {\n // verify we cannot swap to an invalid user\n $this->assertFalse(User::exists('swapped'));\n $change = Change::fetch('default');\n\n try {\n $change->setDescription('Test submit')\n ->setUser('swapped')\n ->save();\n $this->fail('should not have worked');\n } catch (CommandException $e) {\n $this->assertSame(\n \"Command failed: Error in change specification.\\nUser swapped doesn't exist.\",\n $e->getMessage()\n );\n }\n\n\n // add the user swapped to make later attempts work\n $user = new User;\n $user->setId('swapped')->setEmail('[email protected]')->setFullName('Swapped User')->save();\n\n\n // verify set user works on existing change\n $change = Change::fetch('default');\n $change->setDescription('Test submit2')\n ->save();\n\n $this->assertSame('tester', Change::fetch(1)->getUser());\n\n $change = Change::fetch(1);\n $change->setUser('swapped')->save();\n\n $this->assertSame('swapped', Change::fetch(1)->getUser());\n\n\n // verify out of the gate set user works\n $change = Change::fetch('default');\n $change->setDescription('Test submit')\n ->setUser('swapped')\n ->save();\n\n $this->assertSame('swapped', Change::fetch(2)->getUser());\n }", "private function compare_with_login()\n {\n }", "public function CanUserCloneMobidul () {\n $user2Mobidul = null;\n\n if ( Auth::check() ) {\n $userid = Auth::id();\n\n $user2Mobidul = DB::table('user2mobidul')\n ->where('userId', $userid)\n ->whereIn('rights', [1, 2])\n ->get();\n }\n\n return !!$user2Mobidul;\n }", "function studentListLoginCmp($a, $b)\n{\n $ha = $a['login'];\n $hb = $b['login'];\n\n /* Compare both login strings lexicographically. */\n $ret = strcmp($ha, $hb);\n\n return $ret;\n}", "private function compareFiles($fileA, $fileB)\n {\n if (sha1($fileA) === sha1($fileB)) {\n return true;\n }\n\n return false;\n }", "function o_eq($a, $b) {\n\t\t\treturn Obj::singleton()->equal($a, $b);\n\t\t}", "function sort_users($user_a, $user_b)\n{\n\t$cmp = strcasecmp($user_a['lastname'], $user_b['lastname']);\n\tif($cmp !== 0)\n\t\treturn $cmp;\n\telse\n\t{\n\t\t$cmp = strcasecmp($user_a['firstname'], $user_b['firstname']);\n\t\tif($cmp !== 0)\n\t\t\treturn $cmp;\n\t\telse\n\t\t{\n\t\t\treturn strcasecmp($user_a['username'], $user_b['username']);\n\t\t}\n\t}\n\t\n}", "public function equals(User $user) {\n\n return $this->id == $user->id &&\n $this->nome == $user->nome &&\n $this->cognome == $user->cognome &&\n $this->ruolo == $user->ruolo;\n }", "public function chkEmailDuplicate() {\n $this->load->model('register_model');\n $user_email = $this->input->post('user_email');\n $user_email_back = $this->input->post('user_email_back');\n if ($user_email == $user_email_back) {\n echo 'true';\n } else {\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_email');\n $condition_to_pass = array(\"user_email\" => $user_email);\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'false';\n } else {\n echo 'true';\n }\n }\n }", "public function passwordEqual() {\n if($this->getPassword() == $this->getPasswordRepeat()) return TRUE;\n else return FALSE;\n }", "public function belongsToCurrent()\n {\n return Auth::id() == $this->user_id;\n }", "public function is_referee()\n {\n $this->referee = ($this->referee()) ? $this->referee() : NULL;\n $user_obj = User::find(auth()->id());\n if ( isset($this->referee) && $this->referee->id === $user_obj->id ) {\n return $this->is_referee = true;\n } else {\n return $this->is_referee = false;\n }\n }", "function is_unique_username($username, $current_id=null) {\n $users_result = find_users_by_username($username);\n // Loop through all results, return false if username is in use\n while($user = db_fetch_assoc($users_result)) {\n // Make sure username isn't in use by our current user.\n // Use (int) to make sure we are comparing two integers.\n if((int) $user['id'] != (int) $current_id) {\n return false; // username is being used by someone else\n }\n }\n // Returns true at the end, but only if the loop had no records\n // to loop through or if the loop never returned false.\n return true; // username is not used by anyone\n }", "function hash_equals ($a, $b) {\n\t\t$a_length = strlen($a);\n\t\tif ($a_length !== strlen($b)) { return false; }\n\n\t\t$result = 0;\n\t\tfor ($i = 0; $i < $a_length; $i++) {\n\t\t\t$result |= ord($a[$i]) ^ ord($b[$i]);\n\t\t}\n\n\t\treturn $result === 0;\n\t}", "public static function isUser($uname){\n //select statement for pulling user name\n $db = getDatabaseConnection();\n $sql = \"SELECT username FROM registered_user WHERE username ='$uname'\";\n $val = $db->prepare($sql);\n $val->execute();\n $shoop = $val->fetch();\n //echo $sql;\n //var_dump($shoop);\n if($uname == $shoop['username']){\n //echo \"hit\";\n return true;\n }\n else\n {\n return false;\n }\n }", "private function check_If_The_Same_Passwords($pass1, $pass2){\r\n return ($pass1 != $pass2) ? true : false;\r\n }", "private function isUsersRegisteredInThisEdition(User $user1, User $user2, $editionId)\n {\n $em = $this->getDoctrine()->getManager();\n $is_user1_has_a_team = true;\n $is_user1_has_a_team = true;\n \n try\n\t\t{\n\t\t\t$team1 = $em->getRepository('PouceTeamBundle:Team')->findOneTeamByEditionAndUsers($editionId, $user1->getId())->getSingleResult();\n\t\t}\n\t\tcatch(NoResultException $e) \n\t\t{\n\t\t\t$is_user1_has_a_team = false;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$team2 = $em->getRepository('PouceTeamBundle:Team')->findOneTeamByEditionAndUsers($editionId, $user2->getId())->getSingleResult();\n\t\t}\n\t\tcatch(NoResultException $e) \n\t\t{\n\t\t\t$is_user2_has_a_team = false;\n\t\t}\n\n\t\tif($is_user1_has_a_team == true or $is_user2_has_a_team == true)\n\t\t{\n\t\t\t$response = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = false;\n\t\t}\n\n return $response;\n }", "function checkIfPasswordsMatch($password1, $password2) {\r\n return $password1 == $password2;\r\n}", "function correct_user( $name, $passwd, $domain, $conn, $db_users )\r\n\t\t{\r\n\t\t\t$table = $conn->query( \"SELECT count(*) CNT, user, passwd, domain FROM \".$db_users.\" WHERE user = '\".$name.\"' AND domain = '\".$domain.\"'\" );\r\n\t\t\t$row = mysqli_fetch_array( $table );\r\n\t\t\tif ( $row['CNT'] != 1 ) return false;\r\n\t\t\tif ( $row['passwd'] == $passwd ) return true;\r\n\t\t\treturn false;\r\n\t\t}", "public function chkEditEmailDuplicate() {\r\n\r\n if ($this->input->post('user_email') == $this->input->post('user_email_old')) {\r\n echo 'true';\r\n } else {\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_email');\r\n $condition_to_pass = array(\"user_email\" => $this->input->post('user_email'));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'false';\r\n } else {\r\n echo 'true';\r\n }\r\n }\r\n }", "public function isEqualTo( $other )\n {\n if( ( $this->connection == $other->connection() ) &&\n ( $this->ulA->ID == $other->ulA->ID ) &&\n ( $this->ulB->ID == $other->ulB->ID ) &&\n ( $this->ulA->db->ID == $other->ulA->db->ID ) &&\n ( $this->ulB->db->ID == $other->ulB->db->ID ) )\n { return true; }\n return false;\n }", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "public function hashCheck($known, $user) {\n if (function_exists('hash_equals')) {\n return hash_equals($known, $user);\n }\n else {\n return $known === $user;\n }\n\n }", "private function check_for_duplicate_user_ids() {\n foreach($this->data as $course => $rows) {\n $user_ids = null;\n $d_rows = null;\n // Returns FALSE (as in there is an error) when duplicate IDs are found.\n // However, a duplicate ID does not invalidate a course. Instead, the\n // first enrollment is accepted, the other enrollments are discarded,\n // and the event is logged.\n if (validate::check_for_duplicate_user_ids($rows, $user_ids, $d_rows) === false) {\n foreach($d_rows as $user_id => $userid_rows) {\n $length = count($userid_rows);\n for ($i = 1; $i < $length; $i++) {\n unset($this->data[$course][$userid_rows[$i]]);\n }\n }\n\n $msg = \"Duplicate user IDs detected in {$course} data: \";\n $msg .= implode(\", \", $user_ids);\n $this->log_it($msg);\n }\n }\n\n return true;\n }", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "function compairEmail($d1,$d2) {\n if (!isset($d1[\"email\"]) || !isset($d2[\"email\"]))\n return false;\n return getFieldValue($d1,\"email\")==getFieldValue($d2,\"email\");\n}", "public function isOwnedBy(UserInterface $user);", "public static function isSharedWithUser($a_usr_id,$a_calendar_id)\r\n\t{\r\n\t\tglobal $ilDB,$rbacreview;\r\n\t\t\r\n\t\t$query = 'SELECT * FROM cal_shared '.\r\n\t\t\t\"WHERE cal_id = \".$ilDB->quote($a_calendar_id ,'integer').\" \";\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$obj_ids[$row->obj_id] = $row->obj_type;\r\n\t\t}\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($a_usr_id);\r\n\t\tforeach($obj_ids as $id => $type)\r\n\t\t{\r\n\t\t\tswitch($type)\r\n\t\t\t{\r\n\t\t\t\tcase self::TYPE_USR:\r\n\t\t\t\t\tif($a_usr_id == $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase self::TYPE_ROLE:\r\n\t\t\t\t\tif(in_array($id,$assigned_roles))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "public function sharedWith($userId);", "public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }", "public function isSelf()\n {\n return $this->auth->isAssociate() && $this->auth->info('id') == $this->associate->getId();\n }", "public function isUnique();", "public function is($user) {\n if (is_null($user)) return false;\n \n return $this->username == $user->username;\n }", "public function testIsUserPhotoOwner()\n {\n $this->seed();\n\n $isOwner = Photo::isUserPhotoOwner(1,1);\n $this->assertTrue($isOwner);\n\n $isOwner = Photo::isUserPhotoOwner(1,3);\n $this->assertTrue(!$isOwner);\n }", "public static function switchUserTurn($userOne, $userTwo, $loggedUserID){\n\t\tif($userOne['userID'] == $loggedUserID)\n\t\t\treturn $userTwo['userID'];\n\t\telse if($userTwo['userID'] == $loggedUserID)\n\t\t\treturn $userOne['userID'];\n\t}", "function isOwner($table,$referenceKey,$userReferenceKey,$referenceId){\n\t// var_dump('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \tif(Auth::check() && $table){\n \t\t$isOwner = \\DB::select('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \t\t$result = (!empty($isOwner)) ? true :false;\n \t}\n \telse\n \t\t$result = false;\n\n\treturn $result;\n}", "public function crossUserAcl($isMe = false)\n {\n return true;\n }", "function emailAndUserExist($username, $email)\n{\n return (userExist($username) & emailExist($email));\n}", "function equals($x, $y);" ]
[ "0.7659763", "0.70371497", "0.6932173", "0.6898482", "0.6742031", "0.66188085", "0.66070104", "0.65856224", "0.65042925", "0.64616126", "0.63735795", "0.62431204", "0.61908615", "0.6159554", "0.6024719", "0.6000024", "0.599373", "0.59719557", "0.5945403", "0.5926041", "0.5896041", "0.5856431", "0.58337724", "0.5831148", "0.5831003", "0.5813997", "0.5798295", "0.5787351", "0.5780806", "0.57621264", "0.57612044", "0.5746354", "0.5726737", "0.5714002", "0.5713674", "0.5693329", "0.5671403", "0.5638647", "0.5632148", "0.56248546", "0.56175274", "0.5598289", "0.5572453", "0.5548199", "0.55370146", "0.5533468", "0.5533136", "0.5531722", "0.5512834", "0.5482941", "0.54772335", "0.5467657", "0.5467286", "0.54582125", "0.5444854", "0.54348683", "0.5432701", "0.54193133", "0.5413782", "0.5402418", "0.5401828", "0.5393857", "0.5377726", "0.53690296", "0.5355998", "0.534588", "0.533902", "0.53361493", "0.5329913", "0.5322033", "0.5321724", "0.5316889", "0.5311934", "0.5307915", "0.5301486", "0.5300146", "0.5283391", "0.52823395", "0.5280196", "0.5277523", "0.5270098", "0.5269883", "0.52635884", "0.525018", "0.5241667", "0.52360535", "0.5235931", "0.52313346", "0.5222068", "0.5212864", "0.5208354", "0.5206657", "0.52004886", "0.5191495", "0.5180824", "0.5180041", "0.51783735", "0.5177858", "0.51711196", "0.5167657" ]
0.7766447
0
Check if userA has same owner of userB
public function sameOwner(User $userA, User $userB) { return $userA->user_uuid === $userB->user_uuid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isOwner(User $userA, User $userB)\n {\n return $userA->uuid === $userB->user_uuid;\n }", "public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }", "public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }", "public function sameUser(User $userA, User $userB)\n {\n return $userA->uuid === $userB->uuid;\n }", "public function isOwner($user)\n {\n\n if ($this->m_role_created == $user->getId())\n return true;\n else\n return false;\n\n }", "public function isOwner()\n\t{\n\t\treturn is_null($this->CreatedBy) || $this->CreatedBy === Yii::app()->user->GUID;\n\t}", "public function isOwner(\\VMB\\UserBundle\\Entity\\User $user = null)\n {\n return $user && $this->getOwner() && $user->getId() == $this->getOwner()->getId();\n }", "public function isOwner();", "public function testIsUserPhotoOwner()\n {\n $this->seed();\n\n $isOwner = Photo::isUserPhotoOwner(1,1);\n $this->assertTrue($isOwner);\n\n $isOwner = Photo::isUserPhotoOwner(1,3);\n $this->assertTrue(!$isOwner);\n }", "protected function owner_matches_current_user()\n {\n }", "public function ownedBy(User $user){\n\n\t\treturn $this->user_id == $user->id;\n\n\t}", "public function isOwnedBy(UserInterface $user);", "public function getAmOwnerAttribute() {\n\t\t$userId = user('id');\n\t\tif(empty($userId)) { return false; }\n\t\t\n\t\treturn $userId == $this->attributes['user_id'];\n\t}", "function isOwner( $user, $imagecategory )\r\n {\r\n if ( !is_a( $user, \"eZUser\" ) )\r\n return false;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $res, \"SELECT UserID from eZImageCatalogue_Category WHERE ID='$imagecategory'\");\r\n $userID = $res[$db->fieldName(\"UserID\")];\r\n if ( $userID == $user->id() )\r\n return true;\r\n\r\n return false;\r\n }", "public function isOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->user_id);\n }\n }", "function isOwner($facebookID){\n\t\tif($facebookID == $this->fk_member_id){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public static function isOwner(): bool\n\t{\n\t\tif(in_array( 'owner', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t\treturn false;\n\t}", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\n }", "function isOwner($table,$referenceKey,$userReferenceKey,$referenceId){\n\t// var_dump('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \tif(Auth::check() && $table){\n \t\t$isOwner = \\DB::select('select * from '.$table.' where '.$referenceKey.' =\"'.$referenceId.'\" and '.$userReferenceKey.'='.Auth::user()->id);\n\n \t\t$result = (!empty($isOwner)) ? true :false;\n \t}\n \telse\n \t\t$result = false;\n\n\treturn $result;\n}", "public function ownedBy(User $user) {\n // Check to see if the user id = the user id passed in.\n return $this->user_id == $user->id;\n }", "public function ownedBy(User $user)\n {\n return $this->user_id === $user->id;\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function isOwner()\n {\n return $this->affiliation == self::AFFILIATION_OWNER;\n }", "public function isWorker(User $userA, User $userB)\n {\n return $userA->user_uuid === $userB->uuid;\n }", "public function hasOwner()\n {\n return $this->owner !== null;\n }", "public function isOwner($id=''){\n\t\n\tif(empty($id)) $id = $this->id;\n\t \t\n \t$sql=$this->_db->select()->from($this->m_table)->where(\"id=?\",$id)->where(\"user_id =?\",$_SESSION['user_id']);\n \t$rs =$this->_db->fetchCol($sql);\n \t\n \tif(!empty($rs)){\n \t\treturn true;\n \t}\n \treturn false;\n }", "function token_ensure_owner( $p_token_id, $p_owner_id ) {\r\n\t\t$c_token_id = db_prepare_int( $p_token_id );\r\n\t\t$t_tokens_table\t= config_get( 'mantis_tokens_table' );\r\n\r\n\t\t$query = \"SELECT owner\r\n\t\t\t\t \tFROM $t_tokens_table\r\n\t\t\t\t \tWHERE id='$c_token_id'\";\r\n\t\t$result = db_query( $query );\r\n\r\n\t\tif( db_result( $result ) != $p_owner_id ) {\r\n\t\t\ttrigger_error( ERROR_GENERIC, ERROR );\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public static function ownerOnly(){\n return TRUE;\n }", "public function ownedBy(User $user)\n {\n return $this->created_by == $user->id;\n }", "public function GetisOwnerThisRecord(){\n return ($this->{$this->nameFieldUserId}==h::userId());\n}", "public function ownerLoggedIn()\n {\n // For now just check session for an email and owner type\n if ( empty($_SESSION['email']) || $_SESSION['type'] != 'owner')\n return false;\n else\n return true;\n\n }", "public function sameuser($user)\n {\n return $this->hasuser() && $this->user()->equals($user);\n }", "public function owns($image)\n {\n return $this->id === $image->user_id;\n }", "protected function wasActualUser()\n {\n return ($this->wrappedObject->user_id == $this->wrappedObject->revisionable_id || !$this->wrappedObject->user_id);\n }", "public function owner(User $user, Task $task)\n {\n return $user->id === $task->user_id;\n }", "function getOwnedAttribute()\n {\n if (!!Auth::user()) return Auth::id() === $this->user_id;\n return false;\n }", "public function owns($related): bool\n {\n return $this->id == $related->user_id;\n }", "public function isOwner(User $user) : bool\n {\n foreach (config('dan.owners') as $usr) {\n if (fnmatch($usr, $user)) {\n return true;\n }\n }\n\n return false;\n }", "public function has_access($owner, $name) {\n $stmt = $this->pdo->prepare('select * from share where owner_id = :owner_id and user_id = :id and file_id in (select id from file where owner_id = :owner_id and filename = :name)');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':owner_id', $owner->id);\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return count($res) == 1;\n }", "function isOwner() {\n return $this->getIsOwner();\n }", "function is_session_owner ($session_id, $user_agent, $remote_addr, $ip) {\n\t\t$session_data = $this->get($session_id);\n\t\treturn $session_data ? $this->is_session_owner_internal($session_data, $user_agent, $remote_addr, $ip) : false;\n\t}", "public function isOwner()\r\n {\r\n return $this->owner;\r\n }", "public function ownerOnly(User $user, Load $load)\n {\n \n return ($load->user_id === $user->id);\n }", "public function isOwner(){\n return (count($this->rooms()) > 0);\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public function isOwner(UserObject $userObject){\n if(is_callable($this->checkOwner)){\n $check = $this->checkOwner;\n return $check($userObject);\n }\n CoreLog::debug('No checkOwner method defined');\n return false;\n }", "public function isOwnedBy($user)\n {\n if (($entry = $this->getEntry())) {\n return $entry->isOwnedBy($user);\n } else {\n return false;\n }\n }", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "function checkSameUser($userId) {\n if(Auth::guest()) {\n return false; //User not logged in\n }\n if(Auth::user()->id == $userId) {\n return true;\n } else {\n return false;\n }\n}", "public function isUserOwner($user, $mmobj)\n {\n return $this->mmobjService->isUserOwner($user, $mmobj);\n }", "function isOwner() {\n if($this->is_owner === null) {\n $company = $this->getCompany();\n $this->is_owner = instance_of($company, 'Company') ? $company->getIsOwner() : false;\n } // if\n return $this->is_owner;\n }", "public function isOwner(AccountInterface $account);", "private function check_is_owner($user_id)\n {\n if ($user_id != current_user_id()) {\n show_error(lang('not_authorized'), 403);\n }\n }", "public function isOwner($item)\n {\n $roles = Session::get('roles');\n $userId = Auth::user()->externalId;\n\n $result = !empty(array_intersect($roles, ['Administrator','Accounting','Developer']));\n if ($result || in_array($userId,['34',\"55\",'155'])) { // allow mikker to see all forms\n return true;\n }\n\n //remove the user role. we don't care about it\n $roles = array_diff($roles, array('User'));\n $roles = array_values($roles);\n\n switch ($roles[0]){\n case \"Client Manager\":\n return $item->ClientAlias->Client->ClientManager_Id == null? true: $userId ? true:false;\n break;\n case \"Adwords\":\n case \"SEO\":\n // loop through all contracts and find if he has a contract assigned to him\n $owner = false;\n if(is_array($item->Contract)){\n foreach ($item->Contract as $contract){\n if($contract->Manager_Id == $userId){\n $owner = true;\n break;\n }\n }\n }\n return $owner;\n break;\n case \"Sales\":\n return $item->ClientAlias->User_Id == $userId ? true:false;\n break;\n default :\n break;\n }\n //default, we deny.\n return false;\n }", "public function isOwnedBy($comment, $user) {\n return $this->field('id', array('id' => $comment, 'user_id' => $user)) !== false;\n }", "static function user_already_has_a_relationship_with($user1, $user2) {\n global $con;\n\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `relationship` WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\";\";\n $query = mysqli_query($con, $sql);\n if (mysqli_fetch_object($query)->count == 0) {\n return false;\n }\n return true;\n }", "function equals(UserInterface $user){\n return $this->getUsername() == $user->getUsername() && $this->getId() == $user->getId();\n }", "public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }", "public function isToApiOwnedBy($user)\n {\n if (($user === null) || ($user->user_id === null)) {\n return false;\n } elseif (($this->api === null) || ($this->api->owner_id === null)) {\n return false;\n } else {\n return ($user->user_id === $this->api->owner_id);\n }\n }", "public function isOwnerOf( $attr )\n {\n // SOL TICKET #2\n // Dependiendo del tipo de relacion se si un objeto es duenio de otro:\n // - 1) Si la relacion es A (1)->(1) B entonces se necesita belongsTo explicito para no salvar en cascada relaciones que en realidad son blandas (p.e. modelado de *->1 donde el lado * en realidad es blando). (desde el modelo, esto es igual a (*)->(1))\n // - 2) Si la relacion es A (1)<->(1) B entonces se necesita belongsTo para saber cual es el lado fuerte.\n // - 3) Si la relacion es A (1)->(*) B entonces B belongsTo A.\n // - 4) Si la relacion es A (1)<->(*) B entonces B belongsTo A.\n // - 5) Si la relacion es A (*)->(*) B entonces B belongsTo A. (desde el modelo, es lo mismo que (1)->(*))\n // - 6) Si la relacion es A (*)<->(*) B entonces se necesita belongsTo en algun lado.\n //\n // La clase actual es A, el obj es de clase B.\n\n $_thisClass = get_class($this); //self::$thisClass; // get_class da PO, deberia usar otro valor y no la clase...\n\n // Verifico si tengo el atributo y esta en una relacion (hasMany o hasOne).\n //\n if (array_key_exists( $attr, $this->hasOne ))\n {\n $obj = new $this->hasOne[$attr]();\n\n // Si la relacion es unidireccional, se es duenio del otro solo si el otro declara belongsTo mi clase.\n if ($obj->hasOneOfThis( $_thisClass )) // 2) bidireccional 1..1\n {\n return $obj->belonsToClass( $_thisClass ); // Si el objeto que quiero saber si soy duenio pertenece a mi => si soy duenio de el.\n }\n else // 1) unidireccional 1..1\n {\n //return true;\n return $obj->belonsToClass( $_thisClass ); // Ahora se pide belongsTo obligatorio para 1..1 unidireccional (esto evita que se salven en cascada links que realmente son blandos)\n }\n }\n else if (array_key_exists( $attr, $this->hasMany ))\n {\n // Si tengo una relacion hasMany con migo mismo, tengo 1->* o *->*, para ambos casos debería devolver true.\n if ($this->hasMany[$attr] == $_thisClass) return true;\n \n $obj = new $this->hasMany[$attr]();\n\n if ($obj->hasOneOfThis( $_thisClass )) // 4) bidireccional 1..*\n {\n return true;\n }\n else\n {\n // 6) bidireccional *..*\n if ($obj->hasManyOfThis( $_thisClass ))\n {\n return $obj->belonsToClass( $_thisClass ); // problema: get_class(this) tira PO...\n }\n else // casos 3 o 5, como es unidireccional, toma el control la clase del lado que no es visto de la otra.\n {\n return true;\n }\n }\n }\n\n // Si llega aca deberia tirar un warning xq el atributo que me pasaron no es de una relacion...\n return false;\n \n }", "private function _isOwner(&$row, $user = null)\n {\n if (!array_key_exists($this->owner_field, $row)) {\n // No owner field found: error\n return null;\n }\n\n isset($user) || $user = TIP::getUserId();\n if ($row[$this->owner_field] != $user) {\n // Owner and user do not match: return \"not owned row\" condition\n return false;\n }\n\n if ($this->privilege == TIP_PRIVILEGE_MANAGER ||\n $this->privilege == TIP_PRIVILEGE_ADMIN ||\n is_null($this->ownership_expiration)) {\n // Ownership does not expire: return \"owned row\" condition\n return true;\n }\n\n if (!array_key_exists($this->creation_field, $row)) {\n // Ownership expiration set but creation field not found: error\n return null;\n }\n\n // Check if the ownership expired\n $creation = TIP::getTimestamp($row[$this->creation_field], 'sql');\n if (is_null($creation)) {\n // TIP::getTimestamp() failed: error\n return null;\n }\n\n $expiration = strtotime($this->ownership_expiration, $creation);\n if ($expiration === false) {\n // strtotime() failed (wrong expiration format?): error\n return null;\n }\n\n // The row is owned only if now is before the expiration time\n return time() < $expiration;\n }", "public function isPostOwner($id) {\n $post = Post::where('id','=',$id)->first();\n return ($this->id == $post->user->id);\n }", "function checkAdminOwner() {\n //Ensure user is logged in\n if(Auth::guest()) {\n return false;\n }\n //Ensure that the user is an admin or an owner\n $roles = Auth::user()->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == \"admin\" || $role->name == \"owner\") {\n //Double check to make sure user is not banned\n if(checkSingleRole(\"banned\") == false)\n return true;\n else\n return false; //User is an admin but is banned\n }\n }\n //User is not an admin or an owner\n return false;\n}", "public function isFromOwner()\n {\n return $this->fromOwner;\n }", "function compairUser($d1,$d2) {\n if (!isset($d1[\"user\"]) || !isset($d2[\"user\"]))\n return false;\n return strtolower($d1[\"user\"])==strtolower($d2[\"user\"]);\n}", "public function OtherUser(User $user)\n {\n if($user->auth_id == 2)\n {\n return true;\n }\n return false;\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function owns(Model $model)\n {\n return $this->id == $model->user_id;\n }", "private function setCurrentUser(){\t\n $userIsSet = false;\n\n // MERGE on this node - which will create it if it doesnt exist or return the node\n $queryTemplate = \"MERGE (userGUIDNode:PersonGUID{source_uid:'\".$this->user['source_uid'].\"', datasource_name:'\".$this->dataSourceName.\"'})\n SET userGUIDNode.created = timestamp()\n RETURN userGUIDNode;\";\n $query = new Cypher\\Query($this->client, $queryTemplate);\n $r = $query->getResultSet();\n \n foreach ($r as $row) {\n $this->datasourceGUIDNode = $row['userGUIDNode'];\n $userIsSet = true;\n }\n \n return $userIsSet;\n\t\t}", "private function _ownedByCurrentUser($id) {\n if (empty($id)) {\n return false;\n }\n $queryResult = $this->Entries->findById($id)->limit(1);\n foreach ($queryResult as $entry) {\n if ($entry['user_id'] === $this->Auth->user('id')) {\n return true;\n }\n }\n return false;\n }", "public function isMasterOwnedBy(Model $model) : bool {\n return (bool) $this->owners->contains('id', $model->getKey());\n }", "public function owns($article)\n {\n return $this->id == $article->user_id;\n }", "public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }", "public function isOwned(User $user = null) : string {\n $id = $user ? $user->getId() : \"none\";\n return $this->getUserId() . \" == \" . $id ;\n return $this->isOwner() ? \"Yes\" : \"No\" ;\n }", "function setOwner($user) \n {\n return $this->instance->setOwner($user);\n }", "public function iN_CheckChatUserOwnersID($userID, $chatID) {\n\t\t$chatID = mysqli_real_escape_string($this->db, $chatID);\n\t\tif($this->iN_CheckChatIDExist($chatID) == '1'){\n $query = mysqli_query($this->db,\"SELECT user_one, user_two FROM i_chat_users WHERE chat_id = '$chatID' AND (user_one = '$userID' OR user_two = '$userID')\") or die(mysqli_error($this->db));\n\t\t if(mysqli_num_rows($query) == '1'){\n return true;\n\t\t }else{\n\t\t\t return false;\n\t\t }\n\t\t}\n\t}", "function checkOwnershipOfRatingForUserId($conn, $Mid, $Cid) {\n $sql = \"select count(*) from rating where MenuItemId = \" . $Mid . \" and UserId = \" . $Cid;\n $result = $conn->query($sql);\n\n if ($result) {\n $count = mysqli_fetch_array($result, MYSQLI_NUM);\n $count = (int)$count[0];\n\n if ($count === 1) {\n return true;\n }\n else {\n return false;\n }\n }\n }", "static function user_has_added_user($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 1);\n }", "public function owner(User $user, Task $task){\n return $user->id === $task->user_id; //validar que sea el mismo dueño de esa informacion.\n }", "static function users_have_added_them_both($user1, $user2) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' \n FROM `relationship` \n WHERE `user1` = \".$user1.\" AND `user2` = \".$user2.\" AND `relationship`.`type` = 1 OR \n `user2` = \".$user1.\" AND `user1` = \".$user2.\" AND `relationship`.`type` = 1;\";\n $query = mysqli_query($con, $sql);\n return (mysqli_fetch_object($query)->count == 2);\n }", "public function isEqualTo(UserInterface $user): bool;", "static function compareUser($User1 = null, $User2 = null)\r\n {\r\n if ($User1 === null || $User2 === null)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n if ($User1->getUsername() == $User2->getUsername())\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n }", "public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}", "public function isOwnerOfGroup($group);", "public function isAssignee(UserInterface $user);", "public static function Match($userOne, $userTwo): bool\n\t{\n\t\treturn $userOne->Username == $userTwo->Username\n\t\t && get_class($userOne) == get_class($userTwo);\n\t}", "protected function validateOwner()\r\n {\r\n $rule = clone $this->getConfig();\r\n foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {\r\n try {\r\n $rule->setOwner($child);\r\n if (!$rule->validateOwner()) {\r\n return false;\r\n }\r\n } catch (HTML_QuickForm2_InvalidArgumentException $e) {}\r\n }\r\n return true;\r\n }", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected function isBotOwner(User $user, Bot $bot)\n {\n return $user->id == $bot->user_id;\n }", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "public function isOwner($targetId)\n {\n return($targetId == $this->_identity[\"_id\"]);\n }", "function verify_objects ($conn, $username) {\n\t\t$sql = \"select count(*) as count from all_objects where owner = upper(:username)\";\n\t\t$stmt = oci_parse($conn->dbconn, $sql);\n\t\toci_bind_by_name($stmt, \":username\", $username);\n\t\toci_execute($stmt, OCI_DEFAULT);\n\t\twhile (($row = oci_fetch_array($stmt, OCI_BOTH)) != false) \n\t\t\t$count = $row['COUNT'];\n\t\tif ($count === \"0\")\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function isOwnerBooking()\n {\n return ($this->getStatus() == 'O');\n }", "function can_message_each_other($user_id1, $user_id2) {\n\n\tif (user_is_at_least_role(ROLE_ADMIN, $user_id1) || user_is_at_least_role(ROLE_ADMIN, $user_id2)) {\n\t\t// Everyone can talk to an admin\n\t\treturn true;\n\t} else if (get_relationship($user_id1, $user_id2) == LIKE && get_relationship($user_id2, $user_id1) == LIKE) {\n\t\t// If they like each other mutually\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "protected function isCurrentUser()\n {\n return ($this->credentials->check() && $this->credentials->getUser()->id == $this->wrappedObject->revisionable_id);\n }", "public function hasUser();", "private function _checkOwnerShip($targetId, $userRole, $entityId){\n\n $target = 'Users';\n $associationRoute = $this->_getFromKnownRoutes($this->reqController, $userRole); \n if(!$associationRoute){\n $associationRoute = $this->_getAssociationRoute($this->reqController, $target, [], []);\n }\n if(!$associationRoute){\n return true;\n }\n if ($associationRoute == $target) {\n if($targetId == $entityId){\n return true;\n }\n return false;\n\n }elseif ($associationRoute[0] == $target && count($associationRoute) == 1) {\n $direct = true;\n $tableObject = TableRegistry::get($this->reqController);\n $associations = $tableObject->associations();\n $foreignKey = $associations->get($target)->foreignKey();\n $entity = $tableObject->findById($entityId)->where([$foreignKey => $targetId])->first();\n\n } else{\n $direct = false;\n $pathToModel = $this->_decorateRoute($associationRoute);\n $tableObject = TableRegistry::get($this->reqController);\n $entity = $tableObject->findById($entityId)->matching($pathToModel, function($q) use ($targetId, $target){\n return $q->where([$target.'.id' => $targetId]);\n })->first();\n }\n\n //Check Vendor OwnerShip\n if(isset($entity) && $entity){\n return true;\n }\n unset($entity);\n //Check Super Admin OwnerShip\n \n return false;\n }", "public function testOwners()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'p1',\n 'members' => array('x'),\n 'owners' => array('a', 'b', 'c')\n )\n )->save();\n\n $project = Project::fetch('p1', $this->p4);\n $this->assertSame(array('a', 'b', 'c'), $project->getOwners());\n $this->assertSame(true, $project->hasOwners());\n\n // ensure that when we fetch the project and save it, owners are not lost\n Project::fetch('p1', $this->p4)->save();\n $this->assertSame(3, count(Project::fetch('p1', $this->p4)->getOwners()));\n\n // ensure removing owners from a project works as well\n Project::fetch('p1', $this->p4)->set('owners', null)->save();\n $this->assertSame(0, count(Project::fetch('p1', $this->p4)->getOwners()));\n $this->assertSame(false, Project::fetch('p1', $this->p4)->hasOwners());\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }" ]
[ "0.7977679", "0.6912018", "0.67760634", "0.67594475", "0.6751778", "0.66718227", "0.66364187", "0.65947026", "0.6558132", "0.6530355", "0.65232664", "0.65226275", "0.649265", "0.6455727", "0.64537966", "0.6431946", "0.64031345", "0.6393206", "0.63422453", "0.6320344", "0.63096225", "0.63075733", "0.6299183", "0.6282882", "0.62764436", "0.6256437", "0.6247018", "0.623943", "0.6227883", "0.6207985", "0.62049884", "0.6184379", "0.6181905", "0.6169897", "0.6157994", "0.61346424", "0.6132687", "0.6126841", "0.61204845", "0.61178786", "0.609772", "0.6095616", "0.6090368", "0.60858417", "0.608013", "0.60430956", "0.6024684", "0.60131395", "0.59827036", "0.59757495", "0.5959624", "0.5948288", "0.5934018", "0.5914966", "0.5909631", "0.5900739", "0.5884603", "0.588262", "0.58817345", "0.5881412", "0.58783865", "0.586207", "0.5850444", "0.5849887", "0.58366925", "0.582707", "0.5821993", "0.58117545", "0.58028024", "0.5787777", "0.57837284", "0.57788336", "0.5776847", "0.57720214", "0.57639855", "0.57515556", "0.57148045", "0.5707505", "0.5689482", "0.56889606", "0.5683576", "0.5679885", "0.5675558", "0.5662074", "0.5659191", "0.56562865", "0.5649352", "0.5636579", "0.5625793", "0.5623055", "0.56168556", "0.56168556", "0.55990744", "0.55979353", "0.5572665", "0.55708325", "0.5568919", "0.55665183", "0.55658984", "0.5560308" ]
0.7890891
1